| @@ 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); |
|
| @@ 524-528 (lines=5) @@ | ||
| 521 | $message_return = 'missions:declination_has_been_sent'; |
|
| 522 | remove_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid); |
|
| 523 | } |
|
| 524 | if(check_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid)) { |
|
| 525 | $message_return = 'missions:withdrawal_has_been_sent'; |
|
| 526 | remove_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid); |
|
| 527 | mm_complete_mission_inprogress_reports($entity, true); |
|
| 528 | } |
|
| 529 | ||
| 530 | $reasonEn = elgg_echo('missions:decline:'.$message,'en'); |
|
| 531 | $reasonFr = elgg_echo('missions:decline:'.$message,'fr'); |
|
| @@ 571-575 (lines=5) @@ | ||
| 568 | return "Invalid opportunity. Please try a different GUID"; |
|
| 569 | } |
|
| 570 | ||
| 571 | if(check_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid)) { |
|
| 572 | ||
| 573 | remove_entity_relationship($entity->guid, 'mission_offered', $user_entity->guid); |
|
| 574 | add_entity_relationship($entity->guid, 'mission_accepted', $user_entity->guid); |
|
| 575 | } |
|
| 576 | ||
| 577 | return elgg_echo('missions:now_participating_in_mission', array($entity->job_title)); |
|
| 578 | } |
|