| @@ 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); |
|
| @@ 552-556 (lines=5) @@ | ||
| 549 | $message_return = 'missions:declination_has_been_sent'; |
|
| 550 | remove_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid); |
|
| 551 | } |
|
| 552 | if(check_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid)) { |
|
| 553 | $message_return = 'missions:withdrawal_has_been_sent'; |
|
| 554 | remove_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid); |
|
| 555 | mm_complete_mission_inprogress_reports($entity, true); |
|
| 556 | } |
|
| 557 | ||
| 558 | $reason = array('workload', 'interest', 'engagement', 'approval'); |
|
| 559 | if (in_array($message,$reason)){ |
|
| @@ 606-610 (lines=5) @@ | ||
| 603 | return "Invalid opportunity. Please try a different GUID"; |
|
| 604 | } |
|
| 605 | ||
| 606 | if(check_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid)) { |
|
| 607 | ||
| 608 | remove_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid); |
|
| 609 | add_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid); |
|
| 610 | } |
|
| 611 | $mission_link = '<a href="'.$entity->getURL().'">'.$entity->title.'</a>'; |
|
| 612 | ||
| 613 | // notify participant |
|