Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
justinfreeman (Agileware)
Core
Commits
b6a469c5
Commit
b6a469c5
authored
12 years ago
by
colemanw
Browse files
Options
Downloads
Patches
Plain Diff
Fix event payment fields display CRM-12279
parent
b66bb6fd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Contribute/Form/Contribution/Main.php
+7
-8
7 additions, 8 deletions
CRM/Contribute/Form/Contribution/Main.php
CRM/Event/Form/Registration/Register.php
+9
-7
9 additions, 7 deletions
CRM/Event/Form/Registration/Register.php
with
16 additions
and
15 deletions
CRM/Contribute/Form/Contribution/Main.php
+
7
−
8
View file @
b6a469c5
...
...
@@ -387,7 +387,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
TRUE
);
$this
->
addRule
(
"email-
{
$this
->
_bltID
}
"
,
ts
(
'Email is not valid.'
),
'email'
);
$this
->
_paymentProcessors
=
$this
->
get
(
'paymentProcessors'
);
$pps
=
array
();
if
(
!
empty
(
$this
->
_paymentProcessors
))
{
$pps
=
$this
->
_paymentProcessors
;
...
...
@@ -1336,13 +1335,13 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
* Handle Payment Processor switching
* For contribution and event registration forms
*/
static
function
preProcessPaymentOptions
(
&
$form
)
{
static
function
preProcessPaymentOptions
(
&
$form
,
$noFees
=
FALSE
)
{
$form
->
_snippet
=
CRM_Utils_Array
::
value
(
'snippet'
,
$_GET
);
$form
->
assign
(
'snippet'
,
$form
->
_snippet
);
$paymentProcessors
=
$form
->
get
(
'paymentProcessors'
);
$
form
->
_
paymentProcessors
=
$noFees
?
array
()
:
$form
->
get
(
'paymentProcessors'
);
$form
->
_ppType
=
NULL
;
if
(
$paymentProcessors
)
{
if
(
$
form
->
_
paymentProcessors
)
{
// Fetch type during ajax request
if
(
isset
(
$_GET
[
'type'
])
&&
$form
->
_snippet
)
{
$form
->
_ppType
=
$_GET
[
'type'
];
...
...
@@ -1350,15 +1349,15 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
// Remember type during form post
elseif
(
!
empty
(
$form
->
_submitValues
))
{
$form
->
_ppType
=
CRM_Utils_Array
::
value
(
'payment_processor'
,
$form
->
_submitValues
);
$form
->
_paymentProcessor
=
CRM_Utils_Array
::
value
(
$form
->
_ppType
,
$paymentProcessors
);
$form
->
_paymentProcessor
=
CRM_Utils_Array
::
value
(
$form
->
_ppType
,
$
form
->
_
paymentProcessors
);
$form
->
set
(
'type'
,
$form
->
_ppType
);
$form
->
set
(
'mode'
,
$form
->
_mode
);
$form
->
set
(
'paymentProcessor'
,
$form
->
_paymentProcessor
);
}
// Set default payment processor
else
{
foreach
(
$paymentProcessors
as
$values
)
{
if
(
!
empty
(
$values
[
'is_default'
])
||
count
(
$paymentProcessors
)
==
1
)
{
foreach
(
$
form
->
_
paymentProcessors
as
$values
)
{
if
(
!
empty
(
$values
[
'is_default'
])
||
count
(
$
form
->
_
paymentProcessors
)
==
1
)
{
$form
->
_ppType
=
$values
[
'id'
];
break
;
}
...
...
@@ -1369,7 +1368,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
}
//get payPal express id and make it available to template
foreach
(
$paymentProcessors
as
$ppId
=>
$values
)
{
foreach
(
$
form
->
_
paymentProcessors
as
$ppId
=>
$values
)
{
$payPalExpressId
=
(
$values
[
'payment_processor_type'
]
==
'PayPal_Express'
)
?
$values
[
'id'
]
:
0
;
$form
->
assign
(
'payPalExpressId'
,
$payPalExpressId
);
if
(
$payPalExpressId
)
{
...
...
This diff is collapsed.
Click to expand it.
CRM/Event/Form/Registration/Register.php
+
9
−
7
View file @
b6a469c5
...
...
@@ -80,18 +80,21 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
function
preProcess
()
{
parent
::
preProcess
();
CRM_Contribute_Form_Contribution_Main
::
preProcessPaymentOptions
(
$this
);
if
(
$this
->
_snippet
)
{
return
;
}
//CRM-4320.
//here we can't use parent $this->_allowWaitlist as user might
//walk back and we maight set this value in this postProcess.
//(we set when spaces < group count and want to allow become part of waiting )
$eventFull
=
CRM_Event_BAO_Participant
::
eventFull
(
$this
->
_eventId
,
FALSE
,
CRM_Utils_Array
::
value
(
'has_waitlist'
,
$this
->
_values
[
'event'
]));
// Get payment processors if appropriate for this event
// We hide the payment fields if the event is full or requires approval,
// and the current user has not yet been approved CRM-12279
$noFees
=
((
$eventFull
||
$this
->
_requireApproval
)
&&
!
$this
->
_allowConfirmation
);
CRM_Contribute_Form_Contribution_Main
::
preProcessPaymentOptions
(
$this
,
$noFees
);
if
(
$this
->
_snippet
)
{
return
;
}
$this
->
_allowWaitlist
=
FALSE
;
if
(
$eventFull
&&
!
$this
->
_allowConfirmation
&&
CRM_Utils_Array
::
value
(
'has_waitlist'
,
$this
->
_values
[
'event'
])
...
...
@@ -413,7 +416,6 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
}
$pps
=
NULL
;
$this
->
_paymentProcessors
=
$this
->
get
(
'paymentProcessors'
);
if
(
!
empty
(
$this
->
_paymentProcessors
))
{
$pps
=
$this
->
_paymentProcessors
;
foreach
(
$pps
as
$key
=>
&
$name
)
{
...
...
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