Skip to content
Snippets Groups Projects

Template support

Merged Monish Deb requested to merge monish.deb/certificates:template_support into main
3 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
78 78
79 79 function certificates_civicrm_pre($op, $objectName, $id, &$params) {
80 80 if ($op == 'edit' && $objectName == 'Participant') {
81 $contactId = $params['contact_id'];
81 $contactID = $params['contact_id'];
  • Edselopez
    Edselopez @Edselopez started a thread on commit dfd292e8
  • 78 78
    79 79 function certificates_civicrm_pre($op, $objectName, $id, &$params) {
    80 80 if ($op == 'edit' && $objectName == 'Participant') {
    81 $contactId = $params['contact_id'];
    81 $contactID = $params['contact_id'];
    82 82 try {
    83 $statusId = CRM_Core_PseudoConstant::getKey('CRM_Event_BAO_Participant', 'status_id', 'Attended');
    84
    85 83 //get current participant status before data is changed and get event type
    86 84 $participant = \Civi\Api4\Participant::get(FALSE)
    87 85 ->addSelect('status_id', 'id', 'event_id.Event_Certificate.event_certificate')
    88 86 ->addJoin('Event AS event', 'LEFT', ['event_id', '=', 'event.id'])
    89 87 ->addWhere('contact_id', '=', $contactId)
    88 ->addWhere('status_id:name', '=', 'Attended')
  • Edselopez
    Edselopez @Edselopez started a thread on an outdated change in commit dfd292e8
  • 81 $contactId = $params['contact_id'];
    81 $contactID = $params['contact_id'];
    82 82 try {
    83 $statusId = CRM_Core_PseudoConstant::getKey('CRM_Event_BAO_Participant', 'status_id', 'Attended');
    84
    85 83 //get current participant status before data is changed and get event type
    86 84 $participant = \Civi\Api4\Participant::get(FALSE)
    87 85 ->addSelect('status_id', 'id', 'event_id.Event_Certificate.event_certificate')
    88 86 ->addJoin('Event AS event', 'LEFT', ['event_id', '=', 'event.id'])
    89 87 ->addWhere('contact_id', '=', $contactId)
    88 ->addWhere('status_id:name', '=', 'Attended')
    90 89 ->execute()->first();
    91 $participantId = $participant['id'];
    92 90
    93 91 // checks if participant status_id is now status id for Attended --> then send email
    94 if($participant['status_id'] !== $statusId && $params['status_id'] === $statusId) {
    • this is required, not sure why it has been removed. This line checks to see if the current status of the participant is something other than attended, and is changing to attended. we will issue the cert only then.

    • Please register or sign in to reply
  • Edselopez mentioned in commit 6655046f

    mentioned in commit 6655046f

  • merged

  • Please register or sign in to reply
    Loading