From 83daa67cc630cf3d8569a08534c7ecf7ef445fb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Apr 2015 19:15:14 +0200 Subject: [PATCH 01/16] FIX Description of contract line was not visible. --- htdocs/contrat/card.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index f384390ff06..7affb63b9e9 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1302,19 +1302,28 @@ else $productstatic->id=$objp->fk_product; $productstatic->type=$objp->ptype; $productstatic->ref=$objp->pref; - print $productstatic->getNomUrl(1,'',20); + $text = $productstatic->getNomUrl(1,'',20); if ($objp->label) { - print ' - '; + $text .= ' - '; $productstatic->ref=$objp->label; - print $productstatic->getNomUrl(0,'',16); + $text .= $productstatic->getNomUrl(0,'',16); } - if (! empty($conf->global->PRODUIT_DESC_IN_FORM) && !empty($objp->description)) - print '
'.dol_nl2br($objp->description); + $description = $objp->description; + + // Add description in form + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) + { + $text .= (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; + $description = ''; // Already added into main visible desc + } + + echo $form->textwithtooltip($text,$description,3,'','',$cursorline,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); + print ''; } else - { + { print "".dol_htmlentitiesbr($objp->description)."\n"; } // TVA From 060d8a1a38fb01b763c6c49bbf9bd91f46826875 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 Apr 2015 19:57:01 +0200 Subject: [PATCH 02/16] FIX Ref/label of product on contract line was not visible, nor into page, nor into PDF. --- htdocs/contrat/card.php | 8 ++-- htdocs/contrat/class/contrat.class.php | 38 +++++++++++-------- .../contract/doc/pdf_strato.modules.php | 14 ++++++- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 7affb63b9e9..e7075b4f22c 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -36,8 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; -if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -1240,9 +1240,7 @@ else * Lines of contracts */ - if ($conf->product->enabled || $conf->service->enabled) { - $productstatic=new Product($db); - } + $productstatic=new Product($db); $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index d2bbe28726a..76a01b9f0c8 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -260,8 +260,8 @@ class Contrat extends CommonObject /** * Activate a contract line * - * @param User $user Objet User qui active le contrat - * @param int $line_id Id de la ligne de detail a activer + * @param User $user Objet User who activate contract + * @param int $line_id Id of line to activate * @param int $date Date d'ouverture * @param int|string $date_end Date fin prevue * @param string $comment A comment typed by user @@ -307,9 +307,9 @@ class Contrat extends CommonObject /** * Close a contract line * - * @param User $user Objet User qui active le contrat - * @param int $line_id Id de la ligne de detail a activer - * @param int $date_end Date fin + * @param User $user Objet User who close contract + * @param int $line_id Id of line to close + * @param int $date_end Date end * @param string $comment A comment typed by user * @return int <0 if KO, >0 if OK */ @@ -600,7 +600,7 @@ class Contrat extends CommonObject $result=$this->fetch_lines(); if ($result < 0) { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); return -3; } @@ -623,7 +623,7 @@ class Contrat extends CommonObject } /** - * Load lignes array into this->lines + * Load lines array into this->lines * * @return ContratLigne[] Return array of contract lines */ @@ -643,7 +643,7 @@ class Contrat extends CommonObject $this->lines=array(); // Selectionne les lignes contrats liees a un produit - $sql = "SELECT p.label, p.description as product_desc, p.ref,"; + $sql = "SELECT p.label as product_label, p.description as product_desc, p.ref as product_ref,"; $sql.= " d.rowid, d.fk_contrat, d.statut, d.description, d.price_ht, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.remise_percent, d.subprice, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht,"; $sql.= " d.total_ht,"; $sql.= " d.total_tva,"; @@ -701,10 +701,12 @@ class Contrat extends CommonObject $line->fk_user_ouverture= $objp->fk_user_ouverture; $line->fk_user_cloture = $objp->fk_user_cloture; - $line->ref = $objp->ref; - $line->libelle = $objp->label; // Label produit - $line->label = $objp->label; // For backward compatibility - $line->product_desc = $objp->product_desc; // Description produit + $line->ref = $objp->product_ref; // deprecated + $line->label = $objp->product_label; // deprecated + $line->libelle = $objp->product_label; // deprecated + $line->product_ref = $objp->product_ref; // Ref product + $line->product_desc = $objp->product_desc; // Description product + $line->product_label = $objp->product_label; // Label product $line->description = $objp->description; @@ -2245,7 +2247,10 @@ class ContratLigne extends CommonObject $sql.= " t.fk_contrat,"; $sql.= " t.fk_product,"; $sql.= " t.statut,"; - $sql.= " t.label,"; + $sql.= " t.label,"; // This field is not used. Only label of product + $sql.= " p.ref as product_ref,"; + $sql.= " p.label as product_label,"; + $sql.= " p.description as product_desc,"; $sql.= " t.description,"; $sql.= " t.date_commande,"; $sql.= " t.date_ouverture_prevue as date_ouverture_prevue,"; @@ -2273,7 +2278,7 @@ class ContratLigne extends CommonObject $sql.= " t.fk_user_ouverture,"; $sql.= " t.fk_user_cloture,"; $sql.= " t.commentaire"; - $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as t"; + $sql.= " FROM ".MAIN_DB_PREFIX."contratdet as t LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = t.fk_product"; if ($id) $sql.= " WHERE t.rowid = ".$id; if ($ref) $sql.= " WHERE t.rowid = '".$this->db->escape($ref)."'"; @@ -2292,7 +2297,10 @@ class ContratLigne extends CommonObject $this->fk_contrat = $obj->fk_contrat; $this->fk_product = $obj->fk_product; $this->statut = $obj->statut; - $this->label = $obj->label; + $this->product_ref = $obj->product_ref; + $this->product_label = $obj->product_label; + $this->product_description = $obj->product_description; + $this->label = $obj->label; // deprecated. We do not use this field. Only ref and label of product, and description of contract line $this->description = $obj->description; $this->date_commande = $this->db->jdate($obj->date_commande); $this->date_ouverture_prevue = $this->db->jdate($obj->date_ouverture_prevue); diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 46364b23d0d..ea75b7cf171 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -30,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; /** @@ -253,6 +254,7 @@ class pdf_strato extends ModelePDFContract $objectligne = $object->lines[$i]; $valide = $objectligne->id ? $objectligne->fetch($objectligne->id) : 0; + if ($valide > 0 || $object->specimen) { $curX = $this->posxdesc-1; @@ -278,12 +280,20 @@ class pdf_strato extends ModelePDFContract $durationi = $langs->trans("Unknown"); } + $txtpredefinedservice=''; + $txtpredefinedservice = $objectligne->product_ref; + if ($objectligne->product_label) + { + $txtpredefinedservice .= ' - '; + $txtpredefinedservice .= $objectligne->product_label; + } + $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); + $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,dol_concatdesc($txtpredefinedservice,$desc)), 0, 1, 0); - $nexY = $pdf->GetY(); + $nexY = $pdf->GetY() + 2; $pageposafter=$pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); From 6b3c060d9c44514a2db8c5c70bf218d514286809 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 Apr 2015 00:07:30 +0200 Subject: [PATCH 03/16] Fix doxygen --- htdocs/core/class/extrafields.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 821ada820dc..5545dc7cd5d 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -99,7 +99,7 @@ class ExtraFields * @param string $label label of attribute * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour') * @param int $pos Position of attribute - * @param int $size Size/length of attribute + * @param string $size Size/length of attribute * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) * @param int $unique Is field unique or not * @param int $required Is field required or not @@ -118,7 +118,7 @@ class ExtraFields // Create field into database except for separator type which is not stored in database if ($type != 'separate') { - $result=$this->create($attrname,$type,$size,$elementtype, $unique, $required, $default_value,$param); + $result=$this->create($attrname, $type, $size, $elementtype, $unique, $required, $default_value, $param); } $err1=$this->errno; if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate') @@ -146,7 +146,7 @@ class ExtraFields * * @param string $attrname code of attribute * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour') - * @param int $length Size/length of attribute + * @param string $length Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...) * @param int $unique Is field unique or not * @param int $required Is field required or not @@ -219,7 +219,7 @@ class ExtraFields * @param string $label label of attribute * @param int $type Type of attribute ('int', 'text', 'varchar', 'date', 'datehour', 'float') * @param int $pos Position of attribute - * @param int $size Size/length of attribute + * @param string $size Size/length of attribute ('5', '24,8', ...) * @param string $elementtype Element type ('member', 'product', 'thirdparty', ...) * @param int $unique Is field unique or not * @param int $required Is field required or not From afc582a3696d33653c1324e0c11552d9eee69404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 30 Apr 2015 17:19:21 +0200 Subject: [PATCH 04/16] Fixed SQL table reference for members types in export FIX #2712 --- htdocs/core/modules/modAdherent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 56037c9fb16..c135c22ff8a 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -174,7 +174,7 @@ class modAdherent extends DolibarrModules $this->export_label[$r]='MembersAndSubscriptions'; $this->export_permission[$r]=array(array("adherent","export")); $this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'co.code'=>"CountryCode",'co.label'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount'); - $this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number'); + $this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number'); $this->export_entities_array[$r]=array('a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'co.code'=>"member",'co.label'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription'); // Add extra fields From 95058607a400c8d4cc6aabadd45e1330f71cc92f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 1 May 2015 07:13:04 +0200 Subject: [PATCH 05/16] Fix : ER Typo on all variable $_SERVER & traduce of button "Edit" not works --- htdocs/expensereport/card.php | 41 ++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index fad813a570b..64d47efd23e 100755 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2015 Alexandre Spangaro * * 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 @@ -164,7 +165,7 @@ if ($action == 'update' && $user->rights->expensereport->creer) $result = $object->update($user); if ($result > 0) { - header("Location: ".$_SEVER["PHP_SELF"]."?id=".$_POST['id']); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_POST['id']); exit; } else @@ -244,7 +245,7 @@ if ($action == "confirm_save" && GETPOST("confirm") == "yes" && $id > 0 && $user { $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($emailFrom,2),$mailfile->getValidAddress($emailTo,2)); setEventMessage($mesg); - header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } else @@ -349,7 +350,7 @@ if ($action == "confirm_save_from_refuse" && GETPOST("confirm") == "yes" && $id // SEND $result=$mailfile->sendfile(); if ($result): - Header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); + Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; endif; @@ -454,7 +455,7 @@ if ($action == "confirm_approve" && GETPOST("confirm") == "yes" && $id > 0 && $u $result=$mailfile->sendfile(); if ($result): setEventMessage($langs->trans("MailSuccessfulySent",$emailFrom,$emailTo)); - Header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); + Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; else: setEventMessage($langs->trans("ErrorFailedToSendMail",$emailFrom,$emailTo),'errors'); @@ -540,7 +541,7 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user if ($result) { setEventMessage($langs->trans("MailSuccessfulySent",$emailFrom,$emailTo)); - Header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); + Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } else @@ -624,7 +625,7 @@ if ($action == "confirm_cancel" && GETPOST('confirm')=="yes" && GETPOST('detail_ $result=$mailfile->sendfile(); if ($result) { - header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } else @@ -793,7 +794,7 @@ if ($action == "confirm_brouillonner" && GETPOST('confirm')=="yes" && $id > 0 && if ($result > 0) { - header("Location: ".$_SEVER["PHP_SELF"]."?id=".$id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } else @@ -1324,27 +1325,27 @@ else dol_fiche_head($head, 'card', $langs->trans("TripCard"), 0, 'trip'); if ($action == 'save'): - $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save","","",1); if ($ret == 'html') print '
'; endif; if ($action == 'save_from_refuse'): - $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1); if ($ret == 'html') print '
'; endif; if ($action == 'delete'): - $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1); if ($ret == 'html') print '
'; endif; if ($action == 'validate'): - $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1); if ($ret == 'html') print '
'; endif; if ($action == 'paid'): - $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1); if ($ret == 'html') print '
'; endif; @@ -1356,20 +1357,20 @@ else } if ($action == 'brouillonner'): - $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1); if ($ret == 'html') print '
'; endif; if ($action == 'refuse') // Deny { $array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_refuse",'size'=>"50",'value'=>"")); - $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1); if ($ret == 'html') print '
'; } if ($action == 'delete_line') { - $ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id."&rowid=".$_GET['rowid'],$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".$_GET['rowid'],$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1); if ($ret == 'html') print '
'; } @@ -1805,18 +1806,18 @@ if ($action != 'create' && $action != 'edit') if ($object->fk_user_author == $user->id) { // Modifier - print ''.$langs->trans('ModifyInfoGen').''; + print ''.$langs->trans('Modify').''; // Validate if (count($object->lines) > 0 || count($object->lignes) > 0) { - print ''.$langs->trans('ValidateAndSubmit').''; + print ''.$langs->trans('ValidateAndSubmit').''; } if ($user->rights->expensereport->supprimer) { // Supprimer - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } } } @@ -1831,12 +1832,12 @@ if ($action != 'create' && $action != 'edit') if ($user->id == $object->fk_user_author || $user->id == $object->fk_user_valid) { // Modifier - print ''.$langs->trans('ModifyInfoGen').''; + print ''.$langs->trans('Modify').''; // Brouillonner (le statut refusée est identique à brouillon) //print ''.$langs->trans('BROUILLONNER').''; // Enregistrer depuis le statut "Refusée" - print ''.$langs->trans('ValidateAndSubmit').''; + print ''.$langs->trans('ValidateAndSubmit').''; if ($user->rights->expensereport->supprimer) { From b03a9dffeb78a642b69a7dedb1f91de46a59bdd4 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 1 May 2015 07:18:19 +0200 Subject: [PATCH 06/16] Fix : ER Correct Link --- htdocs/expensereport/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 64d47efd23e..b66ff15494b 100755 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -218,7 +218,7 @@ if ($action == "confirm_save" && GETPOST("confirm") == "yes" && $id > 0 && $user $subject = $langs->trans("ExpenseReportWaitingForApproval"); // CONTENT - $link = $urlwithroot.'/expenserecord/card.php?id='.$object->id; + $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->trans("ExpenseReportWaitingForApprovalMessage", $expediteur->getFullName($langs), get_date_range($object->date_debut,$object->date_fin,'',$langs), $link); // Rebuild pdf From 93937fe7f3cb4ad097830fdca590f4b7ec9058d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 30 Apr 2015 11:48:32 +0200 Subject: [PATCH 07/16] Allow exporting projects without a third party FIX #2729 --- htdocs/core/modules/modProjet.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 6bc21adb445..f76158d3a0c 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -286,11 +286,9 @@ class modProjet extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON p.rowid = pt.fk_projet"; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_task_extrafields as extra2 ON pt.rowid = extra2.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,"; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND p.entity = '.$conf->entity; - + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task"; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON p.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' WHERE p.entity = '.$conf->entity; } From 31a8e38d372b350350515bec894d6d3162502b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 1 May 2015 16:01:57 +0200 Subject: [PATCH 08/16] Allow exporting projects without a third party FIX #2729 Conflicts: htdocs/core/modules/modProjet.class.php --- htdocs/core/modules/modProjet.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 7bc9a51c022..e11e801a77b 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -292,11 +292,9 @@ class modProjet extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_extrafields as extra ON p.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task as pt ON p.rowid = pt.fk_projet"; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet_task_extrafields as extra2 ON pt.rowid = extra2.fk_object'; - $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task,"; - $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'societe as s'; - $this->export_sql_end[$r] .=' WHERE p.fk_soc = s.rowid'; - $this->export_sql_end[$r] .=' AND p.entity IN ('.getEntity('project',1).')'; - + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX."projet_task_time as ptt ON pt.rowid = ptt.fk_task"; + $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON p.fk_soc = s.rowid'; + $this->export_sql_end[$r] .=' WHERE p.entity = '.$conf->entity; } From e3f980e32c0e9b2e38a74bb190d41552cb48d6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 May 2015 18:44:27 +0200 Subject: [PATCH 09/16] Typo --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 2f85461887e..ad26b0c409d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1539,7 +1539,7 @@ class Commande extends CommonOrder if ($this->statut == self::STATUS_DRAFT) $this->brouillon = 1; - // Retreive all extrafield for invoice + // Retrieve all extrafields for invoice // fetch optionals attributes and labels require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields=new ExtraFields($this->db); From d8af7a45f87f438a569a641e67c7aad04420aea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 May 2015 19:10:47 +0200 Subject: [PATCH 10/16] Typo --- htdocs/webservices/server_thirdparty.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index aaed36ac9d8..c7ca5911d62 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -121,7 +121,7 @@ $thirdparty_fields= array( 'vat_used' => array('name'=>'vat_used','type'=>'xsd:string'), 'vat_number' => array('name'=>'vat_number','type'=>'xsd:string')); -//Retreive all extrafield for thirdsparty +// Retrieve all extrafields for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label('societe',true); @@ -329,7 +329,7 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='') 'note_private' => $thirdparty->note_private, 'note_public' => $thirdparty->note_public); - //Retreive all extrafield for thirdsparty + // Retrieve all extrafields for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label('societe',true); @@ -445,7 +445,7 @@ function createThirdParty($authentication,$thirdparty) $newobject->canvas=$thirdparty['canvas']; $newobject->particulier=$thirdparty['individual']; - //Retreive all extrafield for thirdsparty + // Retrieve all extrafields for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label('societe',true); @@ -576,7 +576,7 @@ function updateThirdParty($authentication,$thirdparty) $object->canvas=$thirdparty['canvas']; - //Retreive all extrafield for thirdsparty + // Retrieve all extrafields for thirdsparty // fetch optionals attributes and labels $extrafields=new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label('societe',true); From 1174c67b076ad4ea4b6a3981460fefc11989fe44 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 2 May 2015 06:42:06 +0200 Subject: [PATCH 11/16] Accountancy - Add key language & prepare journal for expense report --- htdocs/accountancy/admin/journaux.php | 8 ++++---- htdocs/core/modules/modAccounting.class.php | 7 ++++++- htdocs/langs/en_US/accountancy.lang | 12 +++++++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/admin/journaux.php b/htdocs/accountancy/admin/journaux.php index 03fd8684f50..5a305d87f2c 100644 --- a/htdocs/accountancy/admin/journaux.php +++ b/htdocs/accountancy/admin/journaux.php @@ -1,10 +1,10 @@ - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent - * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2015 Jean-François Ferry * * 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 @@ -48,8 +48,8 @@ $list = array ( 'ACCOUNTING_SELL_JOURNAL', 'ACCOUNTING_PURCHASE_JOURNAL', 'ACCOUNTING_SOCIAL_JOURNAL', - 'ACCOUNTING_CASH_JOURNAL', - 'ACCOUNTING_MISCELLANEOUS_JOURNAL' + 'ACCOUNTING_MISCELLANEOUS_JOURNAL', + 'ACCOUNTING_EXPENSEREPORT_JOURNAL' ); /* diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 70a52dc90e1..84e18048e84 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -69,7 +69,7 @@ class modAccounting extends DolibarrModules $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array("modComptabilite"); // List of modules are in conflict with this module $this->phpmin = array(5, 3); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(3, 6); // Minimum version of Dolibarr required by module + $this->need_dolibarr_version = array(3, 7); // Minimum version of Dolibarr required by module $this->langfiles = array("accountancy"); // Constants @@ -191,6 +191,11 @@ class modAccounting extends DolibarrModules "yesno", "1" ); + $this->const[22] = array( + "ACCOUNTING_EXPENSEREPORT_JOURNAL", + "chaine", + "ER" + ); // Tabs $this->tabs = array(); diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index b09dab7f764..c119a002641 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -1,6 +1,13 @@ # Dolibarr language file - en_US - Accounting Expert CHARSET=UTF-8 - +ACCOUNTING_EXPORT_SEPARATORCSV=Column separator for export file +ACCOUNTING_EXPORT_DATE=Date format for export file +ACCOUNTING_EXPORT_PIECE=Export the number of piece ? +ACCOUNTING_EXPORT_GLOBAL_ACCOUNT=Export with global account ? +ACCOUNTING_EXPORT_LABEL=Export the label ? +ACCOUNTING_EXPORT_AMOUNT=Export the amount ? +ACCOUNTING_EXPORT_DEVISE=Export the devise ? + Accounting=Accounting Globalparameters=Global parameters Chartofaccounts=Chart of accounts @@ -81,9 +88,8 @@ ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts ACCOUNTING_SELL_JOURNAL=Sell journal ACCOUNTING_PURCHASE_JOURNAL=Purchase journal -ACCOUNTING_BANK_JOURNAL=Bank journal -ACCOUNTING_CASH_JOURNAL=Cash journal ACCOUNTING_MISCELLANEOUS_JOURNAL=Miscellaneous journal +ACCOUNTING_EXPENSEREPORT_JOURNAL=Expense report journal ACCOUNTING_SOCIAL_JOURNAL=Social journal ACCOUNTING_ACCOUNT_TRANSFER_CASH=Account of transfer From 816356375310c7754a6b1cf84d08db67b2db719f Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 3 May 2015 06:12:02 +0200 Subject: [PATCH 12/16] New: Add option to show long or short (by default) label in select_month() --- htdocs/admin/company.php | 2 +- htdocs/core/class/html.formother.class.php | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 561e299b937..d5c78761989 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -543,7 +543,7 @@ if ($action == 'edit' || $action == 'updateedit') $var=!$var; print ''; - print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',1) . ''; + print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . ''; print ""; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 3233b479b6c..7dac2c2e527 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -776,17 +776,19 @@ class FormOther * Return HTML combo list of month * * @param string $selected Preselected value - * @param string $htmlname Nom de la zone select - * @param int $useempty Affiche valeur vide dans liste + * @param string $htmlname Name of HTML select object + * @param int $useempty Show empty in list + * @param int $longlabel Show long label * @return string */ - function select_month($selected='',$htmlname='monthid',$useempty=0) + function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) { global $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - $montharray = monthArray($langs, 1); // Get array + if ($longlabel) $montharray = monthArray($langs, 0); // Get array + else $montharray = monthArray($langs, 1); $select_month = ''; if ($useempty) From 3a5f6db571b8149ad4653bf8e0609e4eacf5fc06 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 3 May 2015 06:18:21 +0200 Subject: [PATCH 14/16] Spaces 2 : return of the vilains --- htdocs/core/class/html.formother.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index e1cbfd52047..7d93289a2fb 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -773,13 +773,13 @@ class FormOther } /** - * Return HTML combo list of month + * Return HTML combo list of month * - * @param string $selected Preselected value + * @param string $selected Preselected value * @param string $htmlname Name of HTML select object * @param int $useempty Show empty in list * @param int $longlabel Show long label - * @return string + * @return string */ function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) { From 7062dc7b2edc480e1d2e07e61fe2ddb8d77763e2 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 3 May 2015 06:20:34 +0200 Subject: [PATCH 15/16] Spaces 3 : the darkside --- htdocs/core/class/html.formother.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 7d93289a2fb..d14c748e80e 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -775,10 +775,10 @@ class FormOther /** * Return HTML combo list of month * - * @param string $selected Preselected value - * @param string $htmlname Name of HTML select object - * @param int $useempty Show empty in list - * @param int $longlabel Show long label + * @param string $selected Preselected value + * @param string $htmlname Name of HTML select object + * @param int $useempty Show empty in list + * @param int $longlabel Show long label * @return string */ function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) From 6dfd125872bc3543282ad3875416b73585f7ac9a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 3 May 2015 06:25:50 +0200 Subject: [PATCH 16/16] Spaces 4 : Stop Shouting ! --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index d14c748e80e..9266b8aa3a6 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -775,11 +775,11 @@ class FormOther /** * Return HTML combo list of month * - * @param string $selected Preselected value + * @param string $selected Preselected value * @param string $htmlname Name of HTML select object * @param int $useempty Show empty in list * @param int $longlabel Show long label - * @return string + * @return string */ function select_month($selected='',$htmlname='monthid',$useempty=0,$longlabel=0) {