diff --git a/htdocs/hrm/lib/hrm_skill.lib.php b/htdocs/hrm/lib/hrm_skill.lib.php index a2393229cb5..c9c83fa6411 100644 --- a/htdocs/hrm/lib/hrm_skill.lib.php +++ b/htdocs/hrm/lib/hrm_skill.lib.php @@ -93,430 +93,3 @@ function skillPrepareHead($object) return $head; } - - -/** - * Show html area for list of traduction - * - * @param Conf $conf Object conf - * @param Translate $langs Object langs - * @param DoliDB $db Database handler - * @param Societe $object Third party object - * @param string $backtopage Url to go once contact is created - * @return int - */ -function show_traduction($conf, $langs, $db, $object, $backtopage = '') -{ - global $user, $conf, $extrafields, $hookmanager; - global $contextpage; - - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; - $formcompany = new FormCompany($db); - $form = new Form($db); - - $optioncss = GETPOST('optioncss', 'alpha'); - $sortfield = GETPOST("sortfield", 'alpha'); - $sortorder = GETPOST("sortorder", 'alpha'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); - - $search_status = GETPOST("search_status", 'int'); - if ($search_status == '') { - $search_status = 1; // always display active customer first - } - - $search_name = GETPOST("search_name", 'alpha'); - $search_address = GETPOST("search_address", 'alpha'); - $search_poste = GETPOST("search_poste", 'alpha'); - $search_roles = GETPOST("search_roles", 'array'); - - $socialnetworks = getArrayOfSocialNetworks(); - - $searchAddressPhoneDBFields = array( - //Address - 't.address', - 't.zip', - 't.town', - - //Phone - 't.phone', - 't.phone_perso', - 't.phone_mobile', - - //Fax - 't.fax', - - //E-mail - 't.email', - ); - //Social media - // foreach ($socialnetworks as $key => $value) { - // if ($value['active']) { - // $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'"; - // } - // } - - if (!$sortorder) { - $sortorder = "ASC"; - } - if (!$sortfield) { - $sortfield = "t.lastname"; - } - - if (!empty($conf->clicktodial->enabled)) { - $user->fetch_clicktodial(); // lecture des infos de clicktodial du user - } - - - $SkillLinestatic = new SkillLine($db); - - $extrafields->fetch_name_optionals_label($SkillLinestatic->table_element); - - $SkillLinestatic->fields=array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'fk_skill' => array('type'=>'integer:Skill:skill/class/skill.class.php', 'label'=>'foreign key skill', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), - 'traduction_note' => array('type'=>'text', 'label'=>'traduction_note', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1,), - 'rank' => array('type'=>'integer', 'label'=>'rank', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,), - ); - - // Definition of fields for list - $arrayfields = array( - 't.rowid'=>array('label'=>"TechnicalID", 'checked'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID) ? 1 : 0), 'position'=>1), - 't.name'=>array('label'=>"Name", 'checked'=>1, 'position'=>10), - 't.poste'=>array('label'=>"PostOrFunction", 'checked'=>1, 'position'=>20), - 't.address'=>array('label'=>(empty($conf->dol_optimize_smallscreen) ? $langs->trans("Address").' / '.$langs->trans("Phone").' / '.$langs->trans("Email") : $langs->trans("Address")), 'checked'=>1, 'position'=>30), - 'sc.role'=>array('label'=>"ContactByDefaultFor", 'checked'=>1, 'position'=>40), - 't.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>50, 'class'=>'center'), - ); - // Extra fields - if (!empty($extrafields->attributes[$contactstatic->table_element]['label']) && is_array($extrafields->attributes[$contactstatic->table_element]['label']) && count($extrafields->attributes[$contactstatic->table_element]['label'])) { - foreach ($extrafields->attributes[$contactstatic->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) { - $arrayfields["ef.".$key] = array( - 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key] < 0) ? 0 : 1), - 'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); - } - } - } - - // Initialize array of search criterias - $search = array(); - foreach ($arrayfields as $key => $val) { - $queryName = 'search_'.substr($key, 2); - if (GETPOST($queryName, 'alpha')) { - $search[substr($key, 2)] = GETPOST($queryName, 'alpha'); - } - } - $search_array_options = $extrafields->getOptionalsFromPost($contactstatic->table_element, '', 'search_'); - - // Purge search criteria - if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers - $search_status = ''; - $search_name = ''; - $search_roles = array(); - $search_address = ''; - $search_poste = ''; - $search = array(); - $search_array_options = array(); - - foreach ($contactstatic->fields as $key => $val) { - $search[$key] = ''; - } - } - - $contactstatic->fields = dol_sort_array($contactstatic->fields, 'position'); - $arrayfields = dol_sort_array($arrayfields, 'position'); - - $newcardbutton = ''; - if ($user->rights->societe->contact->creer) { - $addTraduction = $langs->trans("AddTraduction"); - $newcardbutton .= dolGetButtonTitle($addTraduction, '', 'fa fa-plus-circle', DOL_URL_ROOT.'/skilldet/card.php?skillid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); - } - - print "\n"; - - $title = $langs->trans("TraductionRule"); - print load_fiche_titre($title, $newcardbutton, ''); - - print '
'."\n"; - - return $i; -}