- client_id: (string) The client id.
- deliverable_id: (string) The delverable id.
- deliverable_text: (string) Descriptive text for deliverable.
- jobtype_id: (string) The jobtype id.
- time: (integer) Contains the timestamp of the last time
this timer was started. Contains zero if paused.
- paused: (boolean) Flag to indicate the timer is paused.
- elapsed: (integer) Total elapsed time since the timer was
created or reset. Updated when timer is paused.
- exclusive: (boolean) Whether or not this timer should cause
other timers to stop when it is started.
<?php /** * Copyright 2005-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (BSD). If you * did not receive this file, see http://www.horde.org/licenses/bsdl.php. * * @author Chuck Hagenbuch <*****@*****.**> * @author Jan Schneider <*****@*****.**> */ require_once __DIR__ . '/lib/Application.php'; $hermes = Horde_Registry::appInit('hermes'); $vars = Horde_Variables::getDefaultVariables(); $form = new Horde_Form($vars, _("Stop Watch")); $form->addVariable(_("Stop watch description"), 'description', 'text', true); if ($form->validate($vars)) { Hermes::newTimer($vars->get('description')); echo Horde::wrapInlineScript(array('var t = ' . Horde_Serialize::serialize(sprintf(_("The stop watch \"%s\" has been started and will appear in the menu at the next refresh."), $vars->get('description')), Horde_Serialize::JSON) . ';', 'alert(t);', 'window.close();')); exit; } $page_output->topbar = $page_output->sidebar = false; $page_output->header(array('title' => _("Stop Watch"))); $form->renderActive(new Horde_Form_Renderer(), $vars, Horde::url('start.php'), 'post'); $page_output->footer();
/** * Add a new timer. Expects the following in $this->vars: * - desc: The timer description. * - client_id: * - deliverable_id: * - jobtype_id: * * @return array An array with an 'id' key. */ public function addTimer() { $id = Hermes::newTimer($this->vars->desc, $this->vars); $timer = Hermes::getTimer($id); return $timer; }