Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pradeep Nayak
smartdebit
Commits
079e19bc
Commit
079e19bc
authored
Feb 17, 2020
by
Pradeep Nayak
Browse files
Setting end date and start date not required now in pre
parent
09a0d790
Changes
1
Hide whitespace changes
Inline
Side-by-side
smartdebit.php
View file @
079e19bc
...
...
@@ -411,30 +411,6 @@ function smartdebit_civicrm_links( $op, $objectName, $objectId, &$links, &$mask,
*/
function
smartdebit_civicrm_pre
(
$op
,
$objectName
,
$id
,
&
$params
)
{
switch
(
$objectName
)
{
case
'Membership'
:
if
(
$op
!==
'create'
)
{
return
;
}
// If creating a new membership and we have "Mark Initial Payment as Completed" set we need to:
// 1. Set membership status from Pending->New
// 2. Set join_date, start_date, end_date as they are not calculated automatically in this case.
if
(
empty
(
$params
[
'contribution_recur_id'
])
||
!
CRM_Smartdebit_Utils
::
isSmartdebitPaymentProcessor
(
$params
[
'contribution_recur_id'
]))
{
return
;
}
if
((
boolean
)
CRM_Smartdebit_Settings
::
getValue
(
'initial_completed'
))
{
if
(
$params
[
'status_id'
]
==
CRM_Core_PseudoConstant
::
getKey
(
'CRM_Member_BAO_Membership'
,
'status_id'
,
'Pending'
))
{
$params
[
'status_id'
]
=
CRM_Core_PseudoConstant
::
getKey
(
'CRM_Member_BAO_Membership'
,
'status_id'
,
'New'
);
}
$dates
=
civicrm_api3
(
'MembershipType'
,
'getdates'
,
[
'membershiptype_id'
=>
$params
[
'membership_type_id'
]]);
if
(
empty
(
$params
[
'join_date'
]))
{
$params
[
'join_date'
]
=
CRM_Utils_Array
::
value
(
'join_date'
,
$dates
);
}
$params
[
'start_date'
]
=
CRM_Utils_Array
::
value
(
'start_date'
,
$dates
);
$params
[
'end_date'
]
=
CRM_Utils_Array
::
value
(
'end_date'
,
$dates
);
}
break
;
case
'ContributionRecur'
:
if
(
$op
!==
'edit'
)
{
return
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment