"; echo ""; echo "". "" . "" . "" . ""; $query = "SELECT pm.pm_task_guid, pm.taskcategories_id, pm.`start`, gl.name, gl.completename, gl.`comment` FROM glpi_plugin_processmaker_taskcategories AS pm LEFT JOIN glpi_taskcategories AS gl ON pm.taskcategories_id=gl.id WHERE pm.processes_id=".$item->getID().";"; foreach ($DB->request($query) as $taskCat) { echo "". ""; } echo "
".$LANG['processmaker']['title'][3]."
".$LANG['processmaker']['process']['taskcategories']['name']."".$LANG['processmaker']['process']['taskcategories']['completename']."".$LANG['processmaker']['process']['taskcategories']['guid']."".$LANG['processmaker']['process']['taskcategories']['start']."".$LANG['processmaker']['process']['taskcategories']['comment']."
".str_replace(" ", " ", $taskCat['name']); if ($_SESSION["glpiis_ids_visible"]) { echo " (".$taskCat['taskcategories_id'].")"; } echo "".str_replace(" ", " ", $taskCat['completename'])." ".$taskCat['pm_task_guid']."".($taskCat['start']?'x':'')."". $taskCat['comment']."
"; return true; } /** * Print a good title for task categories tab * add button for re-synchro of taskcategory list (only if rigths are w) * @return nothing (display) **/ static function title(CommonGLPI $item) { global $LANG, $CFG_GLPI; $buttons = array(); $title = $LANG['processmaker']['config']['refreshtasklist']; if (Session::haveRight('plugin_processmaker_config', UPDATE)) { $buttons["process.form.php?refreshtask=1&id=".$item->getID()] = $LANG['processmaker']['config']['refreshtasklist']; $title = ""; Html::displayTitle($CFG_GLPI["root_doc"] . "/plugins/processmaker/pics/gears.png", $LANG['processmaker']['config']['refreshtasklist'], $title, $buttons); } } //function getLinkItemFromExternalID($extId) { // if( $this->getFromDBbyExternalID( $extId ) ) { // $taskcat = new TaskCategory ; // return $taskcat->getFromDB( $this->fields['items_id'] ) ; // } //} /** * Retrieve a TaskCat from the database using its external id (unique index): pm_task_guid * * @param $extid string externalid * * @return true if succeed else false **/ function getFromDBbyExternalID($extid) { global $DB; $query = "SELECT * FROM `".$this->getTable()."` WHERE `pm_task_guid` = '$extid'"; if ($result = $DB->query($query)) { if ($DB->numrows($result) != 1) { return false; } $this->fields = $DB->fetch_assoc($result); if (is_array($this->fields) && count($this->fields)) { return true; } } return false; } /** * Retrieve a TaskCat from the database using its category id (unique index): taskcategories_id * * @param $catid string task category id * * @return true if succeed else false **/ function getFromDBbyCategory($catid) { global $DB; $query = "SELECT * FROM `".$this->getTable()."` WHERE `taskcategories_id` = $catid"; if ($result = $DB->query($query)) { if ($DB->numrows($result) != 1) { return false; } $this->fields = $DB->fetch_assoc($result); if (is_array($this->fields) && count($this->fields)) { return true; } } return false; } }