|
@@ -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,258 +221,278 @@ 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();
|
|
|
+
|
|
|
+$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;
|
|
|
+
|
|
|
+// List of mass actions available
|
|
|
+$arrayofmassactions = array();
|
|
|
+if (!empty($permissiontodelete)) {
|
|
|
+ $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
|
|
+}
|
|
|
+if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
|
|
+ $arrayofmassactions = array();
|
|
|
+}
|
|
|
+$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
|
|
|
|
|
- $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
|
|
|
|
|
- print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
|
|
- if ($optioncss != '') {
|
|
|
- print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
|
|
- }
|
|
|
- print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
- print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
|
|
- print '<input type="hidden" name="action" value="list">';
|
|
|
- print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
|
|
- print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|
|
- print '<input type="hidden" name="page" value="'.$page.'">';
|
|
|
- print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
|
|
- print '<input type="hidden" name="page_y" value="">';
|
|
|
- print '<input type="hidden" name="mode" value="'.$mode.'">';
|
|
|
-
|
|
|
- $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('New'), '', 'fa fa-plus-circle', dol_buildpath('/loan/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
|
|
-
|
|
|
- print_barre_liste($langs->trans("Loans"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'money-bill-alt', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
|
|
+$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);
|
|
|
+
|
|
|
+$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
|
|
+
|
|
|
+print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
|
|
+if ($optioncss != '') {
|
|
|
+ print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
|
|
+}
|
|
|
+print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
|
+print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
|
|
+print '<input type="hidden" name="action" value="list">';
|
|
|
+print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
|
|
+print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
|
|
+print '<input type="hidden" name="page" value="'.$page.'">';
|
|
|
+print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
|
|
+print '<input type="hidden" name="page_y" value="">';
|
|
|
+print '<input type="hidden" name="mode" value="'.$mode.'">';
|
|
|
+
|
|
|
+$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('New'), '', 'fa fa-plus-circle', dol_buildpath('/loan/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
|
|
+
|
|
|
+print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'money-bill-alt', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
|
|
+
|
|
|
+$moreforfilter = '';
|
|
|
|
|
|
+$parameters = array();
|
|
|
+$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
+if (empty($reshook)) {
|
|
|
+ $moreforfilter .= $hookmanager->resPrint;
|
|
|
+} else {
|
|
|
+ $moreforfilter = $hookmanager->resPrint;
|
|
|
+}
|
|
|
+
|
|
|
+if (!empty($moreforfilter)) {
|
|
|
+ print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
|
|
+ print $moreforfilter;
|
|
|
$parameters = array();
|
|
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
- if (empty($reshook)) {
|
|
|
- $moreforfilter .= $hookmanager->resPrint;
|
|
|
- } else {
|
|
|
- $moreforfilter = $hookmanager->resPrint;
|
|
|
- }
|
|
|
+ print $hookmanager->resPrint;
|
|
|
+ print '</div>';
|
|
|
+}
|
|
|
|
|
|
- if (!empty($moreforfilter)) {
|
|
|
- print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
|
|
- print $moreforfilter;
|
|
|
- $parameters = array();
|
|
|
- $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
- print $hookmanager->resPrint;
|
|
|
- print '</div>';
|
|
|
- }
|
|
|
+$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
|
|
+$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
|
|
|
+$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
|
|
|
|
|
- $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
|
|
- $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
|
|
|
- $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
|
|
-
|
|
|
- print '<div class="div-table-responsive">';
|
|
|
- print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
|
|
-
|
|
|
- // Fields title search
|
|
|
- // --------------------------------------------------------------------
|
|
|
- print '<tr class="liste_titre_filter">';
|
|
|
- // Action column
|
|
|
- if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
- print '<td class="liste_titre center maxwidthsearch">';
|
|
|
- $searchpicto = $form->showFilterButtons('left');
|
|
|
- print $searchpicto;
|
|
|
- print '</td>';
|
|
|
- }
|
|
|
+print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
|
|
+print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
|
|
|
|
|
- // Filter: Ref
|
|
|
- print '<td class="liste_titre"><input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'"></td>';
|
|
|
+// Fields title search
|
|
|
+// --------------------------------------------------------------------
|
|
|
+print '<tr class="liste_titre_filter">';
|
|
|
+// Action column
|
|
|
+if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
+ print '<td class="liste_titre center maxwidthsearch">';
|
|
|
+ $searchpicto = $form->showFilterButtons('left');
|
|
|
+ print $searchpicto;
|
|
|
+ print '</td>';
|
|
|
+}
|
|
|
|
|
|
- // Filter: Label
|
|
|
- print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
|
|
|
+// Filter: Ref
|
|
|
+print '<td class="liste_titre"><input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'"></td>';
|
|
|
|
|
|
- // Filter: Amount
|
|
|
- print '<td class="liste_titre right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
|
|
|
+// Filter: Label
|
|
|
+print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
|
|
|
|
|
|
- // No filter: Date start
|
|
|
- print '<td class="liste_titre"> </td>';
|
|
|
+// Filter: Amount
|
|
|
+print '<td class="liste_titre right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
|
|
|
|
|
|
- // No filter: Date end
|
|
|
- print '<td class="liste_titre"> </td>';
|
|
|
+// No filter: Date start
|
|
|
+print '<td class="liste_titre"> </td>';
|
|
|
|
|
|
- // No filter: Status
|
|
|
- print '<td class="liste_titre"></td>';
|
|
|
+// No filter: Date end
|
|
|
+print '<td class="liste_titre"> </td>';
|
|
|
|
|
|
- // Action column
|
|
|
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
- print '<td class="liste_titre center maxwidthsearch">';
|
|
|
- $searchpicto = $form->showFilterButtons();
|
|
|
- print $searchpicto;
|
|
|
- print '</td>';
|
|
|
- }
|
|
|
- print '</tr>'."\n";
|
|
|
-
|
|
|
- $totalarray = array();
|
|
|
- $totalarray['nbfield'] = 0;
|
|
|
-
|
|
|
- // Fields title label
|
|
|
- // --------------------------------------------------------------------
|
|
|
- print '<tr class="liste_titre">';
|
|
|
- // Action column
|
|
|
- if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
- print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
|
|
- $totalarray['nbfield']++;
|
|
|
- }
|
|
|
- print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "l.rowid", "", $param, "", $sortfield, $sortorder);
|
|
|
- $totalarray['nbfield']++;
|
|
|
- print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "l.label", "", $param, '', $sortfield, $sortorder, 'left ');
|
|
|
- $totalarray['nbfield']++;
|
|
|
- print_liste_field_titre("LoanCapital", $_SERVER["PHP_SELF"], "l.capital", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
|
- $totalarray['nbfield']++;
|
|
|
- print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center ');
|
|
|
- $totalarray['nbfield']++;
|
|
|
- print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center ');
|
|
|
+// No filter: Status
|
|
|
+print '<td class="liste_titre"></td>';
|
|
|
+
|
|
|
+// Action column
|
|
|
+if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
+ print '<td class="liste_titre center maxwidthsearch">';
|
|
|
+ $searchpicto = $form->showFilterButtons();
|
|
|
+ print $searchpicto;
|
|
|
+ print '</td>';
|
|
|
+}
|
|
|
+print '</tr>'."\n";
|
|
|
+
|
|
|
+$totalarray = array();
|
|
|
+$totalarray['nbfield'] = 0;
|
|
|
+
|
|
|
+// Fields title label
|
|
|
+// --------------------------------------------------------------------
|
|
|
+print '<tr class="liste_titre">';
|
|
|
+// Action column
|
|
|
+if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
+ print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
|
|
$totalarray['nbfield']++;
|
|
|
- print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
|
+}
|
|
|
+print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "l.rowid", "", $param, "", $sortfield, $sortorder);
|
|
|
+$totalarray['nbfield']++;
|
|
|
+print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "l.label", "", $param, '', $sortfield, $sortorder, 'left ');
|
|
|
+$totalarray['nbfield']++;
|
|
|
+print_liste_field_titre("LoanCapital", $_SERVER["PHP_SELF"], "l.capital", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
|
+$totalarray['nbfield']++;
|
|
|
+print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center ');
|
|
|
+$totalarray['nbfield']++;
|
|
|
+print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center ');
|
|
|
+$totalarray['nbfield']++;
|
|
|
+print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
|
+$totalarray['nbfield']++;
|
|
|
+if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
+ print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
|
|
$totalarray['nbfield']++;
|
|
|
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
- print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
|
|
|
- $totalarray['nbfield']++;
|
|
|
- }
|
|
|
- print "</tr>\n";
|
|
|
-
|
|
|
-
|
|
|
- // Loop on record
|
|
|
- // --------------------------------------------------------------------
|
|
|
- $i = 0;
|
|
|
- $savnbfield = $totalarray['nbfield'];
|
|
|
- $totalarray = array();
|
|
|
- $totalarray['nbfield'] = 0;
|
|
|
- $imaxinloop = ($limit ? min($num, $limit) : $num);
|
|
|
- while ($i < $imaxinloop) {
|
|
|
- $obj = $db->fetch_object($resql);
|
|
|
- if (empty($obj)) {
|
|
|
- break; // Should not happen
|
|
|
- }
|
|
|
+}
|
|
|
+print "</tr>\n";
|
|
|
|
|
|
- $object->id = $obj->rowid;
|
|
|
- $object->ref = $obj->rowid;
|
|
|
- $object->label = $obj->label;
|
|
|
- $object->paid = $obj->paid;
|
|
|
|
|
|
+// Loop on record
|
|
|
+// --------------------------------------------------------------------
|
|
|
+$i = 0;
|
|
|
+$savnbfield = $totalarray['nbfield'];
|
|
|
+$totalarray = array();
|
|
|
+$totalarray['nbfield'] = 0;
|
|
|
+$imaxinloop = ($limit ? min($num, $limit) : $num);
|
|
|
+while ($i < $imaxinloop) {
|
|
|
+ $obj = $db->fetch_object($resql);
|
|
|
+ if (empty($obj)) {
|
|
|
+ break; // Should not happen
|
|
|
+ }
|
|
|
|
|
|
- if ($mode == 'kanban') {
|
|
|
- if ($i == 0) {
|
|
|
- print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
|
|
|
- print '<div class="box-flex-container kanban">';
|
|
|
- }
|
|
|
- // Output Kanban
|
|
|
- $object->datestart= $obj->datestart;
|
|
|
- $object->dateend = $obj->dateend;
|
|
|
- $object->capital = $obj->capital;
|
|
|
- $object->totalpaid = $obj->paid;
|
|
|
-
|
|
|
- // Output Kanban
|
|
|
- $selected = -1;
|
|
|
- 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($object->id, $arrayofselected)) {
|
|
|
- $selected = 1;
|
|
|
- }
|
|
|
- }
|
|
|
- print $object->getKanbanView('', array('selected' => $selected));
|
|
|
- if ($i == ($imaxinloop - 1)) {
|
|
|
- print '</div>';
|
|
|
- print '</td></tr>';
|
|
|
- }
|
|
|
- } else {
|
|
|
- print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
|
|
+ $object->id = $obj->rowid;
|
|
|
+ $object->ref = $obj->rowid;
|
|
|
+ $object->label = $obj->label;
|
|
|
+ $object->paid = $obj->paid;
|
|
|
|
|
|
- // Action column
|
|
|
- if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
- print '<td></td>';
|
|
|
+
|
|
|
+ if ($mode == 'kanban') {
|
|
|
+ if ($i == 0) {
|
|
|
+ print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
|
|
|
+ print '<div class="box-flex-container kanban">';
|
|
|
+ }
|
|
|
+ // Output Kanban
|
|
|
+ $object->datestart= $obj->datestart;
|
|
|
+ $object->dateend = $obj->dateend;
|
|
|
+ $object->capital = $obj->capital;
|
|
|
+ $object->totalpaid = $obj->paid;
|
|
|
+
|
|
|
+ // Output Kanban
|
|
|
+ $selected = -1;
|
|
|
+ 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($object->id, $arrayofselected)) {
|
|
|
+ $selected = 1;
|
|
|
}
|
|
|
+ }
|
|
|
+ print $object->getKanbanView('', array('selected' => $selected));
|
|
|
+ if ($i == ($imaxinloop - 1)) {
|
|
|
+ print '</div>';
|
|
|
+ print '</td></tr>';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // Show line of result
|
|
|
+ $j = 0;
|
|
|
+ print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
|
|
|
|
|
- // Ref
|
|
|
- print '<td>'.$object->getNomUrl(1).'</td>';
|
|
|
+ // Action column
|
|
|
+ if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
+ print '<td></td>';
|
|
|
+ }
|
|
|
|
|
|
- // Label
|
|
|
- print '<td>'.dol_trunc($obj->label, 42).'</td>';
|
|
|
+ // Ref
|
|
|
+ print '<td>'.$object->getNomUrl(1).'</td>';
|
|
|
|
|
|
- // Capital
|
|
|
- print '<td class="right maxwidth100"><span class="amount">'.price($obj->capital).'</span></td>';
|
|
|
+ // Label
|
|
|
+ print '<td>'.dol_trunc($obj->label, 42).'</td>';
|
|
|
|
|
|
- // Date start
|
|
|
- print '<td class="center width100">'.dol_print_date($db->jdate($obj->datestart), 'day').'</td>';
|
|
|
+ // Capital
|
|
|
+ print '<td class="right maxwidth100"><span class="amount">'.price($obj->capital).'</span></td>';
|
|
|
|
|
|
- // Date end
|
|
|
- print '<td class="center width100">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
|
|
|
+ // Date start
|
|
|
+ print '<td class="center width100">'.dol_print_date($db->jdate($obj->datestart), 'day').'</td>';
|
|
|
|
|
|
- print '<td class="right nowrap">';
|
|
|
- print $object->LibStatut($obj->paid, 5, $obj->alreadypaid);
|
|
|
- print '</td>';
|
|
|
+ // Date end
|
|
|
+ print '<td class="center width100">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
|
|
|
|
|
|
- // Action column
|
|
|
- if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
- print '<td></td>';
|
|
|
- }
|
|
|
+ print '<td class="right nowrap">';
|
|
|
+ print $object->LibStatut($obj->paid, 5, $obj->alreadypaid);
|
|
|
+ print '</td>';
|
|
|
|
|
|
- print '</tr>'."\n";
|
|
|
+ // Action column
|
|
|
+ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
+ print '<td></td>';
|
|
|
}
|
|
|
- $i++;
|
|
|
- }
|
|
|
|
|
|
- // If no record found
|
|
|
- if ($num == 0) {
|
|
|
- $colspan = 7;
|
|
|
- //foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
|
|
|
- print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
|
|
+ print '</tr>'."\n";
|
|
|
}
|
|
|
+ $i++;
|
|
|
+}
|
|
|
|
|
|
- $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
|
|
- $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
- print $hookmanager->resPrint;
|
|
|
+// If no record found
|
|
|
+if ($num == 0) {
|
|
|
+ $colspan = 7;
|
|
|
+ //foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
|
|
|
+ print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
|
|
+}
|
|
|
|
|
|
- print '</table>'."\n";
|
|
|
- print '</div>'."\n";
|
|
|
+$db->free($resql);
|
|
|
|
|
|
- print '</form>'."\n";
|
|
|
+$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
|
|
+$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
+print $hookmanager->resPrint;
|
|
|
|
|
|
- $db->free($resql);
|
|
|
-} else {
|
|
|
- dol_print_error($db);
|
|
|
-}
|
|
|
+print '</table>'."\n";
|
|
|
+print '</div>'."\n";
|
|
|
+
|
|
|
+print '</form>'."\n";
|
|
|
|
|
|
// End of page
|
|
|
llxFooter();
|