'."\n";
-// Lines for filter fields
+// Fields title search
+// --------------------------------------------------------------------
print '';
// Action column
-if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
- print '| ';
+if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print ' | ';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
print ' | ';
@@ -1093,87 +1123,113 @@ if (!empty($arrayfields['p.import_key']['checked'])) {
print '';
}
// Action column
-if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
- print '';
- $searchpicto = $form->showFilterAndCheckAddButtons(0);
+if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print ' | ';
+ $searchpicto = $form->showFilterButtons();
print $searchpicto;
print ' | ';
}
-print '
';
+print ''."\n";
-// Title line
+$totalarray = array();
+$totalarray['nbfield'] = 0;
+
+// Fields title label
+// --------------------------------------------------------------------
print '';
-if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
- print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
+if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
+ print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.rowid']['checked'])) {
print_liste_field_titre($arrayfields['p.rowid']['label'], $_SERVER["PHP_SELF"], "p.rowid", "", $param, "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.lastname']['checked'])) {
print_liste_field_titre($arrayfields['p.lastname']['label'], $_SERVER["PHP_SELF"], "p.lastname", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.firstname']['checked'])) {
print_liste_field_titre($arrayfields['p.firstname']['label'], $_SERVER["PHP_SELF"], "p.firstname", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.poste']['checked'])) {
print_liste_field_titre($arrayfields['p.poste']['label'], $_SERVER["PHP_SELF"], "p.poste", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.address']['checked'])) {
print_liste_field_titre($arrayfields['p.address']['label'], $_SERVER["PHP_SELF"], "p.address", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.zip']['checked'])) {
print_liste_field_titre($arrayfields['p.zip']['label'], $_SERVER["PHP_SELF"], "p.zip", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.town']['checked'])) {
print_liste_field_titre($arrayfields['p.town']['label'], $_SERVER["PHP_SELF"], "p.town", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
//if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
//if (!empty($arrayfields['region.nom']['checked'])) print_liste_field_titre($arrayfields['region.nom']['label'],$_SERVER["PHP_SELF"],"region.nom","",$param,'',$sortfield,$sortorder);
if (!empty($arrayfields['country.code_iso']['checked'])) {
print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "co.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.phone']['checked'])) {
print_liste_field_titre($arrayfields['p.phone']['label'], $_SERVER["PHP_SELF"], "p.phone", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.phone_perso']['checked'])) {
print_liste_field_titre($arrayfields['p.phone_perso']['label'], $_SERVER["PHP_SELF"], "p.phone_perso", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.phone_mobile']['checked'])) {
print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.fax']['checked'])) {
print_liste_field_titre($arrayfields['p.fax']['label'], $_SERVER["PHP_SELF"], "p.fax", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.email']['checked'])) {
print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['unsubscribed']['checked'])) {
print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center ');
+ $totalarray['nbfield']++;
}
if (isModEnabled('socialnetworks')) {
foreach ($socialnetworks as $key => $value) {
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
print_liste_field_titre($arrayfields['p.'.$key]['label'], $_SERVER["PHP_SELF"], "p.".$key, $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
}
}
if (!empty($arrayfields['p.fk_soc']['checked'])) {
print_liste_field_titre($arrayfields['p.fk_soc']['label'], $_SERVER["PHP_SELF"], "p.fk_soc", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['s.nom']['checked'])) {
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['s.name_alias']['checked'])) {
print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], "s.name_alias", $begin, $param, '', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.priv']['checked'])) {
print_liste_field_titre($arrayfields['p.priv']['label'], $_SERVER["PHP_SELF"], "p.priv", $begin, $param, '', $sortfield, $sortorder, 'center ');
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.fk_prospectlevel']['checked'])) {
print_liste_field_titre($arrayfields['p.fk_prospectlevel']['label'], $_SERVER["PHP_SELF"], "p.fk_prospectlevel", "", $param, '', $sortfield, $sortorder, 'center ');
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['p.fk_stcommcontact']['checked'])) {
print_liste_field_titre($arrayfields['p.fk_stcommcontact']['label'], $_SERVER["PHP_SELF"], "p.fk_stcommcontact", "", $param, '', $sortfield, $sortorder, 'center ');
+ $totalarray['nbfield']++;
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@@ -1204,11 +1260,18 @@ if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print "
\n";
+// Loop on record
+// --------------------------------------------------------------------
$i = 0;
+$savnbfield = $totalarray['nbfield'];
$totalarray = array();
$totalarray['nbfield'] = 0;
-while ($i < min($num, $limit)) {
+$imaxinloop = ($limit ? min($num, $limit) : $num);
+while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
+ if (empty($obj)) {
+ break; // Should not happen
+ }
$arraysocialnetworks = (array) json_decode($obj->socialnetworks, true);
$contactstatic->lastname = $obj->lastname;
@@ -1233,7 +1296,7 @@ while ($i < min($num, $limit)) {
if ($mode == 'kanban') {
if ($i == 0) {
- print '| ';
+ print ' |
| ';
print ' ';
}
$contactstatic->photo = $obj->photo;
@@ -1241,15 +1304,17 @@ while ($i < min($num, $limit)) {
$contactstatic->fetch_thirdparty($obj->socid);
}
print $contactstatic->getKanbanView('');
- if ($i == min($num, $limit) - 1) {
+ if ($i == ($imaxinloop - 1)) {
print ' ';
print ' |
';
}
} else {
- print '';
+ // Show here line of result
+ $j = 0;
+ print '
';
// Action column
- if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '| ';
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;
@@ -1259,6 +1324,9 @@ while ($i < min($num, $limit)) {
print '';
}
print ' | ';
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
// ID
@@ -1523,7 +1591,7 @@ while ($i < min($num, $limit)) {
}
// Action column
- if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '';
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;
@@ -1533,9 +1601,9 @@ while ($i < min($num, $limit)) {
print '';
}
print ' | ';
- }
- if (!$i) {
- $totalarray['nbfield']++;
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
}
print "
\n";
diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php
index 148d9fb6f04..e9e5d64f495 100644
--- a/htdocs/contact/note.php
+++ b/htdocs/contact/note.php
@@ -106,11 +106,10 @@ if ($id > 0) {
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
// Thirdparty
- $morehtmlref .= $langs->trans('ThirdParty').' : ';
if ($objsoc->id > 0) {
$morehtmlref .= $objsoc->getNomUrl(1);
} else {
- $morehtmlref .= $langs->trans("ContactNotLinkedToCompany");
+ $morehtmlref .= ''.$langs->trans("ContactNotLinkedToCompany").'';
}
}
$morehtmlref .= '';
diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php
index bdfa4ddb708..0fd23753fdf 100644
--- a/htdocs/contact/perso.php
+++ b/htdocs/contact/perso.php
@@ -232,11 +232,10 @@ if ($action == 'edit') {
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
// Thirdparty
- $morehtmlref .= $langs->trans('ThirdParty').' : ';
if ($objsoc->id > 0) {
$morehtmlref .= $objsoc->getNomUrl(1);
} else {
- $morehtmlref .= $langs->trans("ContactNotLinkedToCompany");
+ $morehtmlref .= ''.$langs->trans("ContactNotLinkedToCompany").'';
}
}
$morehtmlref .= '';
diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php
index 571fa57e428..466e6a6b5b6 100644
--- a/htdocs/contact/project.php
+++ b/htdocs/contact/project.php
@@ -82,14 +82,14 @@ if ($id) {
$morehtmlref .= '';
$morehtmlref .= '';
- if (empty($conf->global->SOCIETE_DISABLE_CONTACTS) && !empty($socid)) {
- $object->thirdparty->fetch($socid);
+ if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
+ $objsoc = new Societe($db);
+ $objsoc->fetch($object->socid);
// Thirdparty
- $morehtmlref .= $langs->trans('ThirdParty').' : ';
- if ($object->thirdparty->id > 0) {
- $morehtmlref .= $object->thirdparty->getNomUrl(1, 'contact');
+ if ($objsoc->id > 0) {
+ $morehtmlref .= $objsoc->getNomUrl(1, 'contact');
} else {
- $morehtmlref .= $langs->trans("ContactNotLinkedToCompany");
+ $morehtmlref .= ''.$langs->trans("ContactNotLinkedToCompany").'';
}
}
$morehtmlref .= '
';
diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php
index 1413bc36e0c..44cea026320 100644
--- a/htdocs/hrm/class/skill.class.php
+++ b/htdocs/hrm/class/skill.class.php
@@ -1124,6 +1124,7 @@ class Skill extends CommonObject
public function getKanbanView($option = '', $arraydata = null)
{
global $selected, $langs;
+
$return = '';
$return .= '
';
$return .= '';
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index f58e662daea..c5923412e27 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -302,7 +302,7 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array
}
// Add table from hooks
$parameters = array();
-$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
+$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
if ($object->ismultientitymanaged == 1) {
$sql .= " WHERE t.entity IN (".getEntity($object->element).")";
@@ -449,7 +449,7 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
- $param .= '&limit='.urlencode($limit);
+ $param .= '&limit='.((int) $limit);
}
foreach ($search as $key => $val) {
if (is_array($search[$key])) {