/**
  * Display all reminders of the tracker
  *
  * @return Void
  */
 public function displayAllReminders()
 {
     $titles = array($GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_send_to'), $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_notification_when'), $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_field'), $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_actions'));
     $i = 0;
     $trackerReminders = $this->dateReminderFactory->getTrackerReminders(true);
     if (!empty($trackerReminders)) {
         $purifier = Codendi_HTMLPurifier::instance();
         $output = '';
         foreach ($trackerReminders as $reminder) {
             if ($reminder->getStatus() == Tracker_DateReminder::ENABLED) {
                 $output .= '<tr class="' . util_get_alt_row_color($i++) . '">';
             } else {
                 $output .= '<tr class="tracker_date_reminder">';
             }
             $output .= '<td>' . $reminder->getUgroupsLabel();
             $output .= $reminder->getRolesLabel() . '</td>';
             $output .= '<td>' . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_notification_details', array($reminder->getDistance(), $reminder->getNotificationTypeLabel())) . '</td>';
             $output .= '<td>' . $purifier->purify($reminder->getField()->getLabel()) . '</td>';
             $output .= '<td><span style="float:left;"><a href="?func=admin-notifications&amp;tracker=' . (int) $this->tracker->id . '&amp;reminder_id=' . (int) $reminder->getId() . '&amp;action=update_reminder" id="update_reminder"> ' . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_update_action') . ' ' . $GLOBALS['Response']->getimage('ic/edit.png') . '</a></span>';
             $output .= '&nbsp;&nbsp;&nbsp;<span style="float:right;"><a href="?func=admin-notifications&amp;tracker=' . (int) $this->tracker->id . '&amp;action=delete_reminder&amp;reminder_id=' . $reminder->getId() . '" id="delete_reminder"> ' . $GLOBALS['Language']->getText('plugin_tracker_date_reminder', 'tracker_date_reminder_delete_action') . ' ' . $GLOBALS['Response']->getimage('ic/bin.png') . '</a></span></td>';
             $output .= '</tr>';
         }
         $html_table = new HTML_Table_Bootstrap();
         return $html_table->setColumnsTitle($titles)->setBody($output)->render();
     }
 }
Exemplo n.º 2
0
 protected function fetchTable()
 {
     $html_table = new HTML_Table_Bootstrap();
     $html_table->setId('treeTable')->addTableClass('tree-view');
     $this->appendTableTitles($html_table);
     $this->appendTableBody($html_table);
     return $html_table->render();
 }