diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a3f2e4c56db..2de8736b39f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1816,7 +1816,7 @@ class ActionComm extends CommonObject $result .= $linkstart; if ($withpicto) { - $result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$label), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1); + $result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$label), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : ' class="'.(($withpicto != 2) ? 'paddingright ' : '').'"'), 0, 0, $notooltip ? 0 : 1); } $result .= dol_escape_htmltag($labelshort); $result .= $linkend; diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 1cc1244d8df..6f951eff6ea 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -200,7 +200,7 @@ class HookManager 'insertExtraFooter', 'printLeftBlock', 'formAddObjectLine', - 'formBuilddocOption', + 'formBuilddocOptions', 'showSocinfoOnPrint' ))) { $hooktype = 'output'; @@ -241,8 +241,8 @@ class HookManager $actionclassinstance->error = 0; $actionclassinstance->errors = array(); - if (getDolGlobalInt('MAIN_DEBUG_SHOW_EACH_QUALIFIED_HOOK_CALL') >= 2) { - // This his too much verbose, enabled in develop only + if (getDolGlobalInt('MAIN_DEBUG_HOOK')) { + // This his too much verbose, enabled if const enabled only dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".get_class($actionclassinstance).'->'.$method.", context=".$context.", module=".$module.", action=".$action.((is_object($object) && property_exists($object, 'id')) ? ', object id='.$object->id : '').((is_object($object) && property_exists($object, 'element')) ? ', object element='.$object->element : ''), LOG_DEBUG); } @@ -283,7 +283,10 @@ class HookManager continue; } - //dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); + if (getDolGlobalInt('MAIN_DEBUG_HOOK')) { + dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); + } + $resactiontmp = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) $resaction += $resactiontmp; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 0194c45b457..a4b493359d5 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -396,7 +396,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'submenus' => array(), ); - // Tickets and knowledge base + // Tickets and Knowledge base $tmpentry = array( 'enabled'=>(isModEnabled('ticket') || isModEnabled('knowledgemanagement')), 'perms'=>($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), @@ -411,7 +411,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $menu_arr[] = array( 'name' => 'Ticket', 'link' => $link, - 'title' => "Tickets", + 'title' => isModEnabled('ticket') ? "Tickets" : "MenuKnowledgeRecordShort", 'level' => 0, 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), 'target' => $atarget, diff --git a/htdocs/hrm/lib/hrm_job.lib.php b/htdocs/hrm/lib/hrm_job.lib.php index 599ee1c2871..47858460182 100644 --- a/htdocs/hrm/lib/hrm_job.lib.php +++ b/htdocs/hrm/lib/hrm_job.lib.php @@ -61,7 +61,7 @@ function jobPrepareHead($object) $head[$h][2] = 'skill_tab'; $h++; - $head[$h][0] = DOL_URL_ROOT."/hrm/position.php?fk_job=".$object->id; + $head[$h][0] = DOL_URL_ROOT."/hrm/position.php?id=".$object->id; $head[$h][1] = $langs->trans("PositionsWithThisProfile"); $nbResources = 0; $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."hrm_job_user WHERE fk_job = ".((int) $object->id); diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 4b0659bfe5c..ab287ec115d 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -89,10 +89,14 @@ $upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->enti //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); -if (empty($conf->hrm->enabled)) accessforbidden(); -if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) accessforbidden(); +if (empty($conf->hrm->enabled)) { + accessforbidden(); +} +if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { + accessforbidden(); +} -$MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL; +$MaxNumberSkill = getDolGlobalInt('HRM_MAXRANK', Skill::DEFAULT_MAX_RANK_PER_SKILL); /* @@ -167,7 +171,7 @@ if (empty($reshook)) { } // Actions to send emails - $triggersendname = 'hrm_SKILL_SENTBYMAIL'; + $triggersendname = 'HRM_SKILL_SENTBYMAIL'; $autocopy = 'MAIN_MAIL_AUTOCOPY_SKILL_TO'; $trackid = 'skill' . $object->id; include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; @@ -182,7 +186,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formproject = new FormProjets($db); -$title = $langs->trans("skill"); +$title = $langs->trans("Skill"); $help_url = ''; llxHeader('', $title, $help_url); @@ -468,9 +472,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } -//*---------------------------------------------------------------------------- -//*---------------------------------------------------------------------------- - //*--------------------------------------------------------------------------- @@ -589,27 +590,11 @@ if ($action != "create" && $action != "edit") { } else { $sql .= " WHERE 1 = 1 "; } + $sql .= " AND fk_skill = ".((int) $id); - if (!empty($id)) { - $sql .= " AND fk_skill = " . ((int) $id) . " "; - } - - // if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. - if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) { - $num = $nbtotalofrecords; - } else { - if ($limit) { - $sql .= $db->plimit($limit + 1, $offset); - } - - $resql = $db->query($sql); - if (!$resql) { - dol_print_error($db); - exit; - } - - $num = $db->num_rows($resql); - } + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); + $num = $db->num_rows($resql); print '