FIX Debug v16

This commit is contained in:
Laurent Destailleur
2022-07-18 11:51:28 +02:00
parent 311d69da4e
commit 076d93452f
7 changed files with 71 additions and 36 deletions

View File

@@ -825,13 +825,14 @@ class FormCompany extends Form
/**
* showContactRoles on view and edit mode
*
* @param string $htmlname Html component name and id
* @param Contact $contact Contact Obejct
* @param string $rendermode view, edit
* @param array $selected $key=>$val $val is selected Roles for input mode
* @return string String with contacts roles
* @param string $htmlname Html component name and id
* @param Contact $contact Contact Obejct
* @param string $rendermode view, edit
* @param array $selected $key=>$val $val is selected Roles for input mode
* @param string $morecss More css
* @return string String with contacts roles
*/
public function showRoles($htmlname, Contact $contact, $rendermode = 'view', $selected = array())
public function showRoles($htmlname, Contact $contact, $rendermode = 'view', $selected = array(), $morecss = 'minwidth500')
{
if ($rendermode === 'view') {
$toprint = array();
@@ -856,7 +857,7 @@ class FormCompany extends Form
$selected = $newselected;
}
}
return $this->multiselectarray($htmlname, $contactType, $selected, 0, 0, 'minwidth500');
return $this->multiselectarray($htmlname, $contactType, $selected, 0, 0, $morecss);
}
return 'ErrorBadValueForParameterRenderMode'; // Should not happened

View File

@@ -890,14 +890,15 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
/**
* Show html area for list of contacts
*
* @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
* @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
* @param int $showuserlogin 1=Show also user login if it exists
* @return int
*/
function show_contacts($conf, $langs, $db, $object, $backtopage = '')
function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserlogin = 0)
{
global $user, $conf, $extrafields, $hookmanager;
global $contextpage;
@@ -1131,13 +1132,16 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
if (in_array($key, array('statut'))) {
print $form->selectarray('search_status', array('-1'=>'', '0'=>$contactstatic->LibStatut(0, 1), '1'=>$contactstatic->LibStatut(1, 1)), $search_status);
} elseif (in_array($key, array('role'))) {
print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles);
print $formcompany->showRoles("search_roles", $contactstatic, 'edit', $search_roles, 'minwidth200 maxwidth300');
} else {
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.(!empty($search[$key]) ? dol_escape_htmltag($search[$key]) : '').'">';
}
print '</td>';
}
}
if ($showuserlogin) {
print '<td></td>';
}
// Extra fields
$extrafieldsobjectkey = $contactstatic->table_element;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
@@ -1177,6 +1181,9 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n";
}
}
if ($showuserlogin) {
print '<td>'.$langs->trans("DolibarrLogin").'</td>';
}
// Extra fields
$extrafieldsobjectkey = $contactstatic->table_element;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@@ -1275,6 +1282,16 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
print '<td class="center">'.$contactstatic->getLibStatut(5).'</td>';
}
if ($showuserlogin) {
print '<td>';
$tmpuser= new User($db);
$resfetch = $tmpuser->fetch(0, '', '', 0, -1, '', $contactstatic->id);
if ($resfetch > 0) {
print $tmpuser->getNomUrl(1, '', 0, 0, 24, 1);
}
print '</td>';
}
// Extra fields
$extrafieldsobjectkey = $contactstatic->table_element;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';