From 290856db1ca4f5841ac2171afea8ad5e8fe78e53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Apr 2015 22:37:04 +0200 Subject: [PATCH 01/11] Fix remove warning --- htdocs/user/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 9b1845d6bff..dfdb04b67a2 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -961,7 +961,7 @@ else if ($id > 0) { - $object->fetch($id); + $res=$object->fetch($id); if ($res < 0) { dol_print_error($db,$object->error); exit; } $res=$object->fetch_optionals($object->id,$extralabels); From 7419319c0ffe1f53f01498ff705361732158a360 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Apr 2015 22:39:42 +0200 Subject: [PATCH 02/11] Protection into packager --- build/makepack-dolibarr.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 90f055da9df..ea575c167f5 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -435,17 +435,23 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`; $ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`; + # Security to avoid to package data files $ret=`rm -fr $BUILDROOT/$PROJECT/document`; $ret=`rm -fr $BUILDROOT/$PROJECT/documents`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`; + # Security to avoid to package external modules installed for dolistore validation + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/oscim*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; + # Removed other test files + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; From 43efd76b24463e47ab0ea21ead2d6ea2d7033126 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Apr 2015 23:39:34 +0200 Subject: [PATCH 03/11] Fix remove warnings --- htdocs/user/clicktodial.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 3dc3c14cc12..649d7ca8dee 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -46,7 +46,7 @@ $result = restrictedArea($user, 'user', $id, '&user', $feature2); * Actions */ -if ($action == 'update' && ! $_POST['cancel']) +if ($action == 'update' && ! GETPOST('cancel')) { $edituser = new User($db); $edituser->fetch($id); @@ -138,6 +138,11 @@ if ($id > 0) print ''; } + print 'ClickToDial '.$langs->trans("IdPhoneCaller").''; + print ''; + print ''; + print "\n"; + print 'ClickToDial '.$langs->trans("Login").''; print ''; print ''; @@ -148,11 +153,6 @@ if ($id > 0) print ''; print "\n"; - print 'ClickToDial '.$langs->trans("IdPhoneCaller").''; - print ''; - print ''; - print "\n"; - print ''; print '
'; @@ -185,15 +185,20 @@ if ($id > 0) print ''; print ''; } + + print 'ClickToDial '.$langs->trans("IdPhoneCaller").''; + print ''.(! empty($fuser->clicktodial_poste)?$fuser->clicktodial_poste:'').''; + print ""; + print 'ClickToDial '.$langs->trans("Login").''; print ''.(! empty($fuser->clicktodial_login)?$fuser->clicktodial_login:'').''; print ''; + print 'ClickToDial '.$langs->trans("Password").''; print ''.preg_replace('/./','*',(! empty($fuser->clicktodial_password)?$fuser->clicktodial_password:'')).''; print "\n"; - print 'ClickToDial '.$langs->trans("IdPhoneCaller").''; - print ''.(! empty($fuser->clicktodial_poste)?$fuser->clicktodial_poste:'').''; - print "\n"; + + print "\n"; } print "\n"; From f1032baaab0b212af180d4bbc113a254c1adb959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 30 Apr 2015 11:48:32 +0200 Subject: [PATCH 04/11] Allow exporting projects without a third party FIX #2729 --- htdocs/core/modules/modProjet.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 63e917ab04d..5e524a8f89d 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -280,11 +280,9 @@ class modProjet extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON p.rowid = pt.fk_projet"; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_task_extrafields as extra2 ON pt.rowid = extra2.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,"; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity; - + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task"; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON p.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' WHERE p.entity = '.$conf->entity; } From a6b0f6cfac2fd54250f99713e500a04e340de56d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 30 Apr 2015 11:48:32 +0200 Subject: [PATCH 05/11] Allow exporting projects without a third party FIX #2729 --- htdocs/core/modules/modProjet.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index db0b0d765c3..e32911c3759 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -280,11 +280,9 @@ class modProjet extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON p.rowid = pt.fk_projet"; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_task_extrafields as extra2 ON pt.rowid = extra2.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,"; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity; - + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task"; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON p.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' WHERE p.entity = '.$conf->entity; } From b203263e9188d051418e70fa281836e867295b24 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 May 2015 12:16:36 +0200 Subject: [PATCH 06/11] Fix : shipment PDF was not using generation params --- htdocs/core/modules/expedition/modules_expedition.php | 4 ++-- htdocs/expedition/fiche.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php index ceddd5064e1..e178cea51a6 100644 --- a/htdocs/core/modules/expedition/modules_expedition.php +++ b/htdocs/core/modules/expedition/modules_expedition.php @@ -149,7 +149,7 @@ abstract class ModelNumRefExpedition * @param Translate $outputlangs Objet lang a utiliser pour traduction * @return int <=0 if KO, >0 if OK */ -function expedition_pdf_create($db, $object, $modele, $outputlangs) +function expedition_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { global $conf,$user,$langs; @@ -214,7 +214,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs) // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output=$outputlangs->charset_output; - if ($obj->write_file($object, $outputlangs, $srctemplatepath) > 0) + if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0) { $outputlangs->charset_output=$sav_charset_output; diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 5afbb78d241..9cda78f59fe 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -255,7 +255,7 @@ if (empty($reshook)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { $ret=$object->fetch($id); // Reload to get new records - $result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs); + $result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref); } if ($result < 0) { @@ -355,7 +355,7 @@ if (empty($reshook)) { $outputlangs = new Translate("",$conf); $outputlangs->setDefaultLang($newlang); } - $result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs); + $result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref); if ($result <= 0) { dol_print_error($db,$result); From d2603d5308d7a46fa0c994067fabc7ff81055e78 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 May 2015 12:39:10 +0200 Subject: [PATCH 07/11] Fix : shipment was not considered as billed after classifybilled function --- htdocs/expedition/class/expedition.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index d86061949dd..ce9885c1f1a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1540,6 +1540,8 @@ class Expedition extends CommonObject if ($this->db->query($sql) ) { //TODO: Option to set order billed if 100% of order is shipped + $this->billed=1; + $this->db->commit(); return 1; } else From 42455f771a0a00933e33c94092fd2bad1cc203ef Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 6 May 2015 12:43:41 +0200 Subject: [PATCH 08/11] Missing comments --- .../modules/expedition/modules_expedition.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php index e178cea51a6..f225367defa 100644 --- a/htdocs/core/modules/expedition/modules_expedition.php +++ b/htdocs/core/modules/expedition/modules_expedition.php @@ -141,13 +141,16 @@ abstract class ModelNumRefExpedition } /** - * Cree un bon d'expedition sur disque + * Cree un bon d'expedition sur disque * - * @param DoliDB $db Objet base de donnee - * @param Object $object Object expedition - * @param string $modele Force le modele a utiliser ('' to not force) - * @param Translate $outputlangs Objet lang a utiliser pour traduction - * @return int <=0 if KO, >0 if OK + * @param DoliDB $db Objet base de donnee + * @param Object $object Object expedition + * @param string $modele Force le modele a utiliser ('' to not force) + * @param Translate $outputlangs Objet lang a utiliser pour traduction + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @return int <=0 if KO, >0 if OK */ function expedition_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { From 29f562460a0498c58f70e335a6e555619c059ca8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 7 May 2015 17:23:32 +0200 Subject: [PATCH 09/11] fix [ bug #1926 ] [contract] Wrong Rights Checked --- htdocs/contrat/fiche.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 38a2b3f1095..0545ce2e25d 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -1137,7 +1137,7 @@ else $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 && GETPOST('attribute') == $key) { + if ($action == 'edit_extras' && $user->rights->contrat->creer && GETPOST('attribute') == $key) { print '
'; print ''; print ''; @@ -1150,7 +1150,7 @@ else print '
'; } else { print $extrafields->showOutputField($key, $value); - if ($object->statut == 0 && $user->rights->commande->creer) + if ($object->statut == 0 && $user->rights->contrat->creer) print '' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; } print '' . "\n"; From f8e8b39ff2b16e08961c5b68deefa8fb97acc295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 10 May 2015 01:27:28 +0200 Subject: [PATCH 10/11] FIX #2758 Product::update sets product note to "null" when $prod->note is null --- ChangeLog | 1 + htdocs/product/class/product.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c4919910d9..1173dab3204 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref +Fix: [ bug #2758 ] Product::update sets product note to "null" when $prod->note is null ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e6695b75bc6..9dac082a1a3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -442,7 +442,7 @@ class Product extends CommonObject $this->ref = dol_string_nospecial(trim($this->ref)); $this->libelle = trim($this->libelle); $this->description = trim($this->description); - $this->note = (isset($this->note)? trim($this->note):"null"); + $this->note = (isset($this->note)? trim($this->note):null); $this->weight = price2num($this->weight); $this->weight_units = trim($this->weight_units); $this->length = price2num($this->length); @@ -493,7 +493,7 @@ class Product extends CommonObject $sql.= ", accountancy_code_sell= '" . $this->accountancy_code_sell."'"; $sql.= ", desiredstock = " . ((isset($this->desiredstock) && $this->desiredstock != '') ? $this->desiredstock : "null"); $sql.= " WHERE rowid = " . $id; - +var_dump($sql);die; dol_syslog(get_class($this)."update sql=".$sql); $resql=$this->db->query($sql); if ($resql) From f6616deef3b74343a5c28adc969540366f1ed878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 10 May 2015 01:28:40 +0200 Subject: [PATCH 11/11] Removed debugging function --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9dac082a1a3..10762d4e271 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -493,7 +493,7 @@ class Product extends CommonObject $sql.= ", accountancy_code_sell= '" . $this->accountancy_code_sell."'"; $sql.= ", desiredstock = " . ((isset($this->desiredstock) && $this->desiredstock != '') ? $this->desiredstock : "null"); $sql.= " WHERE rowid = " . $id; -var_dump($sql);die; + dol_syslog(get_class($this)."update sql=".$sql); $resql=$this->db->query($sql); if ($resql)