status() public static method

Trigger notifications.
public static status ( )
示例#1
0
文件: view.php 项目: DSNS-LAB/Dmail
        $notification->push(_("Task not found"), 'horde.error');
        Horde::url('list.php', true)->redirect();
    }
}
/* Load child tasks */
$task->loadChildren(false);
/* Check permissions on $tasklist_id. */
$share = $GLOBALS['nag_shares']->getShare($tasklist_id);
if (!$share->hasPermission($GLOBALS['registry']->getAuth(), Horde_Perms::READ)) {
    $notification->push(_("You do not have permission to view this task list."), 'horde.error');
    Horde::url('list.php', true)->redirect();
}
$links = array();
$page_output->addScriptFile('stripe.js', 'horde');
$taskurl = Horde::url('task.php')->add(array('task' => $task_id, 'tasklist' => $tasklist_id));
try {
    $share = $GLOBALS['nag_shares']->getShare($tasklist_id);
} catch (Horde_Share_Exception $e) {
    Horde::log($e->getMessage(), 'ERR');
    throw new Nag_Exception($e);
}
/* Set up alarm units and value. */
$task_alarm = $task->alarm;
if (!$task->due) {
    $task_alarm = 0;
}
$alarm_text = Nag::formatAlarm($task_alarm);
$page_output->header(array('title' => $task->name));
Nag::status();
require NAG_TEMPLATES . '/view/task.inc';
$page_output->footer();
示例#2
0
文件: List.php 项目: horde/horde
 /**
  * Renders the view.
  *
  * @param Horde_PageOutput $output  The output object.
  *
  * @return string  The HTML needed to render the view.
  */
 public function render($output)
 {
     global $injector, $prefs;
     $output->addScriptFile('tooltips.js', 'horde');
     $output->addScriptFile('scriptaculous/effects.js', 'horde');
     $output->addScriptFile('quickfinder.js', 'horde');
     $output->header(array('title' => $this->_title));
     $tabs = new Horde_Core_Ui_Tabs('tab_name', $this->_vars);
     if (!$GLOBALS['prefs']->isLocked('show_completed')) {
         $listurl = Horde::url('list.php');
         $tabs->addTab(_("_All tasks"), $listurl->add('show_completed', Nag::VIEW_ALL), Nag::VIEW_ALL);
         $tabs->addTab(_("Incom_plete tasks"), $listurl->add('show_completed', Nag::VIEW_INCOMPLETE), Nag::VIEW_INCOMPLETE);
         $tabs->addTab(_("_Future tasks"), $listurl->add('show_completed', Nag::VIEW_FUTURE), Nag::VIEW_FUTURE);
         $tabs->addTab(_("_Completed tasks"), $listurl->add('show_completed', Nag::VIEW_COMPLETE), Nag::VIEW_COMPLETE);
     }
     foreach (Nag::listTasklists() as $list) {
         if ($list->get('issmart')) {
             $tabs->addTab($list->get('name'), $listurl->add(array('actionID' => 'smart', 'list' => $list->getName())), array('img' => 'search.png', 'tabname' => $list->getName()));
         }
     }
     // Set up the view
     $view = $GLOBALS['injector']->createInstance('Horde_View');
     $view->addHelper(new Nag_View_Helper_List($view));
     $view->tasks = $this->_tasks;
     $view->tabs = $tabs->render($this->_vars->get('tab_name', $prefs->getValue('show_completed')));
     $view->browser = empty($this->_smartShare) && $this->_showTagBrowser ? $this->_getRelatedTags() . $this->_getTagTrail() : '';
     $view->title = $this->_title;
     $view->sortby = $prefs->getValue('sortby');
     $view->sortdir = $prefs->getValue('sortdir');
     $view->sortdirclass = $view->sortdir ? 'sortup' : 'sortdown';
     $view->dateFormat = $prefs->getValue('date_format');
     $view->columns = @unserialize($prefs->getValue('tasklist_columns'));
     $view->smartShare = $this->_smartShare;
     $view->haveSearch = $this->_haveSearch;
     $view->tab_name = $this->_vars->get('tab_name', $prefs->getValue('show_completed'));
     if (empty($view->columns)) {
         $view->columns = array();
     }
     $view->dynamic_sort = true;
     $view->baseurl = Horde::url('list.php');
     if ($this->_vars->actionID == 'search_tasks') {
         $view->baseurl->add(array('actionID' => 'search_tasks', 'search_pattern' => $search_pattern, 'search_name' => $search_name ? 'on' : 'off', 'search_desc' => $search_desc ? 'on' : 'off'));
     }
     $view->tasks->reset();
     Horde::startBuffer();
     Nag::status();
     echo $view->render('list');
     $output->footer();
     return Horde::endBuffer();
 }