From a35a44b23e73487d42c5eb4ab7994b7c6a49704a Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 3 May 2013 15:22:41 +0200 Subject: [PATCH 01/14] Fix margin calculation problem --- htdocs/margin/agentMargins.php | 5 +++-- htdocs/margin/customerMargins.php | 5 +++-- htdocs/margin/productMargins.php | 6 +++--- htdocs/margin/tabs/productMargins.php | 5 +++-- htdocs/margin/tabs/thirdpartyMargins.php | 5 +++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php index 6ca0879a88a..572f2a10003 100644 --- a/htdocs/margin/agentMargins.php +++ b/htdocs/margin/agentMargins.php @@ -128,7 +128,7 @@ $sql = "SELECT s.nom, s.rowid as socid, s.code_client, s.client, u.rowid as agen $sql.= " u.login, u.name, u.firstname,"; $sql.= " sum(d.total_ht) as selling_price,"; $sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; -$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge" ; +$sql.= $db->ifsql('f.type =2','sum(d.total_ht + (d.buy_price_ht * d.qty))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge" ; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_contact e ON e.element_id = f.rowid and e.statut = 4 and e.fk_c_type_contact = ".(empty($conf->global->AGENT_CONTACT_TYPE)?-1:$conf->global->AGENT_CONTACT_TYPE); @@ -160,11 +160,12 @@ if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPr if ($agentid > 0) $sql.= " GROUP BY s.rowid"; else - $sql.= " GROUP BY u.rowid"; + $sql.= " GROUP BY u.rowid, s.nom, s.rowid, s.code_client, s.client, u.login, u.name, u.firstname, f.type "; $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); +dol_syslog('margin::agentMargins.php sql='.$sql,LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index a07d3192e9b..982384e882c 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -157,7 +157,7 @@ $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, s.client,"; $sql.= " f.facnumber, f.total as total_ht,"; $sql.= " sum(d.total_ht) as selling_price,"; $sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; -$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; +$sql.= $db->ifsql('f.type =2','sum(d.total_ht + (d.buy_price_ht * d.qty))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -178,11 +178,12 @@ if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPr if ($client) $sql.= " GROUP BY f.rowid"; else - $sql.= " GROUP BY s.rowid"; + $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.rowid "; $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); +dol_syslog('margin::customerMargins.php sql='.$sql,LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 3b709559f28..26aaa953d78 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -159,7 +159,7 @@ $sql = "SELECT DISTINCT d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref $sql.= " f.facnumber, f.total as total_ht,"; $sql.= " sum(d.total_ht) as selling_price,"; $sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; -$sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; +$sql.= $db->ifsql('f.type =2','sum(d.total_ht + (d.buy_price_ht * d.qty))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; @@ -182,11 +182,11 @@ if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPr if ($id > 0) $sql.= " GROUP BY f.rowid"; else - $sql.= " GROUP BY d.fk_product"; + $sql.= " GROUP BY d.fk_product, p.label, p.rowid, p.fk_product_type, p.ref, f.facnumber, f.total, f.datef, f.paye, f.fk_statut, f.rowid"; $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); - +dol_syslog('margin::productMargins.php sql='.$sql,LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php index 326efc526d2..a0051d7a6e4 100644 --- a/htdocs/margin/tabs/productMargins.php +++ b/htdocs/margin/tabs/productMargins.php @@ -133,7 +133,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " d.total_ht as selling_price,"; $sql.= $db->ifsql('f.type =2','(d.buy_price_ht * d.qty *-1)','(d.buy_price_ht * d.qty)')." as buying_price, "; $sql.= $db->ifsql('f.type =2','d.qty *-1','d.qty')." as qty,"; - $sql.= $db->ifsql('f.type =2','((d.price + d.buy_price_ht) * d.qty)','((d.price - d.buy_price_ht) * d.qty)')." as marge," ; + $sql.= $db->ifsql('f.type =2','d.total_ht + (d.buy_price_ht * d.qty)','d.total_ht - (d.buy_price_ht * d.qty)')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -153,7 +153,8 @@ if ($id > 0 || ! empty($ref)) $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); - + + dol_syslog('margin:tabs:productMargins.php sql='.$sql,LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 643d190d04d..04ac4d65d64 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -131,7 +131,7 @@ if ($socid > 0) $sql.= " sum(d.total_ht) as selling_price,"; $sql.= $db->ifsql('f.type =2','sum(d.buy_price_ht * d.qty *-1)','sum(d.buy_price_ht * d.qty)')." as buying_price, "; - $sql.= $db->ifsql('f.type =2','sum((d.price + d.buy_price_ht) * d.qty)','sum((d.price - d.buy_price_ht) * d.qty)')." as marge," ; + $sql.= $db->ifsql('f.type =2','sum(d.total_ht + (d.buy_price_ht * d.qty))','sum(d.total_ht - (d.buy_price_ht * d.qty))')." as marge," ; $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -144,11 +144,12 @@ if ($socid > 0) $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0"; - $sql.= " GROUP BY f.rowid"; + $sql.= " GROUP BY f.rowid, s.nom, s.rowid, s.code_client, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; $sql.= " ORDER BY $sortfield $sortorder "; // TODO: calculate total to display then restore pagination //$sql.= $db->plimit($conf->liste_limit +1, $offset); + dol_syslog('margin:tabs:thirdpartyMargins.php sql='.$sql,LOG_DEBUG); $result = $db->query($sql); if ($result) { From 1c9caeb0d31c9c2665808423bb5cd72ab2775ada Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 May 2013 18:33:23 +0200 Subject: [PATCH 02/14] Fix: CRLF --- htdocs/core/login/README.txt | 52 ++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/htdocs/core/login/README.txt b/htdocs/core/login/README.txt index 7c00a86887f..8128dfacd57 100644 --- a/htdocs/core/login/README.txt +++ b/htdocs/core/login/README.txt @@ -1,26 +1,26 @@ -README (english) ---------------------------------------------- -Decription of htdocs/core/login directory ---------------------------------------------- - -This directory contains files that handle way to validate passwords. - -If you want to add a new password checker function, just add a file in -this directory that follow example of already existing files. -This file must be called for example : -functions_mypasschecker.php - -Edit function name to call it: -check_user_mypasschecker - -Change code of this function to return true if couple -$usertotest / $passwordtotest is ok for you. - -Then, you must edit you conf.php file to change the value of -$dolibarr_main_authentication -parameter to set it to : -mypasschecker - -Once this is done, when you log in to Dolibarr, the function -check_user_mypasschecker in this file is called. -If the function return true and login exists, login is accepted. +README (english) +--------------------------------------------- +Decription of htdocs/core/login directory +--------------------------------------------- + +This directory contains files that handle way to validate passwords. + +If you want to add a new password checker function, just add a file in +this directory that follow example of already existing files. +This file must be called for example : +functions_mypasschecker.php + +Edit function name to call it: +check_user_mypasschecker + +Change code of this function to return true if couple +$usertotest / $passwordtotest is ok for you. + +Then, you must edit you conf.php file to change the value of +$dolibarr_main_authentication +parameter to set it to : +mypasschecker + +Once this is done, when you log in to Dolibarr, the function +check_user_mypasschecker in this file is called. +If the function return true and login exists, login is accepted. From 95e44749066eb05980b786255e33e22d0678fd6f Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 3 May 2013 20:56:58 +0200 Subject: [PATCH 03/14] Fix bug on PgSQL if user in on another entity than 1 --- htdocs/core/modules/DolibarrModules.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 106ca4ba4ba..ba874f79c16 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -906,7 +906,9 @@ abstract class DolibarrModules dol_syslog(get_class($this)."::insert_permissions Add permission to user id=".$obj2->rowid); $tmpuser=new User($this->db); $tmpuser->fetch($obj2->rowid); - $tmpuser->addrights($r_id); + if (!empty($tmpuser->id)) { + $tmpuser->addrights($r_id); + } $i++; } if (! empty($user->admin)) // Reload permission for current user if defined From a5009fd555e13408152663aa60ac23f4f6b8693a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 4 May 2013 19:35:38 +0200 Subject: [PATCH 04/14] Corrected es_ES translations --- htdocs/install/mysql/data/llx_c_forme_juridique.sql | 4 ++-- htdocs/langs/es_ES/admin.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql index 965064d019c..6c242da0cfd 100644 --- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql @@ -222,8 +222,8 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '4 INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '404', 'Sociedad Colectiva', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '405', 'Sociedad Limitada', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '406', 'Sociedad Anónima', 1); -INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '407', 'Sociedad Comandataria por Acciones', 1); -INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '408', 'Sociedad Comandataria Simple', 1); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '407', 'Sociedad Comanditaria por Acciones', 1); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '408', 'Sociedad Comanditaria Simple', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '409', 'Sociedad Laboral', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '410', 'Sociedad Cooperativa', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (4, '411', 'Sociedad de Garantía Recíproca', 1); diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 15a055de27a..13052863068 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -51,7 +51,7 @@ DisableJavascript=Desactivar las funciones Javascript ConfirmAjax=Utilizar los popups de confirmación Ajax UseSearchToSelectCompany=Utilizar un formulario de búsqueda para buscar terceros (en vez de lista desplegable)

Tenga en cuenta que si tiene un gran número de productos o servicios (>100 000), puede mejorar el rendimiento mediante la constante SOCIETE_DONOTSEARCH_ANYWHERE a 1 en Configuración->Varios. La búsqueda se limitará entonces al inicio de la cadena. ActivityStateToSelectCompany=Agregar un filtro en la búsqueda para mostrar/ocultar los terceros en activo o que hayan dejado de ejercer -UseSearchToSelectContact=Utilizar un formulario de búsqueda (en vez de una lista desplegable).
Tenga en cuenta que si tiene un gran número de contactos (>100 000), puede mejorar el rendimiento mediante la constante CONTACT_DONOTSEARCH_ANYWHERE a 1 en Configuración->Varios. La búsqueda se limitará entonces al inicio de la cadena. +UseSearchToSelectContact=Utilizar un formulario de búsqueda para buscar contactos (en vez de una lista desplegable).
Tenga en cuenta que si tiene un gran número de contactos (>100 000), puede mejorar el rendimiento mediante la constante CONTACT_DONOTSEARCH_ANYWHERE a 1 en Configuración->Varios. La búsqueda se limitará entonces al inicio de la cadena. SearchFilter=Opciones filtros de búsqueda NumberOfKeyToSearch=Nº de caracteres para desencadenar la búsqueda: %s ViewFullDateActions=Ver las fechas de las acciones en su totalidad en la ficha de tercero From e2a73839bc00d4ed16757e08dc960f828a8d891b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 4 May 2013 20:17:05 +0200 Subject: [PATCH 05/14] Replaced addslashes with $this->db->escape --- htdocs/holiday/class/holiday.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 55971e64375..b790b9154e9 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -124,7 +124,7 @@ class Holiday extends CommonObject // User $sql.= "'".$this->fk_user."',"; $sql.= " '".$this->db->idate($now)."',"; - $sql.= " '".addslashes($this->description)."',"; + $sql.= " '".$this->db->escape($this->description)."',"; $sql.= " '".$this->db->idate($this->date_debut)."',"; $sql.= " '".$this->db->idate($this->date_fin)."',"; $sql.= " ".$this->halfday.","; @@ -473,7 +473,7 @@ class Holiday extends CommonObject // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; - $sql.= " description= '".addslashes($this->description)."',"; + $sql.= " description= '".$this->db->escape($this->description)."',"; if(!empty($this->date_debut)) { $sql.= " date_debut = '".$this->db->idate($this->date_debut)."',"; @@ -527,7 +527,7 @@ class Holiday extends CommonObject $sql.= " fk_user_cancel = NULL,"; } if(!empty($this->detail_refuse)) { - $sql.= " detail_refuse = '".addslashes($this->detail_refuse)."'"; + $sql.= " detail_refuse = '".$this->db->escape($this->detail_refuse)."'"; } else { $sql.= " detail_refuse = NULL"; } @@ -1394,7 +1394,7 @@ class Holiday extends CommonObject $sql.= ") VALUES ("; - $sql.= " '".addslashes($this->optName)."',"; + $sql.= " '".$this->db->escape($this->optName)."',"; $sql.= " '".$this->optValue."'"; $sql.= ")"; @@ -1441,7 +1441,7 @@ class Holiday extends CommonObject function updateEventCP($rowid, $name, $value) { $sql = "UPDATE ".MAIN_DB_PREFIX."holiday_events SET"; - $sql.= " name = '".addslashes($name)."', value = '".$value."'"; + $sql.= " name = '".$this->db->escape($name)."', value = '".$value."'"; $sql.= " WHERE rowid = '".$rowid."'"; $result = $this->db->query($sql); @@ -1564,7 +1564,7 @@ class Holiday extends CommonObject */ function addLogCP($fk_user_action,$fk_user_update,$type,$new_solde) { - global $conf, $langs, $db; + global $conf, $langs; $error=0; @@ -1586,7 +1586,7 @@ class Holiday extends CommonObject $sql.= " NOW(), "; $sql.= " '".$fk_user_action."',"; $sql.= " '".$fk_user_update."',"; - $sql.= " '".addslashes($type)."',"; + $sql.= " '".$this->db->escape($type)."',"; $sql.= " '".$prev_solde."',"; $sql.= " '".$new_solde."'"; $sql.= ")"; From 8bd7c6a763b57461dc8316b6cceb70fd2987226f Mon Sep 17 00:00:00 2001 From: fhenry Date: Mon, 6 May 2013 09:53:23 +0200 Subject: [PATCH 06/14] Fix Trad Fr --- htdocs/langs/fr_FR/dict.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/fr_FR/dict.lang b/htdocs/langs/fr_FR/dict.lang index 649397eb3c8..e0a8fd6f2ef 100644 --- a/htdocs/langs/fr_FR/dict.lang +++ b/htdocs/langs/fr_FR/dict.lang @@ -274,8 +274,8 @@ CurrencyMAD=Dirham CurrencySingMAD=Dirham CurrencyMGA=Ariary CurrencySingMGA=Ariary -CurrencyMUR=Roupies mauritiennes -CurrencySingMUR=Roupie mauritienne +CurrencyMUR=Roupies mauriciennes +CurrencySingMUR=Roupie mauriciennes CurrencyNOK=Couronnes norvégiennes CurrencySingNOK=Couronne norvégienne CurrencySUR=Roubles From 0bb9ee158afb2461ff70961f9c69c8e924c96339 Mon Sep 17 00:00:00 2001 From: fhenry Date: Mon, 6 May 2013 13:47:33 +0200 Subject: [PATCH 07/14] Fix trigger call ficher inter create --- htdocs/fichinter/class/fichinter.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 98defa55406..b8422f23d74 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -167,7 +167,9 @@ class Fichinter extends CommonObject // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('FICHINTER_CREATE',$this,$user,$langs,$conf); + $tmpuser=new User($this->db); + $tmpuser->fetch($this->author); + $result=$interface->run_triggers('FICHINTER_CREATE',$this,$tmpuser,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } From d0635901a6eee54dcf5167a348cdf5d53b97e24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 22:51:07 +0200 Subject: [PATCH 08/14] Fixed bug with holidays log --- htdocs/holiday/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index aa3287bc81a..83523ea4557 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -380,7 +380,7 @@ if($action == 'confirm_valid') $newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $cp->addLogCP($userID,$cp->fk_user, $langs->trans('Event').': '.$langs->transnoentitiesnoconv("Holidays"),$newSolde); + $cp->addLogCP($user->id,$cp->fk_user, $langs->trans('Event').': '.$langs->transnoentitiesnoconv("Holidays"),$newSolde); // Mise à jour du solde $cp->updateSoldeCP($cp->fk_user,$newSolde); From d7a7f316d3f27b3823a6ad953c88c71bdc9bad51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 22:02:53 +0200 Subject: [PATCH 09/14] Replaced "Jours" with DurationDays translation key --- htdocs/holiday/admin/holiday.php | 10 +++++----- htdocs/langs/bg_BG/holiday.lang | 1 - htdocs/langs/ca_ES/holiday.lang | 1 - htdocs/langs/en_US/holiday.lang | 1 - htdocs/langs/es_ES/holiday.lang | 1 - htdocs/langs/fr_FR/holiday.lang | 1 - htdocs/langs/tr_TR/holiday.lang | 1 - 7 files changed, 5 insertions(+), 11 deletions(-) diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index e3a20662f5d..174adbdf725 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -286,7 +286,7 @@ print ''."\n"; $var=!$var; print ''."\n"; print ''.$langs->trans('DelayForSubmitCP').''."\n"; -print ' '.$langs->trans('Jours').''."\n"; +print ' '.$langs->trans('DurationDays').''."\n"; print ''."\n"; $var=!$var; @@ -304,13 +304,13 @@ print ''."\n"; $var=!$var; print ''."\n"; print ''.$langs->trans('nbHolidayEveryMonthCP').''."\n"; -print ' '.$langs->trans('Jours').''."\n"; +print ' '.$langs->trans('DurationDays').''."\n"; print ''."\n"; $var=!$var; print ''."\n"; print ''.$langs->trans('nbHolidayDeductedCP').''."\n"; -print ' '.$langs->trans('Jours').''."\n"; +print ' '.$langs->trans('DurationDays').''."\n"; print ''."\n"; print ''."\n"; @@ -367,7 +367,7 @@ if($cp_events == 1) { print ''."\n"; print ''."\n"; - print ' '.$langs->trans('Jours').''."\n"; + print ' '.$langs->trans('DurationDays').''."\n"; print ''."\n"; print ''."\n"; print ''; @@ -400,7 +400,7 @@ print ''; print ''; print ''."\n"; -print ' '.$langs->trans('Jours').''."\n"; +print ' '.$langs->trans('DurationDays').''."\n"; print ''."\n"; print ''."\n"; diff --git a/htdocs/langs/bg_BG/holiday.lang b/htdocs/langs/bg_BG/holiday.lang index 614539960d5..f47b404400d 100644 --- a/htdocs/langs/bg_BG/holiday.lang +++ b/htdocs/langs/bg_BG/holiday.lang @@ -128,7 +128,6 @@ DeleteEventOptionCP=Изтриване UpdateEventOptionCP=Актуализация ErrorMailNotSend=Възникна грешка при изпращане на електронна поща: NoCPforMonth=Не оставяйте този месец. -Jours=ден nbJours=Брой дни TitleAdminCP=Конфигурация на празници Permission20001=/ Промяна на всички искания празници diff --git a/htdocs/langs/ca_ES/holiday.lang b/htdocs/langs/ca_ES/holiday.lang index 60adaa8faf3..3c51daaa2ed 100644 --- a/htdocs/langs/ca_ES/holiday.lang +++ b/htdocs/langs/ca_ES/holiday.lang @@ -129,7 +129,6 @@ DeleteEventOptionCP=Eliminar UpdateEventOptionCP=Actualitzar ErrorMailNotSend=S'ha produït un error en l'enviament del correu electrònic: NoCPforMonth=Sense vacances aquest mes. -Jours=dies nbJours=Número de dies TitleAdminCP=Configuració de les vacances diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 5453b2b88e6..dec1ca36aa8 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -129,7 +129,6 @@ DeleteEventOptionCP=Delete UpdateEventOptionCP=Update ErrorMailNotSend=An error occurred while sending email: NoCPforMonth=No leave this month. -Jours=days nbJours=Number days TitleAdminCP=Configuration of Holidays diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index 5c234575d25..520fd4454ae 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -129,7 +129,6 @@ DeleteEventOptionCP=Eliminar UpdateEventOptionCP=Actualizar ErrorMailNotSend=Se ha producido un error en el envío del e-mail : NoCPforMonth=Sin vacaciones este mes. -Jours=días nbJours=Número de días TitleAdminCP=Configuración de las vacaciones diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index 938ffaa155d..35a043504eb 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -127,7 +127,6 @@ DeleteEventOptionCP=Supprimer UpdateEventOptionCP=Mettre à jour ErrorMailNotSend=Une erreur est survenue lors de l'envoi du mail : NoCPforMonth=Aucun congé ce mois-ci. -Jours=jours nbJours=Nombre jours TitleAdminCP=Configuration des Congés diff --git a/htdocs/langs/tr_TR/holiday.lang b/htdocs/langs/tr_TR/holiday.lang index d9291737449..b02bea2fe92 100644 --- a/htdocs/langs/tr_TR/holiday.lang +++ b/htdocs/langs/tr_TR/holiday.lang @@ -126,7 +126,6 @@ DeleteEventOptionCP=Sil UpdateEventOptionCP=Güncelle ErrorMailNotSend=Eposta gönderilirken bir hata oluştu: NoCPforMonth=Bu ay hiç izin yok. -Jours=gün nbJours=Gün sayısı TitleAdminCP=Tatillerin Yapılandırması Permission20001=Bütün tatil isteklerini Oku / Değiştir From 7e11f7466a76f059687473de94135134ef2f8df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Tue, 30 Apr 2013 00:26:37 +0200 Subject: [PATCH 10/14] Missing translations --- htdocs/holiday/define_holiday.php | 1 + htdocs/holiday/month_report.php | 2 ++ htdocs/holiday/view_log.php | 2 ++ 3 files changed, 5 insertions(+) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 36e93d84271..82b8003a274 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -117,6 +117,7 @@ elseif($action == 'add_event') dol_htmloutput_mesg($message); } +$langs->load('users'); $var=true; $i = 0; diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index f184cdc201e..fc984971908 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -105,6 +105,8 @@ if($num == '0') { } else { + $langs->load('users'); + while ($holiday = $db->fetch_array($result)) { $user = new User($db); diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 29c58c4dec7..2ff389925d0 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -39,6 +39,8 @@ if(!$user->rights->holiday->view_log) accessforbidden(); * View */ +$langs->load('users'); + llxHeader(array(),$langs->trans('CPTitreMenu')); From e1913f4a1338ce81d0ba6375a3958b75b7d6953a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 22:09:47 +0200 Subject: [PATCH 11/14] Stetic fix: Select was not valigned --- htdocs/holiday/index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index 8343a805081..4e85f261c3c 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -262,6 +262,7 @@ print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Duration")); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); +print ''; print "\n"; // FILTRES @@ -320,6 +321,9 @@ print ' '; // STATUT print ''; $holiday->selectStatutCP($search_statut); +print ''; +// ACTION +print ''; print ''; print "\n"; From 3aa049b6611d6de065fdc3c340bc5e2b62dc158b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 6 May 2013 17:57:33 +0200 Subject: [PATCH 12/14] Fix: regression --- htdocs/contact/class/contact.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e0df3ac276f..205ae0063a8 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -246,11 +246,11 @@ class Contact extends CommonObject $sql .= ", poste='".$this->db->escape($this->poste)."'"; $sql .= ", fax='".$this->db->escape($this->fax)."'"; $sql .= ", email='".$this->db->escape($this->email)."'"; - $sql .= ", note='".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null")."'"; - $sql .= ", phone = '".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null")."'"; - $sql .= ", phone_perso = '".(isset($this->phone_perso)?"'".$this->db->escape($this->phone_perso)."'":"null")."'"; - $sql .= ", phone_mobile = '".(isset($this->phone_mobile)?"'".$this->db->escape($this->phone_mobile)."'":"null")."'"; - $sql .= ", jabberid = '".(isset($this->jabberid)?"'".$this->db->escape($this->jabberid)."'":"null")."'"; + $sql .= ", note = ".(isset($this->note)?"'".$this->db->escape($this->note)."'":"null"); + $sql .= ", phone = ".(isset($this->phone_pro)?"'".$this->db->escape($this->phone_pro)."'":"null"); + $sql .= ", phone_perso = ".(isset($this->phone_perso)?"'".$this->db->escape($this->phone_perso)."'":"null"); + $sql .= ", phone_mobile = ".(isset($this->phone_mobile)?"'".$this->db->escape($this->phone_mobile)."'":"null"); + $sql .= ", jabberid = ".(isset($this->jabberid)?"'".$this->db->escape($this->jabberid)."'":"null"); $sql .= ", priv = '".$this->priv."'"; $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null"); $sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null"); From c28ef8a5578e56c309e5ce0ba31b0b86bde9a34a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 May 2013 12:51:45 +0200 Subject: [PATCH 13/14] Fix: Delete deprecated files during install as they create conflicts when migrating from old versions. --- htdocs/install/upgrade2.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index e17b5a4d556..e477ec3b6a5 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -3526,6 +3526,10 @@ function migrate_delete_old_files($db,$langs,$conf) DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone.lib.php', DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_backoffice.php', DOL_DOCUMENT_ROOT.'/core/menus/smartphone/iphone_frontoffice.php', + DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_backoffice.php', + DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria_frontoffice.php', + DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_backoffice.php', + DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy_frontoffice.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/dolibarr_services_expired.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/peche.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/poire.modules.php', From 094a7e5ea94888690d0adc205fa6a7f3becf9a63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 May 2013 13:20:50 +0200 Subject: [PATCH 14/14] Fix: Bad constant --- scripts/invoices/email_unpaid_invoices_to_customers.php | 2 +- scripts/invoices/email_unpaid_invoices_to_representatives.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 0c069d04683..972cbb7d429 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -174,7 +174,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer) $subject = "[".(empty($conf->global->MAIN_APPLICATION_TITLE)?'Dolibarr':$conf->global->MAIN_APPLICATION_TITLE)."] ".$newlangs->trans("ListOfYourUnpaidInvoices"); $sendto = $oldemail; - $from = $conf->global->MAIN_EMAIL_FROM; + $from = $conf->global->MAIN_MAIL_EMAIL_FROM; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; $msgishtml = 0; diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 77bd9ee6402..8999d41604c 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -177,7 +177,7 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta $subject = "[".(empty($conf->global->MAIN_APPLICATION_TITLE)?'Dolibarr':$conf->global->MAIN_APPLICATION_TITLE)."] ".$newlangs->trans("ListOfYourUnpaidInvoices"); $sendto = $oldemail; - $from = $conf->global->MAIN_EMAIL_FROM; + $from = $conf->global->MAIN_MAIL_EMAIL_FROM; $errorsto = $conf->global->MAIN_MAIL_ERRORS_TO; $msgishtml = 0;