$ending) { /*translation:Beginning date should be smaller than ending date.*/ register_error(elgg_echo('koolielu:error_beginning_larger_than_end')); $errors = true; } } if ($errors) { forward("pg/poster/edit_job_advertisement/" . $entity_guid); // Otherwise, save job advertisement } else if ($entity_guid) { $poster = get_entity($entity_guid); $poster->subtype = $jobtype; $poster->title = $title; $poster->brief_description = $brief_desc; $poster->description = $body; $poster->place = $place; // Make date to timestamp conversions if (!empty($beginning_date)) $beginning_date = dateIntoTimestamp($beginning_date); $poster->beginning_date = $beginning_date; if (!empty($ending_date)) { $ending_date = dateIntoTimestamp($ending_date); // if ending date is bigger than current time, then it should not be archived anymore if ($ending_date > time()) $poster->archived = 0; // also if course is approved, we need to make it public again if ($poster->approved == 1) { $poster->access_id = 2; } } $poster->ending_date = $ending_date; $poster->contact_person = $contact_person; $poster->telephone = $telephone; $poster->email = $email; $poster->subjects = $subjects; if (!isModerator()) { if ($poster->access_id == 2) { /*translation:Job advertisement changes saved. Editor needs to review it before publishing it again.*/ system_message("koolielu:job_ad_changes_saved_needs_moderating"); // get all editors $editors = getAllEditors(); if (is_array($editors) && sizeof($editors) > 0) { foreach($editors as $editor) { // send message /*translation:Job advertisement edited notification*/ $msg_title= elgg_echo('koolielu:job_ad_edited_notification'); $msg_desc = ""; /*translation:Job advertisement %s has been edited and needs reviewing.*/ $msg_desc = sprintf(elgg_echo('koolielu:job_offer_edited_notif_req_app'), $poster->getURL(), $poster->title); $messages = array('title' => $msg_title, 'description' => $msg_desc); send_system_message($editor->getGUID(), $messages); } } } else { /*translation:Job advertisement changes saved*/ system_message(elgg_echo("koolielu:job_ad_changes_saved")); } $poster->access_id = 1; $poster->approved = 0; } else { /*translation:Job advertisement changes saved*/ system_message(elgg_echo("koolielu:job_ad_changes_saved")); } $poster->save(); // Remove from cache unset($_SESSION['adtitle']); unset($_SESSION['jobtype']); unset($_SESSION['brief_description']); unset($_SESSION['adbody']); unset($_SESSION['place']); unset($_SESSION['beginning_date']); unset($_SESSION['ending_date']); unset($_SESSION['contact_person']); unset($_SESSION['telephone']); unset($_SESSION['email']); unset($_SESSION['subjects']); forward("pg/poster/read/" . $entity_guid); } ?>