From 290856db1ca4f5841ac2171afea8ad5e8fe78e53 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Apr 2015 22:37:04 +0200 Subject: [PATCH 01/26] 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/26] 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/26] 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/26] 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/26] 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/26] 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/26] 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/26] 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 4f8c485914e2e6494e9ccc8a98558d0d8dece08b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 6 May 2015 16:44:47 +0200 Subject: [PATCH 09/26] Fix: use global $object instead parameter --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 4b9e7eb520f..d8cd58fe12d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -728,13 +728,13 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable * @param int $disableglob Disable usage of glob like * * @param int $nophperrors Disable all PHP output errors * @param int $nohook Disable all hooks - * @param object $object Current object in use + * @deprecated object $object Current object in use * @return boolean True if file is deleted (or if glob is used and there's nothing to delete), False if error */ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null) { global $db, $conf, $user, $langs; - global $hookmanager; + global $object, $hookmanager; $langs->load("other"); $langs->load("errors"); From c6d841613bdbeef049bfe220f3616d02ded376c2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 7 May 2015 11:42:35 +0200 Subject: [PATCH 10/26] Revert "Fix: use global $object instead parameter" This reverts commit 4f8c485914e2e6494e9ccc8a98558d0d8dece08b. --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d8cd58fe12d..4b9e7eb520f 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -728,13 +728,13 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable * @param int $disableglob Disable usage of glob like * * @param int $nophperrors Disable all PHP output errors * @param int $nohook Disable all hooks - * @deprecated object $object Current object in use + * @param object $object Current object in use * @return boolean True if file is deleted (or if glob is used and there's nothing to delete), False if error */ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null) { global $db, $conf, $user, $langs; - global $object, $hookmanager; + global $hookmanager; $langs->load("other"); $langs->load("errors"); From 85244ba8c9542069884ec147ffed17a7eca33f25 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 7 May 2015 11:59:45 +0200 Subject: [PATCH 11/26] Fix: add $object for use with triggers --- htdocs/product/class/product.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 9e25415b47f..87cc5fd0015 100755 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007-2011 Jean Heimburger * Copyright (C) 2010-2013 Juanjo Menent @@ -70,9 +70,9 @@ class Product extends CommonObject * @var string */ var $label; - /** + /** * Product descripion - * @var string + * @var string */ var $description; @@ -3692,7 +3692,7 @@ class Product extends CommonObject $filename = preg_replace('/'.preg_quote($dir,'/').'/i','',$file); // Nom du fichier // On efface l'image d'origine - dol_delete_file($file); + dol_delete_file($file, 0, 0, 0, $this); // For triggers // Si elle existe, on efface la vignette if (preg_match('/('.$this->regeximgext.')$/i',$filename,$regs)) From 5578151badd69eba8a1803aa41d224b560271fac Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 7 May 2015 11:59:45 +0200 Subject: [PATCH 12/26] Fix: add $object for use with triggers --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 979c1a935f9..a0ade451c53 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur - * Copyright (C) 2005-2014 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007-2011 Jean Heimburger * Copyright (C) 2010-2013 Juanjo Menent @@ -3437,7 +3437,7 @@ class Product extends CommonObject $filename = preg_replace('/'.preg_quote($dir,'/').'/i','',$file); // Nom du fichier // On efface l'image d'origine - dol_delete_file($file); + dol_delete_file($file, 0, 0, 0, $this); // For triggers // Si elle existe, on efface la vignette if (preg_match('/('.$this->regeximgext.')$/i',$filename,$regs)) From 29f562460a0498c58f70e335a6e555619c059ca8 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 7 May 2015 17:23:32 +0200 Subject: [PATCH 13/26] 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 577c872aafbdd88ebfdd8c818061978e14d1a2b6 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 7 May 2015 20:44:31 +0200 Subject: [PATCH 14/26] Code fixes --- htdocs/fourn/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 2a01602eadc..5ab115f01d3 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -5,6 +5,7 @@ * Copyright (C) 2013 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador + * Copyright (C) 2015 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 @@ -153,7 +154,7 @@ if ($search_ref) if (is_numeric($search_ref)) $sql .= natural_search(array('fac.ref'), $search_ref); else $sql .= natural_search('fac.ref', $search_ref); } -if (search_ref_supplier) +if ($search_ref_supplier) { $sql .= natural_search('fac.ref_supplier', $search_ref_supplier); } 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 15/26] 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 16/26] 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) From 9988b1ad4eef5363d47d22f0348f84d84ceee8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 10 May 2015 12:43:21 +0200 Subject: [PATCH 17/26] Revert 25812f0 --- htdocs/societe/soc.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 00345c87566..70f98d5df81 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -7,7 +7,6 @@ * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011-2013 Alexandre Spangaro - * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -1775,6 +1774,20 @@ else print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"action-delete"); } + if ($action == 'merge') { + $form = new Form($db); + + $options = array( + array( + 'label' => $langs->trans('MergeOriginThirdparty'), + 'type' => 'other', + 'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 1) + ) + ); + + print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id,$langs->trans("MergeThirdparties"),$langs->trans("ConfirmMergeThirdparties"),"confirm_merge",$options,'',1); + } + dol_htmloutput_errors($error,$errors); $showlogo=$object->logo; @@ -2225,6 +2238,8 @@ else $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { + print ''; + if (! empty($object->email)) { $langs->load("mails"); From fb01f89e95f2e077dadc5dd33e08eb54396dd262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 10 May 2015 12:44:36 +0200 Subject: [PATCH 18/26] Unwanted deletion --- htdocs/societe/soc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 70f98d5df81..f8d7f05725a 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -7,6 +7,7 @@ * Copyright (C) 2008 Patrick Raguin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011-2013 Alexandre Spangaro + * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify From fece843091e9f40a5bbe229e9fc8d6336d6047cf Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 10 May 2015 15:08:53 +0200 Subject: [PATCH 19/26] Theme Md: Change font & divide by two the border-radius --- htdocs/theme/md_exp/style.css.php | 108 +++++++++++++++--------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/htdocs/theme/md_exp/style.css.php b/htdocs/theme/md_exp/style.css.php index 739f26ce1de..ee46a7f1aaa 100644 --- a/htdocs/theme/md_exp/style.css.php +++ b/htdocs/theme/md_exp/style.css.php @@ -64,7 +64,7 @@ $theme='eldy'; // Value of theme if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global->MAIN_OVERWRITE_THEME_RES; $theme=$conf->global->MAIN_OVERWRITE_THEME_RES; } // Define image path files and other constants -$fontlist='arial,tahoma,verdana,helvetica'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; +$fontlist='Open Sans,sans-serif'; //$fontlist='Verdana,Helvetica,Arial,sans-serif'; $img_head=''; $img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1); $dol_hide_topmenu=$conf->dol_hide_topmenu; @@ -108,7 +108,7 @@ $colorbacklinepair2=(250+round($isred/3)).','.(250+round($isgreen/3)).','.(250+r $colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)); // line pair $colorbackbody='#f0f0f0'; $colortext='40,40,40'; -$fontsize='12'; +$fontsize='13'; $fontsizesmaller='11'; // Eldy colors @@ -256,7 +256,7 @@ input, input.flat, textarea, textarea.flat, form.flat select select, select.flat } input, textarea, select { - border-radius:4px; + border-radius:2px; border:solid 1px rgba(0,0,0,.3); border-top:solid 1px rgba(0,0,0,.3); border-bottom:solid 1px rgba(0,0,0,.2); @@ -330,9 +330,9 @@ fieldset { border: 1px solid #AAAAAA !important; box-shadow: 2px 2px 3px #DDD; } filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border: 1px solid #bbbbbb; border-bottom-color: #a2a2a2; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); @@ -922,7 +922,7 @@ form#login { -webkit-box-shadow: 3px 2px 20px #CCC; box-shadow: 3px 2px 20px #CCC;*/ - border-radius: 8px; + border-radius: 4px; border:solid 1px rgba(80,80,80,.4); border-top:solid 1px f8f8f8; @@ -1177,9 +1177,9 @@ td.photo { background-repeat: repeat-x !important; border: 1px solid #CCC !important; - -moz-border-radius: 5px 5px 5px 5px !important; - -webkit-border-radius: 5px 5px 5px 5px !important; - border-radius: 5px 5px 5px 5px !important; + -moz-border-radius: 2px 2px 2px 2px !important; + -webkit-border-radius: 2px 2px 2px 2px !important; + border-radius: 2px 2px 2px 2px !important; -moz-box-shadow: 2px 2px 4px #DDD; -webkit-box-shadow: 2px 2px 4px #DDD; box-shadow: 2px 2px 4px #DDD; @@ -1414,9 +1414,9 @@ div.tabBar { padding-right: px; padding-bottom: 8px; margin: 0px 0px 14px 0px; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius: 6px; + -moz-border-radius:3px; + -webkit-border-radius: 3px; + border-radius: 3px; border-right: 1px solid #BBB; border-bottom: 1px solid #BBB; border-left: 1px solid #BBB; @@ -1461,9 +1461,9 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { text-decoration: none; white-space: nowrap; - /*-moz-border-radius:6px 6px 0px 0px; - -webkit-border-radius:6px 6px 0px 0px; - border-radius:6px 6px 0px 0px; + /*-moz-border-radius:3px 3px 0px 0px; + -webkit-border-radius:3px 3px 0px 0px; + border-radius:3px 3px 0px 0px; -moz-box-shadow: 0 -1px 4px rgba(0,0,0,.1); -webkit-box-shadow: 0 -1px 4px rgba(0,0,0,.1); @@ -1483,9 +1483,9 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { border-left: 1px solid #D0D0D0; border-top: 1px solid #D8D8D8; - -moz-border-radius:6px 6px 0px 0px; - -webkit-border-radius:6px 6px 0px 0px; - border-radius:6px 6px 0px 0px; + -moz-border-radius:3px 3px 0px 0px; + -webkit-border-radius:3px 3px 0px 0px; + border-radius:3px 3px 0px 0px; -moz-box-shadow: 0 -1px 4px rgba(0,0,0,.1); -webkit-box-shadow: 0 -1px 4px rgba(0,0,0,.1); @@ -1526,9 +1526,9 @@ span.tabspan { margin: 0em 0.2em; text-decoration: none; white-space: nowrap; - -moz-border-radius:6px 6px 0px 0px; - -webkit-border-radius:6px 6px 0px 0px; - border-radius:6px 6px 0px 0px; + -moz-border-radius:3px 3px 0px 0px; + -webkit-border-radius:3px 3px 0px 0px; + border-radius:3px 3px 0px 0px; border-: 1px solid #555555; border-: 1px solid #D8D8D8; @@ -1552,9 +1552,9 @@ div.divButAction { margin-bottom: 1.4em; } background: white; border: 1px solid #8CACBB; color: #434956; - -moz-border-radius:0px 5px 0px 5px; - -webkit-border-radius:0px 5px 0px 5px; - border-radius:0px 5px 0px 5px; + -moz-border-radius:0px 2px 0px 2px; + -webkit-border-radius:0px 2px 0px 2px; + border-radius:0px 2px 0px 2px; -moz-box-shadow: 2px 2px 3px #DDD; -webkit-box-shadow: 2px 2px 3px #DDD; box-shadow: 2px 2px 3px #DDD; @@ -1584,9 +1584,9 @@ div.divButAction { margin-bottom: 1.4em; } background: white !important; border: 1px solid #AAAAAA !important; color: #AAAAAA !important; - -moz-border-radius:0px 5px 0px 5px; - -webkit-border-radius:0px 5px 0px 5px; - border-radius:0px 5px 0px 5px; + -moz-border-radius:0px 2px 0px 2px; + -webkit-border-radius:0px 2px 0px 2px; + border-radius:0px 2px 0px 2px; -moz-box-shadow: 3px 3px 4px #DDD; -webkit-box-shadow: 3px 3px 4px #DDD; box-shadow: 3px 3px 4px #DDD; @@ -1628,9 +1628,9 @@ span.butAction, span.butActionDelete { filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border: 1px solid #bbbbbb; border-bottom-color: #a2a2a2; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); @@ -1781,9 +1781,9 @@ table.noborder, table.formdoc, div.noborder { -webkit-box-shadow: 2px 2px 4px #CCC; box-shadow: 2px 2px 4px #CCC; - -moz-border-radius: 0.2em; - -webkit-border-radius: 0.2em; - border-radius: 0.2em; + -moz-border-radius: 0.1em; + -webkit-border-radius: 0.1em; + border-radius: 0.1em; } table.noborder tr, div.noborder form { @@ -2044,7 +2044,7 @@ div.tabBar .noborder { margin-bottom: 8px !important;*/ border: 1px solid #AAA; text-align: center; - border-radius: 5px; + border-radius: 2px; } .boxtable { @@ -2134,9 +2134,9 @@ div.warning { padding: 0.3em 0.3em 0.3em 0.3em; margin: 0.5em 0em 0.5em 0em; border: 1px solid #e0d0b0; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius: 6px; + -moz-border-radius:3px; + -webkit-border-radius: 3px; + border-radius: 3px; background: #EFDF9A; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } @@ -2146,9 +2146,9 @@ div.error { padding: 0.3em 0.3em 0.3em 0.3em; margin: 0.5em 0em 0.5em 0em; border: 1px solid #DC9CAB; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius: 6px; + -moz-border-radius:3px; + -webkit-border-radius: 3px; + border-radius: 3px; background: #EFCFCF; } @@ -2158,9 +2158,9 @@ div.info { padding: 0.4em 0.4em 0.4em 0.4em; margin: 0.5em 0em 0.5em 0em; border: 1px solid #DFBF9A; - -moz-border-radius:6px; - -webkit-border-radius: 6px; - border-radius:6px; + -moz-border-radius:3px; + -webkit-border-radius: 3px; + border-radius:3px; background: #EFCFAA; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } @@ -2324,9 +2324,9 @@ padding: 2px; z-index: 3000; background-color: #EFCFAA; opacity: 1; --moz-border-radius:6px; --webkit-border-radius: 6px; -border-radius: 6px; +-moz-border-radius:3px; +-webkit-border-radius: 3px; +border-radius: 3px; } #tiptip_content { background-color: rgb(252,248,246); @@ -2346,9 +2346,9 @@ img.datecallink { padding-left: 2px !important; padding-right: 2px !important; } } .bodyline { - -moz-border-radius: 8px; - -webkit-border-radius: 8px; - border-radius: 8px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; border: 1px #E4ECEC outset; padding: 0px; margin-bottom: 5px; @@ -2461,7 +2461,7 @@ table.cal_month { border-spacing: 0px; } .cal_peruser { padding: 0px; } .peruser_busy { background: #CC8888; } .peruser_notbusy { background: #EEDDDD; opacity: 0.5; } -table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px; +table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25); moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25); @@ -2726,9 +2726,9 @@ a.cke_dialog_ui_button background-image: url() !important; background-position: bottom !important; border: 1px solid #C0C0C0 !important; - -moz-border-radius:0px 5px 0px 5px !important; - -webkit-border-radius:0px 5px 0px 5px !important; - border-radius:0px 5px 0px 5px !important; + -moz-border-radius:0px 2px 0px 2px !important; + -webkit-border-radius:0px 2px 0px 2px !important; + border-radius:0px 2px 0px 2px !important; -moz-box-shadow: 3px 3px 4px #DDD !important; -webkit-box-shadow: 3px 3px 4px #DDD !important; box-shadow: 3px 3px 4px #DDD !important; From 443badfbcf3d8ba4c51bc0efb6dd5e6b9e4cc691 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 10 May 2015 17:39:57 +0200 Subject: [PATCH 20/26] New : Signature area on proposal PDF --- .../modules/propale/doc/pdf_azur.modules.php | 33 +++++++++++++++++++ htdocs/langs/en_US/propal.lang | 1 + 2 files changed, 34 insertions(+) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index c519a0adff3..fc7bcfb3d3a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -644,6 +644,9 @@ class pdf_azur extends ModelePDFPropales $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs); } */ + + // Customer signature area + $posy=$this->_signature_area($pdf, $object, $posy, $outputlangs); // Pied de page $this->_pagefoot($pdf,$object,$outputlangs); @@ -1531,5 +1534,35 @@ class pdf_azur extends ModelePDFPropales return pdf_pagefoot($pdf,$outputlangs,'PROPALE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); } + /** + * Show area for the customer to sign + * + * @param PDF $pdf Object PDF + * @param Facture $object Object invoice + * @param int $posy Position depart + * @param Translate $outputlangs Objet langs + * @return int Position pour suite + */ + function _signature_area(&$pdf, $object, $posy, $outputlangs) + { + $default_font_size = pdf_getPDFFontSize($outputlangs); + $tab_top = $posy + 4; + $tab_hl = 4; + $pdf->SetFont('','', $default_font_size - 1); + + $posx = 120; + $largcol = ($this->page_largeur - $this->marge_droite - $posx); + $useborder=0; + $index = 0; + // Total HT + $pdf->SetFillColor(255,255,255); + $pdf->SetXY($posx, $tab_top + 0); + $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1); + + $pdf->SetXY($posx, $tab_top + $tab_hl); + $pdf->MultiCell($largcol, $tab_hl*6, '', 1, 'R'); + + return ($tab_hl*7); + } } diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index c57e9c38324..168f98a2789 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -98,3 +98,4 @@ DocModelJauneDescription=Jaune proposal model DefaultModelPropalCreate=Default model creation DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced) DefaultModelPropalClosed=Default template when closing a business proposal (unbilled) +ProposalCustomerSignature=Written acceptance, company stamp, date and signature \ No newline at end of file From 5bac040a9ae2431dd08e09492899801988be7cce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2015 21:21:29 +0200 Subject: [PATCH 21/26] Enhance prototype for select --- htdocs/core/class/html.form.class.php | 80 ++++++++++++++++++++++++++- htdocs/public/test/test_arrays.php | 3 +- htdocs/public/test/test_forms.php | 56 +++++++++++-------- 3 files changed, 114 insertions(+), 25 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1e05a3b6c3d..150ca48e477 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4347,7 +4347,8 @@ class Form $out.=' '; } - $out.=''; if ($show_empty) { @@ -4400,6 +4401,79 @@ class Form return $out; } + + /** + * Return a HTML select string, built from an array of key+value. + * Note: Do not use returned string into a langs->trans function, content may be entity encoded twice. + * + * @param string $url Url + * @param string $htmlname Name of html select area + * @param array $array Array with key+value + * @param string $id Preselected key + * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '). + * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" + * @param int $value_as_key 1 to use value as key + * @param string $moreparam Add more parameters onto the select tag + * @param int $translate Translate and encode value + * @param int $maxlen Length maximum for labels + * @param int $disabled Html select box is disabled + * @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort + * @param string $morecss Add more class to css styles + * @param int $addjscombo Add js combo + * @return string HTML select string. + */ + static function selectArrayAjax($url, $htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0) + { + $out = ''; + + // Add code for jquery to use multiselect + if ($addjscombo && empty($conf->dol_use_jmobile)) + { + $tmpplugin='select2'; + $out.=' + '; + } + else + { + // TODO get values from ajax page to use a standard already completed array + + } + + $out.=self::selectarray('.'.$htmlname, $array, $id, $show_empty, $key_in_label, $value_as_key, '', $translate, $maxlen, $disabled, $sort, '', 0); + + return $out; + } + /** * Show a multiselect form from an array. * @@ -4450,6 +4524,7 @@ class Form print ' }; $(document).ready(function () { $(\'#'.$htmlname.'\').'.$tmpplugin.'({ + dir: \'ltr\', // Specify format function for dropdown item formatResult: formatResult, templateResult: formatResult, /* For 4.0 */ @@ -4493,6 +4568,7 @@ class Form } + /** * Render list of categories linked to object with id $id and type $type * diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index e08eb5715c4..c2be96b4468 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -61,8 +61,9 @@ else

This page is a sample of page using tables. It is designed to make test with
-- css (add parameter &theme=newthem to test another theme or edit css of current theme)
+- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
- jmobile (add parameter dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
+- no javascript / usage for bind people (add parameter nojs=1 to force disable javascript)
- dataTables
- tablednd

diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php index 86db08fe148..c0c81882fe2 100644 --- a/htdocs/public/test/test_forms.php +++ b/htdocs/public/test/test_forms.php @@ -16,8 +16,9 @@ llxHeader();

This page is a sample of page using Dolibarr HTML widget methods. It is designed to make test with
-- css (edit page to change to test another css)
-- jmobile (add parameter dol_use_jmobile=1 to enable view with jmobile)
+- css (add parameter &theme=newtheme to test another theme or edit css of current theme)
+- jmobile (add parameter dol_use_jmobile=1&dol_optimize_smallscreen=1 to enable view with jmobile)
+- no javascript / usage for bind people (add parameter nojs=1 to force disable javascript)


@@ -44,41 +45,52 @@ print '

'."\n"; print "Test 3: We must have here 1970-01-01 00:00:00 selected (fields are mandatory)
\n"; $form->select_date(dol_get_first_day(1970,1,false), 'test3', 1, 1, 0); -print '

'."\n"; +/*print '

'."\n"; -// Test4a: form->select_product -print "Test 4: Select product - "; -$form->select_produits(0,'producttest'); +print "Test 4c: a select with ajax refresh
\n"; +//$array=array(0=>'',1=>'Search into xxx',2=>'Search into yyy',3=>'Search into zzz'); +$array=array(); +$selected=-1; +print $form->selectArrayAjax(DOL_URL_ROOT.'/core/ajax/selecsearchbox.php', 'testselectc', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); +*/ print '

'."\n"; -// Test4b: form->selectarray -print "Test 4: Select array - "; +// Test4: a select +print "Test 4a: a select
\n"; +$array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3 ith a very long text. aze eazeae e ae aeae a e a ea ea ea e a e aea e ae aeaeaeaze.'); +$selected=3; +print $form->selectarray('testselecta', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); +print '

'; +print "Test 4b: a select
\n"; +$array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3'); +$selected=3; +print $form->selectarray('testselectb', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); +print '

'."\n"; +print "Test 4c: Select array with no js forced
\n"; $array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3'); -$arrayselected=array(1,3); print $form->selectarray('selectarray',$array); print '

'."\n"; +// Test4d: form->select_thirdparty +print "Test 4d: Select thirdparty
\n"; +print $form->select_thirdparty(0,'thirdpartytest'); + +print '

'."\n"; + +// Test4e: form->select_product +print "Test 4e: Select product (using ajax)
\n"; +$form->select_produits(0,'producttest'); + +print '

'."\n"; + // Test5: a multiselect print "Test 5: a multiselect
\n"; $array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3'); $arrayselected=array(1,3); print $form->multiselectarray('testmulti', $array, $arrayselected, '', 0, '', 0, 250); -print '

'."\n"; - -// Test6: a select -print "Test 6a: a select
\n"; -$array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3 ith a very long text. aze eazeae e ae aeae a e a ea ea ea e a e aea e ae aeaeaeaze.'); -$selected=3; -print $form->selectarray('testselecta', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); -print '

'; -print "Test 6b: a select
\n"; -$array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3'); -$selected=3; -print $form->selectarray('testselectb', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1); - llxFooter(); $db->close(); From a503d90982f6c953adb3d65764c8779c21df8497 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2015 23:37:04 +0200 Subject: [PATCH 22/26] FIX We did a test on a permission to export contract when permission did not exists. --- htdocs/core/modules/modContrat.class.php | 64 +++++++++++++++--------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index daf8d4da537..dedfc4efff0 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -85,37 +85,51 @@ class modContrat extends DolibarrModules // Permissions $this->rights = array(); $this->rights_class = 'contrat'; + $r=0; + + $r++; + $this->rights[$r][0] = 161; + $this->rights[$r][1] = 'Lire les contrats'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'lire'; - $this->rights[1][0] = 161; - $this->rights[1][1] = 'Lire les contrats'; - $this->rights[1][2] = 'r'; - $this->rights[1][3] = 1; - $this->rights[1][4] = 'lire'; + $r++; + $this->rights[$r][0] = 162; + $this->rights[$r][1] = 'Creer / modifier les contrats'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'creer'; - $this->rights[2][0] = 162; - $this->rights[2][1] = 'Creer / modifier les contrats'; - $this->rights[2][2] = 'w'; - $this->rights[2][3] = 0; - $this->rights[2][4] = 'creer'; + $r++; + $this->rights[$r][0] = 163; + $this->rights[$r][1] = 'Activer un service d\'un contrat'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'activer'; - $this->rights[3][0] = 163; - $this->rights[3][1] = 'Activer un service d\'un contrat'; - $this->rights[3][2] = 'w'; - $this->rights[3][3] = 0; - $this->rights[3][4] = 'activer'; + $r++; + $this->rights[$r][0] = 164; + $this->rights[$r][1] = 'Desactiver un service d\'un contrat'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'desactiver'; - $this->rights[4][0] = 164; - $this->rights[4][1] = 'Desactiver un service d\'un contrat'; - $this->rights[4][2] = 'w'; - $this->rights[4][3] = 0; - $this->rights[4][4] = 'desactiver'; + $r++; + $this->rights[$r][0] = 165; + $this->rights[$r][1] = 'Supprimer un contrat'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'supprimer'; - $this->rights[5][0] = 165; - $this->rights[5][1] = 'Supprimer un contrat'; - $this->rights[5][2] = 'd'; - $this->rights[5][3] = 0; - $this->rights[5][4] = 'supprimer'; + $r++; + $this->rights[$r][0] = 167; + $this->rights[$r][1] = 'Export contracts'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'export'; + // Exports //-------- $r=1; From 8b596d7a69ab32281367df29205d6e4246a8b024 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2015 23:43:18 +0200 Subject: [PATCH 23/26] Fix css missing --- htdocs/comm/propal/index.php | 2 +- htdocs/commande/index.php | 2 +- htdocs/contrat/index.php | 2 +- htdocs/fourn/commande/index.php | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index de51cf63104..bfa82a5ea84 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -133,7 +133,7 @@ if ($resql) } if ($conf->use_javascript_ajax) { - print ''; + print ''; $data=array('series'=>$dataseries); dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0d2815a6d67..fac4da390ad 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -127,7 +127,7 @@ if ($resql) } if ($conf->use_javascript_ajax) { - print ''; + print ''; $data=array('series'=>$dataseries); dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 02a580174c3..d76bc42a05e 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -196,7 +196,7 @@ foreach($listofstatus as $status) } if (! empty($conf->use_javascript_ajax)) { - print ''; + print ''; $data=array('series'=>$dataseries); dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 0f04ee91eaa..0943e76c3a5 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -56,7 +56,7 @@ print ''; /* * Search form -*/ + */ $var=false; print ''; print ''; @@ -71,7 +71,7 @@ print "

\n"; /* * Statistics -*/ + */ $sql = "SELECT count(cf.rowid), fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -131,7 +131,7 @@ if ($resql) } if ($conf->use_javascript_ajax) { - print ''; + print ''; $data=array('series'=>$dataseries); dol_print_graph('stats',300,180,$data,1,'pie',1); print ''; From f275145bd2481b0e93c53e0a0243e13999eff775 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 May 2015 23:37:04 +0200 Subject: [PATCH 24/26] FIX We did a test on a permission to export contract when permission did not exists. --- htdocs/core/modules/modContrat.class.php | 64 +++++++++++++++--------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 6e1b6b351ae..636dda7d99f 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -85,37 +85,51 @@ class modContrat extends DolibarrModules // Permissions $this->rights = array(); $this->rights_class = 'contrat'; + $r=0; + + $r++; + $this->rights[$r][0] = 161; + $this->rights[$r][1] = 'Lire les contrats'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 1; + $this->rights[$r][4] = 'lire'; - $this->rights[1][0] = 161; - $this->rights[1][1] = 'Lire les contrats'; - $this->rights[1][2] = 'r'; - $this->rights[1][3] = 1; - $this->rights[1][4] = 'lire'; + $r++; + $this->rights[$r][0] = 162; + $this->rights[$r][1] = 'Creer / modifier les contrats'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'creer'; - $this->rights[2][0] = 162; - $this->rights[2][1] = 'Creer / modifier les contrats'; - $this->rights[2][2] = 'w'; - $this->rights[2][3] = 0; - $this->rights[2][4] = 'creer'; + $r++; + $this->rights[$r][0] = 163; + $this->rights[$r][1] = 'Activer un service d\'un contrat'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'activer'; - $this->rights[3][0] = 163; - $this->rights[3][1] = 'Activer un service d\'un contrat'; - $this->rights[3][2] = 'w'; - $this->rights[3][3] = 0; - $this->rights[3][4] = 'activer'; + $r++; + $this->rights[$r][0] = 164; + $this->rights[$r][1] = 'Desactiver un service d\'un contrat'; + $this->rights[$r][2] = 'w'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'desactiver'; - $this->rights[4][0] = 164; - $this->rights[4][1] = 'Desactiver un service d\'un contrat'; - $this->rights[4][2] = 'w'; - $this->rights[4][3] = 0; - $this->rights[4][4] = 'desactiver'; + $r++; + $this->rights[$r][0] = 165; + $this->rights[$r][1] = 'Supprimer un contrat'; + $this->rights[$r][2] = 'd'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'supprimer'; - $this->rights[5][0] = 165; - $this->rights[5][1] = 'Supprimer un contrat'; - $this->rights[5][2] = 'd'; - $this->rights[5][3] = 0; - $this->rights[5][4] = 'supprimer'; + $r++; + $this->rights[$r][0] = 167; + $this->rights[$r][1] = 'Export contracts'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'export'; + // Exports //-------- From 3e4fcd1ac706c1fef9248fb4f4785464571db1e1 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Mon, 11 May 2015 17:51:54 +0100 Subject: [PATCH 25/26] Update html.formfile.class.php in order to correct document lists in list of supplier invoices --- htdocs/core/class/html.formfile.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 0b00dc265f4..7870371a4ab 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -705,6 +705,9 @@ class FormFile if ($modulepart == 'export') { $relativepath = $file["name"]; } + if ($modulepart == 'facture_fournisseur') { + $relativepath = get_exdir($modulesubdir, 2). $modulesubdir. "/" . $file["name"]; + } // Show file name with link to download $out.= ' Date: Mon, 11 May 2015 18:03:26 +0100 Subject: [PATCH 26/26] Update list.php Correct erroneous links to supplier invoice documents in list --- htdocs/fourn/facture/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 836d214e19a..711e452d7bb 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -307,8 +307,8 @@ if ($resql) $facturestatic->ref_supplier=$obj->ref_supplier; print $facturestatic->getNomUrl(1); $filename=dol_sanitizeFileName($obj->ref); - $filedir=$conf->fournisseur->dir_output.'/facture' . '/' . dol_sanitizeFileName($obj->facid).'/0/'.dol_sanitizeFileName($obj->ref); - print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); + $filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid,2).dol_sanitizeFileName($object->ref?$obj->ref:$obj->facid); + print $formfile->getDocumentsLink('facture_fournisseur', $filename, $filedir); print "\n"; // Ref supplier