Ejemplo n.º 1
0
 /**
  * Format into a concise text representation.
  * @param boolean $text_only Do not use tags when formatting.
  * @return string
  * @access private
  */
 protected function _as_text($text_only)
 {
     if ($this->ship->occurred) {
         $Result = 'Released on ' . $this->ship->date_as_text($text_only);
     } else {
         if ($this->test->scheduled) {
             if (!$this->test->occurred) {
                 $label = 'testing';
                 $stat = $this->test;
             } else {
                 if ($this->ship->scheduled) {
                     $label = 'release';
                     $stat = $this->ship;
                 }
             }
         } else {
             if ($this->ship->scheduled) {
                 $label = 'release';
                 $stat = $this->ship;
             } else {
                 $Result = 'Assigned to release';
             }
         }
     }
     if (!isset($Result)) {
         $Result = '';
         $Result .= "Scheduled for {$label} " . $stat->date_as_text($text_only);
         $Result .= ' (' . $stat->diff_as_text($text_only) . ' ' . $stat->diff_label . ')';
         if ($text_only) {
             if ($stat->text) {
                 $Result = '[' . $stat->text . '] ' . $Result;
             }
         } else {
             $Result = $this->app->get_icon_with_text($stat->icon_url, Sixteen_px, $Result);
         }
     }
     return $Result;
 }
Ejemplo n.º 2
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;
 }