From 76b1f0ca86a72faaf72eb5195ef3e571658caa84 Mon Sep 17 00:00:00 2001 From: abb Date: Sat, 28 Nov 2015 22:16:45 +0100 Subject: [PATCH 1/5] modifs to fichinter/card.php FICHINTER_EMPTY_LINE_DESC --- htdocs/fichinter/card.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 3cb613934b9..d0535d81c50 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -6,6 +6,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Ferran Marcet * Copyright (C) 201 Charlie Benke + * Copyright (C) 2015 Abbes Bahfir * * 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 @@ -465,7 +466,7 @@ if (empty($reshook)) // Add line else if ($action == "addline" && $user->rights->ficheinter->creer) { - if (!GETPOST('np_desc')) + if (!GETPOST('np_desc')&&($conf->global->FICHINTER_EMPTY_LINE_DESC!=1)) { $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Description")).'
'; $error++; @@ -1568,10 +1569,12 @@ else if ($id > 0 || ! empty($ref)) print '\n"; print ''; // editeur wysiwyg - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('np_desc',GETPOST('np_desc','alpha'),'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70); - $doleditor->Create(); - print ''; + if ($conf->global->FICHINTER_EMPTY_LINE_DESC != 1) { + require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor('np_desc', GETPOST('np_desc', 'alpha'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, ROWS_2, 70); + $doleditor->Create(); + } + print ''; // Date intervention print ''; From 05258172aac57f3db17cec11a4ca0c1c5f548858 Mon Sep 17 00:00:00 2001 From: abb Date: Wed, 2 Dec 2015 19:08:14 +0100 Subject: [PATCH 2/5] update product.lang --- htdocs/langs/en_US/products.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index b21fd88539e..f4cd0824d70 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -297,3 +297,4 @@ PropalMergePdfProductChooseFile=Select PDF files IncludingProductWithTag=Including product with tag DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer WarningSelectOneDocument=Please select at least one document +DefaultUnitToShow=Units \ No newline at end of file From 613209eadb9aa9bdd876c5207568d26a5595e420 Mon Sep 17 00:00:00 2001 From: abb Date: Fri, 11 Dec 2015 12:14:46 +0100 Subject: [PATCH 3/5] confs sur filefunc --- htdocs/filefunc.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 415a7addf4a..e4fbb602156 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -80,6 +80,12 @@ if (! empty($_GET['conf'])) $conffile = 'conf/'.$confname.'.php'; } */ +if (!empty($_GET['conf'])) { + setcookie('dolconf', $_GET['conf']); + $conffile = 'conf/' . $_GET['conf'] . '.php'; +} else { + $conffile = 'conf/' . (!empty($_COOKIE['dolconf']) ? $_COOKIE['dolconf'] : 'conf') . '.php'; +} // Include configuration $result=@include_once $conffile; // Keep @ because with some error reporting this break the redirect From 1bde35f98e0ad8c2316085014a96b487a56b0985 Mon Sep 17 00:00:00 2001 From: abb Date: Sun, 13 Dec 2015 12:10:43 +0100 Subject: [PATCH 4/5] add change customer function in customer orders --- htdocs/commande/card.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8748b283abe..2b9163886f4 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1149,7 +1149,16 @@ if (empty($reshook)) $action = 'edit_extras'; } - include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + if ($action == 'set_thirdparty' && $user->rights->commande->creer) + { + $object->fetch($id); + $object->setValueFrom('fk_soc', $socid); + + header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); + exit(); + } + + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; /* @@ -1812,8 +1821,19 @@ if ($action == 'create' && $user->rights->commande->creer) print ''; // Third party - print '' . $langs->trans('Company') . ''; - print '' . $soc->getNomUrl(1) . ''; + print ''; + print ''; + print ''; + print ''; + print '
' . $langs->trans('Company') . ''; + if (! empty($conf->global->COMMANDE_CHANGE_THIRDPARTY) && $action != 'editthirdparty' && $object->brouillon && $user->rights->commande->creer) + print 'id . '">' . img_edit($langs->trans('SetLinkToThirdParty'), 1) . '
'; + print ''; + if ($action == 'editthirdparty') { + $form->form_thirdparty($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, 'socid','client>0'); + } else { + print '  ' . $soc->getNomUrl(1, 'compta'); + } print ''; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { From 2f40233e014574b7a35aafb05ceb7ed8aa2ca441 Mon Sep 17 00:00:00 2001 From: abb Date: Sun, 31 Jan 2016 10:10:30 +0100 Subject: [PATCH 5/5] fix : handle case of non existing third party field in object in fecth_thirdparty function --- htdocs/core/class/commonobject.class.php | 34 +++++++++++++----------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 005f4684322..f0b0568d2f7 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1001,26 +1001,30 @@ abstract class CommonObject { global $conf; - if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) return 0; + if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) + return 0; - require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; - $idtofetch=isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty); - if ($force_thirdparty_id) $idtofetch=$force_thirdparty_id; + $idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : $this->fk_thirdparty); + if ($force_thirdparty_id) + $idtofetch = $force_thirdparty_id; - $thirdparty = new Societe($this->db); - $result=$thirdparty->fetch($idtofetch); - $this->client = $thirdparty; // deprecated - $this->thirdparty = $thirdparty; + if ($idtofetch) { + $thirdparty = new Societe($this->db); + $result = $thirdparty->fetch($idtofetch); + $this->client = $thirdparty; // deprecated + $this->thirdparty = $thirdparty; - // Use first price level if level not defined for third party - if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->thirdparty->price_level)) - { - $this->client->price_level=1; // deprecated - $this->thirdparty->price_level=1; - } + // Use first price level if level not defined for third party + if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->thirdparty->price_level)) { + $this->client->price_level = 1; // deprecated + $this->thirdparty->price_level = 1; + } - return $result; + return $result; + } else + return -1; }