Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dataprocessor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
dataprocessor
Commits
0931de86
Commit
0931de86
authored
4 years ago
by
jaapjansma
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
55358166
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
CRM/DataprocessorSearch/Form/Search.php
+24
-0
24 additions, 0 deletions
CRM/DataprocessorSearch/Form/Search.php
CRM/DataprocessorSearch/Form/Task/SearchActionDesigner.php
+37
-1
37 additions, 1 deletion
CRM/DataprocessorSearch/Form/Task/SearchActionDesigner.php
with
62 additions
and
1 deletion
CHANGELOG.md
+
1
−
0
View file @
0931de86
...
...
@@ -7,6 +7,7 @@
*
Add support for filter defaults to be set using the URL.
*
Added Filter for World Region
*
Added Output for World Region
*
Fixed integration with search action designer extension for the Search/Report output.
# Version 1.11.0
...
...
This diff is collapsed.
Click to expand it.
CRM/DataprocessorSearch/Form/Search.php
+
24
−
0
View file @
0931de86
...
...
@@ -78,6 +78,30 @@ class CRM_DataprocessorSearch_Form_Search extends CRM_DataprocessorSearch_Form_A
return
false
;
}
/**
* Return altered rows
*
* Save the ids into the queryParams value. So that when an action is done on the selected record
* or on all records, the queryParams will hold all the case ids so that in the next step only the selected record, or the first
* all records are populated.
*/
protected
function
retrieveEntityIds
()
{
$this
->
dataProcessorClass
->
getDataFlow
()
->
setLimit
(
false
);
$this
->
dataProcessorClass
->
getDataFlow
()
->
setOffset
(
0
);
$this
->
entityIDs
=
[];
$id_field
=
$this
->
getIdFieldName
();
try
{
while
(
$record
=
$this
->
dataProcessorClass
->
getDataFlow
()
->
nextRecord
())
{
if
(
$id_field
&&
isset
(
$record
[
$id_field
]))
{
$this
->
entityIDs
[]
=
$record
[
$id_field
]
->
rawValue
;
}
}
}
catch
(
\Civi\DataProcessor\DataFlow\EndOfFlowException
$e
)
{
// Do nothing
}
$this
->
controller
->
set
(
'entityIds'
,
$this
->
entityIDs
);
}
/**
* Builds the list of tasks or actions that a searcher can perform on a result set.
*
...
...
This diff is collapsed.
Click to expand it.
CRM/DataprocessorSearch/Form/Task/SearchActionDesigner.php
+
37
−
1
View file @
0931de86
...
...
@@ -4,11 +4,47 @@
* @license AGPL-3.0
*/
use
CRM_Dataprocessor_ExtensionUtil
as
E
;
class
CRM_DataprocessorSearch_Form_Task_SearchActionDesigner
extends
CRM_Searchactiondesigner_Form_Task_Task
{
protected
function
setEntityShortName
()
{
self
::
$entityShortname
=
'DataprocessorSearch'
;
}
public
function
preProcess
()
{
$this
->
setEntityShortName
();
$session
=
CRM_Core_Session
::
singleton
();
$url
=
$session
->
readUserContext
();
$session
->
replaceUserContext
(
$url
);
$searchFormValues
=
$this
->
controller
->
exportValues
(
$this
->
get
(
'searchFormName'
));
$this
->
_task
=
$searchFormValues
[
'task'
];
$className
=
'CRM_'
.
ucfirst
(
self
::
$entityShortname
)
.
'_Task'
;
$entityTasks
=
$className
::
tasks
();
$this
->
assign
(
'taskName'
,
$entityTasks
[
$this
->
_task
]);
$entityIds
=
[];
if
(
$searchFormValues
[
'radio_ts'
]
==
'ts_sel'
)
{
foreach
(
$searchFormValues
as
$name
=>
$value
)
{
if
(
substr
(
$name
,
0
,
CRM_Core_Form
::
CB_PREFIX_LEN
)
==
CRM_Core_Form
::
CB_PREFIX
)
{
$entityIds
[]
=
substr
(
$name
,
CRM_Core_Form
::
CB_PREFIX_LEN
);
}
}
}
else
{
$entityIds
=
$this
->
get
(
'entityIds'
);
}
$this
->
_entityIds
=
$this
->
_componentIds
=
$entityIds
;
if
(
strpos
(
$this
->
_task
,
'searchactiondesigner_'
)
!==
0
)
{
throw
new
\Exception
(
E
::
ts
(
'Invalid search task'
));
}
$this
->
searchTaskId
=
substr
(
$this
->
_task
,
21
);
$this
->
searchTask
=
civicrm_api3
(
'SearchTask'
,
'getsingle'
,
array
(
'id'
=>
$this
->
searchTaskId
));
$this
->
assign
(
'searchTask'
,
$this
->
searchTask
);
$this
->
assign
(
'status'
,
E
::
ts
(
"Number of selected records: %1"
,
array
(
1
=>
count
(
$this
->
_entityIds
))));
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment