diff --git a/htdocs/categories/info.php b/htdocs/categories/info.php index f5f63091f9c..382442030e1 100644 --- a/htdocs/categories/info.php +++ b/htdocs/categories/info.php @@ -74,7 +74,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans($title), -1, 'category'); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.urlencode($type)); $linkback = ''.$langs->trans("BackToList").''; -$object->next_prev_filter = ' type = '.$object->type; +$object->next_prev_filter = 'type = '.((int) $object->type); $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index bd98afb87f7..ab47eb0088d 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -111,7 +111,7 @@ if ($object->id) { $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.urlencode($type)); $linkback = ''.$langs->trans("BackToList").''; - $object->next_prev_filter = ' type = '.$object->type; + $object->next_prev_filter = 'type = '.((int) $object->type); $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index b63431780e7..9791cdeb5be 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -189,7 +189,7 @@ print dol_get_fiche_head($head, 'translation', $langs->trans($title), -1, 'categ $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.urlencode($type)); $linkback = ''.$langs->trans("BackToList").''; -$object->next_prev_filter = ' type = '.$object->type; +$object->next_prev_filter = 'type = '.((int) $object->type); $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 2791cf1556a..707c23dfe5e 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -257,7 +257,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans($title), -1, 'category'); $backtolist = (GETPOST('backtolist') ? GETPOST('backtolist') : DOL_URL_ROOT.'/categories/index.php?leftmenu=cat&type='.urlencode($type)); $linkback = ''.$langs->trans("BackToList").''; -$object->next_prev_filter = ' type = '.$object->type; +$object->next_prev_filter = 'type = '.((int) $object->type); $object->ref = $object->label; $morehtmlref = '
'.$langs->trans("Root").' >> '; $ways = $object->print_all_ways(" >> ", '', 1); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 067cbce8efe..8fd0fcf726d 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -713,9 +713,10 @@ if ($object->fetch($id) >= 0) { print ''; //Statut - print ''; - print $formmailing->selectDestinariesStatus($search_dest_status, 'search_dest_status', 1); + print ''; + print $formmailing->selectDestinariesStatus($search_dest_status, 'search_dest_status', 1, 'width100 onrightofpage'); print ''; + // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; @@ -739,12 +740,12 @@ if ($object->fetch($id) >= 0) { print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "mc.lastname", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "mc.firstname", $param, "", "", $sortfield, $sortorder); print_liste_field_titre("OtherInformations", $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder); - print_liste_field_titre("Source", $_SERVER["PHP_SELF"], "", $param, "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("Source", $_SERVER["PHP_SELF"], "", $param, "", '', $sortfield, $sortorder, 'center '); // Date last update - print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "mc.tms", $param, "", 'align="center"', $sortfield, $sortorder); + print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "mc.tms", $param, "", '', $sortfield, $sortorder, 'center '); // Date sending - print_liste_field_titre("DateSending", $_SERVER["PHP_SELF"], "mc.date_envoi", $param, '', 'align="center"', $sortfield, $sortorder); - print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "mc.statut", $param, '', 'class="right"', $sortfield, $sortorder); + print_liste_field_titre("DateSending", $_SERVER["PHP_SELF"], "mc.date_envoi", $param, '', '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "mc.statut", $param, '', '', $sortfield, $sortorder, 'center '); // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch '); @@ -830,22 +831,22 @@ if ($object->fetch($id) >= 0) { print dol_print_date(dol_stringtotime($obj->tms), 'dayhour'); print ''; - // Status of recipient sending email (Warning != status of emailing) - if ($obj->statut == $object::STATUS_DRAFT) { + // Date sent + print ''; + if ($obj->statut != $object::STATUS_DRAFT) { // Date sent - print ''; - - print ''; - print $object::libStatutDest($obj->statut, 2, ''); - print ''; - } else { - // Date sent - print ''.$obj->date_envoi.''; - - print ''; - print $object::libStatutDest($obj->statut, 2, $obj->error_text); - print ''; + print $obj->date_envoi; } + print ''; + + // Status of recipient sending email (Warning != status of emailing) + print ''; + if ($obj->statut == $object::STATUS_DRAFT) { + print $object::libStatutDest($obj->statut, 2, ''); + } else { + print $object::libStatutDest($obj->statut, 2, $obj->error_text); + } + print ''; // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 2a3512a9b70..54d9441a489 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -223,11 +223,11 @@ class Mailing extends CommonObject $this->statuts[2] = 'MailingStatusSentPartialy'; $this->statuts[3] = 'MailingStatusSentCompletely'; - $this->statut_dest[-1] = 'MailingStatusError'; $this->statut_dest[0] = 'MailingStatusNotSent'; $this->statut_dest[1] = 'MailingStatusSent'; $this->statut_dest[2] = 'MailingStatusRead'; $this->statut_dest[3] = 'MailingStatusReadAndUnsubscribe'; // Read but ask to not be contacted anymore + $this->statut_dest[-1] = 'MailingStatusError'; } /** diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index c0fd5d133b5..252d10e731f 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -111,8 +111,8 @@ $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'alpha'); +$search_customer_code = GETPOST("search_customer_code", 'alphanohtml'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); -$search_company_code_client = GETPOST("search_type_thirdparty", 'alpha'); $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); $search_date_startday = GETPOST('search_date_startday', 'int'); @@ -348,6 +348,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $search_state = ""; $search_country = ''; $search_type_thirdparty = ''; + $search_customer_code = ''; $search_date_startday = ''; $search_date_startmonth = ''; $search_date_startyear = ''; @@ -697,8 +698,8 @@ if (empty($arrayfields['s.name_alias']['checked']) && $search_company) { if ($search_parent_name) { $sql .= natural_search('s2.nom', $search_parent_name); } -if ($search_company_code_client) { - $sql .= natural_search('s.code_client', $search_company_code_client); +if ($search_customer_code) { + $sql .= natural_search('s.code_client', $search_customer_code); } if ($search_town) { $sql .= natural_search('s.town', $search_town); @@ -1093,6 +1094,9 @@ if ($resql) { if ($search_type_thirdparty != '') { $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty); } + if ($search_customer_code) { + $param .= '&search_customer_code='.urlencode($search_customer_code); + } if ($search_sale > 0) { $param .= '&search_sale='.urlencode($search_sale); } @@ -1422,7 +1426,7 @@ if ($resql) { } // Customer Code if (!empty($arrayfields['s.code_client']['checked'])) { - print ''; + print ''; } // Town if (!empty($arrayfields['s.town']['checked'])) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 348bba8064d..da18035e1ee 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2090,7 +2090,8 @@ abstract class CommonObject /** * Load properties id_previous and id_next by comparing $fieldid with $this->ref * - * @param string $filter Optional filter. Example: " AND (t.field1 = 'aa' OR t.field2 = 'bb')". Do not allow user input data here. + * @param string $filter Optional SQL filter. Example: "(t.field1 = 'aa' OR t.field2 = 'bb')". Do not allow user input data here. + * Use SQL and not Universal Search Filter. @TODO Replace this with an USF string after changing all ->next_prev_filter * @param string $fieldid Name of field to use for the select MAX and MIN * @param int $nodbprefix Do not include DB prefix to forge table name * @return int <0 if KO, >0 if OK @@ -2155,7 +2156,7 @@ abstract class CommonObject } if (!empty($filter)) { if (!preg_match('/^\s*AND/i', $filter)) { - $sql .= " AND "; // For backward compatibility + $sql .= " AND "; } $sql .= $filter; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ad8b034f9d7..4af7a99bd07 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4622,20 +4622,20 @@ class Form } /** - * Return a HTML select list of shipping mode + * Return a HTML select list of shipping mode * - * @param string $selected Id shipping mode pre-selected - * @param string $htmlname Name of select zone - * @param string $filtre To filter list. This parameter must not come from input of users - * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. - * @param string $moreattrib To add more attribute on select - * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info - * @param string $morecss More CSS - * @return void + * @param string $selected Id shipping mode pre-selected + * @param string $htmlname Name of select zone + * @param string $filtre To filter list. This parameter must not come from input of users + * @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. + * @param string $moreattrib To add more attribute on select + * @param int $noinfoadmin 0=Add admin info, 1=Disable admin info + * @param string $morecss More CSS + * @return void */ public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0, $morecss = '') { - global $langs, $conf, $user; + global $langs, $user; $langs->load("admin"); $langs->load("deliveries"); @@ -8241,7 +8241,7 @@ class Form } } $idname = str_replace(array('[', ']'), array('', ''), $htmlname); - $out .= '