Merge pull request #23272 from lamrani002/kanbanContactAdress

New mode view for contact adress list
This commit is contained in:
Laurent Destailleur 2022-12-27 00:23:29 +01:00 committed by GitHub
commit 5a6410b050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 303 additions and 232 deletions

View File

@ -2115,4 +2115,48 @@ class Contact extends CommonObject
} }
return 0; return 0;
} }
/**
* Return clicable link of object (with eventually picto)
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '')
{
global $langs;
$return = '<div class="box-flex-item box-flex-grow-zero">';
$return .= '<div class="info-box info-box-sm">';
$return .= '<span class="info-box-icon bg-infobox-action">';
//var_dump($this->photo);exit;
if (property_exists($this, 'photo') && !is_null($this->photo)) {
$return.= Form::showphoto('contact', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1);
} else {
$return .= img_picto('', $this->picto);
}
$return .= '</span>';
$return .= '<div class="info-box-content">';
$return .= '<span class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
if (property_exists($this, 'socid') && !is_null($this->socid)) {
$return .= '<br><span class="info-box-label">'.$this->socid.'</span>';
} else {
if (property_exists($this, 'phone_pro')) {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Phone").'</span>';
$return .= '<span class="info-box-label"> : '.$this->phone_pro.'</span>';
}
}
if (method_exists($this, 'LibPubPriv')) {
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Visibility").'</span>';
$return .= '<span> : '.$this->LibPubPriv($this->priv).'</span>';
}
if (method_exists($this, 'getLibStatut')) {
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
}
$return .= '</div>';
$return .= '</div>';
$return .= '</div>';
return $return;
}
} }

View File

@ -53,6 +53,7 @@ $show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array'); $toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'contactlist'; $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'contactlist';
$mode = GETPOST('mode', 'alpha');
// Security check // Security check
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -680,6 +681,9 @@ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:M&oacute;dulo_Empresas';
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
$param = ''; $param = '';
if (!empty($mode)) {
$param .= '&mode='.urlencode($mode);
}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage); $param .= '&contextpage='.urlencode($contextpage);
} }
@ -789,7 +793,10 @@ if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
} }
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $user->rights->societe->contact->creer); $newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
$newcardbutton .= dolGetButtonTitle($langs->trans('NewContactAddress'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/contact/card.php?action=create', '', $user->rights->societe->contact->creer);
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">'; print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" name="formfilter">';
if ($optioncss != '') { if ($optioncss != '') {
@ -802,6 +809,8 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
//print '<input type="hidden" name="page" value="'.$page.'">'; //print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="type" value="'.$type.'">'; print '<input type="hidden" name="type" value="'.$type.'">';
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">'; print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit, 0, 0, 1); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit, 0, 0, 1);
@ -1170,265 +1179,283 @@ while ($i < min($num, $limit)) {
$contactstatic->fk_prospectlevel = $obj->fk_prospectcontactlevel; $contactstatic->fk_prospectlevel = $obj->fk_prospectcontactlevel;
print '<tr class="oddeven">'; if ($mode == 'kanban') {
if ($i == 0) {
print '<tr><td colspan="12">';
print '<div class="box-flex-container">';
}
$contactstatic->photo = $obj->photo;
$soc = new Societe($db);
$soc->fetch($obj->socid);
if ($obj->socid) {
$contactstatic->socid = $soc->getNomUrl(1);
}
print $contactstatic->getKanbanView('');
if ($i == min($num, $limit) - 1) {
print '</div>';
print '</td></tr>';
}
} else {
print '<tr class="oddeven">';
// Action column // Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap center">'; print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0; $selected = 0;
if (in_array($obj->rowid, $arrayofselected)) { if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1; $selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
} }
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>'; print '</td>';
} }
print '</td>'; // ID
} if (!empty($arrayfields['p.rowid']['checked'])) {
// ID print '<td class="tdoverflowmax50">';
if (!empty($arrayfields['p.rowid']['checked'])) { print dol_escape_htmltag($obj->rowid);
print '<td class="tdoverflowmax50">'; print "</td>\n";
print dol_escape_htmltag($obj->rowid); if (!$i) {
print "</td>\n"; $totalarray['nbfield']++;
if (!$i) { }
$totalarray['nbfield']++;
} }
} // Name
// Name if (!empty($arrayfields['p.lastname']['checked'])) {
if (!empty($arrayfields['p.lastname']['checked'])) { print '<td class="middle tdoverflowmax150">';
print '<td class="middle tdoverflowmax150">'; print $contactstatic->getNomUrl(1);
print $contactstatic->getNomUrl(1); print '</td>';
print '</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // Firstname
// Firstname if (!empty($arrayfields['p.firstname']['checked'])) {
if (!empty($arrayfields['p.firstname']['checked'])) { print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">'.dol_escape_htmltag($obj->firstname).'</td>';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">'.dol_escape_htmltag($obj->firstname).'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // Job position
// Job position if (!empty($arrayfields['p.poste']['checked'])) {
if (!empty($arrayfields['p.poste']['checked'])) { print '<td class="tdoverflowmax100">'.dol_escape_htmltag($obj->poste).'</td>';
print '<td class="tdoverflowmax100">'.dol_escape_htmltag($obj->poste).'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // Address
// Address if (!empty($arrayfields['p.address']['checked'])) {
if (!empty($arrayfields['p.address']['checked'])) { print '<td>'.dol_escape_htmltag($obj->address).'</td>';
print '<td>'.dol_escape_htmltag($obj->address).'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // Zip
// Zip if (!empty($arrayfields['p.zip']['checked'])) {
if (!empty($arrayfields['p.zip']['checked'])) { print '<td>'.dol_escape_htmltag($obj->zip).'</td>';
print '<td>'.dol_escape_htmltag($obj->zip).'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // Town
// Town if (!empty($arrayfields['p.town']['checked'])) {
if (!empty($arrayfields['p.town']['checked'])) { print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).'">'.dol_escape_htmltag($obj->town).'</td>';
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).'">'.dol_escape_htmltag($obj->town).'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // State
// State /*if (!empty($arrayfields['state.nom']['checked']))
/*if (!empty($arrayfields['state.nom']['checked'])) {
{ print "<td>".$obj->state_name."</td>\n";
print "<td>".$obj->state_name."</td>\n"; if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['nbfield']++;
}
// Region
if (!empty($arrayfields['region.nom']['checked']))
{
print "<td>".$obj->region_name."</td>\n";
if (! $i) $totalarray['nbfield']++;
}*/
// Country
if (!empty($arrayfields['country.code_iso']['checked'])) {
print '<td class="center">';
$tmparray = getCountry($obj->fk_pays, 'all');
print dol_escape_htmltag($tmparray['label']);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
} }
} // Region
// Phone if (!empty($arrayfields['region.nom']['checked']))
if (!empty($arrayfields['p.phone']['checked'])) { {
print '<td class="nowraponall tdoverflowmax150">'.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>'; print "<td>".$obj->region_name."</td>\n";
if (!$i) { if (! $i) $totalarray['nbfield']++;
$totalarray['nbfield']++; }*/
// Country
if (!empty($arrayfields['country.code_iso']['checked'])) {
print '<td class="center">';
$tmparray = getCountry($obj->fk_pays, 'all');
print dol_escape_htmltag($tmparray['label']);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
} }
} // Phone
// Phone perso if (!empty($arrayfields['p.phone']['checked'])) {
if (!empty($arrayfields['p.phone_perso']['checked'])) { print '<td class="nowraponall tdoverflowmax150">'.dol_print_phone($obj->phone_pro, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
print '<td class="nowraponall tdoverflowmax150">'.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // Phone perso
// Phone mobile if (!empty($arrayfields['p.phone_perso']['checked'])) {
if (!empty($arrayfields['p.phone_mobile']['checked'])) { print '<td class="nowraponall tdoverflowmax150">'.dol_print_phone($obj->phone_perso, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'phone').'</td>';
print '<td class="nowraponall tdoverflowmax150">'.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // Phone mobile
// Fax if (!empty($arrayfields['p.phone_mobile']['checked'])) {
if (!empty($arrayfields['p.fax']['checked'])) { print '<td class="nowraponall tdoverflowmax150">'.dol_print_phone($obj->phone_mobile, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'mobile').'</td>';
print '<td class="nowraponall tdoverflowmax150">'.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // Fax
// EMail if (!empty($arrayfields['p.fax']['checked'])) {
if (!empty($arrayfields['p.email']['checked'])) { print '<td class="nowraponall tdoverflowmax150">'.dol_print_phone($obj->fax, $obj->country_code, $obj->rowid, $obj->socid, 'AC_TEL', ' ', 'fax').'</td>';
print '<td class="nowraponall tdoverflowmax300">'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1).'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} // EMail
// No EMail if (!empty($arrayfields['p.email']['checked'])) {
if (!empty($arrayfields['unsubscribed']['checked'])) { print '<td class="nowraponall tdoverflowmax300">'.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 18, 0, 1).'</td>';
print '<td class="center">'; if (!$i) {
if (empty($obj->email)) { $totalarray['nbfield']++;
//print '<span class="opacitymedium">'.$langs->trans("NoEmail").'</span>'; }
} else {
print yn(($obj->unsubscribed > 0) ? 1 : 0);
} }
print '</td>'; // No EMail
if (!$i) { if (!empty($arrayfields['unsubscribed']['checked'])) {
$totalarray['nbfield']++; print '<td class="center">';
if (empty($obj->email)) {
//print '<span class="opacitymedium">'.$langs->trans("NoEmail").'</span>';
} else {
print yn(($obj->unsubscribed > 0) ? 1 : 0);
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
} }
} if (isModEnabled('socialnetworks')) {
if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) {
foreach ($socialnetworks as $key => $value) { if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) { print '<td class="tdoverflowmax100">'.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).'</td>';
print '<td class="tdoverflowmax100">'.(empty($arraysocialnetworks[$key]) ? '' : dol_print_socialnetworks($arraysocialnetworks[$key], $obj->rowid, $obj->socid, $key, $socialnetworks)).'</td>'; if (!$i) {
if (!$i) { $totalarray['nbfield']++;
$totalarray['nbfield']++; }
} }
} }
} }
} // Company
// Company if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) {
if (!empty($arrayfields['p.fk_soc']['checked']) || !empty($arrayfields['s.nom']['checked'])) { print '<td class="tdoverflowmax200">';
print '<td class="tdoverflowmax200">'; if ($obj->socid) {
if ($obj->socid) { $objsoc = new Societe($db);
$objsoc = new Societe($db); $objsoc->fetch($obj->socid);
$objsoc->fetch($obj->socid); print $objsoc->getNomUrl(1);
print $objsoc->getNomUrl(1); } else {
} else { print '&nbsp;';
print '&nbsp;';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Private/Public
if (!empty($arrayfields['p.priv']['checked'])) {
print '<td class="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) {
// Prospect level
print '<td class="center">';
print $contactstatic->getLibProspLevel();
print "</td>";
if (!$i) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) {
// Prospect status
print '<td class="center nowrap"><div class="nowrap">';
print '<div class="inline-block">'.$contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto);
print '</div> - <div class="inline-block">';
foreach ($contactstatic->cacheprospectstatus as $key => $val) {
$titlealt = 'default';
if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) {
$titlealt = $val['label'];
} }
if ($obj->stcomm_id != $val['id']) { print '</td>';
print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?stcommcontactid='.$obj->rowid.'&stcomm='.urlencode($val['code']).'&action=setstcomm&token='.newToken().$param.($page ? '&page='.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).'</a>'; if (!$i) {
$totalarray['nbfield']++;
} }
} }
print '</div></div></td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Extra fields // Private/Public
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; if (!empty($arrayfields['p.priv']['checked'])) {
// Fields from hook print '<td class="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); if (!$i) {
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $totalarray['nbfield']++;
print $hookmanager->resPrint;
// Date creation
if (!empty($arrayfields['p.datec']['checked'])) {
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Date modification
if (!empty($arrayfields['p.tms']['checked'])) {
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Status
if (!empty($arrayfields['p.statut']['checked'])) {
print '<td class="center">'.$contactstatic->getLibStatut(5).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Import key
if (!empty($arrayfields['p.import_key']['checked'])) {
print '<td class="tdoverflowmax100">';
print dol_escape_htmltag($obj->import_key);
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
}
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
} }
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
} }
print '</td>';
}
if (!$i) {
$totalarray['nbfield']++;
}
print "</tr>\n"; if (!empty($arrayfields['p.fk_prospectcontactlevel']['checked'])) {
// Prospect level
print '<td class="center">';
print $contactstatic->getLibProspLevel();
print "</td>";
if (!$i) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) {
// Prospect status
print '<td class="center nowrap"><div class="nowrap">';
print '<div class="inline-block">'.$contactstatic->libProspCommStatut($obj->stcomm_id, 2, $contactstatic->cacheprospectstatus[$obj->stcomm_id]['label'], $obj->stcomm_picto);
print '</div> - <div class="inline-block">';
foreach ($contactstatic->cacheprospectstatus as $key => $val) {
$titlealt = 'default';
if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) {
$titlealt = $val['label'];
}
if ($obj->stcomm_id != $val['id']) {
print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?stcommcontactid='.$obj->rowid.'&stcomm='.urlencode($val['code']).'&action=setstcomm&token='.newToken().$param.($page ? '&page='.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).'</a>';
}
}
print '</div></div></td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
if (!empty($arrayfields['p.datec']['checked'])) {
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Date modification
if (!empty($arrayfields['p.tms']['checked'])) {
print '<td class="center nowraponall">';
print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Status
if (!empty($arrayfields['p.statut']['checked'])) {
print '<td class="center">'.$contactstatic->getLibStatut(5).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Import key
if (!empty($arrayfields['p.import_key']['checked'])) {
print '<td class="tdoverflowmax100">';
print dol_escape_htmltag($obj->import_key);
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
}
}
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap center">';
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0;
if (in_array($obj->rowid, $arrayofselected)) {
$selected = 1;
}
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
}
if (!$i) {
$totalarray['nbfield']++;
}
print "</tr>\n";
}
$i++; $i++;
} }