From 8542a4fd288233037961cb80a9318476005e4768 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 16:34:14 +0200 Subject: [PATCH 01/18] Fix date extrafield message old datetimeformat use message in log --- htdocs/comm/propal.php | 2 +- htdocs/commande/fiche.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 0c95d919d2f..821d1dd98b0 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1857,7 +1857,7 @@ else // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key]; + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } if ($action == 'edit_extras' && $user->rights->propal->creer) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a7d04670961..816df65ea85 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2158,7 +2158,7 @@ else // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key]; + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } if ($action == 'edit_extras' && $user->rights->commande->creer) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 1d6909874b1..82205be3e7b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3304,7 +3304,7 @@ else if ($id > 0 || ! empty($ref)) // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$object->array_options['options_'.$key]; + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); } if ($action == 'edit_extras' && $user->rights->facture->creer) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b5dee2a3c76..e266062821d 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2236,7 +2236,7 @@ abstract class CommonObject // Convert date into timestamp format if (in_array($extrafields->attribute_type[$key],array('date','datetime'))) { - $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->array_options['options_'.$key]; + $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$this->db->jdate($this->array_options['options_'.$key]); } $out .= ''.$label.''; $out .=''; From 3a05d6c641fdb197778ecf2ae4cb7aec076ed9ba Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 17:50:14 +0200 Subject: [PATCH 02/18] Remove warning if FetchObjectLinked call --- htdocs/core/class/commonobject.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e266062821d..fe58e17ae01 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -44,6 +44,9 @@ abstract class CommonObject public $civility_id; public $array_options=array(); + + public $linkedObjectsIds; + public $linkedObjects; // No constructor as it is an abstract class From 4bb6bd86974d065177fbf4f4986437e155e00729 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 18:23:13 +0200 Subject: [PATCH 03/18] Order result fetchObjectLinked by sourcetype --- htdocs/core/class/commonobject.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fe58e17ae01..f27f5b6a516 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1711,6 +1711,7 @@ abstract class CommonObject $sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')"; $sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')"; } + $sql = ' ORDER BY sourcetype'; //print $sql; dol_syslog(get_class($this)."::fetchObjectLink sql=".$sql); From 0d13b8d194c849cf5f5611c8c466d54f676aea9c Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 18:35:19 +0200 Subject: [PATCH 04/18] Fix previous bug --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index f27f5b6a516..49ee3f471cd 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1711,7 +1711,7 @@ abstract class CommonObject $sql.= "(fk_source = '".$sourceid."' AND sourcetype = '".$sourcetype."')"; $sql.= " ".$clause." (fk_target = '".$targetid."' AND targettype = '".$targettype."')"; } - $sql = ' ORDER BY sourcetype'; + $sql .= ' ORDER BY sourcetype'; //print $sql; dol_syslog(get_class($this)."::fetchObjectLink sql=".$sql); From 1a7a8817be8d0a0d6562e4688c0356ce20280ce5 Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 10 May 2013 18:40:19 +0200 Subject: [PATCH 05/18] Update wrong comment --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 49ee3f471cd..e283c977f5f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1652,7 +1652,7 @@ abstract class CommonObject } /** - * Fetch array of objects linked to current object. Links are loaded into this->linked_object array. + * Fetch array of objects linked to current object. Links are loaded into this->linkedObjects array. * * @param int $sourceid Object source id * @param string $sourcetype Object source type From 23a24909e31820f6a21d333f0f0c581e40b9e3a5 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Sat, 11 May 2013 17:00:47 +0200 Subject: [PATCH 06/18] fix: center bloc was going under left menu --- htdocs/theme/eldy/style.css.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 1fbca3e51a0..3a6311db946 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -870,6 +870,8 @@ img.login, img.printer, img.entity { div.vmenu, td.vmenu { margin-: 2px; + position: relative; + float: left; padding: 0px; padding-bottom: 0px; padding-top: 1px; From c61f48a98f51512b056e7b03243cd19abb304b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 12 May 2013 11:36:49 +0200 Subject: [PATCH 07/18] Added missing translation in holidays module --- htdocs/holiday/fiche.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index 83523ea4557..3e053b1606a 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -854,8 +854,8 @@ else // Si refus de la demande if ($action == 'refuse' && $cp->statut == 2 && $user->id == $cp->fk_validator) { - $array_input = array(array('type'=>"text",'label'=>"Entrez ci-dessous un motif de refus :",'name'=>"detail_refuse",'size'=>"50",'value'=>"")); - $ret=$form->form_confirm("fiche.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), "", "confirm_refuse", $array_input, 1, 0); + $array_input = array(array('type'=>"text",'label'=> $langs->trans('DetailRefusCP'),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); + $ret=$form->form_confirm("fiche.php?id=".$id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0); if ($ret == 'html') print '
'; } From a37392e34e037fece33c49ba8b74a1df62a2b84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 12 May 2013 12:19:26 +0200 Subject: [PATCH 08/18] Removed conflict with margins module name and description (already set in admin.lang) --- htdocs/langs/ca_ES/margins.lang | 2 -- htdocs/langs/en_US/margins.lang | 2 -- htdocs/langs/es_ES/margins.lang | 2 -- htdocs/langs/fr_FR/margins.lang | 2 -- htdocs/langs/tr_TR/margins.lang | 2 -- 5 files changed, 10 deletions(-) diff --git a/htdocs/langs/ca_ES/margins.lang b/htdocs/langs/ca_ES/margins.lang index 8a0763f5214..7f80518f2ff 100644 --- a/htdocs/langs/ca_ES/margins.lang +++ b/htdocs/langs/ca_ES/margins.lang @@ -1,8 +1,6 @@ # Dolibarr language file - ca_ES - margins CHARSET=UTF-8 -Module59000Name=Marges -Module59000Desc=Gestió de marges comercials Margin=Marge Margins=Marges TotalMargin=Marge total diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang index f4975b719c7..e8c5ab38b6b 100644 --- a/htdocs/langs/en_US/margins.lang +++ b/htdocs/langs/en_US/margins.lang @@ -1,8 +1,6 @@ # Dolibarr language file - en_US - marges CHARSET=UTF-8 -Module59000Name=Margins -Module59000Desc=Profit margins management Margin=Margin Margins=Margins TotalMargin=Total Margin diff --git a/htdocs/langs/es_ES/margins.lang b/htdocs/langs/es_ES/margins.lang index b4614596ae6..11505132287 100644 --- a/htdocs/langs/es_ES/margins.lang +++ b/htdocs/langs/es_ES/margins.lang @@ -1,8 +1,6 @@ # Dolibarr language file - es_ES - margins CHARSET=UTF-8 -Module59000Name=Márgenes -Module59000Desc=Gestión de márgenes comerciales Margin=Margen Margins=Márgenes TotalMargin=Margen total diff --git a/htdocs/langs/fr_FR/margins.lang b/htdocs/langs/fr_FR/margins.lang index b30e79a3e7b..19910d90291 100644 --- a/htdocs/langs/fr_FR/margins.lang +++ b/htdocs/langs/fr_FR/margins.lang @@ -1,8 +1,6 @@ # Dolibarr language file - fr_FR - margins CHARSET=UTF-8 -Module59000Name=Marges -Module59000Desc=Gestion des marges commerciales Margin=Marge Margins=Marges TotalMargin=Marge totale diff --git a/htdocs/langs/tr_TR/margins.lang b/htdocs/langs/tr_TR/margins.lang index f8d8d6a39a9..c4e807cf8e7 100644 --- a/htdocs/langs/tr_TR/margins.lang +++ b/htdocs/langs/tr_TR/margins.lang @@ -1,8 +1,6 @@ # Dolibarr language file - en_US - marges CHARSET=UTF-8 -Module59000Name=Oranlar -Module59000Desc=Kar oranı yönetimi Margin=Oran Margins=Oranlar TotalMargin=Toplam Oran From 1e76911890eb84a5d648270586fd532b4a1aeee9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 May 2013 15:25:12 +0200 Subject: [PATCH 09/18] Fix: Not error when migrating from version using exotic menu manager. Fix: Delete of member use id --- htdocs/adherents/class/adherent.class.php | 7 +++++-- htdocs/main.inc.php | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index b98b34ded05..0f2b92622c0 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -690,6 +690,9 @@ class Adherent extends CommonObject $error=0; $errorflag=0; + // Check parameters + if (empty($rowid)) $rowid=$this->id; + $this->db->begin(); // Remove category @@ -1103,7 +1106,7 @@ class Adherent extends CommonObject if (count($extralabels)>0) { $this->fetch_optionals($this->id,$extralabels); } - + // Load other properties $result=$this->fetch_subscriptions(); @@ -1534,7 +1537,7 @@ class Adherent extends CommonObject $lien = ''; $lienfin=''; } - + $picto='user'; $label=$langs->trans("ShowMember"); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6bee9a606ca..5a39f4b09ef 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -823,9 +823,9 @@ if (! defined('NOREQUIREMENU')) foreach($dirmenus as $dirmenu) { $menufound=dol_include_once($dirmenu."standard/".$file_menu); - if ($menufound) break; + if (class_exists('MenuManager')) break; } - if (! $menufound) // If failed to include, we try with standard + if (! class_exists('MenuManager')) // If failed to include, we try with standard eldy_menu.php { dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING); $file_menu='eldy_menu.php'; @@ -987,7 +987,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs //$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); print ''."\n"; } - + } print ''."\n"; From 111fc3153bd04b957e40e30d11770c5ad5631bc6 Mon Sep 17 00:00:00 2001 From: fhenry Date: Sun, 12 May 2013 15:45:23 +0200 Subject: [PATCH 10/18] Fix Extrafield selllist bug in PgSQL --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 17226e7d461..6c6a9de1e99 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -825,7 +825,7 @@ class ExtraFields $sql = 'SELECT '.$InfoFieldList[1]; $sql.= ' FROM '.MAIN_DB_PREFIX .$InfoFieldList[0]; - $sql.= ' WHERE '.$keyList.'="'.$this->db->escape($value).'"'; + $sql.= ' WHERE '.$keyList.'=\''.$this->db->escape($value).'\''; //$sql.= ' AND entity = '.$conf->entity; dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql); $resql = $this->db->query($sql); From d9e477d748d33caefb5e39145415cb7c7daeff8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 May 2013 16:38:38 +0200 Subject: [PATCH 11/18] Fix: Civility translation --- htdocs/langs/nl_NL/dict.lang | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/htdocs/langs/nl_NL/dict.lang b/htdocs/langs/nl_NL/dict.lang index c430b86e6d0..37aa3207418 100644 --- a/htdocs/langs/nl_NL/dict.lang +++ b/htdocs/langs/nl_NL/dict.lang @@ -247,10 +247,11 @@ CountryME = Montenegro CountryBL = Saint Barthelemy CountryMF = Saint Martin ##### Civilities ##### = -CivilityMME = Mej. -CivilityMR = Dhr. -CivilityMLE = Mevr. +CivilityMME = Mevrouw +CivilityMR = Meneer +CivilityMLE = Mejuffrouw CivilityMTRE = Meester +CivilityDR = Dokter ##### Currencies ##### = Currencyeuros = Euro CurrencyAUD = Australische Dollars @@ -289,17 +290,17 @@ CurrencyXOF = Francs CFA BCEAO CurrencySingXOF = Franc CFA BCEAO CurrencyXPF = Francs CFP CurrencySingXPF = Franc CFP - - -// START - Lines generated via autotranslator.php tool (2011-10-10 01:37:25). -// Reference language: en_US -> nl_NL -CurrencyUAH=Hryvnia -CurrencySingUAH=Hryvnia -DemandReasonTypeSRC_INTE=Internet -DemandReasonTypeSRC_CAMP_MAIL=Mailing campagne -DemandReasonTypeSRC_CAMP_EMAIL=E-mailen campagne -DemandReasonTypeSRC_CAMP_PHO=Telefoon campagne -DemandReasonTypeSRC_CAMP_FAX=Fax-campagne -DemandReasonTypeSRC_COMM=Commercieel contact -DemandReasonTypeSRC_SHOP=Winkel contact -// STOP - Lines generated via autotranslator.php tool (2011-10-10 01:39:55). + + +// START - Lines generated via autotranslator.php tool (2011-10-10 01:37:25). +// Reference language: en_US -> nl_NL +CurrencyUAH=Hryvnia +CurrencySingUAH=Hryvnia +DemandReasonTypeSRC_INTE=Internet +DemandReasonTypeSRC_CAMP_MAIL=Mailing campagne +DemandReasonTypeSRC_CAMP_EMAIL=E-mailen campagne +DemandReasonTypeSRC_CAMP_PHO=Telefoon campagne +DemandReasonTypeSRC_CAMP_FAX=Fax-campagne +DemandReasonTypeSRC_COMM=Commercieel contact +DemandReasonTypeSRC_SHOP=Winkel contact +// STOP - Lines generated via autotranslator.php tool (2011-10-10 01:39:55). \ No newline at end of file From df6c796413b94642d487a18529c72913a1dd68ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 May 2013 17:09:48 +0200 Subject: [PATCH 12/18] =?UTF-8?q?Fix:=20[=20bug=20#889=20]=20Titre=20civil?= =?UTF-8?q?it=C3=A9=20ne=20s'affiche?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/class/adherent.class.php | 10 ++++------ htdocs/contact/class/contact.class.php | 6 +++--- htdocs/core/class/translate.class.php | 8 +++++--- htdocs/core/lib/functions.lib.php | 1 + 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 0f2b92622c0..e97a09559af 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1493,19 +1493,17 @@ class Adherent extends CommonObject /** - * Return civility label of a contact + * Return civility label of a member * - * @param int $nohtmlentities 0=Encode with htmlentities for HTML output, 1=No htmlentities for memory translation - * @return string Name translated of civility + * @return string Translated name of civility */ - function getCivilityLabel($nohtmlentities=0) + function getCivilityLabel() { global $langs; $langs->load("dict"); $code=$this->civilite_id; - if ($nohtmlentities) return $langs->transnoentities("Civility".$code)!="Civility".$code ? $langs->transnoentities("Civility".$code) : $code; - else return $langs->trans("Civility".$code)!="Civility".$code ? $langs->trans("Civility".$code) : $code; + return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); } /** diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e956f40a3e3..fb1ce97fd01 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -874,9 +874,9 @@ class Contact extends CommonObject } /** - * Return label of a civility contact + * Return civility label of contact * - * @return string Translated name of civility + * @return string Translated name of civility */ function getCivilityLabel() { @@ -884,7 +884,7 @@ class Contact extends CommonObject $langs->load("dict"); $code=$this->civilite_id; - return $langs->trans("Civility".$code)!="Civility".$code ? $langs->trans("Civility".$code) : ''; + return $langs->getLabelFromKey($this->db, "Civility".$code, "c_civilite", "code", "civilite", $code); } /** diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 433100c4cb4..35271325247 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -643,13 +643,15 @@ class Translate * Store key-label found into cache variable $this->cache_labels to save SQL requests to get labels. * * @param DoliBD $db Database handler - * @param string $key Key to get label (key in language file) + * @param string $key Translation key to get label (key in language file) * @param string $tablename Table name without prefix * @param string $fieldkey Field for key * @param string $fieldlabel Field for label + * @param string $keyforselect Use another value than the translation key for the where into select * @return string Label in UTF8 (but without entities) + * @see dol_getIdFromCode */ - function getLabelFromKey($db,$key,$tablename,$fieldkey,$fieldlabel) + function getLabelFromKey($db,$key,$tablename,$fieldkey,$fieldlabel,$keyforselect='') { // If key empty if ($key == '') return ''; @@ -670,7 +672,7 @@ class Translate $sql = "SELECT ".$fieldlabel." as label"; $sql.= " FROM ".MAIN_DB_PREFIX.$tablename; - $sql.= " WHERE ".$fieldkey." = '".$key."'"; + $sql.= " WHERE ".$fieldkey." = '".($keyforselect?$keyforselect:$key)."'"; dol_syslog(get_class($this).'::getLabelFromKey sql='.$sql,LOG_DEBUG); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2fc96042895..c440b8d33dd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4071,6 +4071,7 @@ function dol_osencode($str) * @param string $fieldkey Field for code * @param string $fieldid Field for id * @return int Id of code + * @see getLabelFromKey */ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id') { From a78b3149fe1eb0463f7984f54618fda050af709e Mon Sep 17 00:00:00 2001 From: fhenry Date: Sun, 12 May 2013 17:15:45 +0200 Subject: [PATCH 13/18] Remove debug lines --- htdocs/societe/note.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 8fbd6c6187f..372177c0c89 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -25,10 +25,6 @@ * \ingroup societe */ -error_reporting(E_ALL); -ini_set('display_errors', true); -ini_set('html_errors', false); - require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; From 757c22a204410c49b5996202cc0130bdf45e670f Mon Sep 17 00:00:00 2001 From: fhenry Date: Sun, 12 May 2013 17:54:30 +0200 Subject: [PATCH 14/18] Fix bug intervention numbering on validation --- htdocs/fichinter/class/fichinter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index b2c4884cf3e..a748ef0f549 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -372,7 +372,7 @@ class Fichinter extends CommonObject // Define new ref if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) { - $num = $this->getNextNumRef($soc); + $num = $this->getNextNumRef($this->thirdparty); } else { From 4fc1fe798c3c3bb70c9fa251ea60cd034038f9df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 May 2013 18:20:28 +0200 Subject: [PATCH 15/18] Fix: Bad check on mandatory parameters --- htdocs/adherents/fiche.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 05833bbce10..8c714ab7c67 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -246,9 +246,22 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) { $birthdate=dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]); } + $lastname=$_POST["lastname"]; + $firstname=$_POST["firstname"]; + $morphy=$morphy=$_POST["morphy"];; + if ($morphy != 'mor' && empty($lastname)) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; + } + if ($morphy != 'mor' && (!isset($firstname) || $firstname=='')) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; + } // Create new object - if ($result > 0) + if ($result > 0 && ! $error) { $object->oldcopy=dol_clone($object); @@ -389,6 +402,10 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $action=''; } } + else + { + $action='edit'; + } } if ($action == 'add' && $user->rights->adherent->creer) @@ -489,7 +506,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Password"))."
\n"; } } - if (empty($lastname)) { + if ($morphy != 'mor' && empty($lastname)) { $error++; $langs->load("errors"); $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; From 0c853b3ebd4a1d60319a5e55d07c5fc0027f3b1d Mon Sep 17 00:00:00 2001 From: simnandez Date: Mon, 13 May 2013 17:35:30 +0200 Subject: [PATCH 16/18] Fix: Some bugs on withdrawal rejects --- ChangeLog | 1 + .../class/rejetprelevement.class.php | 4 +- htdocs/compta/prelevement/ligne.php | 57 +++++++++++++------ htdocs/langs/ca_ES/errors.lang | 1 + htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/es_ES/errors.lang | 1 + htdocs/langs/fr_FR/errors.lang | 1 + 7 files changed, 46 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05db29b146b..c9a5e6b7701 100644 --- a/ChangeLog +++ b/ChangeLog @@ -97,6 +97,7 @@ WARNING: If you used external modules, some of them may need to be upgraded due - Fix: Can't reset payment due date - Fix: Orderstoinvoice didn't act as expected when no order was checked - Fix: Bad link to all proposals into Third party card if customer is prospect +- Fix: Some bugs on withdrawal rejects - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed - Fix: [ bug #787 ] Invoice supplier box incorrect tooltip when delay on payment - Fix: [ bug #789 ] VAT not being calculated in POS diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index a6b37df813d..543c0cdbab5 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * * 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 @@ -50,7 +50,7 @@ class RejetPrelevement $this->motifs = array(); $this->facturer = array(); - $this->motifs[0] = $langs->trans("StatusMotif0"); + $this->motifs[0] = ""; //$langs->trans("StatusMotif0"); $this->motifs[1] = $langs->trans("StatusMotif1"); $this->motifs[2] = $langs->trans("StatusMotif2"); $this->motifs[3] = $langs->trans("StatusMotif3"); diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 45dc325f5c1..55dd526bb2a 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2013 Juanjo Menent * * 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 @@ -53,29 +53,49 @@ if ($action == 'confirm_rejet') { if ( GETPOST("confirm") == 'yes') { - $daterej = mktime(2, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); - - $lipre = new LignePrelevement($db, $user); - - if ($lipre->fetch($id) == 0) + if (GETPOST('remonth','int')) { + $daterej = mktime(2, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); + } - if (GETPOST('motif','alpha') > 0 && $daterej < time()) + if (empty($daterej)) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")),'errors'); + } + + elseif ($daterej > dol_now()) + { + $error++; + $langs->load("error"); + setEventMessage($langs->transnoentities("ErrorDateMustBeBeforeToday"),'errors'); + } + + if (GETPOST('motif','alpha') == 0) + { + $error++; + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefusedReason")),'errors'); + } + + if ( ! $error ) + { + $lipre = new LignePrelevement($db, $user); + + if ($lipre->fetch($id) == 0) + { $rej = new RejetPrelevement($db, $user); - + $rej->create($user, $id, GETPOST('motif','alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer','int')); header("Location: ligne.php?id=".$id); exit; } - else - { - dol_syslog("Motif : ".GETPOST('motif','alpha')); - dol_syslog("$daterej $time "); - header("Location: ligne.php?id=".$id."&action=rejet"); - exit; - } + + } + else + { + $action="rejet"; } } else @@ -176,13 +196,13 @@ if ($id) print ''; //Date - print ''.$langs->trans("RefusedData").''; + print ''.$langs->trans("RefusedData").''; print ''; print $form->select_date('','','','','',"confirm_rejet"); print ''; //Reason - print ''.$langs->trans("RefusedReason").''; + print ''.$langs->trans("RefusedReason").''; print ''; print $form->selectarray("motif", $rej->motifs); print ''; @@ -306,8 +326,9 @@ if ($id) dol_print_error($db); } - $db->close(); } llxFooter(); + +$db->close(); ?> diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang index 5a68c272c3a..74411ee6a34 100644 --- a/htdocs/langs/ca_ES/errors.lang +++ b/htdocs/langs/ca_ES/errors.lang @@ -119,6 +119,7 @@ ErrorFailedToAddToMailmanList=S'ha produït un error en intentar afegir un regis ErrorFailedToRemoveToMailmanList=Error en l'eliminació de %s de la llista Mailmain %s o base SPIP ErrorNewValueCantMatchOldValue=El Nou valor no pot ser igual al antic ErrorFailedToValidatePasswordReset=No s'ha pogut restablir la contrasenya. És possible que aquest enllaç ja s'hagi utilitzat (aquest enllaç només es pot utilitzar una vegada). Si no és el cas prova de reiniciar el procés de restabliment de contrasenya des del principi. +ErrorDateMustBeBeforeToday=La data no pot ser superior a avui # Warnings WarningMandatorySetupNotComplete=Els paràmetres obligatoris de configuració no estan encara definits diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 1f02fc11f5f..47c8e2768f7 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -123,6 +123,7 @@ ErrorNewValueCantMatchOldValue=New value can't be equal to old one ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit was already done (this link can be used only one time). If not, try to restart the reinit process. ErrorToConnectToMysqlCheckInstance=Connect to database fails. Check Mysql server is running (in most cases, you can launch it from command line with 'sudo /etc/init.d/mysql start'). ErrorFailedToAddContact=Failed to add contact +ErrorDateMustBeBeforeToday=The date can not be greater than today # Warnings WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index f3b9694e4fe..2b9b4d09f11 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -122,6 +122,7 @@ ErrorFailedToAddToMailmanList=Ha ocurrido un error al intentar añadir un regist ErrorFailedToRemoveToMailmanList=Error en la eliminación de %s de la lista Mailmain %s o base SPIP ErrorNewValueCantMatchOldValue=El nuevo valor no puede ser igual al antiguo ErrorFailedToValidatePasswordReset=No se ha podido restablecer la contraseña. Es posible que este enlace ya se haya utilizado (este enlace sólo puede usarse una vez). Si no es el caso, trate de reiniciar el proceso de restablecimiento de contraseña desde el principio. +ErrorDateMustBeBeforeToday=La fecha no puede ser superior a hoy # Warnings WarningMandatorySetupNotComplete=Los parámetros obligatorios de configuración no están todavía definidos diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 28be39d651f..f3bcee9c4d9 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -124,6 +124,7 @@ ErrorNewValueCantMatchOldValue=La nouvelle valeur ne peut être égale à l'anci ErrorFailedToValidatePasswordReset=Echec de la réinitialisation du mot de passe. Il est possible que ce lien ait déjà été utilisé (l'utilisation de ce lien ne fonctionne qu'une fois). Si ce n'est pas le cas, essayer de recommencer le processus de réinit de mot de passe depuis le début. ErrorToConnectToMysqlCheckInstance=Echec de la connection au serveur de base de donnée. Vérifier que Mysql est bien lancé (dans la plupart des cas, vous pouvez le lancer depuis la ligne de commande par la commande 'sudo /etc/init.d/mysql start'). ErrorFailedToAddContact=Echec à l'ajout du contact +ErrorDateMustBeBeforeToday=La date ne peut pas être supérieure à aujourd'hui # Warnings WarningMandatorySetupNotComplete=Les informations de configuration obligatoire doivent être renseignées From 03cbe6e2088db60d4f034df9e7aa0ec0e455da96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 May 2013 23:46:37 +0200 Subject: [PATCH 17/18] Fix: Can't read link with some styles --- htdocs/core/tpl/login.tpl.php | 4 ++-- htdocs/theme/amarok/style.css.php | 9 +++++++++ htdocs/theme/auguria/style.css.php | 9 +++++++++ htdocs/theme/bureau2crea/style.css.php | 9 +++++++++ htdocs/theme/cameleo/style.css.php | 9 +++++++++ htdocs/theme/eldy/style.css.php | 9 ++++++++- 6 files changed, 46 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 90caed4b8b4..bef263763de 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -134,7 +134,7 @@ if ($forgetpasslink || $helpcenterlink) echo '
'; echo '
'; if ($forgetpasslink) { - echo '('; + echo '('; echo $langs->trans('PasswordForgotten'); if (! $helpcenterlink) { echo ')'; @@ -145,7 +145,7 @@ if ($forgetpasslink || $helpcenterlink) if ($helpcenterlink) { $url=DOL_URL_ROOT.'/support/index.php'.$moreparam; if (! empty($conf->global->MAIN_HELPCENTER_LINKTOUSE)) $url=$conf->global->MAIN_HELPCENTER_LINKTOUSE; - echo ''; + echo ''; if ($forgetpasslink) { echo ' - '; } else { diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index 5788b0f011f..4f55463a323 100755 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -557,6 +557,15 @@ img.login, img.printer, img.entity { font-weight:bold; } +.alogin { + color: #FFF; + font-weight: normal; +} +.alogin:hover { + color: #FFF; + text-decoration:underline; +} + div.login_main_home { color: #000000; } diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index f998fdc4e9c..41bdadf037c 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -596,6 +596,15 @@ div.login a:hover { text-decoration:underline; } +.alogin, .alogin:hover { + color: #888 !important; + font-weight: normal !important; + font-size: px !important; +} +.alogin:hover { + text-decoration:underline !important; +} + img.login, img.printer, img.entity { padding: dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px; margin: 0px 0px 0px 8px; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index f87364fef9b..46abe55ecae 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -640,6 +640,15 @@ div.login a:hover { text-decoration:underline; } +.alogin, .alogin:hover { + color: #888 !important; + font-weight: normal !important; + font-size: px !important; +} +.alogin:hover { + text-decoration:underline !important; +} + img.login, img.printer, img.entity { padding: dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px; margin: 0px 0px 0px 8px; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 568e81f13f2..be7c6532f44 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -651,6 +651,15 @@ div.login a:hover { text-decoration:underline; } +.alogin, .alogin:hover { + color: #888 !important; + font-weight: normal !important; + font-size: px !important; +} +.alogin:hover { + text-decoration:underline !important; +} + img.login, img.printer, img.entity { padding: dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px; margin: 0px 0px 0px 8px; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 1fbca3e51a0..8313a94438b 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -854,7 +854,14 @@ div.login a:hover { color: #; text-decoration:underline; } - +.alogin, .alogin:hover { + color: #888 !important; + font-weight: normal !important; + font-size: px !important; +} +.alogin:hover { + text-decoration:underline !important; +} img.login, img.printer, img.entity { padding: dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px; margin: 0px 0px 0px 8px; From 80817fd8fbe4eeb2a5b8697b42b4b37f1a1d9677 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 May 2013 01:04:21 +0200 Subject: [PATCH 18/18] Fix: translation --- htdocs/langs/el_GR/admin.lang | 4 ---- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/langs/en_US/companies.lang | 2 +- htdocs/langs/nb_NO/companies.lang | 1 - 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/el_GR/admin.lang b/htdocs/langs/el_GR/admin.lang index 5606120714b..c52e1530095 100644 --- a/htdocs/langs/el_GR/admin.lang +++ b/htdocs/langs/el_GR/admin.lang @@ -74,10 +74,6 @@ OSTZ=Ζώνη Ώρας OS server PHPTZ=Ζώνη Ώρας PHP server PHPServerOffsetWithGreenwich=PHP server offset width Greenwich (seconds) ClientOffsetWithGreenwich=Client/Browser offset width Greenwich (seconds) -CurrentHour=PHP server hour -CompanyTZ= Time Zone company (main company) -CompanyHour= Hour company (main company) -CurrentSessionTimeOut=Current session timeout OSEnv=Περιβάλλον OS Box=Πλαίσιο Boxes=Πλαίσια diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f13698ad1a1..944ee7da053 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -116,8 +116,8 @@ PHPServerOffsetWithGreenwich=PHP server offset width Greenwich (seconds) ClientOffsetWithGreenwich=Client/Browser offset width Greenwich (seconds) DaylingSavingTime=Daylight saving time CurrentHour=Hour PHP (server) -CompanyTZ= Time Zone company (main company) -CompanyHour= Hour company (main company) +CompanyTZ= Company time zone (main company) +CompanyHour= Company time (main company) CurrentSessionTimeOut=Current session timeout OSEnv=OS Environment Box=Box diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 56238311a27..9506f72abc5 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -377,7 +377,7 @@ SupplierCategory=Supplier category JuridicalStatus200=Independant DeleteFile=Delete file ConfirmDeleteFile=Are you sure you want to delete this file? -AllocateCommercial=Allocate a commercial +AllocateCommercial=Assigned to sale representative SelectCountry=Select a country SelectCompany=Select a third party Organization=Organization diff --git a/htdocs/langs/nb_NO/companies.lang b/htdocs/langs/nb_NO/companies.lang index 287d2e2c08e..3b1531f5391 100644 --- a/htdocs/langs/nb_NO/companies.lang +++ b/htdocs/langs/nb_NO/companies.lang @@ -248,7 +248,6 @@ NoOtherDeliveryAddress=Ingen alternativ leveringsadresse lagt inn JuridicalStatus200=Uavhengig DeleteFile=Slett fil ConfirmDeleteFile=Er du sikker på at du vil slette denne filen? -AllocateCommercial=Allocate a commercial SelectCountry=Velg land SelectCompany=Velg tredjepart Organization=Organisasjon