';
+ }
if (property_exists($this, 'lang') && !empty($this->lang)) {
//$return .= '
'.picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow paddingrightonly"');
diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php
index 45593dd624e..92af439b823 100644
--- a/htdocs/loan/class/loan.class.php
+++ b/htdocs/loan/class/loan.class.php
@@ -722,7 +722,9 @@ class Loan extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'capital')) {
$return .= ' |
'.$langs->trans("Amount").' :
'.price($this->capital).'';
}
diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php
index ac524a79a4c..7ade6bb92af 100644
--- a/htdocs/loan/list.php
+++ b/htdocs/loan/list.php
@@ -31,7 +31,17 @@ require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
// Load translation files required by the page
$langs->loadLangs(array("banks", "bills", "compta", "loan"));
-$massaction = GETPOST('massaction', 'alpha');
+// Get parameters
+$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
+$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
+$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
+$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
+$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
+$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
+$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
+$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
+$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -46,10 +56,18 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
// Initialize technical objects
-$hookmanager->initHooks(array('loanlist'));
$object = new Loan($db);
$extrafields = new ExtraFields($db);
+$diroutputmassaction = $conf->loan->dir_output.'/temp/massgeneration/'.$user->id;
+$hookmanager->initHooks(array($contextpage));
+// Fetch optionals attributes and labels
+$extrafields->fetch_name_optionals_label($object->table_element);
+//$extrafields->fetch_name_optionals_label($object->table_element_line);
+
+$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
+
+// Default sort order (if not yet defined by previous GETPOST)
if (!$sortfield) {
$sortfield = "l.rowid";
}
@@ -57,14 +75,32 @@ if (!$sortorder) {
$sortorder = "DESC";
}
+// Definition of array of fields for columns
+$arrayfields = array();
+foreach ($object->fields as $key => $val) {
+ // If $val['visible']==0, then we never show the field
+ if (!empty($val['visible'])) {
+ $visible = (int) dol_eval($val['visible'], 1);
+ $arrayfields['t.'.$key] = array(
+ 'label'=>$val['label'],
+ 'checked'=>(($visible < 0) ? 0 : 1),
+ 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)),
+ 'position'=>$val['position'],
+ 'help'=> isset($val['help']) ? $val['help'] : ''
+ );
+ }
+}
+// Extra fields
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
+
+$object->fields = dol_sort_array($object->fields, 'position');
+//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
+$arrayfields = dol_sort_array($arrayfields, 'position');
+
$search_ref = GETPOST('search_ref', 'int');
$search_label = GETPOST('search_label', 'alpha');
$search_amount = GETPOST('search_amount', 'alpha');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'loanlist'; // To manage different context of search
-$optioncss = GETPOST('optioncss', 'alpha');
-$mode = GETPOST('mode', 'alpha'); // mode view result
-
$permissiontoadd = $user->hasRight('loan', 'write');
// Security check
@@ -113,9 +149,6 @@ $help_url="EN:Module_Loan|FR:Module_Emprunt";
$help_url = '';
$title = $langs->trans('Loans');
-llxHeader('', $title, $help_url);
-
-$arrayofselected = is_array($toselect) ? $toselect : array();
// Build and execute select
// --------------------------------------------------------------------
@@ -160,7 +193,6 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
}
$db->free($resql);
}
-$arrayfields = array();
// Complete request and execute it with limit
$sql .= $db->order($sortfield, $sortorder);
@@ -189,259 +221,279 @@ if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sear
// Output page
// --------------------------------------------------------------------
-if ($resql) {
- $i = 0;
- $param = '';
- if (!empty($mode)) {
- $param .= '&mode='.urlencode($mode);
- }
- if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
- $param .= '&contextpage='.urlencode($contextpage);
- }
- if ($limit > 0 && $limit != $conf->liste_limit) {
- $param .= '&limit='.((int) $limit);
- }
- if ($search_ref) {
- $param .= "&search_ref=".urlencode($search_ref);
- }
- if ($search_label) {
- $param .= "&search_label=".urlencode($search_label);
- }
- if ($search_amount) {
- $param .= "&search_amount=".urlencode($search_amount);
- }
- if ($optioncss != '') {
- $param .= '&optioncss='.urlencode($optioncss);
- }
+llxHeader('', $title, $help_url);
- $url = DOL_URL_ROOT.'/loan/card.php?action=create';
- if (!empty($socid)) {
- $url .= '&socid='.$socid;
- }
- $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 .= dolGetButtonTitleSeparator();
- $newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
+$arrayofselected = is_array($toselect) ? $toselect : array();
- $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
+$param = '';
+if (!empty($mode)) {
+ $param .= '&mode='.urlencode($mode);
+}
+if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
+ $param .= '&contextpage='.urlencode($contextpage);
+}
+if ($limit > 0 && $limit != $conf->liste_limit) {
+ $param .= '&limit='.((int) $limit);
+}
+if ($optioncss != '') {
+ $param .= '&optioncss='.urlencode($optioncss);
+}
+if ($search_ref) {
+ $param .= "&search_ref=".urlencode($search_ref);
+}
+if ($search_label) {
+ $param .= "&search_label=".urlencode($search_label);
+}
+if ($search_amount) {
+ $param .= "&search_amount=".urlencode($search_amount);
+}
+// Add $param from extra fields
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
+// Add $param from hooks
+$parameters = array();
+$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+$param .= $hookmanager->resPrint;
- print '
'."\n";
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php
index 25d0a7190f6..c7dc94e27fd 100644
--- a/htdocs/mrp/class/mo.class.php
+++ b/htdocs/mrp/class/mo.class.php
@@ -1715,7 +1715,9 @@ class Mo extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (!empty($arraydata['bom'])) {
$return .= '
'.$arraydata['bom']->getNomUrl(1).'';
}
diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php
index b8e176e3b73..080184b46f8 100644
--- a/htdocs/partnership/class/partnership.class.php
+++ b/htdocs/partnership/class/partnership.class.php
@@ -1298,7 +1298,9 @@ class Partnership extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'label')) {
$return .= '
'.$this->label.'
';
}
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index c8c95866e25..a548c8705d8 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -6468,7 +6468,9 @@ class Product extends CommonObject
$return .= '
';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'label')) {
$return .= '
'.$this->label.'';
}
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index d8a882b1963..a8730651621 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -682,7 +682,9 @@ class Inventory extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'label')) {
$return .= '
'.$this->label.'
';
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 296a63f06ed..076dae11a00 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -2426,7 +2426,9 @@ class Project extends CommonObject
$return .= img_warning($langs->trans('Late'));
}
$return .= '';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
// Date
/*
if (property_exists($this, 'date_start') && $this->date_start) {
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 1981ca0931b..53690fe9834 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -2401,7 +2401,9 @@ class Task extends CommonObjectLine
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (!empty($arraydata['projectlink'])) {
//$tmpproject = $arraydata['project'];
//$return .= '
'.$tmpproject->getNomProject().'';
diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php
index 891a7fd3075..6df4df808fc 100644
--- a/htdocs/recruitment/class/recruitmentcandidature.class.php
+++ b/htdocs/recruitment/class/recruitmentcandidature.class.php
@@ -1069,7 +1069,9 @@ class RecruitmentCandidature extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'fk_recruitmentjobposition')) {
$return .= '
'.$langs->trans('Job').' :
'.$this->fk_recruitmentjobposition.'';
}
diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php
index 450c6f45896..d81ba26973e 100644
--- a/htdocs/recruitment/class/recruitmentjobposition.class.php
+++ b/htdocs/recruitment/class/recruitmentjobposition.class.php
@@ -1127,7 +1127,9 @@ class RecruitmentJobPosition extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'date_planned')) {
$return .= '
'.$langs->trans("Date").' :
'.dol_print_date($this->db->jdate($this->date_planned), 'day').'';
}
diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php
index 50cb208bdcb..ab2454e003e 100644
--- a/htdocs/salaries/class/paymentsalary.class.php
+++ b/htdocs/salaries/class/paymentsalary.class.php
@@ -910,7 +910,9 @@ class PaymentSalary extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'fk_bank')) {
$return .= ' |
'.$this->fk_bank.'';
}
diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php
index e323420fb4e..a521107310d 100644
--- a/htdocs/salaries/class/salary.class.php
+++ b/htdocs/salaries/class/salary.class.php
@@ -765,7 +765,9 @@ class Salary extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (!empty($arraydata['user']) && is_object($arraydata['user'])) {
$return .= '
'.$arraydata['user']->getNomUrl(1, '', 0, 0, 16, 0, '', 'maxwidth100').'';
}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 3de38c63a9d..cca0c5abdb5 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -5298,11 +5298,12 @@ class Societe extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'code_client')) {
$return .= '
'.$this->code_client.'';
}
-
if (method_exists($this, 'getLibStatut')) {
$return .= '
'.$this->getLibStatut(3).'
';
}
diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php
index 8db3fe8d3c8..48648c6b0e3 100644
--- a/htdocs/supplier_proposal/class/supplier_proposal.class.php
+++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php
@@ -2765,7 +2765,9 @@ class SupplierProposal extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'socid')) {
$return .= '
| '.$this->socid.'';
}
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index b15b03ca5be..02988d1b744 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -3112,7 +3112,9 @@ class Ticket extends CommonObject
$return .= '';
$return .= '
';
$return .= '
'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (!empty($arraydata['user_assignment'])) {
$return .= '
'.$arraydata['user_assignment'].'';
}
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 7a69b261f38..fd7336ed9ac 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -3136,7 +3136,9 @@ class User extends CommonObject
$return .= img_picto($langs->trans("AdministratorDesc"), 'star', 'class="valignmiddle paddingright paddingleft"');
}
$return .= '';
- $return .= '
';
+ if ($selected >= 0) {
+ $return .= '
';
+ }
if (property_exists($this, 'label')) {
$return .= '
'.$this->label.'';
}
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index 58f96977b2a..c06cda641ad 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -1027,7 +1027,9 @@ class UserGroup extends CommonObject
$return .= '';
$return .= '
';
$return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'';
- $return .= '';
+ if ($selected >= 0) {
+ $return .= '';
+ }
if (property_exists($this, 'members')) {
$return .= '
'.(empty($this->nb_users) ? 0 : $this->nb_users).' '.$langs->trans('Users').'';
}