diff --git a/.travis.yml b/.travis.yml index 426c6b97d74..9106acc0339 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,6 +113,7 @@ before_script: echo Start travis echo Current dir is `pwd` echo Home dir is `echo ~` + echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR - | echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit" @@ -138,22 +139,20 @@ before_script: echo - | - if [ "$DEBUG" = true ]; then - echo "Debugging informations" - # Check PHP - php -i - # Check PHP CodeSniffer installation - which phpcs - phpcs --version - phpcs -i - # Check PHPUnit installation - which phpunit - phpunit --version - # Check MySQL - mysql --version - mysql -e "SELECT VERSION();" - echo - fi + echo "Debugging informations" + # Check PHP + php -i + # Check PHP CodeSniffer installation + which phpcs + phpcs --version + phpcs -i + # Check PHPUnit installation + which phpunit + phpunit --version + # Check MySQL + mysql --version + mysql -e "SELECT VERSION();" + echo - | echo "Setting up database" @@ -311,3 +310,4 @@ after_failure: fi after_script: + diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 64194c7b756..7b887113d90 100644 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -124,7 +124,7 @@ - + diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index dc8dac4f959..1440a515794 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -148,14 +148,14 @@ if ($action == 'create') dol_fiche_head(); print ''; - - print ''; + + print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; print '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("Label") . '
' . $langs->trans("Label") . '
' . $langs->trans("Accountparent") . ''; - print $htmlacc->select_account($accounting->account_parent, 'account_parent'); + print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1); print '
' . $langs->trans("Pcgtype") . ''; @@ -204,13 +204,13 @@ else if ($id) print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; print '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("AccountNumber") . '
' . $langs->trans("Label") . '
' . $langs->trans("Label") . '
' . $langs->trans("Accountparent") . ''; - print $htmlacc->select_account($accounting->account_parent, 'account_parent'); + print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1); print '
' . $langs->trans("Pcgtype") . ''; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 8352a20797c..9e7f5fae4f8 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -325,7 +325,7 @@ if (empty($reshook)) for($i = 0; $i < $num; $i ++) { $label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); - $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle); + $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : ''); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); // Dates diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 27fcee1dbeb..91f96aabf5d 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -8,6 +8,7 @@ * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos GarcĂ­a + * Copyright (C) 2015 Ferran Marcet * * 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 @@ -989,6 +990,13 @@ class Contrat extends CommonObject } } + if (! $error) + { + // Delete linked object + $res = $this->deleteObjectLinked(); + if ($res < 0) $error++; + } + if (! $error) { // Delete contratdet_log diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 11ed633b2ac..41d411f01fd 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2015 Regis Houssin * * 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 @@ -21,12 +21,13 @@ * This ajax page is called when doing an up or down drag and drop. */ -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disable token renewal if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a5643c26dc5..4b86fa378cd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4243,7 +4243,7 @@ class Form else { // Day - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { @@ -4257,7 +4257,7 @@ class Form $retstring.=""; - $retstring.=''; + $retstring.=''; if ($emptydate || $set_time == -1) { $retstring.=''; @@ -4275,11 +4275,11 @@ class Form // Year if ($emptydate || $set_time == -1) { - $retstring.=''; + $retstring.=''; } else { - $retstring.=''; + $retstring.=''; for ($year = $syear - 5; $year < $syear + 10 ; $year++) { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 76a386c48c1..593e4616fd0 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -484,7 +484,7 @@ class pdf_einstein extends ModelePDFCommandes $this->tva[$vatrate] += $tvaligne; // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + if ($conf->global->MAIN_PDF_DASH_BETWEEN_LINES && $i < ($nblignes - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 935c2c3f400..974bbac1a3e 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -279,7 +279,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'C', 0); // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + if ($conf->global->MAIN_PDF_DASH_BETWEEN_LINES && $i < ($nblignes - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 091f754a01c..6cc965c5c4f 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -452,7 +452,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C'); // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + if ($conf->global->MAIN_PDF_DASH_BETWEEN_LINES && $i < ($nblignes - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index c0f3ffcc069..e967f6781ea 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -579,7 +579,7 @@ class pdf_crabe extends ModelePDFFactures if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage; // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + if ($conf->global->MAIN_PDF_DASH_BETWEEN_LINES && $i < ($nblignes - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 8f5109eb4ec..8266efe74a5 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -572,7 +572,7 @@ class pdf_azur extends ModelePDFPropales if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage; // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + if ($conf->global->MAIN_PDF_DASH_BETWEEN_LINES && $i < ($nblignes - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index c456bd7e0db..6b89ef7f5c8 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -448,7 +448,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->localtax2[$localtax2rate]+=$localtax2ligne; // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + if ($conf->global->MAIN_PDF_DASH_BETWEEN_LINES && $i < ($nblignes - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index e84416e114e..006b349c965 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -470,7 +470,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Add line - if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) + if ($conf->global->MAIN_PDF_DASH_BETWEEN_LINES && $i < ($nblignes - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 67f07ee1d1c..4a14998d0c4 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -494,7 +494,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage; // Add line - if ($conf->global->MAIN_PDF_DASH_BETWEEN_LINES && $i < ($nblignes - 1)) + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1)) { $pdf->setPage($pageposafter); $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80))); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 236eca113ff..27186807a80 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -732,7 +732,8 @@ class CommandeFournisseur extends CommonOrder // Do we have to change status now ? (If double approval is required and first approval, we keep status to 1 = validated) $movetoapprovestatus=true; - + $comment=''; + $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; $sql.= " SET ref='".$this->db->escape($num)."',"; if (empty($secondlevel)) // standard or first level approval @@ -741,7 +742,11 @@ class CommandeFournisseur extends CommonOrder $sql.= " fk_user_approve = ".$user->id; if (! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $this->total_ht >= $conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL) { - if (empty($this->user_approve_id2)) $movetoapprovestatus=false; // second level approval not done + if (empty($this->user_approve_id2)) + { + $movetoapprovestatus=false; // second level approval not done + $comment=' (first level)'; + } } } else // request a second level approval @@ -749,6 +754,7 @@ class CommandeFournisseur extends CommonOrder $sql.= " date_approve2='".$this->db->idate($now)."',"; $sql.= " fk_user_approve2 = ".$user->id; if (empty($this->user_approve_id)) $movetoapprovestatus=false; // first level approval not done + $comment=' (second level)'; } // If double approval is required and first approval, we keep status to 1 = validated if ($movetoapprovestatus) $sql.= ", fk_statut = 2"; @@ -758,7 +764,7 @@ class CommandeFournisseur extends CommonOrder if ($this->db->query($sql)) { - $this->log($user, 2, time()); // Statut 2 + $this->log($user, 2, time(), $comment); // Statut 2 if (! empty($conf->global->SUPPLIER_ORDER_AUTOADD_USER_CONTACT)) { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 65394016f6c..42d9b8bc99e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2733,10 +2733,24 @@ elseif (! empty($object->id)) // Reopen if (in_array($object->statut, array(2))) { - if ($user->rights->fournisseur->commande->commander) - { - print ''.$langs->trans("Disapprove").''; - } + $buttonshown=0; + if (! $buttonshown && $user->rights->fournisseur->commande->approuver) + { + if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) + || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER_ONLY) && $user->id == $object->user_approve_id)) + { + print ''.$langs->trans("Disapprove").''; + $buttonshown++; + } + } + if (! $buttonshown && $user->rights->fournisseur->commande->approve2 && ! empty($conf->global->SUPPLIER_ORDER_DOUBLE_APPROVAL)) + { + if (empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) + || (! empty($conf->global->SUPPLIER_ORDER_REOPEN_BY_APPROVER2_ONLY) && $user->id == $object->user_approve_id2)) + { + print ''.$langs->trans("Disapprove").''; + } + } } if (in_array($object->statut, array(3, 5, 6, 7, 9)) || ($object->statut == 4 && $object->billed)) { diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 8513bf325f8..dad6b236d92 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -155,3 +155,17 @@ ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting accoun FicheVentilation=Breakdown card GeneralLedgerIsWritten=Operations are written in the general ledger + +##Export Journal Feature +ExportFormat=Format of Export +Prefixname=Prefix of export File +Separate=Export separator +Textframe=Frame of text value +Headercol=Colname in header of file +Fieldname=Name of Field +Headername=Name in header +Type=Type of fields +Param=Additionnal parameters +EnabledProduct=In Product +EnabledTiers=In Tiers +EnabledVat=In Vat diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index b0c2014a104..83208d88c90 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -31,7 +31,7 @@ TripNDF=Informations expense report PDFStandardExpenseReports=Standard template to generate a PDF document for expense report ExpenseReportLine=Expense report line TF_OTHER=Other -TF_TRANSPORTATION=Transportation +TF_TRIP=Transportation TF_LUNCH=Lunch TF_METRO=Metro TF_TRAIN=Train