コード例 #1
0
 private function addRecentChanges()
 {
     ### list project changes ###
     require_once confGet('DIR_STREBER') . './lists/list_changes.inc.php';
     $updates_html = '';
     $updates_txt = '';
     foreach ($this->projects as $p) {
         if ($changes = ChangeLine::getChangeLinesForPerson($this->recipient, $p, $this->recipient->notification_last)) {
             $this->information_count++;
             $updates_html .= "<h4>";
             $updates_html .= $this->getItemLink($p->id, $p->name);
             $updates_html .= "</h4><ul>";
             $updates_txt .= "\n\r" . $p->name . "\n\r";
             foreach ($changes as $c) {
                 $updates_html .= "<li>";
                 $updates_txt .= "\n\r- ";
                 ### task
                 if ($c->item && $c->item->type == ITEM_TASK) {
                     $task = $c->item;
                     $updates_html .= $this->getItemLink($task->id, $task->name);
                     $updates_txt .= $task->name;
                 } else {
                     if ($c->item && $c->item->type == ITEM_FILE) {
                         $file = $c->item;
                         $updates_html .= $this->getItemLink($file->id, $file->name);
                         $updates_txt .= $file->name;
                     }
                 }
                 $updates_html .= '<br><span class="details">';
                 # invisible user
                 $updates_txt .= "\n\r";
                 # invisible user
                 ### what...
                 if ($c->html_what) {
                     $updates_html .= $c->html_what . ' ';
                     if ($c->txt_what) {
                         $updates_txt .= '  ' . $c->txt_what;
                     } else {
                         $updates_txt .= '  ' . strip_tags($c->html_what);
                     }
                 }
                 $updates_html .= ' ' . __("by") . ' ';
                 # invisible user
                 $updates_txt .= ' ' . __("by") . ' ';
                 # invisible user
                 ### who...
                 if ($c->person_by) {
                     if ($p_who = Person::getVisibleById($c->person_by)) {
                         $updates_html .= "<b>" . asHtml($p_who->nickname) . "</b>" . " ";
                         $updates_txt .= $p_who->nickname;
                     } else {
                         $updates_html .= '??? ';
                         # invisible user
                         $updates_txt .= '???: ';
                         # invisible user
                     }
                 }
                 ### when...
                 if ($c->timestamp) {
                     $updates_html .= ' - ' . renderTimestamp($c->timestamp);
                     $updates_txt .= ' - ' . renderTimestamp($c->timestamp);
                 }
                 ### to...
                 /**
                  * @@@ bug: this contains internal links that can be viewed from mail
                  **/
                 if ($c->html_assignment) {
                     $updates_html .= ' (' . $c->html_assignment . ') ';
                 }
                 $updates_html .= "</span>";
                 $updates_html .= "<div class='details'>" . $c->html_details . "</div>";
                 $updates_html .= "</li>";
                 $updates_txt .= "\n\r";
             }
             $updates_html .= "</ul>";
             $updates_txt .= "\n\r";
         }
     }
     if ($updates_html) {
         $this->body_html .= "<h3>" . __('Project Updates') . "</h3>" . $updates_html;
         $this->body_plaintext .= "\n\r" . __('Project Updates') . "\n\r" . str_repeat("=", strlen(__('Project Updates'))) . "\n\r" . $updates_txt;
     }
 }