diff --git a/lib/classes/task/abstract.class.php b/lib/classes/task/abstract.class.php index 8a6236a3b2..4e677ee4d6 100755 --- a/lib/classes/task/abstract.class.php +++ b/lib/classes/task/abstract.class.php @@ -297,9 +297,10 @@ abstract class task_abstract } /** + * 'active' means 'auto-start when scheduler starts' * * @return boolean - * 'active' means 'auto-start when scheduler starts' + * */ public function isActive() { @@ -339,7 +340,7 @@ abstract class task_abstract $this->running = false; - return(''); + return ''; } $sql = 'SELECT crashed, pid, status, active, settings, name, completed, runner FROM task2 WHERE task_id = :taskid'; @@ -466,8 +467,8 @@ abstract class task_abstract /** * - * @return variant - * pid (int) of the task, or NULL if the pid file + * @return null|integer + * pid (int) of the task * NULL : the pid file is not locked (task no running) */ public function getPID() @@ -491,9 +492,9 @@ abstract class task_abstract } /** - * - * @param boolean $stat * set to false to ask the task to quit its loop + * @param boolean $stat + * */ public function setRunning($stat) { @@ -546,7 +547,7 @@ abstract class task_abstract $lockdir = $core->getRegistry()->get('GV_RootPath') . 'tmp/locks/'; $lockfilePath = ($lockdir . 'task_' . $this->getID() . '.lock'); - return($lockfilePath); + return $lockfilePath; } /** @@ -836,7 +837,7 @@ abstract class task_abstract $t .= "\t" . $n . $v["usage"] . "\n"; } - return($t); + return $t; } /** diff --git a/lib/classes/task/period/workflow02.class.php b/lib/classes/task/period/workflow02.class.php index c0dff7b71a..a9ce6d04e3 100644 --- a/lib/classes/task/period/workflow02.class.php +++ b/lib/classes/task/period/workflow02.class.php @@ -22,7 +22,7 @@ class task_period_workflow02 extends task_appboxAbstract */ public function getName() { - return(_("task::workflow02")); + return _("task::workflow02"); } /** @@ -34,9 +34,12 @@ class task_period_workflow02 extends task_appboxAbstract return ''; } - // ==================================================================== - // graphic2xml : must return the xml (text) version of the form - // ==================================================================== + /** + * return the xml (text) version of the form filled by the gui + * + * @param string $oldxml + * @return string + */ public function graphic2xml($oldxml) { $request = http_request::getInstance(); @@ -58,16 +61,16 @@ class task_period_workflow02 extends task_appboxAbstract $pname = substr($pname, 4); $pvalue = $parm2[$pname]; if (($ns = $dom->getElementsByTagName($pname)->item(0))) { - // le champ existait dans le xml, on supprime son ancienne valeur (tout le contenu) + // field did exists, remove thevalue while (($n = $ns->firstChild)) $ns->removeChild($n); } else { - // le champ n'existait pas dans le xml, on le cr�e + // field did not exists, create it $dom->documentElement->appendChild($dom->createTextNode("\t")); $ns = $dom->documentElement->appendChild($dom->createElement($pname)); $dom->documentElement->appendChild($dom->createTextNode("\n")); } - // on fixe sa valeur + // set the value switch ($ptype) { case "str": $ns->appendChild($dom->createTextNode($pvalue)); @@ -79,12 +82,16 @@ class task_period_workflow02 extends task_appboxAbstract $xmlchanged = true; } } - return($dom->saveXML()); + return $dom->saveXML(); } - // ==================================================================== - // xml2graphic : must fill the graphic form (using js) from xml - // ==================================================================== + /** + * must fill the gui (using js) from xml + * + * @param string $xml + * @param form-object $form + * @return string "" or error message + */ public function xml2graphic($xml, $form) { if (($sxml = simplexml_load_string($xml))) { // in fact XML IS always valid here... @@ -190,17 +197,17 @@ class task_period_workflow02 extends task_appboxAbstract @@ -256,9 +263,9 @@ class task_period_workflow02 extends task_appboxAbstract @@ -300,17 +307,19 @@ class task_period_workflow02 extends task_appboxAbstract
@@ -320,18 +329,26 @@ class task_period_workflow02 extends task_appboxAbstract maxrecs = 1000; $this->sxTaskSettings = @simplexml_load_string($this->getSettings()); - if ( ! $this->sxTaskSettings) + if ( ! $this->sxTaskSettings) { return array(); + } $ret = array(); @@ -401,6 +418,13 @@ class task_period_workflow02 extends task_appboxAbstract return $ret; } + /** + * work on ONE record + * + * @param appbox $appbox + * @param array $row + * @return \task_period_workflow02 + */ protected function processOneContent(appbox $appbox, Array $row) { $logsql = (int) ($this->sxTaskSettings->logsql) > 0; @@ -454,11 +478,25 @@ class task_period_workflow02 extends task_appboxAbstract return $this; } + /** + * all work done on processOneContent, so nothing to do here + * + * @param appbox $appbox + * @param array $row + * @return \task_period_workflow02 + */ protected function postProcessOneContent(appbox $appbox, Array $row) { return $this; } + /** + * compute sql for a task (