示例#1
0
文件: day.php 项目: rair/yacs
 /**
  * get form fields to change the day
  *
  * @see overlays/overlay.php
  *
  * @param array hosting attributes
  * @return a list of ($label, $input, $hint)
  */
 function get_fields($host, $field_pos = NULL)
 {
     global $context;
     $options = '<input type="hidden" name="time_stamp" value="12:00" />' . '<input type="hidden" name="duration" value="1440" />';
     // default value is now
     if (!isset($this->attributes['date_stamp']) || $this->attributes['date_stamp'] <= NULL_DATE) {
         $this->attributes['date_stamp'] = gmstrftime('%Y-%m-%d %H:%M', time() + Surfer::get_gmt_offset() * 3600);
     } else {
         $this->attributes['date_stamp'] = Surfer::from_GMT($this->attributes['date_stamp']);
     }
     // split date from time
     list($date, $time) = explode(' ', $this->attributes['date_stamp']);
     // event time
     $label = i18n::s('Date');
     $input = Skin::build_input_time('date_stamp', $date, 'date') . $options;
     $hint = i18n::s('Use format YYYY-MM-DD');
     $fields[] = array($label, $input, $hint);
     // ensure that we do have a date
     Page::insert_script('func' . 'tion validateOnSubmit(container) {' . "\n" . "\n" . '	if(!Yacs.trim(container.date_stamp.value)) {' . "\n" . '		alert("' . i18n::s('Please provide a date.') . '");' . "\n" . '		container.date_stamp.focus();' . "\n" . '		Yacs.stopWorking();' . "\n" . '		return false;' . "\n" . '	}' . "\n\n" . '	return true;' . "\n" . '}' . "\n");
     return $fields;
 }
示例#2
0
文件: petition.php 项目: rair/yacs
 /**
  * build the list of fields for one overlay
  *
  * @see overlays/overlay.php
  *
  * @param the hosting attributes
  * @return a list of ($label, $input, $hint)
  */
 function get_fields($host, $field_pos = NULL)
 {
     global $context;
     // accepted voters
     $label = i18n::s('Scope');
     $input = '<input type="radio" name="voters" value="members"';
     if (!isset($this->attributes['voters']) || $this->attributes['voters'] == 'members') {
         $input .= ' checked="checked"';
     }
     $input .= ' /> ' . i18n::s('All members of the community') . BR . "\n";
     $input .= '<input type="radio" name="voters" value="editors"';
     if (isset($this->attributes['voters']) && $this->attributes['voters'] == 'editors') {
         $input .= ' checked="checked"';
     }
     $input .= ' /> ' . i18n::s('Editors of this section') . BR . "\n";
     $input .= '<input type="radio" name="voters" value="associates"';
     if (isset($this->attributes['voters']) && $this->attributes['voters'] == 'associates') {
         $input .= ' checked="checked"';
     }
     $input .= ' /> ' . i18n::s('Associates only') . BR . "\n";
     $input .= '<input type="radio" name="voters" value="custom"';
     if (isset($this->attributes['voters']) && $this->attributes['voters'] == 'custom') {
         $input .= ' checked="checked"';
     }
     $input .= ' /> ' . i18n::s('Following people:') . ' <input type="text" name="voter_list"  onfocus="document.main_form.voters[3].checked=\'checked\'" size="40" />' . BR . "\n";
     $fields[] = array($label, $input);
     // end date
     $label = i18n::s('End date');
     // adjust date from UTC time zone to surfer time zone
     $value = '';
     if (isset($this->attributes['end_date']) && $this->attributes['end_date'] > NULL_DATE) {
         $value = Surfer::from_GMT($this->attributes['end_date']);
     }
     $input = '<input type="text" name="end_date" value ="' . encode_field($value) . '" size="32" maxlength="64" />';
     $hint = i18n::s('YYYY-MM-AA HH:MM');
     $fields[] = array($label, $input, $hint);
     return $fields;
 }
示例#3
0
 // the publication date
 $label = i18n::s('Publication date');
 if (isset($item['publish_date']) && $item['publish_date'] > NULL_DATE) {
     $input = Surfer::from_GMT($item['publish_date']);
 } elseif (isset($item['id']) && (Surfer::is_associate() || Surfer::is_member() && is_object($anchor) && $anchor->is_assigned())) {
     Skin::define_img('ARTICLES_PUBLISH_IMG', 'articles/publish.gif');
     $input = Skin::build_link(Articles::get_url($item['id'], 'publish'), ARTICLES_PUBLISH_IMG . i18n::s('Publish'), 'basic');
 } else {
     Skin::define_img('ARTICLES_UNPUBLISH_IMG', 'articles/unpublish.gif');
     $input = ARTICLES_UNPUBLISH_IMG . i18n::s('not published');
 }
 $fields[] = array($label, $input);
 // the expiry date
 $label = i18n::s('Expiry date');
 if (isset($item['expiry_date']) && $item['expiry_date'] > NULL_DATE) {
     $input = Surfer::from_GMT($item['expiry_date']);
 } else {
     $input = i18n::s('never');
 }
 $fields[] = array($label, $input);
 // the parent section
 if (is_object($anchor)) {
     if (isset($item['id']) && Articles::is_owned($item, $anchor)) {
         $label = i18n::s('Section');
         $input =& Skin::build_box(i18n::s('Select parent container'), Sections::get_radio_buttons($anchor->get_reference()), 'folded');
         $fields[] = array($label, $input);
     } else {
         $text .= '<input type="hidden" name="anchor" value="' . $anchor->get_reference() . '" />';
     }
 }
 // append fields
示例#4
0
文件: index.php 项目: rair/yacs
 }
 // display in a separate panel
 if (trim($events)) {
     $panels[] = array('events', i18n::s('Events'), 'events_panel', $events);
 }
 //
 // values updated in the background
 //
 $values = '';
 $query = "SELECT * FROM " . SQL::table_name('values') . " ORDER BY id";
 if (!($result = SQL::query($query))) {
     $values .= Logger::error_pop() . BR . "\n";
 } else {
     $values .= Skin::table_prefix('yc-grid');
     while ($row = SQL::fetch($result)) {
         $values .= '<tr><td>' . $row['id'] . '</td><td>' . str_replace("\n", BR, $row['value']) . '</td><td>' . Surfer::from_GMT($row['edit_date']) . "</td></tr>\n";
     }
     $values .= "</table>\n";
 }
 // display in a separate panel
 if (trim($values)) {
     $panels[] = array('values', i18n::s('Values'), 'values_panel', $values);
 }
 //
 // script profiles
 //
 $profiles = '';
 include_once $context['path_to_root'] . 'agents/profiles.php';
 if ($rows = Profiles::list_by_hits(0, 50)) {
     // splash message
     $profiles .= '<p>' . i18n::s('You can sort the table below by clicking on column headers.') . "</p>\n";
示例#5
0
文件: event.php 项目: rair/yacs
 /**
  * get form fields to change the day
  *
  * @see overlays/overlay.php
  *
  * @param array hosting attributes
  * @return a list of ($label, $input, $hint)
  */
 function get_fields($host, $field_pos = NULL)
 {
     global $context;
     // default value is now
     if (!isset($this->attributes['date_stamp']) || $this->attributes['date_stamp'] <= NULL_DATE) {
         $this->attributes['date_stamp'] = gmstrftime('%Y-%m-%d %H:%M', time() + Surfer::get_gmt_offset() * 3600);
     } else {
         $this->attributes['date_stamp'] = Surfer::from_GMT($this->attributes['date_stamp']);
     }
     // split date from time
     list($date, $time) = explode(' ', $this->attributes['date_stamp']);
     // a list for time
     $options = '<select name="time_stamp">';
     list($hours, $minutes) = explode(':', $time);
     if ($hours > '23') {
         $minutes = '23';
     }
     if ($minutes > '30') {
         $minutes = '30';
     } else {
         $minutes = '00';
     }
     if ($hours == '00' && $minutes == '00') {
         $options .= '<option selected="selected">00:00</option>';
     } else {
         $options .= '<option>00:00</option>';
     }
     if ($hours == '00' && $minutes == '30') {
         $options .= '<option selected="selected">00:30</option>';
     } else {
         $options .= '<option>00:30</option>';
     }
     if ($hours == '01' && $minutes == '00') {
         $options .= '<option selected="selected">01:00</option>';
     } else {
         $options .= '<option>01:00</option>';
     }
     if ($hours == '01' && $minutes == '30') {
         $options .= '<option selected="selected">01:30</option>';
     } else {
         $options .= '<option>01:30</option>';
     }
     if ($hours == '02' && $minutes == '00') {
         $options .= '<option selected="selected">02:00</option>';
     } else {
         $options .= '<option>02:00</option>';
     }
     if ($hours == '02' && $minutes == '30') {
         $options .= '<option selected="selected">02:30</option>';
     } else {
         $options .= '<option>02:30</option>';
     }
     if ($hours == '03' && $minutes == '00') {
         $options .= '<option selected="selected">03:00</option>';
     } else {
         $options .= '<option>03:00</option>';
     }
     if ($hours == '03' && $minutes == '30') {
         $options .= '<option selected="selected">03:30</option>';
     } else {
         $options .= '<option>03:30</option>';
     }
     if ($hours == '04' && $minutes == '00') {
         $options .= '<option selected="selected">04:00</option>';
     } else {
         $options .= '<option>04:00</option>';
     }
     if ($hours == '04' && $minutes == '30') {
         $options .= '<option selected="selected">04:30</option>';
     } else {
         $options .= '<option>04:30</option>';
     }
     if ($hours == '05' && $minutes == '00') {
         $options .= '<option selected="selected">05:00</option>';
     } else {
         $options .= '<option>05:00</option>';
     }
     if ($hours == '05' && $minutes == '30') {
         $options .= '<option selected="selected">05:30</option>';
     } else {
         $options .= '<option>05:30</option>';
     }
     if ($hours == '06' && $minutes == '00') {
         $options .= '<option selected="selected">06:00</option>';
     } else {
         $options .= '<option>06:00</option>';
     }
     if ($hours == '06' && $minutes == '30') {
         $options .= '<option selected="selected">06:30</option>';
     } else {
         $options .= '<option>06:30</option>';
     }
     if ($hours == '07' && $minutes == '00') {
         $options .= '<option selected="selected">07:00</option>';
     } else {
         $options .= '<option>07:00</option>';
     }
     if ($hours == '07' && $minutes == '30') {
         $options .= '<option selected="selected">07:30</option>';
     } else {
         $options .= '<option>07:30</option>';
     }
     if ($hours == '08' && $minutes == '00') {
         $options .= '<option selected="selected">08:00</option>';
     } else {
         $options .= '<option>08:00</option>';
     }
     if ($hours == '08' && $minutes == '30') {
         $options .= '<option selected="selected">08:30</option>';
     } else {
         $options .= '<option>08:30</option>';
     }
     if ($hours == '09' && $minutes == '00') {
         $options .= '<option selected="selected">09:00</option>';
     } else {
         $options .= '<option>09:00</option>';
     }
     if ($hours == '09' && $minutes == '30') {
         $options .= '<option selected="selected">09:30</option>';
     } else {
         $options .= '<option>09:30</option>';
     }
     if ($hours == '10' && $minutes == '00') {
         $options .= '<option selected="selected">10:00</option>';
     } else {
         $options .= '<option>10:00</option>';
     }
     if ($hours == '10' && $minutes == '30') {
         $options .= '<option selected="selected">10:30</option>';
     } else {
         $options .= '<option>10:30</option>';
     }
     if ($hours == '11' && $minutes == '00') {
         $options .= '<option selected="selected">11:00</option>';
     } else {
         $options .= '<option>11:00</option>';
     }
     if ($hours == '11' && $minutes == '30') {
         $options .= '<option selected="selected">11:30</option>';
     } else {
         $options .= '<option>11:30</option>';
     }
     if ($hours == '12' && $minutes == '00') {
         $options .= '<option selected="selected">12:00</option>';
     } else {
         $options .= '<option>12:00</option>';
     }
     if ($hours == '12' && $minutes == '30') {
         $options .= '<option selected="selected">12:30</option>';
     } else {
         $options .= '<option>12:30</option>';
     }
     if ($hours == '13' && $minutes == '00') {
         $options .= '<option selected="selected">13:00</option>';
     } else {
         $options .= '<option>13:00</option>';
     }
     if ($hours == '13' && $minutes == '30') {
         $options .= '<option selected="selected">13:30</option>';
     } else {
         $options .= '<option>13:30</option>';
     }
     if ($hours == '14' && $minutes == '00') {
         $options .= '<option selected="selected">14:00</option>';
     } else {
         $options .= '<option>14:00</option>';
     }
     if ($hours == '14' && $minutes == '30') {
         $options .= '<option selected="selected">14:30</option>';
     } else {
         $options .= '<option>14:30</option>';
     }
     if ($hours == '15' && $minutes == '00') {
         $options .= '<option selected="selected">15:00</option>';
     } else {
         $options .= '<option>15:00</option>';
     }
     if ($hours == '15' && $minutes == '30') {
         $options .= '<option selected="selected">15:30</option>';
     } else {
         $options .= '<option>15:30</option>';
     }
     if ($hours == '16' && $minutes == '00') {
         $options .= '<option selected="selected">16:00</option>';
     } else {
         $options .= '<option>16:00</option>';
     }
     if ($hours == '16' && $minutes == '30') {
         $options .= '<option selected="selected">16:30</option>';
     } else {
         $options .= '<option>16:30</option>';
     }
     if ($hours == '17' && $minutes == '00') {
         $options .= '<option selected="selected">17:00</option>';
     } else {
         $options .= '<option>17:00</option>';
     }
     if ($hours == '17' && $minutes == '30') {
         $options .= '<option selected="selected">17:30</option>';
     } else {
         $options .= '<option>17:30</option>';
     }
     if ($hours == '18' && $minutes == '00') {
         $options .= '<option selected="selected">18:00</option>';
     } else {
         $options .= '<option>18:00</option>';
     }
     if ($hours == '18' && $minutes == '30') {
         $options .= '<option selected="selected">18:30</option>';
     } else {
         $options .= '<option>18:30</option>';
     }
     if ($hours == '19' && $minutes == '00') {
         $options .= '<option selected="selected">19:00</option>';
     } else {
         $options .= '<option>19:00</option>';
     }
     if ($hours == '19' && $minutes == '30') {
         $options .= '<option selected="selected">19:30</option>';
     } else {
         $options .= '<option>19:30</option>';
     }
     if ($hours == '20' && $minutes == '00') {
         $options .= '<option selected="selected">20:00</option>';
     } else {
         $options .= '<option>20:00</option>';
     }
     if ($hours == '20' && $minutes == '30') {
         $options .= '<option selected="selected">20:30</option>';
     } else {
         $options .= '<option>20:30</option>';
     }
     if ($hours == '21' && $minutes == '00') {
         $options .= '<option selected="selected">21:00</option>';
     } else {
         $options .= '<option>21:00</option>';
     }
     if ($hours == '21' && $minutes == '30') {
         $options .= '<option selected="selected">21:30</option>';
     } else {
         $options .= '<option>21:30</option>';
     }
     if ($hours == '22' && $minutes == '00') {
         $options .= '<option selected="selected">22:00</option>';
     } else {
         $options .= '<option>22:00</option>';
     }
     if ($hours == '22' && $minutes == '30') {
         $options .= '<option selected="selected">22:30</option>';
     } else {
         $options .= '<option>22:30</option>';
     }
     if ($hours == '23' && $minutes == '00') {
         $options .= '<option selected="selected">23:00</option>';
     } else {
         $options .= '<option>23:00</option>';
     }
     if ($hours == '23' && $minutes == '30') {
         $options .= '<option selected="selected">23:30</option>';
     } else {
         $options .= '<option>23:30</option>';
     }
     $options .= '</select>';
     // event time
     $label = i18n::s('Date');
     $input = Skin::build_input_time('date_stamp', $date, 'date') . $options;
     $hint = i18n::s('Use format YYYY-MM-DD');
     $fields[] = array($label, $input, $hint);
     // ensure that we do have a date
     Page::insert_script('func' . 'tion validateOnSubmit(container) {' . "\n" . '	if(!Yacs.trim(container.date_stamp.value)) {' . "\n" . '		alert("' . i18n::s('Please provide a date.') . '");' . "\n" . '		container.date_stamp.focus();' . "\n" . '		Yacs.stopWorking();' . "\n" . '		return false;' . "\n" . '	}' . "\n" . '	return true;' . "\n" . '}' . "\n");
     // duration
     $label = i18n::s('Duration');
     $input = '<select name="duration">';
     if (!isset($this->attributes['duration']) || $this->attributes['duration'] < 15 || $this->attributes['duration'] > 1440) {
         $this->attributes['duration'] = 60;
     }
     $input .= '<option value="15"' . ($this->attributes['duration'] == 15 ? ' selected="selected"' : '') . '>' . sprintf(i18n::s('%d minutes'), 15) . '</option>';
     $input .= '<option value="30"' . ($this->attributes['duration'] == 30 ? ' selected="selected"' : '') . '>' . sprintf(i18n::s('%d minutes'), 30) . '</option>';
     $input .= '<option value="45"' . ($this->attributes['duration'] == 45 ? ' selected="selected"' : '') . '>' . sprintf(i18n::s('%d minutes'), 45) . '</option>';
     $input .= '<option value="60"' . ($this->attributes['duration'] == 60 ? ' selected="selected"' : '') . '>' . i18n::s('one hour') . '</option>';
     $input .= '<option value="120"' . ($this->attributes['duration'] == 120 ? ' selected="selected"' : '') . '>' . i18n::s('two hours') . '</option>';
     $input .= '<option value="1440"' . ($this->attributes['duration'] == 1440 ? ' selected="selected"' : '') . '>' . i18n::s('all day') . '</option>';
     $input .= '</select>';
     $fields[] = array($label, $input);
     return $fields;
 }
示例#6
0
文件: edit.php 项目: rair/yacs
 // the activation date
 $label = i18n::s('Activation date');
 // adjust date from UTC time zone to surfer time zone
 $value = '';
 if (isset($item['activation_date']) && $item['activation_date'] > NULL_DATE) {
     $value = Surfer::from_GMT($item['activation_date']);
 }
 $input = Skin::build_input_time('activation_date', $value, 'date_time');
 $hint = i18n::s('Publish content in the future - automatically');
 $fields[] = array($label, $input, $hint);
 // the expiry date
 $label = i18n::s('Expiry date');
 // adjust date from UTC time zone to surfer time zone
 $value = '';
 if (isset($item['expiry_date']) && $item['expiry_date'] > NULL_DATE) {
     $value = Surfer::from_GMT($item['expiry_date']);
 }
 $input = Skin::build_input_time('expiry_date', $value, 'date_time');
 $hint = i18n::s('Remove content on dead-line - automatically');
 $fields[] = array($label, $input, $hint);
 // provide my id
 $me = isset($item['id']) ? $item['id'] : NULL;
 // reference to parent section
 $ref = is_object($anchor) ? $anchor->get_reference() : NULL;
 // associates can anchor the section anywhere
 if (Surfer::is_associate()) {
     $label = i18n::s('Section');
     $input =& Skin::build_box(i18n::s('Select parent container'), Sections::get_radio_buttons($ref, $me), 'folded');
     $fields[] = array($label, $input);
     // parent section is defined and surfer is an editor of it
 } elseif (is_object($anchor) && $anchor->is_assigned()) {
示例#7
0
文件: issue.php 项目: rair/yacs
 /**
  * add some tabs
  *
  * Display additional information in panels.
  *
  * Accepted action codes:
  * - 'edit' - embedded into the main form page
  *
  * @see overlays/overlay.php
  *
  * @param string the on-going action
  * @param array the hosting record
  * @return an array of array('tab_id', 'tab_label', 'panel_id', 'panel_content') or NULL
  */
 function &get_tabs($variant = 'view', $host = NULL)
 {
     global $context, $local;
     // returned tabs
     $tabs = array();
     $now = strftime('%Y-%m-%d %H:%M:%S', time() + (Surfer::get_gmt_offset() - intval($context['gmt_offset'])) * 3600);
     // trackings
     //
     $tracking = '';
     // only associates and page owners can change the status
     if ($variant == 'edit' && isset($this->anchor) && $this->anchor->is_owned()) {
         // a table of fields
         $fields = array();
         // owner
         $label = i18n::s('Owner');
         if (isset($host['owner_id']) && ($user = Users::get($host['owner_id']))) {
             $value = $user['nick_name'];
         } else {
             $value = '';
         }
         $input = '<input type="text" name="owner" id="owner" value ="' . encode_field($value) . '" size="25" maxlength="32" />';
         $hint = i18n::s('Type some letters of the name and select in the list');
         $fields[] = array($label, $input, $hint);
         // enable owner autocompletion
         Page::insert_script('$(function() { Yacs.autocomplete_names("owner",true); });');
         // priority
         $label = i18n::s('Priority');
         if (!isset($this->attributes['color'])) {
             $this->attributes['color'] = 'green';
         }
         $input = self::get_color_as_radio_buttons($this->attributes['color']);
         $fields[] = array($label, $input);
         // type
         $label = i18n::s('Workflow');
         if (!isset($this->attributes['type'])) {
             $this->attributes['type'] = 'incident';
         }
         $input = '<select name="type" id="type">' . self::get_type_options($this->attributes['type']) . '</select>';
         $fields[] = array($label, $input);
         // format these fields
         $tracking .= Skin::build_form($fields);
         $fields = array();
         // to represent transitions from one step to the next one
         Skin::define_img('NEXT_STEP', 'overlays/next_step.gif', 'V');
         // status
         if (!isset($this->attributes['status'])) {
             $this->attributes['status'] = 'on-going:suspect';
         }
         // create_date
         if (!isset($host['create_date']) || !$host['create_date']) {
             $host['create_date'] = gmstrftime('%Y-%m-%d %H:%M:%S');
         }
         $host['create_date'] = Surfer::from_GMT($host['create_date']);
         if ($this->attributes['type'] == 'feature') {
             $label = i18n::s('Feature request has been created on %s');
         } elseif ($this->attributes['type'] == 'patch') {
             $label = i18n::s('Patch has been submitted on %s');
         } else {
             $label = i18n::s('Page has been created on %s');
         }
         $tracking .= '<div class="bottom" style="margin-bottom: 1em;">' . sprintf($label, Skin::build_input_time('create_date', $host['create_date'], 'date_time') . ' <a onclick="$(\'#create_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '</div>';
         $tracking .= NEXT_STEP;
         // qualification_date
         if (isset($this->attributes['qualification_date'])) {
             $this->attributes['qualification_date'] = Surfer::from_GMT($this->attributes['qualification_date']);
         }
         $tracking .= '<div style="margin-top: 1em">' . sprintf(i18n::s('Qualification has taken place on %s'), Skin::build_input_time('qualification_date', isset($this->attributes['qualification_date']) ? $this->attributes['qualification_date'] : NULL_DATE, 'date_time') . ' <a onclick="$(\'#qualification_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '<p>';
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'on-going:problem') {
             $checked = 'checked="checked"';
         }
         $tracking .= '<input type="radio" name="status" value ="on-going:problem" ' . $checked . ' />&nbsp;' . $this->get_status_label('on-going:problem');
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'cancelled:suspect') {
             $checked = 'checked="checked"';
         }
         $tracking .= BR . '<input type="radio" name="status" value ="cancelled:suspect" ' . $checked . ' />&nbsp;' . $this->get_status_label('cancelled:suspect') . '</p></div>';
         $tracking .= NEXT_STEP;
         // analysis_date, except for maintenance cases
         if ($this->attributes['type'] != 'maintenance') {
             if (isset($this->attributes['analysis_date'])) {
                 $this->attributes['analysis_date'] = Surfer::from_GMT($this->attributes['analysis_date']);
             }
             $tracking .= '<div style="margin-top: 1em">' . sprintf(i18n::s('Analysis has ended on %s'), Skin::build_input_time('analysis_date', isset($this->attributes['analysis_date']) ? $this->attributes['analysis_date'] : NULL_DATE, 'date_time') . ' <a onclick="$(\'#analysis_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '<p>';
             $checked = '';
             if (isset($this->attributes['status']) && $this->attributes['status'] == 'on-going:issue') {
                 $checked = 'checked="checked"';
             }
             $tracking .= '<input type="radio" name="status" value ="on-going:issue" ' . $checked . ' />&nbsp;' . $this->get_status_label('on-going:issue');
             $checked = '';
             if (isset($this->attributes['status']) && $this->attributes['status'] == 'cancelled:problem') {
                 $checked = 'checked="checked"';
             }
             $tracking .= BR . '<input type="radio" name="status" value ="cancelled:problem" ' . $checked . ' />&nbsp;' . $this->get_status_label('cancelled:problem') . '</p></div>';
             $tracking .= NEXT_STEP;
         }
         // resolution_date
         if (isset($this->attributes['resolution_date'])) {
             $this->attributes['resolution_date'] = Surfer::from_GMT($this->attributes['resolution_date']);
         }
         if ($this->attributes['type'] == 'feature') {
             $label = i18n::s('Assignment has been finalized on %s');
         } elseif ($this->attributes['type'] == 'maintenance') {
             $label = i18n::s('Change has been finalized on %s');
         } elseif ($this->attributes['type'] == 'patch') {
             $label = i18n::s('Assignment has been finalized on %s');
         } else {
             $label = i18n::s('Resolution has been finalized on %s');
         }
         $tracking .= '<div style="margin-top: 1em">' . sprintf($label, Skin::build_input_time('resolution_date', isset($this->attributes['resolution_date']) ? $this->attributes['resolution_date'] : NULL_DATE, 'date_time') . ' <a onclick="$(\'#resolution_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '<p>';
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'on-going:solution') {
             $checked = 'checked="checked"';
         }
         $tracking .= '<input type="radio" name="status" value ="on-going:solution" ' . $checked . ' />&nbsp;' . $this->get_status_label('on-going:solution');
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'cancelled:issue') {
             $checked = 'checked="checked"';
         }
         $tracking .= BR . '<input type="radio" name="status" value ="cancelled:issue" ' . $checked . ' />&nbsp;' . $this->get_status_label('cancelled:issue') . '</p></div>';
         $tracking .= NEXT_STEP;
         // close_date
         if (isset($this->attributes['close_date'])) {
             $this->attributes['close_date'] = Surfer::from_GMT($this->attributes['close_date']);
         }
         $tracking .= '<div style="margin-top: 1em">' . sprintf(i18n::s('Case has been closed on %s'), Skin::build_input_time('close_date', isset($this->attributes['close_date']) ? $this->attributes['close_date'] : NULL_DATE, 'date_time') . ' <a onclick="$(\'#close_date\').val(\'' . $now . '\')" style="cursor: pointer;" class="details">' . i18n::s('now') . '</a>') . '<p>';
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'completed:solution') {
             $checked = 'checked="checked"';
         }
         $tracking .= '<input type="radio" name="status" value ="completed:solution" ' . $checked . ' />&nbsp;' . $this->get_status_label('completed:solution');
         $checked = '';
         if (isset($this->attributes['status']) && $this->attributes['status'] == 'cancelled:solution') {
             $checked = 'checked="checked"';
         }
         $tracking .= BR . '<input type="radio" name="status" value ="cancelled:solution" ' . $checked . ' />&nbsp;' . $this->get_status_label('cancelled:solution') . '</p></div>';
     }
     // finalize this tab
     if ($tracking) {
         $tabs[] = array('tracking', i18n::s('Tracking'), 'tracking_panel', $tracking);
     }
     // add these tabs
     return $tabs;
 }
示例#8
0
文件: stamp.php 项目: rair/yacs
     $context['text'] .= '<form method="post" action="' . $context['script_url'] . '"><div>' . "\n" . Skin::build_submit_button(i18n::s('Remove expiry date')) . "\n" . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="action" value="expiry" />' . "\n" . '<input type="hidden" name="expiry_date" value="" />' . "\n" . '</div></form>' . "\n";
     // set a new expiry date
 } else {
     // a form to change the date
     $context['text'] .= '<form method="post" action="' . $context['script_url'] . '" name="form_2"><div>' . "\n";
     // catch user input
     $context['text'] .= sprintf(i18n::s('Expire the page after the %s'), Skin::build_input_time('expiry_date', NULL, 'date_time'));
     // the submit button
     $context['text'] .= Skin::build_submit_button(i18n::s('Save the date')) . "\n" . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="action" value="expiry" />' . "\n" . '</div></form>' . "\n";
 }
 // change or delete the publishing date
 $context['text'] .= Skin::build_block(i18n::s('Publication date'), 'title');
 // change the publication date
 if (isset($item['publish_date']) && $item['publish_date'] > NULL_DATE) {
     // adjust date from server time zone to surfer time zone
     $value = Surfer::from_GMT($item['publish_date']);
     // a form to change the date
     $context['text'] .= '<form method="post" action="' . $context['script_url'] . '" name="form_3"><div>' . "\n";
     // catch user input
     $context['text'] .= sprintf(i18n::s('Change the publication date to %s'), Skin::build_input_time('publish_date', $value, 'date_time'));
     // the submit button
     $context['text'] .= Skin::build_submit_button(i18n::s('Save the date')) . "\n" . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="action" value="publish" />' . "\n" . '</div></form>' . "\n";
     // a form to remove the date
     $context['text'] .= '<form method="post" action="' . $context['script_url'] . '"><div>' . "\n" . Skin::build_submit_button(i18n::s('Change to draft mode')) . "\n" . '<input type="hidden" name="id" value="' . $item['id'] . '" />' . "\n" . '<input type="hidden" name="action" value="publish" />' . "\n" . '<input type="hidden" name="publish_date" value="" />' . "\n" . '</div></form>' . "\n";
     // set a new publication date
 } else {
     // go to the dedicated page
     $context['text'] .= '<p>' . Skin::build_link(Articles::get_url($item['id'], 'publish'), i18n::s('Publish the page'), 'shortcut') . '</p>';
 }
 // cancel
 if (isset($_SERVER['HTTP_REFERER'])) {