|
|
|
|
@ -39,13 +39,14 @@ require_once __DIR__.'/class/mo.class.php';
|
|
|
|
|
// Load translation files required by the page
|
|
|
|
|
$langs->loadLangs(array("mrp", "other"));
|
|
|
|
|
|
|
|
|
|
// 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 ?
|
|
|
|
|
$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') : 'molist'; // To manage different context of search
|
|
|
|
|
$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', 'alpha');
|
|
|
|
|
@ -71,7 +72,7 @@ $pagenext = $page + 1;
|
|
|
|
|
$object = new Mo($db);
|
|
|
|
|
$extrafields = new ExtraFields($db);
|
|
|
|
|
$diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id;
|
|
|
|
|
$hookmanager->initHooks(array('molist')); // Note that conf->hooks_modules contains array
|
|
|
|
|
$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
|
|
|
|
|
|
|
|
|
|
// Fetch optionals attributes and labels
|
|
|
|
|
$extrafields->fetch_name_optionals_label($object->table_element);
|
|
|
|
|
@ -87,7 +88,7 @@ if (!$sortorder) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Initialize array of search criteria
|
|
|
|
|
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
|
|
|
|
|
$search_all = trim(GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
|
|
|
|
$search = array();
|
|
|
|
|
foreach ($object->fields as $key => $val) {
|
|
|
|
|
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
|
|
|
|
@ -112,11 +113,11 @@ $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, 1, '1');
|
|
|
|
|
$visible = (int) dol_eval($val['visible'], 1);
|
|
|
|
|
$arrayfields['t.'.$key] = array(
|
|
|
|
|
'label'=>$val['label'],
|
|
|
|
|
'checked'=>(($visible < 0) ? 0 : 1),
|
|
|
|
|
'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1, 1, '1')),
|
|
|
|
|
'enabled'=>(abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)),
|
|
|
|
|
'position'=>$val['position'],
|
|
|
|
|
'help'=> isset($val['help']) ? $val['help'] : ''
|
|
|
|
|
);
|
|
|
|
|
@ -145,7 +146,6 @@ $permissiontodelete = $user->hasRight('mrp', 'delete');
|
|
|
|
|
|
|
|
|
|
// Security check
|
|
|
|
|
if ($user->socid > 0) {
|
|
|
|
|
// Protection if external user
|
|
|
|
|
accessforbidden();
|
|
|
|
|
}
|
|
|
|
|
$result = restrictedArea($user, 'mrp');
|
|
|
|
|
@ -185,6 +185,7 @@ if (empty($reshook)) {
|
|
|
|
|
$search[$key.'_dtend'] = '';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$search_all = '';
|
|
|
|
|
$toselect = array();
|
|
|
|
|
$search_array_options = array();
|
|
|
|
|
}
|
|
|
|
|
@ -229,7 +230,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|
|
|
|
}
|
|
|
|
|
// Add fields from hooks
|
|
|
|
|
$parameters = array();
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$sql .= $hookmanager->resPrint;
|
|
|
|
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
|
|
|
|
|
|
|
|
|
@ -244,10 +245,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo as moparent ON lineparent.fk_mo = m
|
|
|
|
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON t.fk_product = p.rowid";
|
|
|
|
|
// 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).")";
|
|
|
|
|
$sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")";
|
|
|
|
|
} else {
|
|
|
|
|
$sql .= " WHERE 1 = 1";
|
|
|
|
|
}
|
|
|
|
|
@ -276,17 +277,17 @@ foreach ($search as $key => $val) {
|
|
|
|
|
$mode_search = 2;
|
|
|
|
|
}
|
|
|
|
|
if ($search[$key] != '') {
|
|
|
|
|
$sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
|
|
|
|
$sql .= natural_search("t.".$db->sanitize($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
|
|
|
|
|
$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
|
|
|
|
|
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
|
|
|
|
|
if (preg_match('/_dtstart$/', $key)) {
|
|
|
|
|
$sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
|
|
|
|
|
$sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'";
|
|
|
|
|
}
|
|
|
|
|
if (preg_match('/_dtend$/', $key)) {
|
|
|
|
|
$sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
|
|
|
|
|
$sql .= " AND t.".$db->sanitize($columnName)." <= '".$db->idate($search[$key])."'";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -300,23 +301,23 @@ if ($search_all) {
|
|
|
|
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
|
|
|
|
// Add where from hooks
|
|
|
|
|
$parameters = array();
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$sql .= $hookmanager->resPrint;
|
|
|
|
|
|
|
|
|
|
/* If a group by is required
|
|
|
|
|
$sql.= " GROUP BY ";
|
|
|
|
|
foreach($object->fields as $key => $val) {
|
|
|
|
|
$sql .= "t.".$key.", ";
|
|
|
|
|
$sql .= "t.".$db->sanitize($key).", ";
|
|
|
|
|
}
|
|
|
|
|
// Add fields from extrafields
|
|
|
|
|
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|
|
|
|
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
|
|
|
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.", " : "");
|
|
|
|
|
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Add where from hooks
|
|
|
|
|
// Add groupby from hooks
|
|
|
|
|
$parameters=array();
|
|
|
|
|
$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$sql.=$hookmanager->resPrint;
|
|
|
|
|
$sql=preg_replace('/,\s*$/','', $sql);
|
|
|
|
|
*/
|
|
|
|
|
@ -335,7 +336,7 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
|
|
|
|
|
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than paging size (filtering), goto and load page 0
|
|
|
|
|
$page = 0;
|
|
|
|
|
$offset = 0;
|
|
|
|
|
}
|
|
|
|
|
@ -357,10 +358,10 @@ if (!$resql) {
|
|
|
|
|
$num = $db->num_rows($resql);
|
|
|
|
|
|
|
|
|
|
// Direct jump if only one record found
|
|
|
|
|
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
|
|
|
|
if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
|
|
|
|
$obj = $db->fetch_object($resql);
|
|
|
|
|
$id = $obj->rowid;
|
|
|
|
|
header("Location: ".dol_buildpath('/mrp/mo_card.php', 1).'?id='.$id);
|
|
|
|
|
header("Location: ".dol_buildpath('/mrp/mo_card.php', 1).'?id='.((int) $id));
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -383,25 +384,29 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
|
|
|
|
if ($limit > 0 && $limit != $conf->liste_limit) {
|
|
|
|
|
$param .= '&limit='.((int) $limit);
|
|
|
|
|
}
|
|
|
|
|
if ($optioncss != '') {
|
|
|
|
|
$param .= '&optioncss='.urlencode($optioncss);
|
|
|
|
|
}
|
|
|
|
|
foreach ($search as $key => $val) {
|
|
|
|
|
if (is_array($search[$key]) && count($search[$key])) {
|
|
|
|
|
if (is_array($search[$key])) {
|
|
|
|
|
foreach ($search[$key] as $skey) {
|
|
|
|
|
if ($skey != '') {
|
|
|
|
|
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} 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'));
|
|
|
|
|
} elseif ($search[$key] != '') {
|
|
|
|
|
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($optioncss != '') {
|
|
|
|
|
$param .= '&optioncss='.urlencode($optioncss);
|
|
|
|
|
}
|
|
|
|
|
// Add $param from extra fields
|
|
|
|
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
|
|
|
|
// Add $param from hooks
|
|
|
|
|
$parameters = array('param' => &$param);
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$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
|
|
|
|
|
@ -411,7 +416,7 @@ $arrayofmassactions = array(
|
|
|
|
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
|
|
|
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
|
|
|
|
);
|
|
|
|
|
if ($permissiontodelete) {
|
|
|
|
|
if (!empty($permissiontodelete)) {
|
|
|
|
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
|
|
|
|
}
|
|
|
|
|
if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
|
|
|
|
|
@ -430,6 +435,7 @@ 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 = '';
|
|
|
|
|
@ -460,7 +466,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_
|
|
|
|
|
$moreforfilter.= '</div>';*/
|
|
|
|
|
|
|
|
|
|
$parameters = array();
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$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 {
|
|
|
|
|
@ -470,11 +476,15 @@ if (empty($reshook)) {
|
|
|
|
|
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 = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
|
|
|
|
$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
|
|
|
|
|
$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
|
|
|
|
|
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
|
|
|
|
|
|
|
|
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
|
|
|
|
|
@ -483,10 +493,10 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
|
|
|
|
|
|
|
|
|
// Fields title search
|
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<tr class="liste_titre_filter">';
|
|
|
|
|
// Action column
|
|
|
|
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
|
|
print '<td class="liste_titre maxwidthsearch">';
|
|
|
|
|
print '<td class="liste_titre center maxwidthsearch">';
|
|
|
|
|
$searchpicto = $form->showFilterButtons('left');
|
|
|
|
|
print $searchpicto;
|
|
|
|
|
print '</td>';
|
|
|
|
|
@ -533,11 +543,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
|
|
|
|
|
|
|
|
|
// Fields from hook
|
|
|
|
|
$parameters = array('arrayfields'=>$arrayfields);
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
print $hookmanager->resPrint;
|
|
|
|
|
// Action column
|
|
|
|
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
|
|
print '<td class="liste_titre maxwidthsearch">';
|
|
|
|
|
print '<td class="liste_titre center maxwidthsearch">';
|
|
|
|
|
$searchpicto = $form->showFilterButtons();
|
|
|
|
|
print $searchpicto;
|
|
|
|
|
print '</td>';
|
|
|
|
|
@ -581,8 +591,8 @@ 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);
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
print $hookmanager->resPrint;
|
|
|
|
|
// Action column
|
|
|
|
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
|
|
@ -622,13 +632,13 @@ while ($i < $imaxinloop) {
|
|
|
|
|
// Store properties in $object
|
|
|
|
|
$object->setVarsFromFetchObj($obj);
|
|
|
|
|
|
|
|
|
|
//mode Kanban
|
|
|
|
|
|
|
|
|
|
if ($mode == 'kanban') {
|
|
|
|
|
if ($i == 0) {
|
|
|
|
|
print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
|
|
|
|
|
print '<div class="box-flex-container kanban">';
|
|
|
|
|
}
|
|
|
|
|
$object->id = $obj->type_id;
|
|
|
|
|
//$object->type_id = $obj->type_id;
|
|
|
|
|
|
|
|
|
|
// TODO Use a cache on BOM
|
|
|
|
|
if ($obj->fk_bom > 0) {
|
|
|
|
|
@ -652,8 +662,10 @@ while ($i < $imaxinloop) {
|
|
|
|
|
print '</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Show here line of result
|
|
|
|
|
print '<tr class="oddeven">';
|
|
|
|
|
// Show line of result
|
|
|
|
|
$j = 0;
|
|
|
|
|
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
|
|
|
|
|
|
|
|
|
// Action column
|
|
|
|
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
|
|
print '<td class="nowrap center">';
|
|
|
|
|
@ -665,7 +677,11 @@ while ($i < $imaxinloop) {
|
|
|
|
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
|
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
if (!$i) {
|
|
|
|
|
$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'))) {
|
|
|
|
|
@ -677,17 +693,21 @@ while ($i < $imaxinloop) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array($val['type'], array('timestamp'))) {
|
|
|
|
|
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
|
|
|
|
$cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
|
|
|
|
|
} elseif ($key == 'ref') {
|
|
|
|
|
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
|
|
|
|
$cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
|
|
|
|
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) {
|
|
|
|
|
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
|
|
|
|
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
|
|
|
|
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($object->$key).'"';
|
|
|
|
|
}
|
|
|
|
|
print '>';
|
|
|
|
|
if ($key == 'status') {
|
|
|
|
|
print $object->getLibStatut(5);
|
|
|
|
|
} elseif ($key == 'fk_parent_line') {
|
|
|
|
|
@ -722,8 +742,9 @@ while ($i < $imaxinloop) {
|
|
|
|
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
|
|
|
|
// Fields from hook
|
|
|
|
|
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
|
|
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
print $hookmanager->resPrint;
|
|
|
|
|
|
|
|
|
|
// Action column
|
|
|
|
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
|
|
|
print '<td class="nowrap center">';
|
|
|
|
|
@ -735,9 +756,9 @@ while ($i < $imaxinloop) {
|
|
|
|
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
|
|
|
|
}
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
if (!$i) {
|
|
|
|
|
$totalarray['nbfield']++;
|
|
|
|
|
if (!$i) {
|
|
|
|
|
$totalarray['nbfield']++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|