| @@ 48-52 (lines=5) @@ | ||
| 45 | $message_return = 'missions:declination_has_been_sent'; |
|
| 46 | remove_entity_relationship($mission->guid, 'mission_offered', $applicant->guid); |
|
| 47 | } |
|
| 48 | if(check_entity_relationship($mission->guid, 'mission_accepted', $applicant->guid)) { |
|
| 49 | $message_return = 'missions:withdrawal_has_been_sent'; |
|
| 50 | remove_entity_relationship($mission->guid, 'mission_accepted', $applicant->guid); |
|
| 51 | mm_complete_mission_inprogress_reports($mission, true); |
|
| 52 | } |
|
| 53 | ||
| 54 | // Object which stores the reason for declining a mission. |
|
| 55 | $ia = elgg_set_ignore_access(true); |
|
| @@ 579-583 (lines=5) @@ | ||
| 576 | $message_return = 'missions:declination_has_been_sent'; |
|
| 577 | remove_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid); |
|
| 578 | } |
|
| 579 | if(check_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid)) { |
|
| 580 | $message_return = 'missions:withdrawal_has_been_sent'; |
|
| 581 | remove_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid); |
|
| 582 | mm_complete_mission_inprogress_reports($entity, true); |
|
| 583 | } |
|
| 584 | ||
| 585 | $reason = array('workload', 'interest', 'engagement', 'approval'); |
|
| 586 | if (in_array($message,$reason)){ |
|
| @@ 633-637 (lines=5) @@ | ||
| 630 | return "Invalid opportunity. Please try a different GUID"; |
|
| 631 | } |
|
| 632 | ||
| 633 | if(check_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid)) { |
|
| 634 | ||
| 635 | remove_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid); |
|
| 636 | add_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid); |
|
| 637 | } |
|
| 638 | $mission_link = '<a href="'.$entity->getURL().'">'.$entity->title.'</a>'; |
|
| 639 | ||
| 640 | // notify participant |
|