diff --git a/build/debian/dolibarr.postinst b/build/debian/dolibarr.postinst
index 0f99f53203b..8a6078af377 100644
--- a/build/debian/dolibarr.postinst
+++ b/build/debian/dolibarr.postinst
@@ -129,7 +129,7 @@ case "$1" in
then
# Create an empty conf.php with permission to web server
setup_empty_conf
- else
+ #else
# File already exist. We add params not found.
#echo Add new params to overwrite path to use shared libraries/fonts
#grep -q -c "dolibarr_lib_ADODB_PATH" $config || [ ! -d "/usr/share/php/adodb" ] || echo "" >> $config
diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss
index 0037e091973..da727786896 100644
--- a/build/exe/doliwamp/doliwamp.iss
+++ b/build/exe/doliwamp/doliwamp.iss
@@ -32,7 +32,7 @@ AppPublisherURL=http://www.nltechno.com
AppSupportURL=http://www.dolibarr.org
AppUpdatesURL=http://www.dolibarr.org
AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares.
-AppCopyright=Copyright (C) 2008-2013 Laurent Destailleur, NLTechno
+AppCopyright=Copyright (C) 2008-2014 Laurent Destailleur, NLTechno
DefaultDirName=c:\dolibarr
DefaultGroupName=Dolibarr
;LicenseFile=COPYING
diff --git a/htdocs/cashdesk/affContenu.php b/htdocs/cashdesk/affContenu.php
index ca471e0bdf4..543006baedf 100644
--- a/htdocs/cashdesk/affContenu.php
+++ b/htdocs/cashdesk/affContenu.php
@@ -55,6 +55,8 @@ print '';
print '
';
$page=GETPOST('menu','alpha');
+if (empty($page)) $page='facturation';
+
if (in_array(
$page,
array(
diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php
index def98b25ae8..30e0211ece1 100644
--- a/htdocs/core/ajax/ziptown.php
+++ b/htdocs/core/ajax/ziptown.php
@@ -65,9 +65,10 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
$sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country";
$sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country";
$sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county";
- $sql.= " FROM (".MAIN_DB_PREFIX."c_ziptown as z,".MAIN_DB_PREFIX."c_country as c)";
+ $sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid";
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,";
+ $sql.= " ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE z.fk_pays = c.rowid";
$sql.= " AND z.active = 1 AND c.active = 1";
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
@@ -81,8 +82,8 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
$sql.= ", c.code as country_code, c.label as country";
$sql.= ", d.code_departement as county_code , d.nom as county";
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON fk_departement = d.rowid";
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON fk_pays = c.rowid';
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
$sql.= " WHERE";
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index af71662b3a5..9d15e3d57c8 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -48,7 +48,7 @@ abstract class CommonObject
public $array_options=array();
public $thirdparty;
-
+
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
public $linkedObjects; // Loaded by ->fetchObjectLinked
@@ -2784,7 +2784,7 @@ abstract class CommonObject
// Price HT
print '
';
- if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '
';
+ if ($inputalsopricewithtax) print '
';
// Qty
print '
';
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index 01ff6774fc3..6593b2d896b 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -298,6 +298,9 @@ class DoliDBPgsql extends DoliDB
$line=str_replace(' LIKE \'',' ILIKE \'',$line);
$line=str_replace(' LIKE BINARY \'',' LIKE \'',$line);
+ // Replace INSERT IGNORE into INSERT
+ $line=preg_replace('/^INSERT IGNORE/','INSERT',$line);
+
// Delete using criteria on other table must not declare twice the deleted table
// DELETE FROM tabletodelete USING tabletodelete, othertable -> DELETE FROM tabletodelete USING othertable
if (preg_match('/DELETE FROM ([a-z_]+) USING ([a-z_]+), ([a-z_]+)/i',$line,$reg))
diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php
index e68fe78bc87..79ceb73d05a 100644
--- a/htdocs/core/lib/ajax.lib.php
+++ b/htdocs/core/lib/ajax.lib.php
@@ -25,8 +25,9 @@
/**
- * Get value of an HTML field, do Ajax process and show result.
+ * Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: /societe/ajaxcompanies.php).
* The HTML field must be an input text with id=search_$htmlname.
+ * This use the jQuery "autocomplete" function.
*
* @param string $selected Preselecte value
* @param string $htmlname HTML name of input field
@@ -34,7 +35,7 @@
* @param string $urloption More parameters on URL request
* @param int $minLength Minimum number of chars to trigger that Ajax search
* @param int $autoselect Automatic selection if just one value
- * @param array $ajaxoptions Multiple options array (Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done
+ * @param array $ajaxoptions Multiple options array (Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done)
* @return string Script
*/
function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array())
@@ -182,25 +183,28 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
}
/**
- * Get value of field, do Ajax process and return result
+ * Generic function that return javascript to add to a page to transform a common input field into an autocomplete field by calling an Ajax page (ex: core/ajax/ziptown.php).
+ * The Ajax page can also returns several values (json format) to fill several input fields.
+ * The HTML field must be an input text with id=$htmlname.
+ * This use the jQuery "autocomplete" function.
*
- * @param string $htmlname Name of field
- * @param string $fields other fields to autocomplete
- * @param string $url Chemin du fichier de reponse : /chemin/fichier.php
+ * @param string $htmlname HTML name of input field
+ * @param string $fields Other fields to autocomplete
+ * @param string $url URL for ajax request : /chemin/fichier.php
* @param string $option More parameters on URL request
* @param int $minLength Minimum number of chars to trigger that Ajax search
* @param int $autoselect Automatic selection if just one value
* @return string Script
*/
-function ajax_multiautocompleter($htmlname,$fields,$url,$option='',$minLength=2,$autoselect=0)
+function ajax_multiautocompleter($htmlname, $fields, $url, $option='', $minLength=2, $autoselect=0)
{
$script = ''."\n";
$script.= '