From 99c657255eed16e106e8417b67c0f3d5dccaf153 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 May 2013 17:14:56 +0200 Subject: [PATCH 01/11] Fix: Bug erase member data --- htdocs/societe/class/societe.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 0ea3253bdd1..3f7e00a4702 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -588,8 +588,9 @@ class Societe extends CommonObject if ($result > 0) { - $lmember->firstname=$this->firstname; - $lmember->lastname=$this->lastname; + $lmember->company=$this->name; + //$lmember->firstname=$this->firstname?$this->firstname:$lmember->firstname; // We keep firstname and lastname of member unchanged + //$lmember->lastname=$this->lastname?$this->lastname:$lmember->lastname; // We keep firstname and lastname of member unchanged $lmember->address=$this->address; $lmember->email=$this->email; $lmember->phone=$this->phone; From f16026b79c2a623a46ada1d61da439791008e57e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 May 2013 17:28:31 +0200 Subject: [PATCH 02/11] Fix: cyclic updates --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3f7e00a4702..1172a795920 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -595,7 +595,7 @@ class Societe extends CommonObject $lmember->email=$this->email; $lmember->phone=$this->phone; - $result=$lmember->update($user,0,1,1); // Use nosync to 1 to avoid cyclic updates + $result=$lmember->update($user,0,1,1,1); // Use nosync to 1 to avoid cyclic updates if ($result < 0) { $this->error=$lmember->error; From 2a96172294c469f952205ab42a153f4715df7e88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 May 2013 18:01:50 +0200 Subject: [PATCH 03/11] Fix: Pb in synchro update --- htdocs/adherents/class/adherent.class.php | 5 +++-- htdocs/societe/class/societe.class.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index e97a09559af..344bf615f56 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -392,7 +392,7 @@ class Adherent extends CommonObject $nbrowsaffected=0; $error=0; - dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass.", email=".$this->email); + dol_syslog(get_class($this)."::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", nosyncuserpass=".$nosyncuserpass." nosyncthirdparty=".$nosyncthirdparty.", email=".$this->email); // Clean parameters $this->lastname=trim($this->lastname)?trim($this->lastname):trim($this->lastname); @@ -1013,7 +1013,7 @@ class Adherent extends CommonObject { global $langs; - $sql = "SELECT d.rowid, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,"; + $sql = "SELECT d.rowid, d.ref_ext, d.civilite, d.firstname, d.lastname, d.societe as company, d.fk_soc, d.statut, d.public, d.address, d.zip, d.town, d.note,"; $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.login, d.pass,"; $sql.= " d.photo, d.fk_adherent_type, d.morphy, d.entity,"; $sql.= " d.datec as datec,"; @@ -1050,6 +1050,7 @@ class Adherent extends CommonObject $this->entity = $obj->entity; $this->ref = $obj->rowid; $this->id = $obj->rowid; + $this->ref_ext = $obj->ref_ext; $this->civilite_id = $obj->civilite; $this->firstname = $obj->firstname; $this->lastname = $obj->lastname; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1172a795920..f998f563729 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -588,7 +588,7 @@ class Societe extends CommonObject if ($result > 0) { - $lmember->company=$this->name; + $lmember->societe=$this->name; //$lmember->firstname=$this->firstname?$this->firstname:$lmember->firstname; // We keep firstname and lastname of member unchanged //$lmember->lastname=$this->lastname?$this->lastname:$lmember->lastname; // We keep firstname and lastname of member unchanged $lmember->address=$this->address; From 8fa9a60bc64ffb9c760c09fe5fe951f5fa5629f5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 May 2013 18:10:55 +0200 Subject: [PATCH 04/11] Fix: Bad field size --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 1 + htdocs/install/mysql/tables/llx_adherent.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 46affb6327a..68e84cb609d 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -256,6 +256,7 @@ CREATE TABLE llx_printer_ipp ) ENGINE=innodb; ALTER TABLE llx_socpeople ADD COLUMN ref_ext varchar(128) after entity; +ALTER TABLE llx_adherent MODIFY COLUMN ref_ext varchar(128); create table llx_commande_extrafields ( diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index 936f04d78a4..af15f5da198 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -28,7 +28,7 @@ create table llx_adherent ( rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id - ref_ext varchar(30), -- reference into an external system (not used by dolibarr) + ref_ext varchar(128), -- reference into an external system (not used by dolibarr) civilite varchar(6), lastname varchar(50), From 9ffbed07fec65654160be22d532a5a3a7b974bf6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 May 2013 18:16:13 +0200 Subject: [PATCH 05/11] Fix: More consistent fix --- htdocs/contrat/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 9c1f1ae2973..77553e67d13 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -432,7 +432,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer) } $desc = $prod->description; - $desc.= $prod->description && GETPOST('desc') ? "\n" : ""; + $desc.= $prod->description && GETPOST('np_desc') ? "\n" : ""; $desc.= GETPOST('np_desc'); } else From 309f59fb00ccc56df047e8ab67ed7615c2af65bc Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 25 May 2013 19:02:06 +0200 Subject: [PATCH 06/11] Fix: wrong field name --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 2 ++ htdocs/install/mysql/tables/llx_societe_address.sql | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 68e84cb609d..e16f1e81eb2 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -377,3 +377,5 @@ create table llx_facture_fourn_extrafields ALTER TABLE llx_facture_fourn_extrafields ADD INDEX idx_facture_fourn_extrafields (fk_object); ALTER TABLE llx_user_clicktodial ADD COLUMN url varchar(255) AFTER fk_user; + +ALTER TABLE llx_societe_address CHANGE COLUMN tel phone varchar(20); diff --git a/htdocs/install/mysql/tables/llx_societe_address.sql b/htdocs/install/mysql/tables/llx_societe_address.sql index 7d39a9654fa..aa596333b2c 100644 --- a/htdocs/install/mysql/tables/llx_societe_address.sql +++ b/htdocs/install/mysql/tables/llx_societe_address.sql @@ -1,6 +1,6 @@ -- ======================================================================== -- Copyright (C) 2000-2004 Rodolphe Quiedeville --- Copyright (C) 2005-2010 Houssin Regis +-- Copyright (C) 2005-2013 Houssin Regis -- -- 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 @@ -29,7 +29,7 @@ create table llx_societe_address zip varchar(10), -- zipcode town varchar(50), -- town fk_pays integer DEFAULT 0, -- - tel varchar(20), -- phone number + phone varchar(20), -- phone number fax varchar(20), -- fax number note text, -- fk_user_creat integer, From c61f7b63903996573fb9b4b602dc23262d5b2ac6 Mon Sep 17 00:00:00 2001 From: Florian Henry Date: Sat, 25 May 2013 19:48:49 +0200 Subject: [PATCH 07/11] Fix [ bug #911 ] Reorder intervention do not work --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 2 ++ htdocs/install/mysql/tables/llx_fichinterdet.sql | 1 + 2 files changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index 46affb6327a..155e27508fa 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -376,3 +376,5 @@ create table llx_facture_fourn_extrafields ALTER TABLE llx_facture_fourn_extrafields ADD INDEX idx_facture_fourn_extrafields (fk_object); ALTER TABLE llx_user_clicktodial ADD COLUMN url varchar(255) AFTER fk_user; + +ALTER TABLE llx_fichinterdet ADD COLUMN fk_parent_line integer NULL AFTER fk_fichinter; diff --git a/htdocs/install/mysql/tables/llx_fichinterdet.sql b/htdocs/install/mysql/tables/llx_fichinterdet.sql index ada5557f1de..5fcd1b1d524 100644 --- a/htdocs/install/mysql/tables/llx_fichinterdet.sql +++ b/htdocs/install/mysql/tables/llx_fichinterdet.sql @@ -21,6 +21,7 @@ create table llx_fichinterdet ( rowid integer AUTO_INCREMENT PRIMARY KEY, fk_fichinter integer, + fk_parent_line integer NULL, date datetime, -- date de la ligne d'intervention description text, -- description de la ligne d'intervention duree integer, -- duree de la ligne d'intervention From e3e00b034b13a11edf4ff64bd3ae528b03d1d523 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 May 2013 20:43:01 +0200 Subject: [PATCH 08/11] Fix: Dir with linked files was not renamed when invoices was renamed with its final ref (linked files were lost) Fix: Ref visible into message was wrong. Fix: Bad counting of product/service available --- .../fourn/class/fournisseur.facture.class.php | 41 ++++++++++++++++++- htdocs/fourn/facture/fiche.php | 12 +++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 31a8fc85b77..e3bc1fadb8b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -659,7 +659,7 @@ class FactureFournisseur extends CommonInvoice } } } - + // Remove extrafields if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used { @@ -855,6 +855,45 @@ class FactureFournisseur extends CommonInvoice } } + if (! $error) + { + $this->oldref = ''; + + // Rename directory if dir was a temporary ref + if (preg_match('/^[\(]?PROV/i', $this->ref)) + { + // On renomme repertoire facture ($this->ref = ancienne ref, $num = nouvelle ref) + // afin de ne pas perdre les fichiers attaches + $facref = dol_sanitizeFileName($this->ref); + $snumfa = dol_sanitizeFileName($num); + + $dirsource = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$facref; + $dirdest = $conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa; + if (file_exists($dirsource)) + { + dol_syslog(get_class($this)."::validate rename dir ".$dirsource." into ".$dirdest); + + if (@rename($dirsource, $dirdest)) + { + $this->oldref = $facref; + + dol_syslog("Rename ok"); + // Suppression ancien fichier PDF dans nouveau rep + dol_delete_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($this->id,2).$snumfa.'/'.$facref.'*.*'); + } + } + } + } + + // Set new ref and define current statut + if (! $error) + { + $this->ref = $num; + $this->statut=1; + //$this->date_validation=$now; this is stored into log table + } + + // Triggers call if (! $error) { // Appel des triggers diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 3a157d74ceb..8774c2b871c 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -114,8 +114,18 @@ elseif ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->fourni $object->fetch($id); $object->fetch_thirdparty(); + $qualified_for_stock_change=0; + if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + $qualified_for_stock_change=$object->hasProductsOrServices(2); + } + else + { + $qualified_for_stock_change=$object->hasProductsOrServices(1); + } + // Check parameters - if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $object->hasProductsOrServices(1)) + if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) && $qualified_for_stock_change) { $langs->load("stocks"); if (! $idwarehouse || $idwarehouse == -1) From 268c1cfa296c9c7860e59380fb966bd68731ad8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 May 2013 03:57:34 +0200 Subject: [PATCH 09/11] Fix: Removed useless file (not correctly defined) to avoid cache problems --- htdocs/cache.manifest | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 htdocs/cache.manifest diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest deleted file mode 100644 index f0ea032ea16..00000000000 --- a/htdocs/cache.manifest +++ /dev/null @@ -1,30 +0,0 @@ -# version 1 - -# Files listed under CACHE will be cached after they are loaded; -# while the ones under NETWORK are said to be white-listed. -# What this means is that they require a live connection to the server. -# If the user isn't connected to the server, the browser should not use the cached version instead. - -CACHE MANIFEST - -CACHE: -index.php -main.inc.php -master.inc.php -filefunc.inc.php -core/lib/functions.lib.php - -# The NETWORK section contains the path to a folder to ensure that requests -# to load resources contained under /api will bypass the cache and always fetch the resource from the server. - -NETWORK: -# search.php -# login.php -# /api - -# The FALLBACK section contains entries that provide a backup strategy. -# If the browser is unable to retrieve the original content, the fallback resource will be used. -# In the example above, we display a static image in case the dynamic one is unavailable. - -FALLBACK: -# images/dynamic.php static_image.png \ No newline at end of file From 2005ce8d6ee02d0287e5724929174b2130ed4fc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 26 May 2013 05:01:28 +0200 Subject: [PATCH 10/11] Fix: Error with jmobile --- htdocs/core/class/html.formother.class.php | 113 +++++++++++---------- 1 file changed, 59 insertions(+), 54 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c3157c07124..c2d3a7c32c2 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -544,68 +544,73 @@ class FormOther */ function selectColor($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='', $morecss='') { - global $langs; + global $langs,$conf; $out=''; if (! is_array($arrayofcolors) || count($arrayofcolors) < 1) { $langs->load("other"); - $out.= ''; - $out.= ''; - $out.= ''; + if (empty($conf->dol_use_jmobile)) + { + $out.= ''; + $out.= ''; + $out.= ''; + } $out.= ''; } else // In most cases, this is not used. We used instead function with no specific list of colors { - $out.= ''; - $out.= ''; - $out.= ''; - + if (empty($conf->dol_use_jmobile)) + { + $out.= ''; + $out.= ''; + $out.= ''; + } $out.= '