예제 #1
0
 /**
  * Returns to development.
  * The release has been set back to planning stages. Clears testing and shipping times.
  * @param boolean $update_now Actualize the database?
  */
 public function plan($update_now = true)
 {
     if ($this->planned()) {
         $this->set_state(Planned, $update_now);
         $this->time_tested->clear();
         $this->time_shipped->clear();
         $this->_update_next_deadline();
     }
 }
예제 #2
0
 public function __construct()
 {
     $this->gecko_date = new DATE_TIME();
     $this->gecko_date->clear();
 }
예제 #3
0
 /**
  * Return the needed by status as HTML or plain text.
  * Returns empty if there is no needed by date.
  * @param boolean $text_only Do not use HTML tags when formatting.
  * @return string
  * @access private
  */
 protected function _needed_by_as_text($text_only)
 {
     $Result = '';
     $entry = $this->entry();
     if ($entry->time_needed->is_valid()) {
         $rel = $this->release();
         if ($rel) {
             $occurred = new DATE_TIME();
             $occurred->clear();
             include_once 'projects/obj/release_status.php';
             $status = new RELEASE_DATE_STATUS($rel, $occurred, $entry->time_needed);
             $Result = '';
             $diff_as_text = $status->diff_as_text($text_only);
             $Result .= 'Needed by ' . $status->date_as_text($text_only);
             if ($diff_as_text) {
                 $Result .= ' (' . $diff_as_text;
                 if ($status->diff_label) {
                     $Result .= ' ' . $status->diff_label . ')';
                 } else {
                     $Result .= ')';
                 }
             }
             if ($text_only) {
                 if ($status->text) {
                     $Result = $status->text . ' ' . $Result;
                 }
             } else {
                 $Result = $this->app->get_icon_with_text($status->icon_url, Sixteen_px, $Result);
             }
         }
     }
     return $Result;
 }
예제 #4
0
 /**
  * Set up this object so it will {@link store()} a new object.
  */
 public function initialize_as_new()
 {
     parent::initialize_as_new();
     $this->time_created->clear();
     $this->time_modified->clear();
 }
예제 #5
0
 /**
  * Values will expire when the browser is closed.
  */
 public function expire_when_session_ends()
 {
     $this->expire_date->clear();
 }
예제 #6
0
 /**
  * Read a time value from the EXIF data block.
  * Date/times are stored in a non-standard format and must be parsed to create a usable time object.
  * @param string $exif_time
  * @return DATE_TIME
  * @access private
  */
 protected function _time_from_exif($exif_time)
 {
     $Result = new DATE_TIME();
     $Result->clear();
     if ($exif_time) {
         $exif_pieces = explode(' ', $exif_time);
         if (sizeof($exif_pieces) == 2) {
             $d = str_replace(':', '-', $exif_pieces[0]);
             $t = trim($exif_pieces[1]);
         }
         $Result->set_from_iso($d . ' ' . $t);
     }
     return $Result;
 }
예제 #7
0
 protected function _pre_store()
 {
     parent::_pre_store();
     if ($this->unpublished()) {
         $this->time_published->clear();
         $this->publisher_id = 0;
         if ($this->_state_when_loaded != $this->state) {
             // State changed; check history items and revoke notification for published items
             $history_item_query = $this->history_item_query();
             /** @var HISTORY_ITEM[] $history_items */
             $history_items = $history_item_query->objects();
             foreach ($history_items as $history_item) {
                 if ($history_item->kind == History_item_published && $history_item->publication_state == History_item_needs_send) {
                     $history_item->publication_state = History_item_silent;
                     $history_item->store();
                 }
             }
         }
     } elseif (!$this->time_published->is_valid()) {
         $this->time_published->set_now();
         if ($this->update_modifier_on_change) {
             $this->publisher_id = $this->login->id;
         } else {
             $this->publisher_id = $this->modifier_id;
         }
     }
 }