Debug v18
This commit is contained in:
parent
75cddd8c09
commit
40d9d7481b
@ -8276,7 +8276,7 @@ class Form
|
|||||||
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
|
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag */
|
||||||
placeholder: "'.dol_escape_js($placeholder).'",
|
placeholder: "'.dol_escape_js($placeholder).'",
|
||||||
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
||||||
minimumInputLength: '.$minimumInputLength.',
|
minimumInputLength: '.((int) $minimumInputLength).',
|
||||||
formatResult: function(result, container, query, escapeMarkup) {
|
formatResult: function(result, container, query, escapeMarkup) {
|
||||||
return escapeMarkup(result.text);
|
return escapeMarkup(result.text);
|
||||||
},
|
},
|
||||||
@ -8529,6 +8529,8 @@ class Form
|
|||||||
},';
|
},';
|
||||||
}
|
}
|
||||||
$out .= ' dir: \'ltr\',
|
$out .= ' dir: \'ltr\',
|
||||||
|
containerCssClass: \':all:\', /* Line to add class of origin SELECT propagated to the new <span class="select2-selection...> tag (ko with multiselect) */
|
||||||
|
dropdownCssClass: \''.$morecss.'\', /* Line to add class on the new <span class="select2-selection...> tag (ok with multiselect) */
|
||||||
// Specify format function for dropdown item
|
// Specify format function for dropdown item
|
||||||
formatResult: formatResult,
|
formatResult: formatResult,
|
||||||
templateResult: formatResult, /* For 4.0 */
|
templateResult: formatResult, /* For 4.0 */
|
||||||
|
|||||||
@ -1136,12 +1136,12 @@ class KnowledgeRecord extends CommonObject
|
|||||||
$selected = 1;
|
$selected = 1;
|
||||||
}
|
}
|
||||||
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
if (property_exists($this, 'question')) {
|
|
||||||
$return .= '<br><span class="opacitymedium">'.$langs->trans('Question').'</span> : <span class="info-box-label">'.$this->question.'</span>';
|
|
||||||
}
|
|
||||||
if (property_exists($this, 'lang') && !empty($this->lang)) {
|
if (property_exists($this, 'lang') && !empty($this->lang)) {
|
||||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("Language").'</span> : <span class="info-box-label" title="'.$langs->trans("Language_".$this->lang).'">'.$langs->trans("Language_".$this->lang, '', '', '', '', 12).'</span>';
|
//$return .= '<br><span class="opacitymedium">'.$langs->trans("Language").'</span> : <span class="info-box-label" title="'.$langs->trans("Language_".$this->lang).'">'.$langs->trans("Language_".$this->lang, '', '', '', '', 12).'</span>';
|
||||||
$return .= picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow"');
|
$return .= '<br>'.picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow paddingrightonly"');
|
||||||
|
}
|
||||||
|
if (property_exists($this, 'question')) {
|
||||||
|
$return .= '<span class="info-box-label">'.dolGetFirstLineOfText($this->question).'</span>';
|
||||||
}
|
}
|
||||||
if (method_exists($this, 'getLibStatut')) {
|
if (method_exists($this, 'getLibStatut')) {
|
||||||
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
||||||
|
|||||||
@ -68,8 +68,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma');
|
|||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||||
|
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||||
$page = 0;
|
$page = 0;
|
||||||
} // If $page is not defined, or '' or -1 or if we click on clear filters
|
}
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@ -242,8 +243,11 @@ $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); // Note that $action and $object may have been modified by hook
|
||||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$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 ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
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.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||||
}
|
}
|
||||||
// Add table from hooks
|
// Add table from hooks
|
||||||
@ -268,7 +272,7 @@ foreach ($search as $key => $val) {
|
|||||||
$mode_search = 2;
|
$mode_search = 2;
|
||||||
}
|
}
|
||||||
if ($search[$key] != '') {
|
if ($search[$key] != '') {
|
||||||
$sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
$sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
|
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
|
||||||
@ -322,7 +326,7 @@ if ($search_all) {
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||||
// Add where from hooks
|
// Add where from hooks
|
||||||
$parameters = array();
|
$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;
|
$sql .= $hookmanager->resPrint;
|
||||||
|
|
||||||
/* If a group by is required
|
/* If a group by is required
|
||||||
@ -344,10 +348,18 @@ $sql=preg_replace('/,\s*$/','', $sql);
|
|||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
$resql = $db->query($sql);
|
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||||
$nbtotalofrecords = $db->num_rows($resql);
|
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||||
|
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||||
|
$resql = $db->query($sqlforcount);
|
||||||
|
if ($resql) {
|
||||||
|
$objforcount = $db->fetch_object($resql);
|
||||||
|
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, 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;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -397,12 +409,16 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
|||||||
$param .= '&limit='.urlencode($limit);
|
$param .= '&limit='.urlencode($limit);
|
||||||
}
|
}
|
||||||
foreach ($search as $key => $val) {
|
foreach ($search as $key => $val) {
|
||||||
if (is_array($search[$key]) && count($search[$key])) {
|
if (is_array($search[$key])) {
|
||||||
foreach ($search[$key] as $skey) {
|
foreach ($search[$key] as $skey) {
|
||||||
if ($skey != '') {
|
if ($skey != '') {
|
||||||
$param .= '&search_'.$key.'[]='.urlencode($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] != '') {
|
} elseif ($search[$key] != '') {
|
||||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||||
}
|
}
|
||||||
@ -424,14 +440,12 @@ $arrayofmassactions = array(
|
|||||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||||
);
|
);
|
||||||
if ($permissiontodelete) {
|
|
||||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isModEnabled('category') && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
|
if (isModEnabled('category') && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
|
||||||
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
|
||||||
}
|
}
|
||||||
|
if (!empty($permissiontodelete)) {
|
||||||
|
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||||
|
}
|
||||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||||
$arrayofmassactions = array();
|
$arrayofmassactions = array();
|
||||||
}
|
}
|
||||||
@ -446,12 +460,15 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
|||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
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="contextpage" value="'.$contextpage.'">';
|
||||||
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
|
|
||||||
$newcardbutton = '';
|
$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('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
$newcardbutton .= dolGetButtonTitle($langs->trans('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('/knowledgemanagement/knowledgerecord_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/knowledgemanagement/knowledgerecord_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, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
@ -491,7 +508,7 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$parameters = array();
|
$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)) {
|
if (empty($reshook)) {
|
||||||
$moreforfilter .= $hookmanager->resPrint;
|
$moreforfilter .= $hookmanager->resPrint;
|
||||||
} else {
|
} else {
|
||||||
@ -501,11 +518,14 @@ if (empty($reshook)) {
|
|||||||
if (!empty($moreforfilter)) {
|
if (!empty($moreforfilter)) {
|
||||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
print $moreforfilter;
|
print $moreforfilter;
|
||||||
|
$parameters = array('type'=>$type);
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
|
||||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
@ -514,31 +534,30 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
|||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre_filter">';
|
||||||
// Action column
|
// Action column
|
||||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch center">';
|
||||||
$searchpicto = $form->showFilterButtons('left');
|
$searchpicto = $form->showFilterButtons('left');
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$searchkey = empty($search[$key]) ? '' : $search[$key];
|
$searchkey = empty($search[$key]) ? '' : $search[$key];
|
||||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
if ($key == 'status') {
|
if ($key == 'status') {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
$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')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
|
||||||
|
|
||||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
|
||||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
|
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
|
||||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
|
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
|
||||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||||
@ -563,11 +582,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
|||||||
|
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields);
|
$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;
|
print $hookmanager->resPrint;
|
||||||
// Action column
|
// Action column
|
||||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre center maxwidthsearch">';
|
||||||
$searchpicto = $form->showFilterButtons();
|
$searchpicto = $form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -580,8 +599,9 @@ $totalarray['nbfield'] = 0;
|
|||||||
// Fields title label
|
// Fields title label
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
@ -591,34 +611,33 @@ foreach ($object->fields as $key => $val) {
|
|||||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
$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')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||||
}
|
}
|
||||||
$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
|
$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
|
||||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
// Hook fields
|
// 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); // Note that $action and $object may have been modified by hook
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
// Action column
|
// Action column
|
||||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
$totalarray['nbfield']++;
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
|
||||||
// Detect if we need a fetch on each output line
|
// Detect if we need a fetch on each output line
|
||||||
$needToFetchEachLine = 0;
|
$needToFetchEachLine = 0;
|
||||||
if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
||||||
if (preg_match('/\$object/', $val)) {
|
if ($val && preg_match('/\$object/', $val)) {
|
||||||
$needToFetchEachLine++; // There is at least one compute field that use $object
|
$needToFetchEachLine++; // There is at least one compute field that use $object
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -629,6 +648,7 @@ if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_a
|
|||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$savnbfield = $totalarray['nbfield'];
|
$savnbfield = $totalarray['nbfield'];
|
||||||
|
$totalarray = array();
|
||||||
$totalarray['nbfield'] = 0;
|
$totalarray['nbfield'] = 0;
|
||||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
while ($i < $imaxinloop) {
|
while ($i < $imaxinloop) {
|
||||||
@ -646,12 +666,7 @@ while ($i < $imaxinloop) {
|
|||||||
print '<div class="box-flex-container kanban">';
|
print '<div class="box-flex-container kanban">';
|
||||||
}
|
}
|
||||||
// Output Kanban
|
// Output Kanban
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
print $object->getKanbanView('');
|
||||||
if ($massactionbutton || $massaction) {
|
|
||||||
$selected = 0;
|
|
||||||
}
|
|
||||||
print $object->getKanbanView('');
|
|
||||||
}
|
|
||||||
if ($i == ($imaxinloop - 1)) {
|
if ($i == ($imaxinloop - 1)) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -661,7 +676,7 @@ while ($i < $imaxinloop) {
|
|||||||
$j = 0;
|
$j = 0;
|
||||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||||
// Action column
|
// Action column
|
||||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="nowrap center">';
|
print '<td class="nowrap center">';
|
||||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
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;
|
$selected = 0;
|
||||||
@ -671,6 +686,9 @@ while ($i < $imaxinloop) {
|
|||||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
@ -691,9 +709,9 @@ while ($i < $imaxinloop) {
|
|||||||
}
|
}
|
||||||
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '');
|
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
|
||||||
if (preg_match('/tdoverflow/', $cssforfield)) {
|
if (preg_match('/tdoverflow/', $cssforfield)) {
|
||||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
print ' title="'.dol_escape_htmltag(dol_nl2br($object->$key, 1)).'"'; // We add dol_nl2br for the question and answer fields
|
||||||
}
|
}
|
||||||
print '>';
|
print '>';
|
||||||
if ($key == 'status') {
|
if ($key == 'status') {
|
||||||
@ -737,6 +755,8 @@ while ($i < $imaxinloop) {
|
|||||||
$labellang = ($object->lang ? $langs->trans('Language_'.$object->lang) : '');
|
$labellang = ($object->lang ? $langs->trans('Language_'.$object->lang) : '');
|
||||||
print picto_from_langcode($object->lang, 'class="paddingrightonly saturatemedium opacitylow"');
|
print picto_from_langcode($object->lang, 'class="paddingrightonly saturatemedium opacitylow"');
|
||||||
print $labellang;
|
print $labellang;
|
||||||
|
} elseif ($key == 'question') {
|
||||||
|
print dolGetFirstLineOfText($object->$key);
|
||||||
} else {
|
} else {
|
||||||
print $object->showOutputField($val, $key, $object->$key, '');
|
print $object->showOutputField($val, $key, $object->$key, '');
|
||||||
}
|
}
|
||||||
@ -762,10 +782,10 @@ while ($i < $imaxinloop) {
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
$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;
|
print $hookmanager->resPrint;
|
||||||
// Action column
|
// Action column
|
||||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="nowrap center">';
|
print '<td class="nowrap center">';
|
||||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
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;
|
$selected = 0;
|
||||||
@ -775,9 +795,9 @@ while ($i < $imaxinloop) {
|
|||||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
if (!$i) {
|
||||||
if (!$i) {
|
$totalarray['nbfield']++;
|
||||||
$totalarray['nbfield']++;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|||||||
@ -388,7 +388,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
|||||||
dol_print_error($db);
|
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 the paging size (filtering), goto and load page 0
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -668,9 +668,6 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|||||||
}
|
}
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
$totalarray = array();
|
|
||||||
$totalarray['nbfield'] = 0;
|
|
||||||
|
|
||||||
// Detect if we need a fetch on each output line
|
// Detect if we need a fetch on each output line
|
||||||
$needToFetchEachLine = 0;
|
$needToFetchEachLine = 0;
|
||||||
if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||||
|
|||||||
@ -2398,7 +2398,7 @@ class Project extends CommonObject
|
|||||||
}
|
}
|
||||||
$return .= '</span>';
|
$return .= '</span>';
|
||||||
if (property_exists($this, 'date_start') && $this->date_start) {
|
if (property_exists($this, 'date_start') && $this->date_start) {
|
||||||
$return .= '<br><span class="info-box-label ">'.dol_print_date($this->date_start, 'day').'</>';
|
$return .= '<br><span class="info-box-label">'.dol_print_date($this->date_start, 'day').'</>';
|
||||||
}
|
}
|
||||||
if (property_exists($this, 'date_end') && $this->date_end) {
|
if (property_exists($this, 'date_end') && $this->date_end) {
|
||||||
if ($this->date_start) {
|
if ($this->date_start) {
|
||||||
@ -2406,7 +2406,7 @@ class Project extends CommonObject
|
|||||||
} else {
|
} else {
|
||||||
$return .= '<br>';
|
$return .= '<br>';
|
||||||
}
|
}
|
||||||
$return .= '<span class="info-box-label ">'.dol_print_date($this->date_end, 'day').'</>';
|
$return .= '<span class="info-box-label">'.dol_print_date($this->date_end, 'day').'</>';
|
||||||
}
|
}
|
||||||
/*if (property_exists($this, 'user_author_id')) {
|
/*if (property_exists($this, 'user_author_id')) {
|
||||||
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Author").'</span>';
|
$return .= '<br><span class="info-box-label opacitymedium">'.$langs->trans("Author").'</span>';
|
||||||
@ -2414,12 +2414,12 @@ class Project extends CommonObject
|
|||||||
}*/
|
}*/
|
||||||
if ($this->usage_opportunity && $this->opp_status_code) {
|
if ($this->usage_opportunity && $this->opp_status_code) {
|
||||||
//$return .= '<br><span class="info-bo-label opacitymedium">'.$langs->trans("OpportunityStatusShort").'</span>';
|
//$return .= '<br><span class="info-bo-label opacitymedium">'.$langs->trans("OpportunityStatusShort").'</span>';
|
||||||
$return .= '<br><span class="info-box-label ">'. $langs->trans("OppStatus".$this->opp_status_code);
|
$return .= '<br><span class="info-box-label">'. $langs->trans("OppStatus".$this->opp_status_code);
|
||||||
$return .= ' <span class="opacitymedium">('.round($this->opp_percent).'%)</span>';
|
$return .= ' <span class="opacitymedium">('.round($this->opp_percent).'%)</span>';
|
||||||
$return .= '</>';
|
$return .= '<br><span class="amount">'.price($this->opp_amount).'</span>';
|
||||||
}
|
}
|
||||||
if (method_exists($this, 'getLibStatut')) {
|
if (method_exists($this, 'getLibStatut')) {
|
||||||
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(5).'</div>';
|
||||||
}
|
}
|
||||||
$return .= '</div>';
|
$return .= '</div>';
|
||||||
$return .= '</div>';
|
$return .= '</div>';
|
||||||
|
|||||||
@ -6569,8 +6569,8 @@ select.multiselectononeline {
|
|||||||
.select2-container.select2-container--open .select2-dropdown.ui-dialog {
|
.select2-container.select2-container--open .select2-dropdown.ui-dialog {
|
||||||
min-width: 220px !important;
|
min-width: 220px !important;
|
||||||
}
|
}
|
||||||
.select2-container.select2-container--open .select2-dropdown--below,
|
.select2-container.select2-container--open .select2-dropdown--below:not(.onrightofpage),
|
||||||
.select2-container.select2-container--open .select2-dropdown--above {
|
.select2-container.select2-container--open .select2-dropdown--above:not(.onrightofpage) {
|
||||||
min-width: 220px !important;
|
min-width: 220px !important;
|
||||||
}
|
}
|
||||||
.onrightofpage span.select2-dropdown.ui-dialog.select2-dropdown--below,
|
.onrightofpage span.select2-dropdown.ui-dialog.select2-dropdown--below,
|
||||||
|
|||||||
@ -6464,8 +6464,9 @@ select.multiselectononeline {
|
|||||||
.select2-container.select2-container--open .select2-dropdown.ui-dialog {
|
.select2-container.select2-container--open .select2-dropdown.ui-dialog {
|
||||||
min-width: 220px !important;
|
min-width: 220px !important;
|
||||||
}
|
}
|
||||||
.select2-container.select2-container--open .select2-dropdown--below,
|
|
||||||
.select2-container.select2-container--open .select2-dropdown--above {
|
.select2-container.select2-container--open .select2-dropdown--below:not(.onrightofpage),
|
||||||
|
.select2-container.select2-container--open .select2-dropdown--above:not(.onrightofpage) {
|
||||||
min-width: 220px !important;
|
min-width: 220px !important;
|
||||||
}
|
}
|
||||||
.onrightofpage span.select2-dropdown.ui-dialog.select2-dropdown--below,
|
.onrightofpage span.select2-dropdown.ui-dialog.select2-dropdown--below,
|
||||||
|
|||||||
@ -3000,7 +3000,7 @@ class Ticket extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getKanbanView($option = '', $arraydata = null)
|
public function getKanbanView($option = '', $arraydata = null)
|
||||||
{
|
{
|
||||||
global $langs, $selected,$arrayofselected,$obj;
|
global $langs, $selected,$arrayofselected;
|
||||||
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||||
$return .= '<div class="info-box info-box-sm">';
|
$return .= '<div class="info-box info-box-sm">';
|
||||||
$return .= '<span class="info-box-icon bg-infobox-action">';
|
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||||
@ -3012,12 +3012,12 @@ class Ticket extends CommonObject
|
|||||||
$selected = 1;
|
$selected = 1;
|
||||||
}
|
}
|
||||||
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
if (property_exists($this, 'fk_user_assign') && !empty($this->fk_user_assign)) {
|
if (!empty($arraydata['user_assignment'])) {
|
||||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("AssignedTo").'</span> : <span class="info-box-label">'.$this->fk_user_assign.'</span>';
|
$return .= '<br><span class="info-box-label" title="'.dol_escape_htmltag($langs->trans("AssignedTo")).'">'.$arraydata['user_assignment'].'</span>';
|
||||||
}
|
}
|
||||||
if (property_exists($this, 'type_code') && !empty($this->type_code)) {
|
if (property_exists($this, 'type_code') && !empty($this->type_code)) {
|
||||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("Type").'</span> : ';
|
$return .= '<br>';
|
||||||
$return .= $langs->getLabelFromKey($this->db, 'TicketTypeShort'.$this->type_code, 'c_ticket_type', 'code', 'label', $this->type_code);
|
$return .= '<div class="tdoverflowmax125 inline-block">'.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$this->type_code, 'c_ticket_type', 'code', 'label', $this->type_code).'</div>';
|
||||||
}
|
}
|
||||||
if (method_exists($this, 'getLibStatut')) {
|
if (method_exists($this, 'getLibStatut')) {
|
||||||
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
||||||
|
|||||||
@ -49,6 +49,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected
|
|||||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ticketlist'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ticketlist'; // To manage different context of search
|
||||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||||
|
$mode = GETPOST('mode', 'alpha');
|
||||||
|
|
||||||
$id = GETPOST('id', 'int');
|
$id = GETPOST('id', 'int');
|
||||||
$msg_id = GETPOST('msg_id', 'int');
|
$msg_id = GETPOST('msg_id', 'int');
|
||||||
@ -65,8 +66,6 @@ $search_dateclose_start = dol_mktime(0, 0, 0, GETPOST('search_dateclose_startmon
|
|||||||
$search_dateclose_end = dol_mktime(23, 59, 59, GETPOST('search_dateclose_endmonth', 'int'), GETPOST('search_dateclose_endday', 'int'), GETPOST('search_dateclose_endyear', 'int'));
|
$search_dateclose_end = dol_mktime(23, 59, 59, GETPOST('search_dateclose_endmonth', 'int'), GETPOST('search_dateclose_endday', 'int'), GETPOST('search_dateclose_endyear', 'int'));
|
||||||
|
|
||||||
|
|
||||||
$mode = GETPOST('mode', 'alpha');
|
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
@ -136,11 +135,11 @@ $arrayfields = array();
|
|||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
// If $val['visible']==0, then we never show the field
|
// If $val['visible']==0, then we never show the field
|
||||||
if (!empty($val['visible'])) {
|
if (!empty($val['visible'])) {
|
||||||
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
|
$visible = (int) dol_eval($val['visible'], 1);
|
||||||
$arrayfields['t.'.$key] = array(
|
$arrayfields['t.'.$key] = array(
|
||||||
'label'=>$val['label'],
|
'label'=>$val['label'],
|
||||||
'checked'=>(($visible < 0) ? 0 : 1),
|
'checked'=>(($visible < 0) ? 0 : 1),
|
||||||
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
|
'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)),
|
||||||
'position'=>$val['position'],
|
'position'=>$val['position'],
|
||||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||||
);
|
);
|
||||||
@ -329,6 +328,8 @@ if (empty($reshook)) {
|
|||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
$formTicket = new FormTicket($db);
|
$formTicket = new FormTicket($db);
|
||||||
|
|
||||||
|
$now = dol_now();
|
||||||
|
|
||||||
$user_temp = new User($db);
|
$user_temp = new User($db);
|
||||||
$socstatic = new Societe($db);
|
$socstatic = new Societe($db);
|
||||||
|
|
||||||
@ -350,7 +351,7 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||||||
}
|
}
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
$parameters = array();
|
$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 .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
@ -471,7 +472,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
|||||||
dol_print_error($db);
|
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 the paging size (filtering), goto and load page 0
|
||||||
$page = 0;
|
$page = 0;
|
||||||
$offset = 0;
|
$offset = 0;
|
||||||
}
|
}
|
||||||
@ -504,7 +505,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
|||||||
// Output page
|
// Output page
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', '');
|
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
|
||||||
|
|
||||||
if ($socid && !$projectid && !$project_ref && $user->hasRight('societe', 'lire')) {
|
if ($socid && !$projectid && !$project_ref && $user->hasRight('societe', 'lire')) {
|
||||||
$socstat = new Societe($db);
|
$socstat = new Societe($db);
|
||||||
@ -642,9 +643,13 @@ foreach ($search as $key => $val) {
|
|||||||
if (is_array($search[$key])) {
|
if (is_array($search[$key])) {
|
||||||
foreach ($search[$key] as $skey) {
|
foreach ($search[$key] as $skey) {
|
||||||
if ($skey != '') {
|
if ($skey != '') {
|
||||||
$param .= (!empty($val)) ? '&search_'.$key.'[]='.urlencode($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] != '') {
|
} elseif ($search[$key] != '') {
|
||||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||||
}
|
}
|
||||||
@ -816,15 +821,16 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
|||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre_filter">';
|
||||||
// Action column
|
// Action column
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch center">';
|
||||||
$searchpicto = $form->showFilterButtons('left');
|
$searchpicto = $form->showFilterButtons('left');
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
|
$searchkey = empty($search[$key]) ? '' : $search[$key];
|
||||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
if ($key == 'fk_statut') {
|
if ($key == 'fk_statut') {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||||
@ -832,7 +838,7 @@ foreach ($object->fields as $key => $val) {
|
|||||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
$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')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||||
}
|
}
|
||||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||||
@ -865,7 +871,7 @@ foreach ($object->fields as $key => $val) {
|
|||||||
}
|
}
|
||||||
$arrayofstatus[$key2] = $val2;
|
$arrayofstatus[$key2] = $val2;
|
||||||
}
|
}
|
||||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
print '<td class="liste_titre center parentonrightofpage'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||||
//var_dump($arrayofstatus);
|
//var_dump($arrayofstatus);
|
||||||
//var_dump($search['fk_statut']);
|
//var_dump($search['fk_statut']);
|
||||||
//var_dump(array_values($search[$key]));
|
//var_dump(array_values($search[$key]));
|
||||||
@ -873,7 +879,7 @@ foreach ($object->fields as $key => $val) {
|
|||||||
if (!empty($search[$key])) {
|
if (!empty($search[$key])) {
|
||||||
$selectedarray = array_values($search[$key]);
|
$selectedarray = array_values($search[$key]);
|
||||||
}
|
}
|
||||||
print Form::multiselectarray('search_fk_statut', $arrayofstatus, $selectedarray, 0, 0, 'minwidth100imp maxwidth150', 1, 0, '', '', '');
|
print Form::multiselectarray('search_fk_statut', $arrayofstatus, $selectedarray, 0, 0, 'search_status width150 onrightofpage', 1, 0, '', '', '');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($key == "fk_soc") {
|
} elseif ($key == "fk_soc") {
|
||||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'"><input type="text" class="flat maxwidth75" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'"><input type="text" class="flat maxwidth75" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||||
@ -922,23 +928,26 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
|||||||
|
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields);
|
$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;
|
print $hookmanager->resPrint;
|
||||||
// Action column
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre center maxwidthsearch">';
|
||||||
$searchpicto = $form->showFilterButtons();
|
$searchpicto = $form->showFilterButtons();
|
||||||
print $searchpicto;
|
print $searchpicto;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
|
||||||
// Fields title label
|
// Fields title label
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
@ -948,30 +957,24 @@ foreach ($object->fields as $key => $val) {
|
|||||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
$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')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
$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 (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$totalarray = array(
|
|
||||||
'nbfield' => 0,
|
|
||||||
);
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||||
// Hook fields
|
// Hook fields
|
||||||
$parameters = array(
|
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
|
||||||
'arrayfields' => $arrayfields,
|
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
'param' => $param,
|
|
||||||
'sortfield' => $sortfield,
|
|
||||||
'sortorder' => $sortorder,
|
|
||||||
'totalarray' => &$totalarray,
|
|
||||||
);
|
|
||||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
|
||||||
print $hookmanager->resPrint;
|
print $hookmanager->resPrint;
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
@ -980,7 +983,7 @@ print '</tr>'."\n";
|
|||||||
$needToFetchEachLine = 0;
|
$needToFetchEachLine = 0;
|
||||||
if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
||||||
if (preg_match('/\$object/', $val)) {
|
if ($val && preg_match('/\$object/', $val)) {
|
||||||
$needToFetchEachLine++; // There is at least one compute field that use $object
|
$needToFetchEachLine++; // There is at least one compute field that use $object
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -990,12 +993,12 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
|
|||||||
// Loop on record
|
// Loop on record
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$savnbfield = $totalarray['nbfield'];
|
||||||
$totalarray = array();
|
$totalarray = array();
|
||||||
$totalarray['nbfield'] = 0;
|
$totalarray['nbfield'] = 0;
|
||||||
$now = dol_now();
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
|
|
||||||
$cacheofoutputfield = array();
|
$cacheofoutputfield = array();
|
||||||
while ($i < ($limit ? min($num, $limit) : $num)) {
|
while ($i < $imaxinloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if (empty($obj)) {
|
if (empty($obj)) {
|
||||||
break; // Should not happen
|
break; // Should not happen
|
||||||
@ -1003,43 +1006,45 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
|
|
||||||
// Store properties in $object
|
// Store properties in $object
|
||||||
$object->setVarsFromFetchObj($obj);
|
$object->setVarsFromFetchObj($obj);
|
||||||
|
$object->type_code = $obj->type_code;
|
||||||
$object->status = $object->fk_statut; // fk_statut is deprecated
|
$object->status = $object->fk_statut; // fk_statut is deprecated
|
||||||
|
|
||||||
if ($mode == 'kanban') {
|
if ($mode == 'kanban') {
|
||||||
if ($i == 0) {
|
if ($i == 0) {
|
||||||
print '<tr><td colspan="12">';
|
print '<tr><td colspan="'.$savnbfield.'">';
|
||||||
print '<div class="box-flex-container kanban">';
|
print '<div class="box-flex-container kanban">';
|
||||||
}
|
}
|
||||||
|
|
||||||
// get infos needed from object
|
// get infos needed from object
|
||||||
$userstatic = new User($db);
|
$data = array();
|
||||||
$userstatic->fetch($obj->fk_user_assign);
|
if ($obj->fk_user_assign > 0) {
|
||||||
$object->fk_user_assign = $userstatic->getNomUrl(-1);
|
$user_temp->fetch($obj->fk_user_assign);
|
||||||
$object->type_code = $obj->type_code;
|
$data['user_assignment'] = $user_temp->getNomUrl(-3);
|
||||||
// Output Kanban
|
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
|
||||||
if ($massactionbutton || $massaction) {
|
|
||||||
$selected = 0;
|
|
||||||
}
|
|
||||||
print $object->getKanbanView('');
|
|
||||||
}
|
}
|
||||||
if ($i == (min($num, $limit) - 1)) {
|
// Output Kanban
|
||||||
|
print $object->getKanbanView('', $data);
|
||||||
|
if ($i == ($imaxinloop - 1)) {
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Show here line of result
|
// Show here line of result
|
||||||
print '<tr class="oddeven">';
|
$j = 0;
|
||||||
|
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||||
// Action column
|
// Action column
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="nowrap center">';
|
print '<td class="nowrap center">';
|
||||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
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;
|
$selected = 0;
|
||||||
if (in_array($obj->rowid, $arrayofselected)) {
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
$selected = 1;
|
$selected = 1;
|
||||||
}
|
}
|
||||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
@ -1178,17 +1183,17 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
$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;
|
print $hookmanager->resPrint;
|
||||||
// Action column
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print '<td class="nowrap center">';
|
print '<td class="nowrap center">';
|
||||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
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;
|
$selected = 0;
|
||||||
if (in_array($obj->rowid, $arrayofselected)) {
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
$selected = 1;
|
$selected = 1;
|
||||||
}
|
}
|
||||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user