Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
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
Development
CiviCRM Core
Commits
5f3ff0ef
Commit
5f3ff0ef
authored
5 years ago
by
Seamus Lee
Browse files
Options
Downloads
Patches
Plain Diff
Proper Fix for
#1422
parent
df67940b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Event/Form/Search.php
+24
-26
24 additions, 26 deletions
CRM/Event/Form/Search.php
with
24 additions
and
26 deletions
CRM/Event/Form/Search.php
+
24
−
26
View file @
5f3ff0ef
...
...
@@ -289,7 +289,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
$this
->
_queryParams
=
CRM_Contact_BAO_Query
::
convertFormValues
(
$this
->
_formValues
,
0
,
FALSE
,
NULL
,
[
'event_id'
]);
$this
->
set
(
'formValues'
,
$this
->
_formValues
);
$this
->
set
(
'queryParams'
,
$this
->
_queryParams
);
$buttonName
=
$this
->
controller
->
getButtonName
();
...
...
@@ -382,29 +381,6 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
// if this search has been forced
// then see if there are any get values, and if so over-ride the post values
// note that this means that GET over-rides POST :)
$event
=
CRM_Utils_Request
::
retrieve
(
'event'
,
'Positive'
);
if
(
$event
)
{
$this
->
_formValues
[
'event_id'
]
=
$event
;
$this
->
_formValues
[
'event_name'
]
=
CRM_Event_PseudoConstant
::
event
(
$event
,
TRUE
);
}
$status
=
CRM_Utils_Request
::
retrieve
(
'status'
,
'String'
);
if
(
isset
(
$status
))
{
if
(
$status
===
'true'
)
{
$statusTypes
=
CRM_Event_PseudoConstant
::
participantStatus
(
NULL
,
"is_counted = 1"
);
}
elseif
(
$status
===
'false'
)
{
$statusTypes
=
CRM_Event_PseudoConstant
::
participantStatus
(
NULL
,
"is_counted = 0"
);
}
elseif
(
is_numeric
(
$status
))
{
$statusTypes
=
(
int
)
$status
;
}
elseif
(
is_array
(
$status
)
&&
!
array_key_exists
(
'IN'
,
$status
))
{
$statusTypes
=
array_keys
(
$status
);
}
$this
->
_formValues
[
'participant_status_id'
]
=
is_array
(
$statusTypes
)
?
[
'IN'
=>
array_keys
(
$statusTypes
)]
:
$statusTypes
;
}
$role
=
CRM_Utils_Request
::
retrieve
(
'role'
,
'String'
);
...
...
@@ -465,8 +441,30 @@ class CRM_Event_Form_Search extends CRM_Core_Form_Search {
* the default array reference
*/
public
function
setDefaultValues
()
{
parent
::
setDefaultValues
();
return
$this
->
_formValues
;
$this
->
_defaults
=
parent
::
setDefaultValues
();
$event
=
CRM_Utils_Request
::
retrieve
(
'event'
,
'Positive'
);
if
(
$event
)
{
$this
->
_defaults
[
'event_id'
]
=
$event
;
$this
->
_defaults
[
'event_name'
]
=
CRM_Event_PseudoConstant
::
event
(
$event
,
TRUE
);
}
$status
=
CRM_Utils_Request
::
retrieve
(
'status'
,
'String'
);
if
(
isset
(
$status
))
{
if
(
$status
===
'true'
)
{
$statusTypes
=
CRM_Event_PseudoConstant
::
participantStatus
(
NULL
,
"is_counted = 1"
);
}
elseif
(
$status
===
'false'
)
{
$statusTypes
=
CRM_Event_PseudoConstant
::
participantStatus
(
NULL
,
"is_counted = 0"
);
}
elseif
(
is_numeric
(
$status
))
{
$statusTypes
=
(
int
)
$status
;
}
elseif
(
is_array
(
$status
)
&&
!
array_key_exists
(
'IN'
,
$status
))
{
$statusTypes
=
array_keys
(
$status
);
}
$this
->
_defaults
[
'participant_status_id'
]
=
is_array
(
$statusTypes
)
?
array_keys
(
$statusTypes
)
:
$statusTypes
;
}
return
$this
->
_defaults
;
}
}
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