';
+ return $return;
+ }
}
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 5286b3bb3ad..1ab2ff5a0b9 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -466,7 +466,6 @@ if ($resql) {
} else {
dol_print_error($db);
}
-
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.address, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, s.logo,";
$sql .= " s.entity,";
$sql .= " st.libelle as stcomm, st.picto as stcomm_picto, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,";
@@ -494,13 +493,14 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
-$sqlfields = $sql; // $sql fields to remove for count total
+$sqlfields = $sql; // $sql fields to remove for count totall
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s2 ON s.parent = s2.rowid";
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (s.rowid = ef.fk_object)";
}
+
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_effectif)";
@@ -794,6 +794,9 @@ $help_url = 'EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('', $title, $help_url);
$param = '';
+if (!empty($mode)) {
+ $param .= '&mode='.urlencode($mode);
+}
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
@@ -982,8 +985,11 @@ if ($contextpage != 'poslist') {
if (!empty($socid)) {
$url .= '&socid='.$socid;
}
- $newcardbutton = dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url, '', $user->hasRight("societe", "creer"));
-} elseif ($user->hasRight("societe", "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($label), '', 'fa fa-plus-circle', $url, '', $user->rights->societe->creer);
+} elseif ($user->rights->societe->creer) {
$url = DOL_URL_ROOT.'/societe/card.php?action=create&type=t&contextpage=poslist&optioncss=print&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type=t&contextpage=poslist&nomassaction=1&optioncss=print&place='.$place);
$label = 'MenuNewCustomer';
$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url);
@@ -999,6 +1005,7 @@ print '';
print '';
//print '';
print '';
+print '';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'building', 0, $newcardbutton, '', $limit, 0, 0, 1);
@@ -1491,349 +1498,364 @@ while ($i < min($num, $limit)) {
$companystatic->entity = $obj->entity;
}
- print '
';
+ if ($mode == 'kanban') {
+ if ($i == 0) {
+ print '
';
+ print '
';
+ }
- // Action column (Show the massaction button only when this page is not opend from the Extended POS)
- if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
- print '
';
- if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // 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 '';
+ // Output Kanban
+ print $companystatic->getKanbanView('');
+ //print_r($obj->nb_rights);
+ if ($i == ($imaxinloop - 1)) {
+ print '';
+ print '
';
- foreach ($prospectstatic->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'];
+ // Action column (Show the massaction button only when this page is not opend from the Extended POS)
+ if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+ print '
\n";
- if (!$i) {
- $totalarray['nbfield']++;
- }
- }
- // Action column (Show the massaction button only when this page is not opend from the Extended POS)
- if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
- print '
';
- if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // 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;
+ if (!empty($arrayfields['s.rowid']['checked'])) {
+ print '
';
+ print $obj->rowid;
+ print "
\n";
+ if (!$i) {
+ $totalarray['nbfield']++;
}
- print '';
}
- print '';
- if (!$i) {
- $totalarray['nbfield']++;
+ if (!empty($arrayfields['s.nom']['checked'])) {
+ print '
\n";
+ if (!$i) {
+ $totalarray['nbfield']++;
+ }
+ }
+ // Action column (Show the massaction button only when this page is not opend from the Extended POS)
+ if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
+ print '
';
+ if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // 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 '';
+ }
+ print '