diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index 313a852e384..75c82157ddf 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -70,18 +70,8 @@ else if ($action == 'update')
$res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
$coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha');
$res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
-}
-else if ($action == 'updateengine')
-{
- // TODO Update engines.
-
-}
-
-if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
-{
- if (! $res > 0) $error++;
-
- if (! $error)
+
+ if ($res > 0)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
@@ -90,6 +80,42 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
+else if ($action == 'updateengine')
+{
+ $sql = "SELECT rowid, coder";
+ $sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
+ $sql.= " WHERE entity = ".$conf->entity;
+ $sql.= " ORDER BY code";
+
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $num = $db->num_rows($resql);
+ $i = 0;
+
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+
+ if (GETPOST('coder'.$obj->rowid, 'alpha'))
+ {
+ $coder = GETPOST('coder'.$obj->rowid,'alpha');
+ $code_id = $obj->rowid;
+
+ $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
+ $sqlp.= " SET coder = '" . $coder."'";
+ $sqlp.= " WHERE rowid = ". $code_id;
+ $sqlp.= " AND entity = ".$conf->entity;
+
+ $upsql=$db->query($sqlp);
+ if (! $upsql) dol_print_error($db);
+ }
+
+ $i++;
+ }
+ }
+
+}
/*
* View
@@ -162,9 +188,12 @@ $var=true;
print '
';
print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'','');
-//print "
';
}
-//print '';
print "
";
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index c63467390b4..3e7fb384011 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -302,6 +302,8 @@ if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
if (strlen($search_zip)) $sql.= natural_search("p.zip",$search_zip);
+if (strlen($search_town)) $sql.= natural_search("p.town",$search_town);
+
if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status);
if ($search_import_key) $sql.= natural_search("p.import_key",$search_import_key);
if ($type == "o") // filtre sur type
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 4d72b576429..04c16c75fe0 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -172,7 +172,7 @@ if ($type == 'directory')
$sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC);
// Right area. If module is defined here, we are in automatic ecm.
- $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport');
+ $automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport', 'holiday');
// TODO change for multicompany sharing
// Auto area for suppliers invoices
@@ -203,6 +203,8 @@ if ($type == 'directory')
else if ($module == 'user') $upload_dir = $conf->user->dir_output;
// Auto area for expense report
else if ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
+ // Auto area for holiday
+ else if ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
// Automatic list
if (in_array($module, $automodules))
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 3eb96cf7e6f..bc9aa55f6f6 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -16,6 +16,7 @@
* Copyright (C) 2012 Cedric Salvador
* Copyright (C) 2012-2015 Raphaël Doursenaud
* Copyright (C) 2014 Alexandre Spangaro
+ * Copyright (C) 2018 Nicolas ZABOURI
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -3791,7 +3792,7 @@ class Form
if ($("#" + inputname).attr("type") == "radio") { more = ":checked"; }
var inputvalue = $("#" + inputname + more).val();
if (typeof inputvalue == "undefined") { inputvalue=""; }
- options += "&" + inputname + "=" + inputvalue;
+ options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
});
}
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index bd22470d952..9f4b9e0da89 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -321,7 +321,7 @@ class FormActions
{
global $langs,$user,$form,$conf;
- if (! is_object($form)) $form=new Form($db);
+ if (! is_object($form)) $form=new Form($this->db);
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
@@ -346,7 +346,7 @@ class FormActions
}
else
{
- $out.=$form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', '', 1);
+ $out.=$form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200', 1);
}
if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0)
diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php
index e1ee7ae04ff..d155c8a1a0c 100644
--- a/htdocs/core/class/html.formbarcode.class.php
+++ b/htdocs/core/class/html.formbarcode.class.php
@@ -59,7 +59,7 @@ class FormBarCode
$disable = '';
- if ($conf->use_javascript_ajax)
+ if (!empty($conf->use_javascript_ajax))
{
print "\n".'