/** * retrieve the content of one modified overlay * * @see overlays/overlay.php * * @param the fields as filled by the end user */ function parse_fields($fields) { global $context; $this->attributes['voters'] = isset($fields['voters']) ? $fields['voters'] : ''; $this->attributes['voter_list'] = isset($fields['voter_list']) ? $fields['voter_list'] : ''; $this->attributes['end_date'] = isset($fields['end_date']) ? $fields['end_date'] : NULL_DATE; // adjust date from surfer time zone to UTC time zone if (isset($fields['end_date']) && $fields['end_date']) { $this->attributes['end_date'] = Surfer::to_GMT($fields['end_date']); } }
/** * retrieve the content of one modified overlay * * @see overlays/overlay.php * * @param the fields as filled by the end user */ function parse_fields($fields) { // set initial status if (!isset($this->attributes['status'])) { $this->attributes['status'] = 'created'; } // date and time $this->attributes['date_stamp'] = isset($fields['date_stamp']) ? $fields['date_stamp'] : ''; if ($this->attributes['date_stamp'] && isset($fields['time_stamp']) && $fields['time_stamp']) { $this->attributes['date_stamp'] .= ' ' . $fields['time_stamp']; } // convert date and time from surfer time zone to GMT $this->attributes['date_stamp'] = Surfer::to_GMT($this->attributes['date_stamp']); // duration $this->attributes['duration'] = isset($fields['duration']) ? $fields['duration'] : 60; // enrolment if ($this->with_enrolment()) { $this->attributes['enrolment'] = isset($fields['enrolment']) ? $fields['enrolment'] : 'none'; } // static messages $this->attributes['follow_up_message'] = isset($fields['follow_up_message']) ? $fields['follow_up_message'] : ''; $this->attributes['induction_message'] = isset($fields['induction_message']) ? $fields['induction_message'] : ''; $this->attributes['lobby_message'] = isset($fields['lobby_message']) ? $fields['lobby_message'] : ''; $this->attributes['welcome_message'] = isset($fields['welcome_message']) ? $fields['welcome_message'] : ''; // process event specific attributes $this->parse_event_fields($fields); }
/** * retrieve the content of one modified overlay * * These are data saved into the piggy-backed overlay field of the hosting record. * * If change is the status affects a previous step of the process, then this is either a simple date * update or some steps have to be cancelled. * * Current and previous step are computed using following table: * - 'on-going:suspect': step 1 - creation * - 'cancelled:suspect': step 2 - qualification * - 'on-going:problem': step 2 - qualification * - 'cancelled:problem': step 3 - analysis * - 'on-going:issue': step 3 - analysis * - 'cancelled:issue': step 4 - resolution * - 'on-going:solution': step 4 - resolution * - 'cancelled:solution': step 5 - close * - 'completed:solution': step 5 - close * * @see overlays/overlay.php * * @param the fields as filled by the end user */ function parse_fields($fields) { $this->attributes['color'] = isset($fields['color']) ? $fields['color'] : 'green'; $this->attributes['owner'] = isset($fields['owner']) ? $fields['owner'] : ''; $this->attributes['status'] = isset($fields['status']) ? $fields['status'] : 'on-going:suspect'; $this->attributes['type'] = isset($fields['type']) ? $fields['type'] : 'incident'; $this->attributes['create_date'] = isset($fields['create_date']) ? Surfer::to_GMT($fields['create_date']) : NULL_DATE; $this->attributes['qualification_date'] = isset($fields['qualification_date']) ? Surfer::to_GMT($fields['qualification_date']) : NULL_DATE; $this->attributes['analysis_date'] = isset($fields['analysis_date']) ? Surfer::to_GMT($fields['analysis_date']) : NULL_DATE; $this->attributes['resolution_date'] = isset($fields['resolution_date']) ? Surfer::to_GMT($fields['resolution_date']) : NULL_DATE; $this->attributes['close_date'] = isset($fields['close_date']) ? Surfer::to_GMT($fields['close_date']) : NULL_DATE; }
} // validate input syntax only if required if (isset($_REQUEST['option_validate']) && $_REQUEST['option_validate'] == 'Y') { if (isset($_REQUEST['introduction'])) { xml::validate($_REQUEST['introduction']); } if (isset($_REQUEST['description'])) { xml::validate($_REQUEST['description']); } } // adjust dates from surfer time zone to UTC time zone if (isset($_REQUEST['activation_date']) && $_REQUEST['activation_date']) { $_REQUEST['activation_date'] = Surfer::to_GMT($_REQUEST['activation_date']); } if (isset($_REQUEST['expiry_date']) && $_REQUEST['expiry_date']) { $_REQUEST['expiry_date'] = Surfer::to_GMT($_REQUEST['expiry_date']); } // stop crawlers if (Surfer::is_crawler()) { Safe::header('Status: 401 Unauthorized', TRUE, 401); Logger::error(i18n::s('You are not allowed to perform this operation.')); // access denied } elseif (!$permitted) { // anonymous users are invited to log in or to register if (!Surfer::is_logged()) { if (isset($item['id'])) { $link = Sections::get_url($item['id'], 'edit'); } elseif (isset($_REQUEST['anchor'])) { $link = 'sections/edit.php?anchor=' . urlencode($_REQUEST['anchor']); } else { $link = 'sections/edit.php';
$anchor->touch('article:update', $item['id'], isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y'); } // clear the cache Articles::clear($item); // follow-up commands $follow_up = i18n::s('Where do you want to go now?'); $menu = array(); $menu = array_merge($menu, array(Articles::get_permalink($item) => i18n::s('Back to the page'))); $menu = array_merge($menu, array('articles/review.php#expired' => i18n::s('Review queue'))); $follow_up .= Skin::build_list($menu, 'menu_bar'); $context['text'] .= Skin::build_block($follow_up, 'bottom'); // new publication date } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'publish') { // convert from surfer time zone to UTC time zone if (isset($_REQUEST['publish_date']) && $_REQUEST['publish_date'] > NULL_DATE) { $_REQUEST['publish_date'] = Surfer::to_GMT($_REQUEST['publish_date']); } // reset the publication date if (!isset($_REQUEST['publish_date']) || $_REQUEST['publish_date'] <= '0000-00-00') { $query = "UPDATE " . SQL::table_name('articles') . " SET publish_date='" . NULL_DATE . "' WHERE id = " . SQL::escape($item['id']); SQL::query($query); $context['text'] .= '<p>' . i18n::s('The publication date has been removed.') . "</p>\n"; // update the database } elseif ($error = Articles::stamp($item['id'], $_REQUEST['publish_date'])) { Logger::error($error); } else { $context['text'] .= '<p>' . i18n::s('The publication date has been changed.') . "</p>\n"; } // touch the related anchor if (is_object($anchor)) { $anchor->touch('article:update', $item['id'], isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y');