From 1ab6955494849e57cad898585082f7be18b3f021 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Sat, 27 Dec 2014 11:27:41 +0100 Subject: [PATCH 01/37] FIX: dont remove price ht if it is forced (ie: calculated by margin rate and cost price, or by external module) --- htdocs/comm/propal.php | 3 +-- htdocs/commande/fiche.php | 3 +-- htdocs/compta/facture.php | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index e3be3ac8361..4929ee9c70e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -545,16 +545,15 @@ else if ($action == 'addline' && $user->rights->propal->creer) { // Set if we used free entry or predefined product $predef=''; $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); if (GETPOST('prod_entry_mode') == 'free') { $idprod=0; - $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod=GETPOST('idprod', 'int'); - $price_ht = ''; $tva_tx = ''; } diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index e0950bdccc7..1c01b975a3b 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -511,16 +511,15 @@ else if ($action == 'addline' && $user->rights->commande->creer) { // Set if we used free entry or predefined product $predef=''; $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); if (GETPOST('prod_entry_mode') == 'free') { $idprod=0; - $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod=GETPOST('idprod', 'int'); - $price_ht = ''; $tva_tx = ''; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 25330ba548b..d9582e957e2 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1064,16 +1064,15 @@ else if ($action == 'addline' && $user->rights->facture->creer) // Set if we used free entry or predefined product $predef=''; $product_desc=(GETPOST('dp_desc')?GETPOST('dp_desc'):''); + $price_ht = GETPOST('price_ht'); if (GETPOST('prod_entry_mode') == 'free') { $idprod=0; - $price_ht = GETPOST('price_ht'); $tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); } else { $idprod=GETPOST('idprod', 'int'); - $price_ht = ''; $tva_tx = ''; } From 191d4467e358274a77e21f821838924170fd99f3 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 28 Dec 2014 12:31:27 +0100 Subject: [PATCH 02/37] Update facture.php $soc already filled upper when $socid send --- htdocs/compta/facture.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 25330ba548b..b2da9f652f7 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1884,8 +1884,10 @@ if ($action == 'create') $projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : ''); $ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : ''); $ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : ''); - - $soc = $objectsrc->thirdparty; + + // only if socid not filled else it's allready done upper + if (empty($socid)) + $soc = $objectsrc->thirdparty; $cond_reglement_id = (! empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(! empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); $mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); From 2957c1445eb62aaf4adaf2746eb184d23692d871 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 28 Dec 2014 12:34:21 +0100 Subject: [PATCH 03/37] Update facture.php $soc already filled upper if $socid filled --- htdocs/compta/facture.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 000b1f7de90..2ea3baa6198 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1767,7 +1767,9 @@ if ($action == 'create') $ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : ''); $ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : ''); - $soc = $objectsrc->thirdparty; + // only if socid not filled else it's allready done upper + if (empty($socid)) + $soc = $objectsrc->thirdparty; $cond_reglement_id = (! empty($objectsrc->cond_reglement_id)?$objectsrc->cond_reglement_id:(! empty($soc->cond_reglement_id)?$soc->cond_reglement_id:1)); $mode_reglement_id = (! empty($objectsrc->mode_reglement_id)?$objectsrc->mode_reglement_id:(! empty($soc->mode_reglement_id)?$soc->mode_reglement_id:0)); From d4e7a97fdb54058990ff1f6fa6ebae43d0302179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 17:31:27 +0100 Subject: [PATCH 04/37] Fix: [ bug #1774 ] PHP Fatal error when creating a contract with Product module not enabled --- htdocs/contrat/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e4a8c644615..274376860da 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1229,8 +1229,10 @@ else /* * Lines of contracts */ - $productstatic=new Product($db); + if ($conf->product->enabled) { + $productstatic=new Product($db); + } $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; From b9d6f2a4963e4265ffe04ffedfafa30776bff8bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 17:43:25 +0100 Subject: [PATCH 05/37] Fix: [ bug #1775 ] New lines can be entered after contract validation --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e4a8c644615..f23ffb33845 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1672,7 +1672,7 @@ else } // Form to add new line - if ($user->rights->contrat->creer && ($object->statut >= 0)) + if ($user->rights->contrat->creer && ($object->statut == 0)) { $dateSelector=1; From 584be6a589e3d55d6c45b50a997a79e9423254c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 17:47:13 +0100 Subject: [PATCH 06/37] Fixed Contrat::fetch --- htdocs/contrat/class/contrat.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 5265f7025c5..8c96727c5aa 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -470,6 +470,18 @@ class Contrat extends CommonObject $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true); $this->fetch_optionals($this->id,$extralabels); + /* + * Lines + */ + + $this->lines = array(); + + $result=$this->fetch_lines(); + if ($result < 0) + { + $this->error=$this->db->error(); + return -3; + } return $this->id; } From e70b6714ce475f4dae98abd3bace519988c74668 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Dec 2014 01:10:42 +0100 Subject: [PATCH 07/37] Doxygen (cherry picked from commit 613d1b3) --- htdocs/contrat/class/contrat.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 8c96727c5aa..3b23f739a50 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -59,11 +59,11 @@ class Contrat extends CommonObject var $product; var $user_author; - var $date_creation; - var $date_validation; + var $date_creation; // date of creation + var $date_validation; // date of last update - var $date_contrat; - var $date_cloture; + var $date_contrat; // date when contract was signed + var $date_cloture; // deprecated (we close contract lines, not a contract) var $commercial_signature_id; var $commercial_suivi_id; From cd468b65fdd198f02095ecb3976d22fc62cf9c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 17:55:21 +0100 Subject: [PATCH 08/37] Documented Contrat class --- htdocs/contrat/class/contrat.class.php | 77 ++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 3b23f739a50..f546531a256 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -49,27 +49,94 @@ class Contrat extends CommonObject */ protected $table_ref_field = 'ref'; + /** + * Id of the contract + * @var int + */ var $id; + + /** + * Reference of the contract + * @var string + */ var $ref; + + /** + * External reference of the contract. + * Used by 3rd party services + * @var string + */ var $ref_ext; + + /** + * Supplier reference of the contract + * @var string + */ var $ref_supplier; + + /** + * Client id linked to the contract + * @var int + */ var $socid; var $societe; // Objet societe + + /** + * Status of the contract + * @var int + */ var $statut=0; // 0=Draft, var $product; + /** + * Author of the contract + * @var + */ var $user_author; - var $date_creation; // date of creation - var $date_validation; // date of last update - var $date_contrat; // date when contract was signed - var $date_cloture; // deprecated (we close contract lines, not a contract) + /** + * Date of creation + * @var int + */ + var $date_creation; + + /** + * Date of last update + * @var int + */ + var $date_validation; + + /** + * Date when contract was signed + * @var int + */ + var $date_contrat; + + /** + * Date of contract closure + * @var int + * @deprecated we close contract lines, not a contract + */ + var $date_cloture; var $commercial_signature_id; var $commercial_suivi_id; - var $note; // deprecated + /** + * @deprecated Use note_private or note_public instead + */ + var $note; + + /** + * Private note + * @var string + */ var $note_private; + + /** + * Public note + * @var string + */ var $note_public; var $modelpdf; From 52b8bb350ed5de7d7254a079305ab2aacb499a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 18:10:30 +0100 Subject: [PATCH 09/37] Fixed Contrat::fetch not setting Contrat::date_creation and improved class doc --- htdocs/contrat/class/contrat.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index f546531a256..77dde27dd46 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -140,8 +140,13 @@ class Contrat extends CommonObject var $note_public; var $modelpdf; + /** + * @deprecated Use fk_project instead + */ var $fk_projet; + public $fk_project; + var $extraparams=array(); var $lines=array(); @@ -508,7 +513,9 @@ class Contrat extends CommonObject $this->ref_ext = $result["ref_ext"]; $this->statut = $result["statut"]; $this->mise_en_service = $this->db->jdate($result["datemise"]); + $this->date_contrat = $this->db->jdate($result["datecontrat"]); + $this->date_creation = $this->db->jdate($result["datecontrat"]); $this->user_author_id = $result["fk_user_author"]; From df1f931ab8a0c85855903b14e3d1ae5b30da1ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 18:10:41 +0100 Subject: [PATCH 10/37] Fixed: [ bug #1767 ] Contract document is not generated properly --- .../contract/doc/pdf_strato.modules.php | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index be686377ce3..46364b23d0d 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -239,29 +239,9 @@ class pdf_strato extends ModelePDFContract $iniY = $tab_top + 7; $curY = $tab_top + 7; - $nexY = $tab_top + 7; + $nexY = $tab_top + 2; $pdf->SetXY($this->marge_gauche, $tab_top); - $pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0); - $pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8); - - $pdf->SetFont('', '', $default_font_size - 1); - - $pdf->MultiCell(0, 3, ''); // Set interline to 3 - $pdf->SetXY($this->marge_gauche, $tab_top + 8); - $text=$object->description; - if ($object->duree > 0) - { - $totaltime=convertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY); - $text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime; - } - $desc=dol_htmlentitiesbr($text,1); - //print $outputlangs->convToOutputCharset($desc); exit; - - $pdf->writeHTMLCell(180, 3, 10, $tab_top + 8, $outputlangs->convToOutputCharset($desc), 0, 1); - $nexY = $pdf->GetY(); - - $pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY); $pdf->MultiCell(0, 2, ''); // Set interline to 3. Then writeMultiCell must use 3 also. @@ -285,7 +265,20 @@ class pdf_strato extends ModelePDFContract $pageposbefore=$pdf->getPage(); // Description of product line - $txt=''.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).''; + + if ($objectligne->datei) { + $datei = dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true); + } else { + $datei = $langs->trans("Unknown"); + } + + if ($objectligne->duration) { + $durationi = convertSecondToTime($objectligne->duration); + } else { + $durationi = $langs->trans("Unknown"); + } + + $txt=''.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".$datei." - ".$outputlangs->transnoentities("Duration")." : ".$durationi,1,$outputlangs->charset_output).''; $desc=dol_htmlentitiesbr($objectligne->desc,1); $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0); @@ -533,7 +526,7 @@ class pdf_strato extends ModelePDFContract $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->datec,"day",false,$outputlangs,true), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_creation,"day",false,$outputlangs,true), '', 'R'); if ($object->client->code_client) { From 7670ae46a6437186041168804ca37703388e4604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 18:56:23 +0100 Subject: [PATCH 11/37] Fix [ bug #1778 ] Cancel button of edit ref. supplier contract card saves changes instead of cancelling --- htdocs/contrat/card.php | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 14a43e59f12..f27d47f2dd5 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -7,6 +7,7 @@ * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014 Marcos García * * 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 @@ -718,19 +719,25 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra setEventMessage($object->error,'errors'); } } elseif ($action=='setref_supplier') { - $result = $object->fetch($id); - if ($result < 0) { - setEventMessage($object->errors,'errors'); - } - $object->ref_supplier=GETPOST('ref_supplier','alpha'); - $result = $object->update($user); - if ($result < 0) { - setEventMessage($object->errors,'errors'); - $action='editref_supplier'; - } else { - header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; + $cancelbutton = GETPOST('cancel'); + + if (!$cancelbutton) { + + $result = $object->fetch($id); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + } + $object->ref_supplier = GETPOST('ref_supplier', 'alpha'); + + $result = $object->update($user); + if ($result < 0) { + setEventMessage($object->errors, 'errors'); + $action = 'editref_supplier'; + } else { + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } } } elseif ($action=='setref') { $object->ref=GETPOST('ref','alpha'); From 0b4bddd738e0897a43bb285d5f8a4b865f153ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 18:57:59 +0100 Subject: [PATCH 12/37] Fix [ bug #1779 ] Undefined variable $localtaxtx1 and $localtaxtx2 in Contrat::updateline --- htdocs/contrat/class/contrat.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 77dde27dd46..ea133a86b0d 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1390,7 +1390,7 @@ class Contrat extends CommonObject $localtaxes_type=getLocalTaxesFromRate($tvatx, 0, $this->societe, $mysoc); - $tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtaxtx1, $txlocaltaxtx2, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type); + $tabprice=calcul_price_total($qty, $pu, $remise_percent, $tvatx, $localtax1tx, $localtax2tx, 0, $price_base_type, $info_bits, 1, '', $localtaxes_type); $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; From ec7bc21e4c2873ebeb7bde8d1d9231d80dc8d0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 19:01:39 +0100 Subject: [PATCH 13/37] Fixed undefined variable $pu_ht --- htdocs/contrat/class/contrat.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index ea133a86b0d..df22f1d0469 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1403,19 +1403,19 @@ class Contrat extends CommonObject // TODO A virer // Anciens indicateurs: $price, $remise (a ne plus utiliser) $remise = 0; - $price = price2num(round($pu_ht, 2)); + $price = price2num(round($pu, 2)); if (dol_strlen($remise_percent) > 0) { - $remise = round(($pu_ht * $remise_percent / 100), 2); - $price = $pu_ht - $remise; + $remise = round(($pu * $remise_percent / 100), 2); + $price = $pu - $remise; } if (empty($pa_ht)) $pa_ht=0; // si prix d'achat non renseigne et utilise pour calcul des marges alors prix achat = prix vente if ($pa_ht == 0) { - if ($pu_ht > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) - $pa_ht = $pu_ht * (1 - $remise_percent / 100); + if ($pu > 0 && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) + $pa_ht = $pu * (1 - $remise_percent / 100); } $sql = "UPDATE ".MAIN_DB_PREFIX."contratdet set description='".$this->db->escape($desc)."'"; From ef4d710f788a518e19ffc2d2805023c128d82cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 19:16:14 +0100 Subject: [PATCH 14/37] Improving CommonObject and Contrat documentation --- htdocs/contrat/class/contrat.class.php | 32 +++++++++++++----------- htdocs/core/class/commonobject.class.php | 3 +++ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index df22f1d0469..623e7e121f2 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -149,6 +149,10 @@ class Contrat extends CommonObject var $extraparams=array(); + /** + * Contract lines + * @var ContratLigne[] + */ var $lines=array(); @@ -215,8 +219,8 @@ class Contrat extends CommonObject * * @param User $user Objet User qui active le contrat * @param int $line_id Id de la ligne de detail a activer - * @param timestamp $date Date d'ouverture - * @param timestamp $date_end Date fin prevue + * @param int $date Date d'ouverture + * @param int|string $date_end Date fin prevue * @param string $comment A comment typed by user * @return int <0 if KO, >0 if OK */ @@ -262,7 +266,7 @@ class Contrat extends CommonObject * * @param User $user Objet User qui active le contrat * @param int $line_id Id de la ligne de detail a activer - * @param timestamp $date_end Date fin + * @param int $date_end Date fin * @param string $comment A comment typed by user * @return int <0 if KO, >0 if OK */ @@ -578,7 +582,7 @@ class Contrat extends CommonObject /** * Load lignes array into this->lines * - * @return Array Return array of contract lines + * @return ContratLigne[] Return array of contract lines */ function fetch_lines() { @@ -1183,16 +1187,16 @@ class Contrat extends CommonObject * @param float $txlocaltax2 Local tax 2 rate * @param int $fk_product Id produit * @param float $remise_percent Pourcentage de remise de la ligne - * @param timestamp $date_start Date de debut prevue - * @param timestamp $date_end Date de fin prevue - * @param float $price_base_type HT or TTC + * @param int $date_start Date de debut prevue + * @param int $date_end Date de fin prevue + * @param string $price_base_type HT or TTC * @param float $pu_ttc Prix unitaire TTC * @param int $info_bits Bits de type de lignes * @param int $fk_fournprice Fourn price id * @param int $pa_ht Buying price HT * @return int <0 si erreur, >0 si ok */ - function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0) + function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $remise_percent, $date_start, $date_end, $price_base_type='HT', $pu_ttc=0.0, $info_bits=0, $fk_fournprice=null, $pa_ht = 0) { global $user, $langs, $conf, $mysoc; @@ -1340,20 +1344,20 @@ class Contrat extends CommonObject * @param float $pu Prix unitaire * @param int $qty Quantite * @param float $remise_percent Pourcentage de remise de la ligne - * @param timestamp $date_start Date de debut prevue - * @param timestamp $date_end Date de fin prevue + * @param int $date_start Date de debut prevue + * @param int $date_end Date de fin prevue * @param float $tvatx Taux TVA * @param float $localtax1tx Local tax 1 rate * @param float $localtax2tx Local tax 2 rate - * @param timestamp $date_debut_reel Date de debut reelle - * @param timestamp $date_fin_reel Date de fin reelle - * @param float $price_base_type HT or TTC + * @param int|string $date_debut_reel Date de debut reelle + * @param int|string $date_fin_reel Date de fin reelle + * @param string $price_base_type HT or TTC * @param int $info_bits Bits de type de lignes * @param int $fk_fournprice Fourn price id * @param int $pa_ht Buying price HT * @return int < 0 si erreur, > 0 si ok */ - function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0, $localtax2tx=0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0) + function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $tvatx, $localtax1tx=0.0, $localtax2tx=0.0, $date_debut_reel='', $date_fin_reel='', $price_base_type='HT', $info_bits=0, $fk_fournprice=null, $pa_ht = 0) { global $user, $conf, $langs, $mysoc; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d0e4e086640..ca9461e7deb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -47,6 +47,9 @@ abstract class CommonObject public $array_options=array(); + /** + * @var Societe + */ public $thirdparty; public $linkedObjectsIds; // Loaded by ->fetchObjectLinked From 7424ee1107a78b1634c43e8e054fe474bd5a57a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 19:28:25 +0100 Subject: [PATCH 15/37] Improving Contrat documentation and fixed some properties usage --- htdocs/contrat/class/contrat.class.php | 39 ++++++++++++++++++++++++-- htdocs/install/upgrade2.php | 2 +- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 623e7e121f2..9e0005bf3ad 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -89,11 +89,38 @@ class Contrat extends CommonObject var $product; /** + * TODO: Which is the correct one? * Author of the contract * @var */ var $user_author; + /** + * TODO: Which is the correct one? + * Author of the contract + * @var User + */ + public $user_creation; + + /** + * TODO: Which is the correct one? + * Author of the contract + * @var int + */ + public $fk_user_author; + + /** + * TODO: Which is the correct one? + * Author of the contract + * @var int + */ + public $user_author_id; + + /** + * @var User + */ + public $user_cloture; + /** * Date of creation * @var int @@ -101,7 +128,14 @@ class Contrat extends CommonObject var $date_creation; /** - * Date of last update + * Date of last modification + * Not filled until you call ->info() + * @var int + */ + public $date_modification; + + /** + * Date of validation * @var int */ var $date_validation; @@ -1952,7 +1986,6 @@ class Contrat extends CommonObject while ($xnbp < $nbp) { $line=new ContratLigne($this->db); - $line->desc=$langs->trans("Description")." ".$xnbp; $line->qty=1; $line->subprice=100; $line->price=100; @@ -2421,7 +2454,7 @@ class ContratLigne extends CommonObject $sql.= ",total_localtax1=".price2num($this->total_localtax1,'MT').""; $sql.= ",total_localtax2=".price2num($this->total_localtax2,'MT').""; $sql.= ",total_ttc=".price2num($this->total_ttc,'MT').""; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_total", LOG_DEBUG); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 09f0d507a39..7bee1a38b6b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1523,7 +1523,7 @@ function migrate_price_contrat($db,$langs,$conf) // On met a jour les 3 nouveaux champs $contratligne= new ContratLigne($db); //$contratligne->fetch($rowid); Non requis car le update_total ne met a jour que chp redefinis - $contratligne->rowid=$rowid; + $contratligne->id=$rowid; $result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,0,'HT',$info_bits,0,$tmpmysoc); $total_ht = $result[0]; From 2202380bc2a11c27383cdbcf90c9b8eed2c386fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 19:36:43 +0100 Subject: [PATCH 16/37] Improving ContratLigne documentation --- htdocs/contrat/class/contrat.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9e0005bf3ad..a407f0c3a6f 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2055,6 +2055,13 @@ class ContratLigne extends CommonObject var $fk_product; var $statut; // 0 inactive, 4 active, 5 closed var $label; + + /** + * @var string + * @deprecated Use $label instead + */ + public $libelle; + var $description; var $date_commande; var $date_ouverture_prevue; // date start planned @@ -2072,6 +2079,13 @@ class ContratLigne extends CommonObject var $fk_remise_except; var $subprice; // Unit price HT + + /** + * @var float + * @deprecated Use $price_ht instead + */ + public $price; + var $price_ht; var $total_ht; From 86100758ffa4f796bef02b57f648b09b873c8fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 28 Dec 2014 20:12:32 +0100 Subject: [PATCH 17/37] Miscellaneous corrections --- htdocs/admin/tools/export.php | 2 +- htdocs/comm/action/class/actioncomm.class.php | 2 +- .../compta/paiement/class/paiement.class.php | 1 - htdocs/compta/tva/index.php | 2 +- htdocs/core/actions_sendmails.inc.php | 1 - .../core/class/commondocgenerator.class.php | 2 +- htdocs/core/class/commonobject.class.php | 33 +++++++++---------- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/lib/date.lib.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 2 +- .../task/doc/doc_generic_task_odt.modules.php | 2 +- htdocs/user/class/user.class.php | 4 +-- 12 files changed, 26 insertions(+), 29 deletions(-) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 203776bc7f9..0831571ace1 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -485,7 +485,7 @@ function backup_tables($outputfile, $tables='*') $row[$j] = "''"; } elseif(is_numeric($row[$j]) and !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0) // if it's a number, we return it as-is - $row[$j] = $row[$j]; +// $row[$j] = $row[$j]; } else { // else for all other cases we escape the value and put quotes around $row[$j] = addslashes($row[$j]); $row[$j] = preg_replace("#\n#", "\\n", $row[$j]); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 15394c81a3a..135b775249b 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -350,7 +350,7 @@ class ActionComm extends CommonObject $this->label = $obj->label; $this->datep = $this->db->jdate($obj->datep); $this->datef = $this->db->jdate($obj->datep2); - $this->durationp = $this->durationp; // deprecated +// $this->durationp = $this->durationp; // deprecated $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem); diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 95503db6ff9..2fce476af78 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -422,7 +422,6 @@ class Paiement extends CommonObject $totalamount=$this->amount; if (empty($totalamount)) $totalamount=$this->total; // For backward compatibility - if ($mode == 'payment') $totalamount=$totalamount; if ($mode == 'payment_supplier') $totalamount=-$totalamount; // Insert payment into llx_bank diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 16652327ef3..c0dcff6d5c3 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -60,7 +60,7 @@ if (isset($_GET["modetax"])) $modetax=$_GET["modetax"]; * * @param DoliDB $db Database handler * @param string $sql SQL Request - * @param date $date Date + * @param string $date Date * @return void */ function pt ($db, $sql, $date) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 40e177404f9..49de1529321 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -131,7 +131,6 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $from = $_POST['fromname'] . ' <' . $_POST['frommail'] .'>'; $replyto = $_POST['replytoname']. ' <' . $_POST['replytomail'].'>'; $message = $_POST['message']; - $sendtocc = $sendtocc; $sendtobcc= GETPOST('sendtoccc'); if ($mode == 'emailfromproposal') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO); if ($mode == 'emailfromorder') $sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO); diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 26f209ed107..fbf5363b753 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -388,7 +388,7 @@ abstract class CommonDocGenerator $extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true); $object->fetch_optionals($object->id,$extralabels); - $resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key=$array_key,$outputlangs); + $resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs); } return $resarray; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d0e4e086640..8b91d8ac9c3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2109,24 +2109,23 @@ abstract class CommonObject dol_syslog(get_class($this)."::setStatut", LOG_DEBUG); if ($this->db->query($sql)) { - if (! $error) - { - $trigkey=''; - if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED'; - if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED'; + $error = 0; - if ($trigkey) - { - // Appel des triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers($trigkey,$this,$user,$langs,$conf); - if ($result < 0) { - $error++; $this->errors=$interface->errors; - } - // Fin appel triggers - } - } + $trigkey=''; + if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED'; + if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED'; + + if ($trigkey) + { + // Appel des triggers + include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; + $interface=new Interfaces($this->db); + $result=$interface->run_triggers($trigkey,$this,$user,$langs,$conf); + if ($result < 0) { + $error++; $this->errors=$interface->errors; + } + // Fin appel triggers + } if (! $error) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e90dbdd203d..7d2851f1b31 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4375,7 +4375,7 @@ class Form * @param string $morehtmlref Code html supplementaire a afficher apres ref * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name - * @return tring Portion HTML avec ref + boutons nav + * @return string Portion HTML avec ref + boutons nav */ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0) { diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 4b9401498d7..d2c6ce4bd4f 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -169,7 +169,7 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0) * @param string $format Output format (all: total delay days hour:min like "2 days 12:30"", allhourmin: total delay hours:min like "60:30", allhour: total delay hours without min/sec like "60:30", fullhour: total delay hour decimal like "60.5" for 60:30, hour: only hours part "12", min: only minutes part "30", sec: only seconds part, month: only month part, year: only year part); * @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour) * @param int $lengthOfWeek Length of week (default 7) - * @return sTime Formated text of duration + * @return string Formated text of duration * Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00 */ function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7) diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 1364aeff65e..f19d8a0e3a0 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -138,7 +138,7 @@ class doc_generic_project_odt extends ModelePDFProjects $extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true); $object->fetch_optionals($object->id,$extralabels); - $resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key=$array_key,$outputlangs); + $resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs); } return $resarray; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 7f93851cc65..c074cba31e5 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -139,7 +139,7 @@ class doc_generic_task_odt extends ModelePDFTask $extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true); $object->fetch_optionals($object->id,$extralabels); - $resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key=$array_key,$outputlangs); + $resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs); } return $resarray; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 837be155929..b2502e2140f 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1662,7 +1662,7 @@ class User extends CommonObject /** * Add user into a group * - * @param Group $group Id of group + * @param int $group Id of group * @param int $entity Entity * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK @@ -1721,7 +1721,7 @@ class User extends CommonObject /** * Remove a user from a group * - * @param Group $group Id of group + * @param int $group Id of group * @param int $entity Entity * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK From a9a33479f176a3464302b1459cbff5ca3063a963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 29 Dec 2014 03:44:03 +0100 Subject: [PATCH 18/37] Fixed error deleting survey comment --- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index fa506285cc8..b4c8570dec8 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -496,7 +496,7 @@ class Opensurveysondage extends CommonObject */ public function deleteComment($id_comment) { - $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'opensurvey_comments WHERE id_comment = '.$id_comment.' AND id_sondage = '.$this->id_sondage; + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'opensurvey_comments WHERE id_comment = '.$id_comment.' AND id_sondage = "'.$this->db->escape($this->id_sondage).'"'; $resql = $this->db->query($sql); if (!$resql) { From 410c8e56c6c30ca1f38af56fb138a1c866bb26e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Dec 2014 04:30:32 +0100 Subject: [PATCH 19/37] Better fix --- htdocs/main.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ae9f347f4e8..c6c7654cf00 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1557,7 +1557,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me && ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE)) { $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'sall'.rand(0, 10)); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'sallsearchleftp'); } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled) @@ -1570,7 +1570,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire) { $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall', 'M', 'sall'.rand(0, 10)); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall', 'M', 'sallsearchleftm'); } // Execute hook printSearchForm From be34fcfa8af181c51aa1056b59c655d96b4a4c40 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 Dec 2014 21:33:56 +0100 Subject: [PATCH 20/37] Removed duplicate link making same thing --- htdocs/core/lib/company.lib.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 4dd9a51d0b7..5a906298312 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -760,12 +760,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { print ''; - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) - { - print ''; - print img_object($langs->trans("Rendez-Vous"),"action_rdv"); - print ' '; - } + //if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + //{ + // print ''; + // print img_object($langs->trans("Rendez-Vous"),"action_rdv"); + // print ' '; + //} print ''; print img_object($langs->trans("Event"),"action"); print ''; From 68049a2f0e608e14f56f11a88e3dadb1ec35b9c3 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Fri, 2 Jan 2015 18:10:47 +0200 Subject: [PATCH 21/37] Fix Lang for Check Payment Type --- htdocs/cashdesk/tpl/facturation1.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 47116705320..338c0f23b16 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -193,9 +193,9 @@ $langs->load("cashdesk"); if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CB']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] < 0) { $langs->load("errors"); - print ''; + print ''; } - else print ''; + else print ''; print ''; ?> From f14ea7b6490508ca33f9b07a166e0c37e3b2a44d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 3 Jan 2015 15:07:54 +0100 Subject: [PATCH 22/37] Add module accountancy expert in auguria menu --- htdocs/core/menus/init_menu_auguria.sql | 38 ++++++++++++---------- htdocs/core/menus/standard/auguria.lib.php | 36 ++++++++++++++++++++ 2 files changed, 56 insertions(+), 18 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 7acce783e39..2758ff5ecbd 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -187,26 +187,28 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'accountancy', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __ENTITY__); -- Ventilation (accounting) -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'ventil', 6__+MAX_llx_menu__, '/compta/ventilation/index.php?leftmenu=ventil', 'Ventilation', 0, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 8, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/ventilation/list.php', 'ToDispatch', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/ventilation/lignes.php', 'Dispatched', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/param/', 'Setup', 1, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2404__+MAX_llx_menu__, 'accountancy', '', 2403__+MAX_llx_menu__, '/compta/param/comptes/list.php', 'List', 2, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2405__+MAX_llx_menu__, 'accountancy', '', 2403__+MAX_llx_menu__, '/compta/param/comptes/card.php?action=create', 'New', 2, 'companies', '$user->rights->compta->ventilation->parametrer', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2406__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/compta/export/', 'Export', 1, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2407__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/index.php', 'New', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $conf->global->FACTURE_VENTILATION', __HANDLER__, 'left', 2408__+MAX_llx_menu__, 'accountancy', '', 2406__+MAX_llx_menu__, '/compta/export/list.php', 'List', 2, 'companies', '$user->rights->compta->ventilation->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2400__+MAX_llx_menu__, 'accountancy', 'ventil_customer', 6__+MAX_llx_menu__, '/accountancy/customer/index.php?leftmenu=ventil_customer', 'CustomersVentilation', 0, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 8, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ventil_customer"', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/accountancy/customer/list.php', 'ToDispatch', 1, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="ventil_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2400__+MAX_llx_menu__, '/accountancy/customer/lines.php', 'Dispatched', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 1, __ENTITY__); + +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'ventil_supplier', 6__+MAX_llx_menu__, '/accountancy/supplier/index.php?leftmenu=ventil_supplier', 'SuppliersVentilation', 0, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 9, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="ventil_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php', 'ToDispatch', 1, 'accountancy', '$user->rights->accounting->ventilation->dispatch', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $conf->fournisseur->enabled && $leftmenu=="ventil_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php', 'Dispatched', 1, 'accountancy', '$user->rights->accounting->ventilation->read', '', 0, 1, __ENTITY__); -- Rapports insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2700__+MAX_llx_menu__, 'accountancy', 'ca', 6__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca&mainmenu=accountancy', 'Reportings', 0, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 11, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2702__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); --- Fiscal year +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2701__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/resultat/index.php?leftmenu=ca', 'ReportInOut', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2702__+MAX_llx_menu__, 'accountancy', '', 2701__+MAX_llx_menu__, '/compta/resultat/clientfourn.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2703__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/stats/index.php?leftmenu=ca', 'ReportTurnover', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2704__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/casoc.php?leftmenu=ca', 'ByCompanies', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2705__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyuser.php?leftmenu=ca', 'ByUsers', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled || $conf->accounting->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2708__+MAX_llx_menu__, 'accountancy', '', 2703__+MAX_llx_menu__, '/compta/stats/cabyprodserv.php?leftmenu=ca', 'ByProductsAndServices', 2, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2706__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/sellsjournal.php?leftmenu=ca', 'SellsJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->comptabilite->enabled && $leftmenu=="ca"', __HANDLER__, 'left', 2707__+MAX_llx_menu__, 'accountancy', '', 2700__+MAX_llx_menu__, '/compta/journal/purchasesjournal.php?leftmenu=ca', 'PurchasesJournal', 1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->comptarapport->lire', '', 0, 1, __ENTITY__); +-- Book Keeping +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 2720__+MAX_llx_menu__, 'accountancy', 'bookkeeping', 6__+MAX_llx_menu__, '/accountancy/bookkeeping/list.php?leftmenu=bookkeeping', 'Bookkeeping', 0, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 12, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="bookkeeping"', __HANDLER__, 'left', 2721__+MAX_llx_menu__, 'accountancy', '', 2720__+MAX_llx_menu__, '/accountancy/bookkeeping/listbyyear.php', 'ByYear', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled && $leftmenu=="bookkeeping"', __HANDLER__, 'left', 2722__+MAX_llx_menu__, 'accountancy', '', 2720__+MAX_llx_menu__, '/accountancy/bookkeeping/balancebymonth.php', 'AccountBalanceByMonth', 1, 'accountancy', '$user->rights->accounting->mouvements->lire', '', 0, 1, __ENTITY__); +-- Fiscal year & Chart of accounts insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled"', __HANDLER__, 'left', 2750__+MAX_llx_menu__, 'home', '', 6__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?leftmenu=setup', 'Fiscalyear', 1, 'main', '$user->rights->accounting->fiscalyear', '', 2, 20, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled"', __HANDLER__, 'left', 2751__+MAX_llx_menu__, 'home', '', 6__+MAX_llx_menu__, '/accountancy/admin/account.php?mainmenu=accountancy', 'Chartofaccounts', 1, 'main', '$user->rights->accounting->chartofaccount', '', 2, 21, __ENTITY__); -- Check deposit diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index c411ef96039..d732de547ab 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -273,6 +273,42 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM else dol_print_error($db); $db->free($resql); } + + if (! empty($conf->accounting->enabled) && !empty($user->rights->accounting->mouvements->lire) && $mainmenu == 'accountancy') // Entry in accountancy journal for each bank account + { + $newmenu->add('/accountancy/journal/index.php?leftmenu=journal',$langs->trans("Journaux"),0,$user->rights->banque->lire); + + if ($leftmenu == 'journal') + { + $sql = "SELECT rowid, label, accountancy_journal"; + $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; + $sql.= " WHERE entity = ".$conf->entity; + $sql.= " AND clos = 0"; + $sql.= " ORDER BY label"; + + $resql = $db->query($sql); + if ($resql) + { + $numr = $db->num_rows($resql); + $i = 0; + + if ($numr > 0) + + while ($i < $numr) + { + $objp = $db->fetch_object($resql); + $newmenu->add('/accountancy/journal/bankjournal.php?id_account='.$objp->rowid,$langs->trans("Journal").' - '.$objp->label,1,$user->rights->accounting->comptarapport->lire); + $i++; + } + } + else dol_print_error($db); + $db->free($resql); + + // Add other journal + $newmenu->add("/accountancy/journal/sellsjournal.php?leftmenu=journal",$langs->trans("SellsJournal"),1,$user->rights->accounting->comptarapport->lire); + $newmenu->add("/accountancy/journal/purchasesjournal.php?leftmenu=journal",$langs->trans("PurchasesJournal"),1,$user->rights->accounting->comptarapport->lire); + } + } if ($conf->ftp->enabled && $mainmenu == 'ftp') // Entry for FTP { From df3987fa103490131f59316b1b0cd0a6486236d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jan 2015 14:51:16 +0100 Subject: [PATCH 23/37] Fixed: Bad url link with jquery mobile. We must add rel="external" on all external links. --- htdocs/admin/modules.php | 8 ++++---- htdocs/admin/system/about.php | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index df9632761dd..e3524425c6c 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -520,17 +520,17 @@ else $var=!$var; print "\n"; $url='http://www.dolistore.com'; - print ''; + print ''; print ''.$langs->trans("DoliStoreDesc").''; - print ''.$url.''; + print ''.$url.''; print ''; $var=!$var; print "\n"; $url='http://partners.dolibarr.org'; - print ''; + print ''; print ''.$langs->trans("DoliPartnersDesc").''; - print ''.$url.''; + print ''.$url.''; print ''; print "\n"; diff --git a/htdocs/admin/system/about.php b/htdocs/admin/system/about.php index e7490225107..532293cdad2 100644 --- a/htdocs/admin/system/about.php +++ b/htdocs/admin/system/about.php @@ -51,8 +51,8 @@ print ''; print $langs->trans("Developpers").':'; print ''; //print "
\n"; @@ -61,31 +61,31 @@ print $langs->trans("OtherInformations").':'; print ''; print $langs->trans("Demo").':'; print ''; print $langs->trans("ModulesMarketPlaces").':'; print ''; @@ -94,7 +94,7 @@ print $langs->trans("HelpCenter").':'; print ''; @@ -104,11 +104,11 @@ print ''; @@ -120,11 +120,11 @@ $url='http://saas.dolibarr.org'; $title=$langs->trans("OfficialWebHostingService if (preg_match('/^fr_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Solutions_de_Cloud'; if (preg_match('/^es_/i',$langs->getDefaultLang())) $url='http://wiki.dolibarr.org/index.php/Soluciones_en_la_Nube'; print '
  • '; -print ''.$title.''; +print ''.$title.''; print '
  • '; $url='http://partners.dolibarr.org'; $title=$langs->trans("ReferencedPreferredPartners"); print '
  • '; -print ''.$title.''; +print ''.$title.''; print '
  • '; print ''; From 48818ed2fdd4255c3f2c7ed8ecfb209614a99bb7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jan 2015 15:40:01 +0100 Subject: [PATCH 24/37] Fixed: Quick solution to solve problem of unknown payment amount for online subscription. --- htdocs/langs/en_US/main.lang | 1 + htdocs/public/paypal/newpayment.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index fd07d379a44..bfded6f40e2 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -61,6 +61,7 @@ ErrorFailedToSaveFile=Error, failed to save file. SetDate=Set date SelectDate=Select a date SeeAlso=See also %s +SeeHere=See here BackgroundColorByDefault=Default background color FileNotUploaded=The file was not uploaded FileUploaded=The file was successfully uploaded diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index afe685fb6ac..b28ce169230 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -870,7 +870,12 @@ if (GETPOST("source") == 'membersubscription' && $valid) // Amount $var=!$var; print ''.$langs->trans("Amount"); - if (empty($amount)) print ' ('.$langs->trans("ToComplete").')'; + if (empty($amount)) + { + print ' ('.$langs->trans("ToComplete"); + if (! empty($conf->global->MEMBER_EXT_URL_SUBSCRIPTION_INFO)) print ' - '.$langs->trans("SeeHere").''; + print ')'; + } print ''; if (empty($amount) || ! is_numeric($amount)) { From c0b5b9f00b4c19a089c26b7919c1c66c1c59bf17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jan 2015 19:26:51 +0100 Subject: [PATCH 25/37] Fixed: Removed deprecated function --- test/phpunit/ContratTest.php | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/test/phpunit/ContratTest.php b/test/phpunit/ContratTest.php index 149d867135e..d62a7bf388d 100644 --- a/test/phpunit/ContratTest.php +++ b/test/phpunit/ContratTest.php @@ -162,37 +162,13 @@ class ContratTest extends PHPUnit_Framework_TestCase return $localobject; } - /** - * testContratValid - * - * @param Contrat $localobject Contract - * @return int - * - * @depends testContratFetch - * The depends says test is run only if previous is ok - */ - public function testContratValid($localobject) - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - $result=$localobject->update_statut($user); - print __METHOD__." id=".$localobject->id." result=".$result."\n"; - - $this->assertLessThan($result, 0); - return $localobject; - } - /** - * testContratValid + * testContratOther * * @param Object $localobject Object contract * @return int * - * @depends testContratValid + * @depends testContratFetch * The depends says test is run only if previous is ok */ public function testContratOther($localobject) From d8d01090cdb11ff53820ed2c0d200da141257129 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Jan 2015 19:28:05 +0100 Subject: [PATCH 26/37] Fixed: Mark function as deprecated --- htdocs/contrat/class/contrat.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 5265f7025c5..8c44b0538d4 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1445,6 +1445,7 @@ class Contrat extends CommonObject * * @param User $user Object user * @return int <0 if KO, >0 if OK + * @deprecated This function will never be used. Status of a contract is status of its lines. */ function update_statut($user) { From b4b5b35afa77d9ea80a31e3e520c5414f1e57281 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 4 Jan 2015 20:17:49 +0100 Subject: [PATCH 27/37] Skype :: Better presentation --- htdocs/core/lib/functions.lib.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index dbc1cc31e85..4afe2d7917a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1297,11 +1297,11 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid= * Show Skype link * * @param string $skype Skype to show (only skype, without 'Name of recipient' before) - * @param int $cid Id of contact if known - * @param int $socid Id of third party if known - * @param int $addlink 0=no link to create action - * @param int $max Max number of characters to show - * @return string HTML Link + * @param int $cid Id of contact if known + * @param int $socid Id of third party if known + * @param int $addlink 0=no link to create action + * @param int $max Max number of characters to show + * @return string HTML Link */ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64) { @@ -1316,11 +1316,11 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64) $newskype=''; - $newskype.=' '; - $newskype.=' '; + $newskype.='    '; - $newskype.=' '; + $newskype.=''; $newskype.=''; if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) From 3794c9305e159fb89c1a717c9924fc1d2d3e0280 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jan 2015 00:04:23 +0100 Subject: [PATCH 28/37] Fix: [ bug #1754 ] Error while installing 3.7 --- htdocs/install/mysql/tables/llx_c_departements.key.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/tables/llx_c_departements.key.sql b/htdocs/install/mysql/tables/llx_c_departements.key.sql index 427d031a705..66194440610 100644 --- a/htdocs/install/mysql/tables/llx_c_departements.key.sql +++ b/htdocs/install/mysql/tables/llx_c_departements.key.sql @@ -21,5 +21,8 @@ ALTER TABLE llx_c_departements ADD UNIQUE uk_departements (code_departement,fk_r ALTER TABLE llx_c_departements ADD INDEX idx_departements_fk_region (fk_region); +-- NOTE: We duplicate creation of unique keys on llx_c_regions NOW to be able to create foreign keys. +ALTER TABLE llx_c_regions ADD UNIQUE INDEX uk_code_region (code_region); + ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (code_region); From a668d163fdbf3cf97ba685b015a2c6ff4b573ef9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jan 2015 00:27:35 +0100 Subject: [PATCH 29/37] Repair corrupted data --- htdocs/install/mysql/migration/repair.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 70fae404149..90730796279 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -115,7 +115,7 @@ ALTER TABLE llx_product_fournisseur_price DROP FOREIGN KEY fk_product_fournisseu -- Fix: deprecated tag to new one update llx_opensurvey_sondage set format = 'D' where format = 'D+'; update llx_opensurvey_sondage set format = 'A' where format = 'A+'; - +update llx_opensurvey_sondage set tms = now(); -- ALTER TABLE llx_facture_fourn ALTER COLUMN fk_cond_reglement DROP NOT NULL; From 2bf2c8fce7966c800b1c5a8fd181ceeddeef38f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jan 2015 00:34:23 +0100 Subject: [PATCH 30/37] Restore all requets --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 0b71a2fe6fe..ad05f850e16 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -1145,5 +1145,5 @@ ALTER TABLE llx_facturedet_rec ADD COLUMN fk_contract_line integer NULL; ALTER TABLE llx_resource MODIFY COLUMN entity integer DEFAULT 1 NOT NULL; -- This request make mysql drop (mysql bug, so we add it at end): ---ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid); +ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type(rowid); From 4ee308c77b859937430db4b2c1c36cf8b35a2d27 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 6 Jan 2015 20:58:23 +0100 Subject: [PATCH 31/37] Fixed: Filter lost after search on date --- htdocs/comm/action/listactions.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index 7fa67695860..a53628e3d31 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -136,6 +136,17 @@ $form=new Form($db); $nav=''; $nav.='  
    '; +if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.=''; +if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.=''; +if ($filter) $nav.=''; +if ($filtera) $nav.=''; +if ($filtert) $nav.=''; +if ($filterd) $nav.=''; +if ($socid) $nav.=''; +if ($showbirthday) $nav.=''; +if ($pid) $nav.=''; +if ($type) $nav.=''; +if ($usergroup) $nav.=''; $nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); $nav.=' '; $nav.='
    '; @@ -159,6 +170,7 @@ if ($socid) $param.="&socid=".$socid; if ($showbirthday) $param.="&showbirthday=1"; if ($pid) $param.="&projectid=".$pid; if ($type) $param.="&type=".$type; +if ($usergroup) $param.="&usergroup=".$usergroup; $sql = "SELECT s.nom as societe, s.rowid as socid, s.client,"; $sql.= " a.id, a.datep as dp, a.datep2 as dp2,"; @@ -203,11 +215,13 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0) if ($usergroup > 0) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; $sql.= ")"; } -if ($dateselect > 0) $sql.= " AND a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'"; +// The second or of next test is to take event with no end date (we suppose duration is 1 hour in such case) +if ($dateselect > 0) $sql.= " AND ((a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."') OR (a.datep2 IS NULL AND a.datep > '".$db->idate($dateselect-3600)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'))"; if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'"; if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); + //print $sql; dol_syslog("comm/action/listactions.php", LOG_DEBUG); From f8792bdbc75032c28094b6bbb1c65037608a1dd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jan 2015 11:11:40 +0100 Subject: [PATCH 32/37] Fixed: Add opensurvey into list of reloaded modules for 3.7 --- htdocs/install/upgrade2.php | 275 ++++++++++++++++++++---------------- 1 file changed, 154 insertions(+), 121 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 7bee1a38b6b..d5fa016e02a 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -3634,137 +3634,170 @@ function migrate_delete_old_dir($db,$langs,$conf) * We must do this when internal menu of module or permissions has changed * or when triggers have moved. * - * @param DoliDB $db Database handler - * @param Translate $langs Object langs - * @param Conf $conf Object conf + * @param DoliDB $db Database handler + * @param Translate $langs Object langs + * @param Conf $conf Object conf + * @param array $listofmodule List of modules * @return void */ -function migrate_reload_modules($db,$langs,$conf) +function migrate_reload_modules($db,$langs,$conf,$listofmodule=array()) { dolibarr_install_syslog("upgrade2::migrate_reload_modules"); - if (! empty($conf->global->MAIN_MODULE_AGENDA)) + // Module to reload if no info is provided + if (count($listofmodule) == 0) { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Agenda"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php'; - if ($res) { - $mod=new modAgenda($db); - $mod->remove('noboxes'); - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_SOCIETE)) - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Societe"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php'; - if ($res) { - $mod=new modSociete($db); - $mod->remove('noboxes'); - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_PRODUIT)) // Permission has changed into 2.7 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Produit"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php'; - if ($res) { - $mod=new modProduct($db); - //$mod->remove('noboxes'); - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_SERVICE)) // Permission has changed into 2.7 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; - $mod=new modService($db); - //$mod->remove('noboxes'); - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_COMMANDE)) // Permission has changed into 2.9 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; - $mod=new modCommande($db); - //$mod->remove('noboxes'); - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_FACTURE)) // Permission has changed into 2.9 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; - $mod=new modFacture($db); - //$mod->remove('noboxes'); - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_FOURNISSEUR)) // Permission has changed into 2.9 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Fournisseur"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; - if ($res) { - $mod=new modFournisseur($db); - //$mod->remove('noboxes'); - $mod->init('newboxdefonly'); - } + $listofmodule=array( + 'MAIN_MODULE_AGENDA', + 'MAIN_MODULE_SOCIETE', + 'MAIN_MODULE_PRODUIT', + 'MAIN_MODULE_SERVICE', + 'MAIN_MODULE_COMMANDE', + 'MAIN_MODULE_FACTURE', + 'MAIN_MODULE_FOURNISSEUR', + 'MAIN_MODULE_USER', + 'MAIN_MODULE_DEPLACEMENT', + 'MAIN_MODULE_DON', + 'MAIN_MODULE_ECM', + 'MAIN_MODULE_PAYBOX', + 'MAIN_MODULE_OPENSURVEY' + ); } - if (! empty($conf->global->MAIN_MODULE_USER)) // Permission has changed into 3.0 + foreach($listofmodule as $moduletoreload) { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module User"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php'; - if ($res) { - $mod=new modUser($db); - //$mod->remove('noboxes'); // We need to remove because id of module has changed - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_DEPLACEMENT)) // Permission has changed into 3.0 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Deplacement"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php'; - if ($res) { - $mod=new modDeplacement($db); - //$mod->remove('noboxes'); // We need to remove because a permission id has been removed - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_DON)) // Permission has changed into 3.0 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Don"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php'; - if ($res) { - $mod=new modDon($db); - //$mod->remove('noboxes'); // We need to remove because a permission id has been removed - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_ECM)) // Permission has changed into 3.0 and 3.1 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM"); - if ($res) { - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; - $mod=new modECM($db); - $mod->remove('noboxes'); // We need to remove because a permission id has been removed - $mod->init('newboxdefonly'); - } - } - if (! empty($conf->global->MAIN_MODULE_PAYBOX)) // Permission has changed into 3.0 - { - dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Paybox"); - $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php'; - if ($res) { - $mod=new modPaybox($db); - $mod->remove('noboxes'); // We need to remove because id of module has changed - $mod->init('newboxdefonly'); - } - } + if (! empty($conf->global->MAIN_MODULE_AGENDA)) + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Agenda"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modAgenda.class.php'; + if ($res) { + $mod=new modAgenda($db); + $mod->remove('noboxes'); + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_SOCIETE)) + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Societe"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modSociete.class.php'; + if ($res) { + $mod=new modSociete($db); + $mod->remove('noboxes'); + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_PRODUIT)) // Permission has changed into 2.7 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Produit"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modProduct.class.php'; + if ($res) { + $mod=new modProduct($db); + //$mod->remove('noboxes'); + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_SERVICE)) // Permission has changed into 2.7 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Service"); + if ($res) { + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modService.class.php'; + $mod=new modService($db); + //$mod->remove('noboxes'); + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_COMMANDE)) // Permission has changed into 2.9 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Commande"); + if ($res) { + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modCommande.class.php'; + $mod=new modCommande($db); + //$mod->remove('noboxes'); + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_FACTURE)) // Permission has changed into 2.9 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Facture"); + if ($res) { + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFacture.class.php'; + $mod=new modFacture($db); + //$mod->remove('noboxes'); + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_FOURNISSEUR)) // Permission has changed into 2.9 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Fournisseur"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php'; + if ($res) { + $mod=new modFournisseur($db); + //$mod->remove('noboxes'); + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_USER)) // Permission has changed into 3.0 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module User"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modUser.class.php'; + if ($res) { + $mod=new modUser($db); + //$mod->remove('noboxes'); // We need to remove because id of module has changed + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_DEPLACEMENT)) // Permission has changed into 3.0 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Deplacement"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDeplacement.class.php'; + if ($res) { + $mod=new modDeplacement($db); + //$mod->remove('noboxes'); // We need to remove because a permission id has been removed + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_DON)) // Permission has changed into 3.0 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Don"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modDon.class.php'; + if ($res) { + $mod=new modDon($db); + //$mod->remove('noboxes'); // We need to remove because a permission id has been removed + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_ECM)) // Permission has changed into 3.0 and 3.1 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ECM"); + if ($res) { + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modECM.class.php'; + $mod=new modECM($db); + $mod->remove('noboxes'); // We need to remove because a permission id has been removed + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_PAYBOX)) // Permission has changed into 3.0 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Paybox"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modPaybox.class.php'; + if ($res) { + $mod=new modPaybox($db); + $mod->remove('noboxes'); // We need to remove because id of module has changed + $mod->init('newboxdefonly'); + } + } + if (! empty($conf->global->MAIN_MODULE_OPENSURVEY)) // Permission has changed into 3.0 + { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module Opensurvey"); + $res=@include_once DOL_DOCUMENT_ROOT.'/core/modules/modOpenSurvey.class.php'; + if ($res) { + $mod=new modOpenSurvey($db); + $mod->remove('noboxes'); // We need to remove because menu entries has changed + $mod->init('newboxdefonly'); + } + } + } } From b220bb7b1d4a8714a8bd041cd78264b4c8ea47a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 7 Jan 2015 11:14:51 +0100 Subject: [PATCH 33/37] Fixed: Size too low --- htdocs/opensurvey/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 884d5124126..396fdf050ec 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -373,7 +373,7 @@ print '
    '; if ($object->allow_comments) { print $langs->trans("AddACommentForPoll") . '
    '; print '
    '."\n"; - print $langs->trans("Name") .':
    '."\n"; + print $langs->trans("Name") .':
    '."\n"; print '
    '."\n"; if (isset($erreur_commentaire_vide) && $erreur_commentaire_vide=="yes") { print "" . $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Name")) . ""; From f54e90c9cf556c1232970d5af25a1464181feca2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Jan 2015 13:00:10 +0100 Subject: [PATCH 34/37] Better doc to install external modules. Custom dir will be installed by default. --- htdocs/.gitignore | 1 - htdocs/conf/conf.php.example | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/.gitignore b/htdocs/.gitignore index 3cba3ce99cd..bf99a2deebe 100644 --- a/htdocs/.gitignore +++ b/htdocs/.gitignore @@ -1,5 +1,4 @@ /test.php -/custom* /extensions* /nltechno* /ancot* diff --git a/htdocs/conf/conf.php.example b/htdocs/conf/conf.php.example index 32adc4b87c9..67147a6d06b 100644 --- a/htdocs/conf/conf.php.example +++ b/htdocs/conf/conf.php.example @@ -43,10 +43,10 @@ $dolibarr_main_document_root=''; // You can put several values, separated by a coma, but number of entries must match // number of entries into $dolibarr_main_document_root_alt. // Examples: -// $dolibarr_main_url_root_alt='/extensions'; +// $dolibarr_main_url_root_alt='/custom'; // $dolibarr_main_url_root_alt='/extensions1,/extensions2'; // -$dolibarr_main_url_root_alt=''; +//$dolibarr_main_url_root_alt='/custom'; // dolibarr_main_document_root_alt @@ -55,10 +55,10 @@ $dolibarr_main_url_root_alt=''; // You can put several values, separated by a coma, but number of entries must match // number of entries into $dolibarr_main_url_root_alt. // Examples: -// $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/extensions'; +// $dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom'; // $dolibarr_main_document_root_alt='C:/My web sites/dolibarr/htdocs/extensions1,C:/My web sites/dolibarr/htdocs/extensions2'; // -$dolibarr_main_document_root_alt=''; +//$dolibarr_main_document_root_alt='/var/www/dolibarr/htdocs/custom'; // dolibarr_main_data_root From 068ae7f0d4da5f63bc93891c858472141fecdd0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Jan 2015 22:32:00 +0100 Subject: [PATCH 35/37] - Fix: ref_ext was not saved when recording a customer order from web service --- ChangeLog | 3 +++ htdocs/commande/class/commande.class.php | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8f276f9c81..0a849cce895 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.6.3 compared to 3.6.2 ***** +- Fix: ref_ext was not saved when recording a customer order from web service + ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: bug 1588 : relative discount. diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8501f04e8b8..52e454bf14e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -658,18 +658,19 @@ class Commande extends CommonOrder $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."commande ("; - $sql.= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_client, ref_int"; + $sql.= " ref, fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note_private, note_public, ref_ext, ref_client, ref_int"; $sql.= ", model_pdf, fk_cond_reglement, fk_mode_reglement, fk_availability, fk_input_reason, date_livraison, fk_delivery_address"; $sql.= ", remise_absolue, remise_percent"; $sql.= ", entity"; $sql.= ")"; $sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id; - $sql.= ", ".($this->fk_project?$this->fk_project:"null"); + $sql.= ", ".($this->fk_project>0?$this->fk_project:"null"); $sql.= ", '".$this->db->idate($date)."'"; $sql.= ", ".($this->source>=0 && $this->source != '' ?$this->source:'null'); $sql.= ", '".$this->db->escape($this->note_private)."'"; $sql.= ", '".$this->db->escape($this->note_public)."'"; - $sql.= ", '".$this->db->escape($this->ref_client)."'"; + $sql.= ", ".($this->ref_ext?"'".$this->db->escape($this->ref_ext)."'":"null"); + $sql.= ", ".($this->ref_client?"'".$this->db->escape($this->ref_client)."'":"null"); $sql.= ", ".($this->ref_int?"'".$this->db->escape($this->ref_int)."'":"null"); $sql.= ", '".$this->modelpdf."'"; $sql.= ", ".($this->cond_reglement_id>0?"'".$this->cond_reglement_id."'":"null"); @@ -904,7 +905,7 @@ class Commande extends CommonOrder $modCommande = new $obj; $this->ref = $modCommande->getNextValue($objsoc,$this); - + // Create clone $result=$this->create($user); if ($result < 0) $error++; From 32edb33411601018ed6bba70daaadd2034c21ea7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 9 Jan 2015 22:32:25 +0100 Subject: [PATCH 36/37] Start 3.6.3 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 526f2aa2e57..5ef76717d72 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.2'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.3'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From 9049931ff0141c49aebeb67248546c9709b36a24 Mon Sep 17 00:00:00 2001 From: fentman Date: Thu, 8 Jan 2015 11:21:25 +1100 Subject: [PATCH 37/37] Change to $listofcurrenciesbefore for GBP + AUD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update of functions.lib.php - function price() $listofcurrenciesbefore to include USD, GBP, and AUD to support $ and £ appearing before amounts on invoices not after the amount --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4afe2d7917a..dcb76a10cd7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2900,7 +2900,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou { if ($currency_code == 'auto') $currency_code=$conf->currency; - $listofcurrenciesbefore=array('USD'); + $listofcurrenciesbefore=array('USD','GBP','AUD'); if (in_array($currency_code,$listofcurrenciesbefore)) $cursymbolbefore.=$outlangs->getCurrencySymbol($currency_code); else {