From f08ce6d96adc78d8e04ab32828c3c13c5b82f497 Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 21 May 2013 14:28:42 +0200 Subject: [PATCH 01/18] Fix bug on DDLCreateDb in Mysql --- htdocs/core/db/mysql.class.php | 35 ++++++++++++++++------------ htdocs/core/db/mysqli.class.php | 41 ++++++++++++++++++--------------- 2 files changed, 43 insertions(+), 33 deletions(-) diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 81d5d7de4ff..66024689c4f 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -884,22 +884,27 @@ class DoliDBMysql { $sqlfields[$i] = $field_name." "; $sqlfields[$i] .= $field_desc['type']; - if( preg_match("/^[^\s]/i",$field_desc['value'])) - $sqlfields[$i] .= "(".$field_desc['value'].")"; - else if( preg_match("/^[^\s]/i",$field_desc['attribute'])) - $sqlfields[$i] .= " ".$field_desc['attribute']; - else if( preg_match("/^[^\s]/i",$field_desc['default'])) - { - if(preg_match("/null/i",$field_desc['default'])) - $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; + if( preg_match("/^[^\s]/i",$field_desc['value'])) { + $sqlfields[$i] .= "(".$field_desc['value'].")"; + } + if( preg_match("/^[^\s]/i",$field_desc['attribute'])) { + $sqlfields[$i] .= " ".$field_desc['attribute']; + } + if( preg_match("/^[^\s]/i",$field_desc['default'])) + { + if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) { + $sqlfields[$i] .= " default ".$field_desc['default']; + } + else { + $sqlfields[$i] .= " default '".$field_desc['default']."'"; + } + } + if( preg_match("/^[^\s]/i",$field_desc['null'])) { + $sqlfields[$i] .= " ".$field_desc['null']; + } + if( preg_match("/^[^\s]/i",$field_desc['extra'])) { + $sqlfields[$i] .= " ".$field_desc['extra']; } - else if( preg_match("/^[^\s]/i",$field_desc['null'])) - $sqlfields[$i] .= " ".$field_desc['null']; - - else if( preg_match("/^[^\s]/i",$field_desc['extra'])) - $sqlfields[$i] .= " ".$field_desc['extra']; $i++; } if($primary_key != "") diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index ba24d5c53bf..95a9a24384c 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -876,24 +876,29 @@ class DoliDBMysqli $i=0; foreach($fields as $field_name => $field_desc) { - $sqlfields[$i] = $field_name." "; - $sqlfields[$i] .= $field_desc['type']; - if( preg_match("/^[^\s]/i",$field_desc['value'])) - $sqlfields[$i] .= "(".$field_desc['value'].")"; - else if( preg_match("/^[^\s]/i",$field_desc['attribute'])) - $sqlfields[$i] .= " ".$field_desc['attribute']; - else if( preg_match("/^[^\s]/i",$field_desc['default'])) - { - if(preg_match("/null/i",$field_desc['default'])) - $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; - } - else if( preg_match("/^[^\s]/i",$field_desc['null'])) - $sqlfields[$i] .= " ".$field_desc['null']; - - else if( preg_match("/^[^\s]/i",$field_desc['extra'])) - $sqlfields[$i] .= " ".$field_desc['extra']; + $sqlfields[$i] = $field_name." "; + $sqlfields[$i] .= $field_desc['type']; + if( preg_match("/^[^\s]/i",$field_desc['value'])) { + $sqlfields[$i] .= "(".$field_desc['value'].")"; + } + if( preg_match("/^[^\s]/i",$field_desc['attribute'])) { + $sqlfields[$i] .= " ".$field_desc['attribute']; + } + if( preg_match("/^[^\s]/i",$field_desc['default'])) + { + if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) { + $sqlfields[$i] .= " default ".$field_desc['default']; + } + else { + $sqlfields[$i] .= " default '".$field_desc['default']."'"; + } + } + if( preg_match("/^[^\s]/i",$field_desc['null'])) { + $sqlfields[$i] .= " ".$field_desc['null']; + } + if( preg_match("/^[^\s]/i",$field_desc['extra'])) { + $sqlfields[$i] .= " ".$field_desc['extra']; + } $i++; } if($primary_key != "") From 13ad88832c3413155bc21970db8005b3cc0c28e7 Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 21 May 2013 14:31:39 +0200 Subject: [PATCH 02/18] Fix bug in DDLCreateTable --- htdocs/core/db/mysql.class.php | 23 +++++++++------- htdocs/core/db/mysqli.class.php | 48 ++++++++++++++++----------------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 4868fb81642..287fba04bcc 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -879,30 +879,33 @@ class DoliDBMysql { // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); - $sql = "create table ".$table."("; + $sql = "CREATE TABLE ".$table."("; $i=0; foreach($fields as $field_name => $field_desc) { $sqlfields[$i] = $field_name." "; $sqlfields[$i] .= $field_desc['type']; - if( preg_match("/^[^\s]/i",$field_desc['value'])) + if( preg_match("/^[^\s]/i",$field_desc['value'])) { $sqlfields[$i] .= "(".$field_desc['value'].")"; - if( preg_match("/^[^\s]/i",$field_desc['attribute'])) + } + if( preg_match("/^[^\s]/i",$field_desc['attribute'])) { $sqlfields[$i] .= " ".$field_desc['attribute']; + } if( preg_match("/^[^\s]/i",$field_desc['default'])) { - if(preg_match("/null/i",$field_desc['default'])) + if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) { $sqlfields[$i] .= " default ".$field_desc['default']; - elseif ($field_desc['default'] == 'CURRENT_TIMESTAMP') - $sqlfields[$i] .= " default ".$field_desc['default']; - else + } + else { $sqlfields[$i] .= " default '".$field_desc['default']."'"; + } } - if( preg_match("/^[^\s]/i",$field_desc['null'])) + if( preg_match("/^[^\s]/i",$field_desc['null'])) { $sqlfields[$i] .= " ".$field_desc['null']; - - if( preg_match("/^[^\s]/i",$field_desc['extra'])) + } + if( preg_match("/^[^\s]/i",$field_desc['extra'])) { $sqlfields[$i] .= " ".$field_desc['extra']; + } $i++; } if($primary_key != "") diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index e7ccebbd0ee..2ae51e7def5 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -873,33 +873,33 @@ class DoliDBMysqli { // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); - $sql = "create table ".$table."("; + $sql = "CREATE TABLE ".$table."("; $i=0; foreach($fields as $field_name => $field_desc) { - $sqlfields[$i] = $field_name." "; - $sqlfields[$i] .= $field_desc['type']; - - if( preg_match("/^[^\s]/i",$field_desc['value'])) - $sqlfields[$i] .= "(".$field_desc['value'].")"; - - if( preg_match("/^[^\s]/i",$field_desc['attribute'])) - $sqlfields[$i] .= " ".$field_desc['attribute']; - - if( preg_match("/^[^\s]/i",$field_desc['default'])) - { - if(preg_match("/null/i",$field_desc['default'])) - $sqlfields[$i] .= " default ".$field_desc['default']; - elseif ($field_desc['default'] == 'CURRENT_TIMESTAMP') - $sqlfields[$i] .= " default ".$field_desc['default']; - else - $sqlfields[$i] .= " default '".$field_desc['default']."'"; - } - if( preg_match("/^[^\s]/i",$field_desc['null'])) - $sqlfields[$i] .= " ".$field_desc['null']; - - if( preg_match("/^[^\s]/i",$field_desc['extra'])) - $sqlfields[$i] .= " ".$field_desc['extra']; + $sqlfields[$i] = $field_name." "; + $sqlfields[$i] .= $field_desc['type']; + if( preg_match("/^[^\s]/i",$field_desc['value'])) { + $sqlfields[$i] .= "(".$field_desc['value'].")"; + } + if( preg_match("/^[^\s]/i",$field_desc['attribute'])) { + $sqlfields[$i] .= " ".$field_desc['attribute']; + } + if( preg_match("/^[^\s]/i",$field_desc['default'])) + { + if ((preg_match("/null/i",$field_desc['default'])) || (preg_match("/CURRENT_TIMESTAMP/i",$field_desc['default']))) { + $sqlfields[$i] .= " default ".$field_desc['default']; + } + else { + $sqlfields[$i] .= " default '".$field_desc['default']."'"; + } + } + if( preg_match("/^[^\s]/i",$field_desc['null'])) { + $sqlfields[$i] .= " ".$field_desc['null']; + } + if( preg_match("/^[^\s]/i",$field_desc['extra'])) { + $sqlfields[$i] .= " ".$field_desc['extra']; + } $i++; } if($primary_key != "") From b36a16ed43bc156e332c546b917391383a03224b Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 21 May 2013 14:32:30 +0200 Subject: [PATCH 03/18] Change-Id: I2e25d4b82388f6a0fc83b97f9162a095247e3fa1 --- htdocs/core/db/mysql.class.php | 2 +- htdocs/core/db/mysqli.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php index 66024689c4f..10ba70c11af 100644 --- a/htdocs/core/db/mysql.class.php +++ b/htdocs/core/db/mysql.class.php @@ -878,7 +878,7 @@ class DoliDBMysql { // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); - $sql = "create table ".$table."("; + $sql = "CREATE TABLE ".$table."("; $i=0; foreach($fields as $field_name => $field_desc) { diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 95a9a24384c..b07f3e8e354 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -872,11 +872,11 @@ class DoliDBMysqli { // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); - $sql = "create table ".$table."("; + $sql = "CREATE TABLE ".$table."("; $i=0; foreach($fields as $field_name => $field_desc) { - $sqlfields[$i] = $field_name." "; + $sqlfields[$i] = $field_name." "; $sqlfields[$i] .= $field_desc['type']; if( preg_match("/^[^\s]/i",$field_desc['value'])) { $sqlfields[$i] .= "(".$field_desc['value'].")"; From 961ce6e3e2837ba19ca76223ea9c95a7f0f4263e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 21 May 2013 19:53:10 +0200 Subject: [PATCH 04/18] Fix: Removed error blocking redirect --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index b93d383638b..545a0254eed 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -68,7 +68,7 @@ $conffiletoshow = "htdocs/conf/conf.php"; // Include configuration -$result=include_once $conffile; +$result=@include_once $conffile; // Keep @ because with some error reporting this break the redirect if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done and we are in a web session { From 992600664e2fb397fb23dc26878b55ee5c5ff6f3 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 22 May 2013 10:29:31 +0200 Subject: [PATCH 05/18] fix wrong construction of description when creatin from orders (it was putting a mess on update) --- htdocs/fichinter/fiche.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 086b88fa032..1a2820ef5ce 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -195,8 +195,6 @@ else if ($action == 'add' && $user->rights->ficheinter->creer) // service prédéfini if ($lines[$i]->fk_product > 0) { - $product_static = new Product($db); - // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) { @@ -219,15 +217,8 @@ else if ($action == 'add' && $user->rights->ficheinter->creer) $label = $lines[$i]->product_label; } - $product_static->type=$lines[$i]->fk_product_type; - $product_static->id=$lines[$i]->fk_product; - $product_static->ref=$lines[$i]->ref; - $product_static->libelle=$label; - $desc=$product_static->getNomUrl(0); - $desc.= ' - '.$label; + $desc = $label; $desc .= ' ('.$langs->trans('Quantity').': '.$lines[$i]->qty.')'; - if ($conf->global->PRODUIT_DESC_IN_FORM) - $desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?'
'.dol_htmlentitiesbr($lines[$i]->desc):''; } else { $desc = dol_htmlentitiesbr($lines[$i]->desc); From 469ae91e70a4517e9bcc0849fd7111dac9ef98ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 May 2013 12:02:39 +0200 Subject: [PATCH 06/18] Fix: regression --- htdocs/core/lib/json.lib.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 24464898a28..9b6f5a95d62 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -72,15 +72,16 @@ function dol_json_encode($elements) $output = '{'; $last = $num - 1; $i = 0; - if (is_array($elements) && count($elements)>0) { - foreach($elements as $key => $value) - { - $output .= '"'.$key.'":'; - if (is_array($value)) $output.= json_encode($value); - else $output .= _val($value); - if ($i !== $last) $output.= ','; - ++$i; - } + $tmpelements=array(); + if (is_array($elements)) $tmpelements=$elements; + if (is_object($elements)) $tmpelements=get_object_vars($elements); + foreach($tmpelements as $key => $value) + { + $output .= '"'.$key.'":'; + if (is_array($value)) $output.= json_encode($value); + else $output .= _val($value); + if ($i !== $last) $output.= ','; + ++$i; } $output.= '}'; } From 7856b7f613ce7e884c455759e249c1f1bfa8a444 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 May 2013 15:52:26 +0200 Subject: [PATCH 07/18] Removed warning --- build/obs/README | 7 +++++-- htdocs/webservices/demo_wsclient_category.php-NORUN | 3 +-- htdocs/webservices/server_category.php | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build/obs/README b/build/obs/README index 24a6df2e84b..8b3ea336dc1 100644 --- a/build/obs/README +++ b/build/obs/README @@ -23,10 +23,13 @@ To submit a snapshot for building, we should have a service file with content www.dolibarr.org http - /files/lastbuild/package_rpm_generic/dolibarr-3.3.0-0.2.beta1.src.rpm + /files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm How to have such a service ? -Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/lastbuild/package_rpm_generic/dolibarr-3.3.0-0.2.beta1.src.rpm +Try to make "Add file" and select Remote URL and enter http://www.dolibarr.org/files/stable/package_rpm_generic/dolibarr-3.3.2-3.src.rpm +Then add into advanded - attributes +OBS:Screenshots http://www.dolibarr.org/images/phocagallery/dolibarr_screenshot1.png +OBS:QualityCategory Testing \ No newline at end of file diff --git a/htdocs/webservices/demo_wsclient_category.php-NORUN b/htdocs/webservices/demo_wsclient_category.php-NORUN index 9feda9dcb9b..0793fd1806c 100755 --- a/htdocs/webservices/demo_wsclient_category.php-NORUN +++ b/htdocs/webservices/demo_wsclient_category.php-NORUN @@ -13,8 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /** diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index abf12b0f591..5e55dae8b18 100755 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -13,8 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ /** From bb42f8384b9da0873020fd4fd7d1d2546fd933d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Pr=C3=B6mer?= Date: Wed, 22 May 2013 14:59:21 +0200 Subject: [PATCH 08/18] Fix: 'rights' instead of 'right' --- htdocs/core/lib/company.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index de42a730b2b..6279e4ee9a0 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -60,15 +60,15 @@ function societe_prepare_head($object) $head[$h][2] = 'supplier'; $h++; } - if (! empty($conf->agenda->enabled) && !empty($user->right->agenda->lire)) - { + if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) + { $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id; $head[$h][1] = $langs->trans("Agenda"); $head[$h][2] = 'agenda'; $h++; } //show categorie tab - if (! empty($conf->categorie->enabled) && !empty($user->right->categorie->lire)) + if (! empty($conf->categorie->enabled) && ! empty($user->rights->categorie->lire)) { $type = 2; if ($object->fournisseur) $type = 1; From 3b6c55f90850374166ced57cf4cbead23baa9ac3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 May 2013 17:29:25 +0200 Subject: [PATCH 09/18] Fix: Param was renamed --- htdocs/fourn/facture/fiche.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index d4010f6c495..3a157d74ceb 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -95,7 +95,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes') $result=$object->createFromClone($id); if ($result > 0) { - header("Location: ".$_SERVER['PHP_SELF'].'?action=editfacnumber&id='.$result); + header("Location: ".$_SERVER['PHP_SELF'].'?action=editref_supplier&id='.$result); exit; } else @@ -1158,7 +1158,7 @@ if ($action == 'create') print ''.$langs->trans('DateMaxPayment').''; $form->select_date($datedue,'ech','','','',"add",1,1); print ''; - + // Project if (! empty($conf->projet->enabled)) { From ee8445710444430fd4f08e23a8e0fa05b15d95ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 May 2013 10:04:35 +0200 Subject: [PATCH 10/18] Fix: not defined default value --- .../mailings/thirdparties_services_expired.modules.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 75f67ca2c46..f618a156819 100755 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -175,11 +175,9 @@ class mailing_thirdparties_services_expired extends MailingTargets * For example if this selector is used to extract 500 different * emails from a text file, this function must return 500. * - * @param int $filter Filter - * @param string $option Option * @return int Number of recipients */ - function getNbOfRecipients($sql,$filter=1,$option='') + function getNbOfRecipients($sql='') { $now=dol_now(); From 6270a2e23c2b3aeed14507a4d3b014afea658aca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 May 2013 19:29:39 +0200 Subject: [PATCH 11/18] Try a fix for some browsers --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index df7ae4d4c43..c1aa388507c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -931,7 +931,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if (empty($disablehead)) { print "\n"; - + if (GETPOST('dol_basehref')) print ''."\n"; // Displays meta print ''."\n"; // Evite indexation par robots print ''."\n"; From 7bbdae239f12e7ec3dc0413fbf8ad33aabc0781f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 May 2013 14:32:12 +0200 Subject: [PATCH 12/18] Fix: Removed errors with not defined vars --- htdocs/core/get_menudiv.php | 2 ++ htdocs/user/class/user.class.php | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index 0f1da52c46e..f320b7cc8eb 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -45,6 +45,8 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); * View */ +$title=$langs->trans("Menu"); + // URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests $arrayofjs=array(); $arrayofcss=array(); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 32dafcef617..4639405bfd4 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1113,7 +1113,10 @@ class User extends CommonObject $this->note = trim($this->note); $this->openid = trim(empty($this->openid)?'':$this->openid); // Avoid warning $this->admin = $this->admin?$this->admin:0; - + $this->address = empty($this->address)?'':$this->address; + $this->zip = empty($this->zip)?'':$this->zip; + $this->town = empty($this->town)?'':$this->town; + // Check parameters if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) { @@ -1133,8 +1136,8 @@ class User extends CommonObject $sql.= ", address = '".$this->db->escape($this->address)."'"; $sql.= ", zip = '".$this->db->escape($this->zip)."'"; $sql.= ", town = '".$this->db->escape($this->town)."'"; - $sql.= ", fk_state = ".($this->state_id > 0?"'".$this->db->escape($this->state_id)."'":"null"); - $sql.= ", fk_country = ".($this->country_id > 0?"'".$this->db->escape($this->country_id)."'":"null"); + $sql.= ", fk_state = ".((! empty($this->state_id) && $this->state_id > 0)?"'".$this->db->escape($this->state_id)."'":"null"); + $sql.= ", fk_country = ".((! empty($this->country_id) && $this->country_id > 0)?"'".$this->db->escape($this->country_id)."'":"null"); $sql.= ", office_phone = '".$this->db->escape($this->office_phone)."'"; $sql.= ", office_fax = '".$this->db->escape($this->office_fax)."'"; $sql.= ", user_mobile = '".$this->db->escape($this->user_mobile)."'"; From ed67173734e9653d0b4a373a1052fb1ec5ad2a63 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Fri, 24 May 2013 16:17:36 +0200 Subject: [PATCH 13/18] Update modFournisseur.class.php Add filter feature on the commande export --- htdocs/core/modules/modFournisseur.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 5ebff71df0c..71f4ebfd542 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -296,7 +296,7 @@ class modFournisseur extends DolibarrModules $this->export_icon[$r]='order'; $this->export_permission[$r]=array(array("fournisseur","commande","export")); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','c.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','s.tva_intra'=>'VATIntra','f.rowid'=>"OrderId",'f.ref'=>"Ref",'f.ref_supplier'=>"RefSupplier",'f.date_creation'=>"DateCreation",'f.date_commande'=>"OrderDate",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.tva'=>"TotalVAT",'f.fk_statut'=>'Status','f.note'=>"Note",'fd.rowid'=>'LineId','fd.description'=>"LineDescription",'fd.tva_tx'=>"LineVATRate",'fd.qty'=>"LineQty",'fd.remise_percent'=>"Discount",'fd.total_ht'=>"LineTotalHT",'fd.total_ttc'=>"LineTotalTTC",'fd.total_tva'=>"LineTotalVAT",'fd.product_type'=>'TypeOfLineServiceOrProduct','fd.fk_product'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); - //$this->export_TypeFields_array[$r]=array(); // TODO add fields type + $this->export_TypeFields_array[$r]=array('s.rowid'=>"company",'s.nom'=>'Text','s.address'=>'Text','s.cp'=>'Text','s.ville'=>'Text','c.code'=>'Text','s.tel'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.idprof5'=>'Text','s.idprof6'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.date_creation'=>"Date",'f.date_commande'=>"Date",'f.total_ht'=>"Number",'f.total_ttc'=>"Number",'f.tva'=>"Number",'f.fk_statut'=>'Status','f.note'=>"Text",'fd.description'=>"Text",'fd.tva_tx'=>"Number",'fd.qty'=>"Number",'fd.remise_percent'=>"Number",'fd.total_ht'=>"Number",'fd.total_ttc'=>"Number",'fd.total_tva'=>"Number",'fd.product_type'=>'Boolean','fd.fk_product'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company','f.rowid'=>"order",'f.ref'=>"order",'f.ref_supplier'=>"order",'f.date_creation'=>"order",'f.date_commande'=>"order",'f.total_ht'=>"order",'f.total_ttc'=>"order",'f.tva'=>"order",'f.fk_statut'=>'order','f.note'=>"order",'fd.rowid'=>'order_line','fd.description'=>"order_line",'fd.tva_tx'=>"order_line",'fd.qty'=>"order_line",'fd.remise_percent'=>"order_line",'fd.total_ht'=>"order_line",'fd.total_ttc'=>"order_line",'fd.total_tva'=>"order_line",'fd.product_type'=>'order_line','fd.fk_product'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_dependencies_array[$r]=array('order_line'=>'fd.rowid','product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them From 92a7037c1dcde30831ddcfdbebf6e49ba41a310d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 May 2013 18:20:28 +0200 Subject: [PATCH 14/18] Fix: Missing translation --- htdocs/fourn/fiche.php | 3 ++- htdocs/langs/en_US/cashdesk.lang | 1 + htdocs/langs/fr_FR/cashdesk.lang | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 3fcfa4b7a86..38ce1e648b3 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -102,13 +102,14 @@ if ($object->fetch($id)) if ($object->fournisseur) { - print ''; + print ''; print ''.$langs->trans("SupplierCode"). ''; print $object->code_fournisseur; if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; print ''; print ''; + $langs->load('compta'); print ''; print ''; print $form->editfieldkey("SupplierAccountancyCode",'supplieraccountancycode',$object->code_compta_fournisseur,$object,$user->rights->societe->creer); diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 2f252d39923..f8e1d1fa780 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -13,6 +13,7 @@ CashDeskProducts=Products CashDeskStock=Stock CashDeskOn=on CashDeskThirdParty=Third party +CashdeskDashboard=Point of sale access ShoppingCart=Shopping cart NewSell=New sell BackOffice=Back office diff --git a/htdocs/langs/fr_FR/cashdesk.lang b/htdocs/langs/fr_FR/cashdesk.lang index 5c59db99c57..6eab6e5b3d0 100644 --- a/htdocs/langs/fr_FR/cashdesk.lang +++ b/htdocs/langs/fr_FR/cashdesk.lang @@ -13,6 +13,7 @@ CashDeskProducts=Produits CashDeskStock=Stock CashDeskOn=de CashDeskThirdParty=Tiers +CashdeskDashboard=Accès Point de vente ShoppingCart=Panier NewSell=Nouvelle vente BackOffice=Back office From c97d1cb15b94d9b3850d2d179d620e0e3d828fb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 May 2013 19:29:39 +0200 Subject: [PATCH 15/18] Try a fix for some browsers --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5a39f4b09ef..d27bb64e6d0 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -931,7 +931,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs if (empty($disablehead)) { print "\n"; - + if (GETPOST('dol_basehref')) print ''."\n"; // Displays meta print ''."\n"; // Evite indexation par robots print ''."\n"; From b9f5c155420899bd60cc5b67460dda4ee04951be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 May 2013 18:49:40 +0200 Subject: [PATCH 16/18] Fix: Bad link if not supplier defined for product --- htdocs/fourn/product/liste.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php index fc35d0a8057..3f8b3ed0353 100644 --- a/htdocs/fourn/product/liste.php +++ b/htdocs/fourn/product/liste.php @@ -231,7 +231,9 @@ if ($resql) $companystatic->nom=$objp->nom; $companystatic->id=$objp->socid; - print ''.$companystatic->getNomUrl(1,'supplier').''; + print ''; + if ($companystatic->id > 0) print $companystatic->getNomUrl(1,'supplier'); + print ''; print ''.price($objp->price).''; From 9ecb1ddcb4cc2c83d6f6ae5b9a4e7c6e2ceafd51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 May 2013 18:20:28 +0200 Subject: [PATCH 17/18] Fix: Missing translation --- htdocs/fourn/fiche.php | 3 ++- htdocs/langs/en_US/cashdesk.lang | 1 + htdocs/langs/fr_FR/cashdesk.lang | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 3fcfa4b7a86..38ce1e648b3 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -102,13 +102,14 @@ if ($object->fetch($id)) if ($object->fournisseur) { - print ''; + print ''; print ''.$langs->trans("SupplierCode"). ''; print $object->code_fournisseur; if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; print ''; print ''; + $langs->load('compta'); print ''; print ''; print $form->editfieldkey("SupplierAccountancyCode",'supplieraccountancycode',$object->code_compta_fournisseur,$object,$user->rights->societe->creer); diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 2f252d39923..f8e1d1fa780 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -13,6 +13,7 @@ CashDeskProducts=Products CashDeskStock=Stock CashDeskOn=on CashDeskThirdParty=Third party +CashdeskDashboard=Point of sale access ShoppingCart=Shopping cart NewSell=New sell BackOffice=Back office diff --git a/htdocs/langs/fr_FR/cashdesk.lang b/htdocs/langs/fr_FR/cashdesk.lang index 5c59db99c57..6eab6e5b3d0 100644 --- a/htdocs/langs/fr_FR/cashdesk.lang +++ b/htdocs/langs/fr_FR/cashdesk.lang @@ -13,6 +13,7 @@ CashDeskProducts=Produits CashDeskStock=Stock CashDeskOn=de CashDeskThirdParty=Tiers +CashdeskDashboard=Accès Point de vente ShoppingCart=Panier NewSell=Nouvelle vente BackOffice=Back office From eecfbf9670ec7a3faee3097a700a225405dd605c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 May 2013 18:49:40 +0200 Subject: [PATCH 18/18] Fix: Bad link if not supplier defined for product --- htdocs/fourn/product/liste.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php index fc35d0a8057..3f8b3ed0353 100644 --- a/htdocs/fourn/product/liste.php +++ b/htdocs/fourn/product/liste.php @@ -231,7 +231,9 @@ if ($resql) $companystatic->nom=$objp->nom; $companystatic->id=$objp->socid; - print ''.$companystatic->getNomUrl(1,'supplier').''; + print ''; + if ($companystatic->id > 0) print $companystatic->getNomUrl(1,'supplier'); + print ''; print ''.price($objp->price).'';