diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index 7d8861aded3..2e80a92acd1 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -183,7 +183,8 @@ if ($user->socid && $socid) {
*/
if (GETPOST('cancel', 'alpha')) {
- $mode = 'list'; $massaction = '';
+ $mode = 'list';
+ $massaction = '';
}
if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday")) {
@@ -268,7 +269,7 @@ if (empty($reshook)) {
}
/*
- * View
+ * View
*/
$form = new Form($db);
@@ -282,7 +283,8 @@ $nav .= ' trans("Agenda");
+llxHeader('', $title, $help_url);
// Define list of all external calendars
$listofextcals = array();
@@ -570,11 +572,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords++;
}*/
/* The fast and low memory method to get and count full list converts the sql into a sql count */
- $sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
+ $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
$resql = $db->query($sqlforcount);
$objforcount = $db->fetch_object($resql);
$nbtotalofrecords = $objforcount->nbtotalofrecords;
- if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
+ if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
$page = 0;
$offset = 0;
}
@@ -804,44 +806,57 @@ print '
';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print ' | ';
-print "\n";
+print ''."\n";
+$totalarray = array();
+$totalarray['nbfield'] = 0;
+
+// Fields title label
+// --------------------------------------------------------------------
print '';
if (!empty($arrayfields['a.id']['checked'])) {
print_liste_field_titre($arrayfields['a.id']['label'], $_SERVER["PHP_SELF"], "a.id", $param, "", "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['owner']['checked'])) {
print_liste_field_titre($arrayfields['owner']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['c.libelle']['checked'])) {
print_liste_field_titre($arrayfields['c.libelle']['label'], $_SERVER["PHP_SELF"], "c.libelle", $param, "", "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['a.label']['checked'])) {
print_liste_field_titre($arrayfields['a.label']['label'], $_SERVER["PHP_SELF"], "a.label", $param, "", "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['a.note']['checked'])) {
print_liste_field_titre($arrayfields['a.note']['label'], $_SERVER["PHP_SELF"], "a.note", $param, "", "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
//if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
if (!empty($arrayfields['a.datep']['checked'])) {
print_liste_field_titre($arrayfields['a.datep']['label'], $_SERVER["PHP_SELF"], "a.datep,a.id", $param, '', 'align="center"', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['a.datep2']['checked'])) {
print_liste_field_titre($arrayfields['a.datep2']['label'], $_SERVER["PHP_SELF"], "a.datep2", $param, '', 'align="center"', $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['s.nom']['checked'])) {
print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", $param, "", "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['a.fk_contact']['checked'])) {
print_liste_field_titre($arrayfields['a.fk_contact']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
if (!empty($arrayfields['a.fk_element']['checked'])) {
print_liste_field_titre($arrayfields['a.fk_element']['label'], $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
+ $totalarray['nbfield']++;
}
-
// 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); // Note that $action and $object may have been modified by hook
@@ -869,9 +884,21 @@ $caction = new CActionComm($db);
$arraylist = $caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), '', 1);
$contactListCache = array();
-while ($i < min($num, $limit)) {
+// Loop on record
+// --------------------------------------------------------------------
+$i = 0;
+//$savnbfield = $totalarray['nbfield'];
+//$totalarray['nbfield'] = 0;
+$imaxinloop = ($limit ? min($num, $limit) : $num);
+while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
-
+ if (empty($obj)) {
+ break; // Should not happen
+ }
+
+ // Store properties in $object
+ $object->setVarsFromFetchObj($obj);
+
// Discard auto action if option is on
if (!empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO) && $obj->type_code == 'AC_OTH_AUTO') {
$i++;
@@ -1087,12 +1114,20 @@ while ($i < min($num, $limit)) {
}
print '';
- print "
\n";
+ print ''."\n";
+
$i++;
}
-print "";
-print '';
-print '';
+// If no record found
+if ($num == 0) {
+ print '| '.$langs->trans("NoRecordFound").' |
';
+}
+
+
+print ''."\n";
+print ''."\n";
+
+print ''."\n";
$db->free($resql);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 31f69878dda..8a3093b0f0a 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1279,7 +1279,6 @@ class Form
// mode 1
$urloption = 'htmlname='.urlencode(str_replace('.', '_', $htmlname)).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '');
- $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
$out .= '';
if (empty($hidelabel)) {
@@ -1294,6 +1293,8 @@ class Form
if ($hidelabel == 3) {
$out .= img_picto($langs->trans("Search"), 'search');
}
+
+ $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
} else {
// Immediate load of all database
$out .= $this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam, $multiple, $excludeids);
@@ -9435,7 +9436,6 @@ class Form
if ($resql) {
// Enhance with select2
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
- $out .= ajax_combobox($htmlname);
$out .= '';
+
+ $out .= ajax_combobox($htmlname);
} else {
dol_print_error($this->db);
}
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index 27a8c9de3eb..47bbdec0fb2 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -191,14 +191,9 @@ class FormProjets
$resql = $this->db->query($sql);
if ($resql) {
- // Use select2 selector
if (!empty($conf->use_javascript_ajax)) {
- include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
- $comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus);
- $out .= $comboenhancement;
$morecss .= ' minwidth100';
}
-
if (empty($option_only)) {
$out .= '';
}
+
+ // Use select2 selector
+ if (!empty($conf->use_javascript_ajax)) {
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
+ $comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus);
+ $out .= $comboenhancement;
+ $morecss .= ' minwidth100';
+ }
+
if (empty($nooutput)) {
print $out;
return '';
diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php
index 488010609f9..6feee8c35d5 100644
--- a/htdocs/core/lib/agenda.lib.php
+++ b/htdocs/core/lib/agenda.lib.php
@@ -71,25 +71,24 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if ($canedit) {
print '';
-
// Type
$multiselect = 0;
if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) { // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
$multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
}
- print img_picto($langs->trans("ActionType"), 'square', 'class="fawidth30 inline-block" style="color: #ddd;"');
- print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0, 'maxwidth500');
+ print img_picto($langs->trans("ActionType"), 'square', 'class="pictofixedwidth inline-block" style="color: #ddd;"');
+ print $formactions->select_type_actions($actioncode, "search_actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 0, $multiselect, 0, 'maxwidth500 widthcentpercentminusx');
print '
';
// Assigned to user
print '';
- print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="fawidth30 inline-block"');
+ print img_picto($langs->trans("ActionsToDoBy"), 'user', 'class="pictofixedwidth inline-block"');
print $form->select_dolusers($filtert, 'search_filtert', 1, '', !$canedit, '', '', 0, 0, 0, '', 0, '', 'minwidth150 maxwidth500 widthcentpercentminusxx');
print '
';
// Assigned to user group
print '';
- print img_picto($langs->trans("ToUserOfGroup"), 'object_group', 'class="fawidth30 inline-block"');
+ print img_picto($langs->trans("ToUserOfGroup"), 'object_group', 'class="pictofixedwidth inline-block"');
print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit, '', '', '0', false, 'minwidth100 maxwidth500 widthcentpercentminusxx');
print '
';
@@ -99,7 +98,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
// Resource
print '';
- print img_picto($langs->trans("Resource"), 'object_resource', 'class="fawidth30 inline-block"');
+ print img_picto($langs->trans("Resource"), 'object_resource', 'class="pictofixedwidth inline-block"');
print $formresource->select_resource_list($resourceid, "search_resourceid", '', 1, 0, 0, null, '', 2, 0, 'maxwidth500');
print '
';
}
@@ -107,7 +106,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) {
print '';
- print img_picto($langs->trans("ThirdParty"), 'company', 'class="fawidth30 inline-block"');
+ print img_picto($langs->trans("ThirdParty"), 'company', 'class="pictofixedwidth inline-block"');
print $form->select_company($socid, 'search_socid', '', ' ', 0, 0, null, 0, 'minwidth100 maxwidth500');
print '
';
}
@@ -117,7 +116,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
$formproject = new FormProjets($db);
print '';
- print img_picto($langs->trans("Project"), 'project', 'class="fawidth30 inline-block"');
+ print img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth inline-block"');
print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500');
print '
';
}
@@ -125,7 +124,7 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
if ($canedit && !preg_match('/list/', $_SERVER["PHP_SELF"])) {
// Status
print '';
- print img_picto($langs->trans("Status"), 'setup', 'class="fawidth30 inline-block"');
+ print img_picto($langs->trans("Status"), 'setup', 'class="pictofixedwidth inline-block"');
$formactions->form_select_status_action('formaction', $status, 1, 'search_status', 1, 2, 'minwidth100');
print '
';
}
diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php
index 705c3a70788..8b4e32c05d2 100644
--- a/htdocs/resource/class/html.formresource.class.php
+++ b/htdocs/resource/class/html.formresource.class.php
@@ -101,13 +101,6 @@ class FormResource
}
if ($resourcestat) {
- if (!empty($conf->use_javascript_ajax) && !empty($conf->global->RESOURCE_USE_SEARCH_TO_SELECT) && !$forcecombo) {
- //$minLength = (is_numeric($conf->global->RESOURCE_USE_SEARCH_TO_SELECT)?$conf->global->RESOURCE_USE_SEARCH_TO_SELECT:2);
- $out .= ajax_combobox($htmlname, $event, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT);
- } else {
- $out .= ajax_combobox($htmlname);
- }
-
// Construct $out and $outarray
$out .= ''."\n";
+ if (!empty($conf->use_javascript_ajax) && !empty($conf->global->RESOURCE_USE_SEARCH_TO_SELECT) && !$forcecombo) {
+ //$minLength = (is_numeric($conf->global->RESOURCE_USE_SEARCH_TO_SELECT)?$conf->global->RESOURCE_USE_SEARCH_TO_SELECT:2);
+ $out .= ajax_combobox($htmlname, $event, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT);
+ } else {
+ $out .= ajax_combobox($htmlname);
+ }
+
if ($outputmode != 2) {
$out .= ' ';