Debug v22
This commit is contained in:
parent
423b302a2b
commit
270caf0dcb
11 changed files with 82 additions and 53 deletions
|
|
@ -42,8 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
|||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('mrp', 'other'));
|
||||
|
||||
// Get Parameters
|
||||
$id = GETPOSTINT('id');
|
||||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
|
||||
|
|
@ -55,6 +54,7 @@ $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'); // mode view (kanban or common)
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
|
|
@ -104,8 +104,8 @@ foreach ($object->fields as $key => $val) {
|
|||
}
|
||||
}
|
||||
|
||||
$fieldstosearchall = array();
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (!empty($val['searchall'])) {
|
||||
$fieldstosearchall['t.'.$key] = $val['label'];
|
||||
|
|
@ -139,7 +139,6 @@ $permissiontodelete = $user->hasRight('bom', 'delete');
|
|||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
// Protection if external user
|
||||
accessforbidden();
|
||||
}
|
||||
$result = restrictedArea($user, 'bom');
|
||||
|
|
@ -172,11 +171,15 @@ if (empty($reshook)) {
|
|||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$search[$key] = '';
|
||||
if ($key == 'status') {
|
||||
$search[$key] = -1;
|
||||
}
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = '';
|
||||
$search[$key.'_dtend'] = '';
|
||||
}
|
||||
}
|
||||
$search_all = '';
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
}
|
||||
|
|
@ -188,8 +191,6 @@ if (empty($reshook)) {
|
|||
// Mass actions
|
||||
$objectclass = 'BOM';
|
||||
$objectlabel = 'BillOfMaterials';
|
||||
$permissiontoread = $user->hasRight('bom', 'read');
|
||||
$permissiontodelete = $user->hasRight('bom', 'delete');
|
||||
$uploaddir = $conf->bom->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
|
|
@ -373,7 +374,7 @@ $sql .= $hookmanager->resPrint;
|
|||
/* If a group by is required
|
||||
$sql.= " GROUP BY ";
|
||||
foreach($object->fields as $key => $val) {
|
||||
$sql .= "t.".$db->escape($key).", ";
|
||||
$sql .= "t.".$db->sanitize($key).", ";
|
||||
}
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
|
|
@ -551,7 +552,7 @@ $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arra
|
|||
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
|
||||
|
|
@ -740,6 +741,7 @@ while ($i < $imaxinloop) {
|
|||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Fields
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
|
|
@ -761,7 +763,7 @@ while ($i < $imaxinloop) {
|
|||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
|
||||
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
|
||||
print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
|
|
@ -769,7 +771,13 @@ while ($i < $imaxinloop) {
|
|||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
if ($val['type'] == 'html') {
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">';
|
||||
}
|
||||
print $object->showOutputField($val, $key, (string) $object->$key, '');
|
||||
if ($val['type'] == 'html') {
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
|
|
|||
|
|
@ -2382,7 +2382,7 @@ while ($i < $imaxinloop) {
|
|||
// Note public
|
||||
if (!empty($arrayfields['p.note_public']['checked'])) {
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'</div>';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
@ -2391,7 +2391,7 @@ while ($i < $imaxinloop) {
|
|||
// Note private
|
||||
if (!empty($arrayfields['p.note_private']['checked'])) {
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'</div>';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
|
|||
|
|
@ -2908,8 +2908,8 @@ while ($i < $imaxinloop) {
|
|||
|
||||
// Note public
|
||||
if (!empty($arrayfields['c.note_public']['checked'])) {
|
||||
print '<td class="flat maxwidth250imp">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'</div>';
|
||||
print '<td class="sensiblehtmlcontent maxwidth250imp">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
@ -2918,8 +2918,8 @@ while ($i < $imaxinloop) {
|
|||
|
||||
// Note private
|
||||
if (!empty($arrayfields['c.note_private']['checked'])) {
|
||||
print '<td class="flat maxwidth250imp">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'</div>';
|
||||
print '<td class="sensiblehtmlcontent maxwidth250imp">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
|
|||
|
|
@ -2920,7 +2920,7 @@ if ($num > 0) {
|
|||
// Note public
|
||||
if (!empty($arrayfields['f.note_public']['checked'])) {
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print dolPrintHTML($obj->note_public);
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
@ -2928,8 +2928,8 @@ if ($num > 0) {
|
|||
}
|
||||
// Note private
|
||||
if (!empty($arrayfields['f.note_private']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print dolPrintHTML($obj->note_private);
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
|
|||
|
|
@ -1688,7 +1688,7 @@ while ($i < $imaxinloop) {
|
|||
// Note public
|
||||
if (!empty($arrayfields['e.note_public']['checked'])) {
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print dolPrintHTML($obj->note_public);
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
@ -1697,7 +1697,7 @@ while ($i < $imaxinloop) {
|
|||
// Note private
|
||||
if (!empty($arrayfields['e.note_private']['checked'])) {
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print dolPrintHTML($obj->note_private);
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
|
|||
|
|
@ -996,7 +996,7 @@ while ($i < $imaxinloop) {
|
|||
// Note public
|
||||
if (!empty($arrayfields['f.note_public']['checked'])) {
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print dolPrintHTML($obj->note_public);
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
@ -1005,7 +1005,7 @@ while ($i < $imaxinloop) {
|
|||
// Note private
|
||||
if (!empty($arrayfields['f.note_private']['checked'])) {
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print dolPrintHTML($obj->note_private);
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
|
|||
|
|
@ -2102,8 +2102,8 @@ if ($resql) {
|
|||
}
|
||||
// Note public
|
||||
if (!empty($arrayfields['cf.note_public']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'</div>';
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
@ -2113,7 +2113,7 @@ if ($resql) {
|
|||
// Note private
|
||||
if (!empty($arrayfields['cf.note_private']['checked'])) {
|
||||
print '<td class="sensiblehtmlcontent center">';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'</div>';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
|
|||
|
|
@ -162,8 +162,8 @@ foreach ($object->fields as $key => $val) {
|
|||
}
|
||||
}
|
||||
|
||||
$fieldstosearchall = array();
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array();
|
||||
// foreach ($object->fields as $key => $val) {
|
||||
// if (!empty($val['searchall'])) {
|
||||
// $fieldstosearchall['t.'.$key] = $val['label'];
|
||||
|
|
@ -850,7 +850,13 @@ while ($i < $imaxinloop) {
|
|||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
if ($val['type'] == 'html') {
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">';
|
||||
}
|
||||
print $object->showOutputField($val, $key, (string) $object->$key, '');
|
||||
if ($val['type'] == 'html') {
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
|
|
|||
|
|
@ -2045,7 +2045,10 @@ class Mo extends CommonObject
|
|||
if ($this->status != Mo::STATUS_VALIDATED && $this->status != Mo::STATUS_INPROGRESS) {
|
||||
return false;
|
||||
}
|
||||
return (dol_now() > ($this->date_end_planned + $conf->mrp->progress->warning_delay));
|
||||
if (empty($this->date_end_planned)) {
|
||||
return false;
|
||||
}
|
||||
return (dol_now() > ((int) $this->date_end_planned + $conf->mrp->progress->warning_delay));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
// load mrp libraries
|
||||
require_once __DIR__.'/class/mo.class.php';
|
||||
|
||||
|
|
@ -58,6 +57,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str
|
|||
$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', 'alpha');
|
||||
$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ $id = GETPOSTINT('id');
|
|||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
|
||||
$also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0);
|
||||
$changeDate = GETPOST('change_date', 'alpha');
|
||||
|
||||
|
|
@ -128,15 +128,16 @@ foreach ($object->fields as $key => $val) {
|
|||
}
|
||||
|
||||
// Definition of array of fields for columns
|
||||
$tableprefix = 't';
|
||||
$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((string) $val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
$arrayfields[$tableprefix.'.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
'checked' => (($visible < 0) ? 0 : 1),
|
||||
'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
'checked' => (($visible < 0) ? '0' : '1'),
|
||||
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
|
||||
'position' => $val['position'],
|
||||
'help' => isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
|
|
@ -144,7 +145,7 @@ foreach ($object->fields as $key => $val) {
|
|||
|
||||
if ($key == 'fk_parent_line') {
|
||||
$visible = (int) dol_eval((string) $val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
$arrayfields[$tableprefix.'.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
'checked' => (($visible <= 0) ? 0 : 1),
|
||||
'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
|
|
@ -182,7 +183,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
|
|||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$parameters = array('arrayfields' => &$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -306,8 +307,8 @@ $morecss = array();
|
|||
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = 'SELECT ';
|
||||
$sql .= $object->getFieldList('t');
|
||||
$sql = "SELECT ";
|
||||
$sql .= " ".$object->getFieldList('t');
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
|
|
@ -322,13 +323,13 @@ $sql = preg_replace('/,\s*$/', '', $sql);
|
|||
|
||||
$sqlfields = $sql; // $sql fields to remove for count total
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
$sql .= " FROM ".$db->prefix().$object->table_element." as t";
|
||||
if (isset($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 (t.rowid = ef.fk_object)";
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON t.fk_product = p.rowid";
|
||||
$sql .= " LEFT JOIN ".$db->prefix()."mrp_production as lineparent ON t.fk_parent_line = lineparent.rowid";
|
||||
$sql .= " LEFT JOIN ".$db->prefix()."mrp_mo as moparent ON lineparent.fk_mo = moparent.rowid";
|
||||
$sql .= " LEFT JOIN ".$db->prefix()."product as p ON t.fk_product = p.rowid";
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
@ -431,7 +432,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
|||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than paging size (filtering), goto and load page 0
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
|
|
@ -481,6 +482,9 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
|||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
if ($groupby != '') {
|
||||
$param .= '&groupby='.urlencode($groupby);
|
||||
}
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
|
|
@ -489,9 +493,9 @@ foreach ($search as $key => $val) {
|
|||
}
|
||||
}
|
||||
} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
|
||||
$param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int'));
|
||||
$param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int'));
|
||||
$param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int'));
|
||||
$param .= '&search_'.$key.'month='.GETPOSTINT('search_'.$key.'month');
|
||||
$param .= '&search_'.$key.'day='.GETPOSTINT('search_'.$key.'day');
|
||||
$param .= '&search_'.$key.'year='.GETPOSTINT('search_'.$key.'year');
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
|
|
@ -670,7 +674,7 @@ foreach ($object->fields as $key => $val) {
|
|||
}
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth125', 1);
|
||||
} elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
|
|
@ -722,9 +726,10 @@ foreach ($object->fields as $key => $val) {
|
|||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
if ($key == "fk_product") {
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'p.ref', '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
||||
|
|
@ -737,7 +742,7 @@ foreach ($object->fields as $key => $val) {
|
|||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
|
||||
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
|
|
@ -779,7 +784,7 @@ while ($i < $imaxinloop) {
|
|||
$object->setVarsFromFetchObj($obj);
|
||||
|
||||
|
||||
if ($mode == 'kanban') {
|
||||
if ($mode == 'kanban' || $mode == 'kanbangroupby') {
|
||||
if ($i == 0) {
|
||||
print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
|
||||
print '<div class="box-flex-container kanban">';
|
||||
|
|
@ -851,7 +856,7 @@ while ($i < $imaxinloop) {
|
|||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.((preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
|
||||
print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
|
||||
print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
|
|
@ -864,7 +869,14 @@ while ($i < $imaxinloop) {
|
|||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} else {
|
||||
if ($val['type'] == 'html') {
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">';
|
||||
}
|
||||
print $object->showOutputField($val, $key, (string) $object->$key, '');
|
||||
if ($val['type'] == 'html') {
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($key == 'date_end_planned' && $object->hasDelay()) {
|
||||
print img_warning($langs->trans('Alert').' - '.$langs->trans('Late'));
|
||||
}
|
||||
|
|
@ -934,7 +946,7 @@ if ($num == 0) {
|
|||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</table>'."\n";
|
||||
|
|
|
|||
|
|
@ -2325,7 +2325,7 @@ while ($i < $imaxinloop) {
|
|||
// Note public
|
||||
if (!empty($arrayfields['s.note_public']['checked'])) {
|
||||
print '<td class="flat maxwidth250imp">';
|
||||
print '<div class="small lineheightsmall">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public), 5).'</div>';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_public, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
@ -2334,7 +2334,7 @@ while ($i < $imaxinloop) {
|
|||
// Note private
|
||||
if (!empty($arrayfields['s.note_private']['checked'])) {
|
||||
print '<td class="flat maxwidth250imp">';
|
||||
print '<div class="small lineheightsmall">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private), 5).'</div>';
|
||||
print '<div class="small lineheightsmall twolinesmax-normallineheight">'.dolPrintHTML(dolGetFirstLineOfText($obj->note_private, 5)).'</div>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
|
|
|||
Loading…
Reference in a new issue