From 8fa7b924d5975f5d69d8571bc31a04dd15acfb5f Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 9 Dec 2017 12:08:50 +0100 Subject: [PATCH 001/203] enhance image using awesome icon --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9683517f377..ba842682221 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6245,7 +6245,7 @@ function dol_validElement($element) * Return img flag of country for a language code or country code * * @param string $codelang Language code (en_IN, fr_CA...) or Country code (IN, FR) - * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"') + * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"') * @return string HTML img string with flag. */ function picto_from_langcode($codelang, $moreatt = '') @@ -6258,7 +6258,7 @@ function picto_from_langcode($codelang, $moreatt = '') if ($codelang == 'auto') { - return img_picto_common($langs->trans('AutoDetectLang'), 'flags/int.png', $moreatt); + return ''; } $langtocountryflag = array( From a33411b8bd5842f1f201aaa03475d596b9c5f233 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Wed, 20 Dec 2017 09:06:11 +0100 Subject: [PATCH 002/203] Create 7.0.0-8.0.0.sql --- .../install/mysql/migration/7.0.0-8.0.0.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 htdocs/install/mysql/migration/7.0.0-8.0.0.sql diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql new file mode 100644 index 00000000000..e9a72ab9360 --- /dev/null +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -0,0 +1,26 @@ +-- +-- Be carefull to requests order. +-- This file must be loaded by calling /install/index.php page +-- when current version is 7.0.0 or higher. +-- +-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; +-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol; +-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60); +-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname; +-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60); +-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name; +-- To drop an index: -- VMYSQL4.0 DROP INDEX nomindex on llx_table +-- To drop an index: -- VPGSQL8.0 DROP INDEX nomindex +-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y +-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y +-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT; +-- To make pk to be auto increment (postgres): -- VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE +-- To set a field as NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NULL; +-- To set a field as NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL; +-- To set a field as NOT NULL: -- VMYSQL4.3 ALTER TABLE llx_table MODIFY COLUMN name varchar(60) NOT NULL; +-- To set a field as NOT NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET NOT NULL; +-- To set a field as default NULL: -- VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL; +-- Note: fields with type BLOB/TEXT can't have default value. + +-- For 8.0 +ALTER TABLE llx_societe ADD COLUMN fk_entrepot int DEFAULT 0; From e308124ed6d473f6b0694586c3a29b3eb4831320 Mon Sep 17 00:00:00 2001 From: AlainRnet Date: Wed, 20 Dec 2017 17:41:26 +0100 Subject: [PATCH 003/203] Show total number of records by category There is so much information missing in these categories and it is also not possible to sort or display other information than currently displayed. Here is a small hack to display the total number of record(s) in the list header of each category. --- htdocs/categories/viewcat.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index daa5ade05b5..255dc4888aa 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -353,7 +353,7 @@ if ($type == Categorie::TYPE_PRODUCT) print "
"; print "\n"; - print '\n"; + print '\n"; if (count($prods) > 0) { @@ -402,7 +402,7 @@ if ($type == Categorie::TYPE_SUPPLIER) { print "
"; print '
'.$langs->trans("ProductsAndServices")."
'.$langs->trans("ProductsAndServices")." (".count($prods).")
'."\n"; - print '\n"; + print '\n"; if (count($socs) > 0) { @@ -451,7 +451,7 @@ if($type == Categorie::TYPE_CUSTOMER) { print "
"; print '
'.$langs->trans("Suppliers")."
'.$langs->trans("Suppliers")." (".count($socs).")
'."\n"; - print '\n"; + print '\n"; if (count($socs) > 0) { @@ -507,7 +507,7 @@ if ($type == Categorie::TYPE_MEMBER) { print "
"; print "
'.$langs->trans("Customers")."
'.$langs->trans("Customers")." (".count($socs).")
\n"; - print '\n"; + print '\n"; if (count($prods) > 0) { @@ -558,7 +558,7 @@ if ($type == Categorie::TYPE_CONTACT) { print "
"; print '
'.$langs->trans("Member")."
'.$langs->trans("Member")." (".count($prods).")
'."\n"; - print '\n"; + print '\n"; if (count($contacts) > 0) { @@ -613,7 +613,7 @@ if ($type == Categorie::TYPE_ACCOUNT) { print "
"; print "
'.$langs->trans("Contact")."
'.$langs->trans("Contact")." (".count($contacts).")
\n"; - print '\n"; + print '\n"; if (count($accounts) > 0) { @@ -666,7 +666,7 @@ if ($type == Categorie::TYPE_PROJECT) { print "
"; print "
'.$langs->trans("Account")."
'.$langs->trans("Account")." (".count($accounts).")
\n"; - print '\n"; + print '\n"; if (count($projects) > 0) { From a9c7dc48abfaa23a0411535576472daf4cbb1a23 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 24 Dec 2017 17:31:31 +0100 Subject: [PATCH 004/203] New option to force e-mail recipient, helpful for test purposes --- htdocs/admin/mails.php | 11 +++++++++++ htdocs/core/class/CMailFile.class.php | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index d482322a054..677e6099a8d 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -70,6 +70,7 @@ complete_substitutions_array($substitutionarrayfortest, $langs); if ($action == 'update' && empty($_POST["cancel"])) { dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO"),'chaine',0,'',$conf->entity); // Send mode parameters dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"),'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"),'chaine',0,'',$conf->entity); @@ -238,6 +239,11 @@ if ($action == 'edit') print ''; + + // Force e-mail recipient + print ''; // Separator @@ -477,6 +483,11 @@ else // Disable print ''; + + // Force e-mail recipient + print ''; // Separator diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 86a6cb008d3..c79b7ac0cea 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -495,7 +495,7 @@ class CMailFile $res=false; - if (empty($conf->global->MAIN_DISABLE_ALL_MAILS)) + if (empty($conf->global->MAIN_DISABLE_ALL_MAILS) || !empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) { require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); @@ -557,6 +557,12 @@ class CMailFile $keyfortls ='MAIN_MAIL_EMAIL_TLS_EMAILING'; $keyforstarttls ='MAIN_MAIL_EMAIL_STARTTLS_EMAILING'; } + + if(!empty($conf->global->MAIN_MAIL_FORCE_SENDTO)) { + $this->addr_to = $conf->global->MAIN_MAIL_FORCE_SENDTO; + $this->addr_cc = ''; + $this->addr_bcc = ''; + } // Action according to choosed sending method if ($this->sendmode == 'mail') From d770f732193e97811ec9f94fd3d1e8b6a07ed009 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 26 Dec 2017 16:21:15 +0100 Subject: [PATCH 005/203] Add option translation --- htdocs/langs/en_US/admin.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a4ece445581..e2c39c45a3d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -272,6 +272,7 @@ MAIN_MAIL_EMAIL_FROM=Sender email for automatic emails (By default in php.ini: < MAIN_MAIL_ERRORS_TO=Sender email used for error returns emails sent MAIN_MAIL_AUTOCOPY_TO= Send systematically a hidden carbon-copy of all sent emails to MAIN_DISABLE_ALL_MAILS=Disable all emails sendings (for test purposes or demos) +MAIN_MAIL_FORCE_SENDTO=Send all emails to (instead of real recipients, for test purposes) MAIN_MAIL_SENDMODE=Method to use to send EMails MAIN_MAIL_SMTPS_ID=SMTP ID if authentication required MAIN_MAIL_SMTPS_PW=SMTP Password if authentication required From 33f6ba19da673faf0bec863cfebcdee5d4a608f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 28 Dec 2017 16:20:08 +0100 Subject: [PATCH 006/203] display weight volume in propal --- htdocs/comm/propal/card.php | 16 ++++++++++++++++ htdocs/commande/card.php | 5 ++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index edd2607a11c..78c38c1cc32 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2100,6 +2100,22 @@ if ($action == 'create') print ''; } + $tmparray=$object->getTotalWeightVolume(); + $totalWeight=$tmparray['weight']; + $totalVolume=$tmparray['volume']; + if ($totalWeight) { + print ''; + print ''; + } + if ($totalVolume) { + print ''; + print ''; + } + // Incoterms if (!empty($conf->incoterm->enabled)) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index bb6d2d78571..32bbdb9d0d8 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2268,12 +2268,15 @@ if ($action == 'create' && $user->rights->commande->creer) $tmparray=$object->getTotalWeightVolume(); $totalWeight=$tmparray['weight']; $totalVolume=$tmparray['volume']; - if ($totalWeight || $totalVolume) + if ($totalWeight) { print ''; print ''; + } + if ($totalVolume) + { print ''; print '"; } print "\n"; diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 30830cb26d4..8c4711f98c0 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -389,7 +389,7 @@ foreach($configfileparameters as $key => $value) } } else print ${$newkey}; - if ($newkey == 'dolibarr_main_url_root' && $newkey != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; + if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')'; print ""; } print "\n"; From 3987033aab88b28f9a5fadcbe8c3f06efa4ed0af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Jan 2018 20:53:36 +0100 Subject: [PATCH 020/203] Fix substitution in public notes of pdf --- htdocs/core/lib/functions.lib.php | 5 +++-- .../commande/doc/pdf_einstein.modules.php | 4 ++++ .../doc/pdf_standard.modules.php | 20 +++++++++++-------- .../modules/facture/doc/pdf_crabe.modules.php | 4 ++++ .../fichinter/doc/pdf_soleil.modules.php | 6 +++++- .../product/doc/pdf_standard.modules.php | 6 +++++- .../modules/propale/doc/pdf_azur.modules.php | 4 ++++ .../doc/pdf_aurore.modules.php | 12 +++++++---- 8 files changed, 45 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 96222974a13..d2333028203 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5620,10 +5620,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob } /** - * Make substition into a text string, replacing keys with vals from $substitutionarray (oldval=>newval). + * Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval). + * Texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced * * @param string $text Source string in which we must do substitution - * @param array $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal') + * @param array $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal', ...) * @param Translate $outputlangs Output language * @return string Output string after substitutions * @see complete_substitutions_array diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f5797e0fb2e..c3a7d3a7c56 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -348,6 +348,10 @@ class pdf_einstein extends ModelePDFCommandes } if ($notetoshow) { + $substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); + $tab_top = 88 + $height_incoterms; $pdf->SetFont('','', $default_font_size - 1); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 6182b5afca3..90746afed0e 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -262,10 +262,14 @@ class pdf_standard extends ModeleExpenseReport } if ($notetoshow) { + $substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); + $tab_top = 95; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxpiece-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxpiece-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -299,7 +303,7 @@ class pdf_standard extends ModeleExpenseReport $curY = $nexY; $pdf->SetFont('','', $default_font_size - 1); - + // Accountancy piece $pdf->SetXY($this->posxpiece, $curY); $pdf->writeHTMLCell($this->posxcomment-$this->posxpiece-0.8, 4, $this->posxpiece-1, $curY, $piece_comptable, 0, 1); @@ -327,7 +331,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, dol_trunc($outputlangs->transnoentities($object->lines[$i]->type_fees_code), 12), 0, 'C'); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->projet->enabled)) { $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY($this->posxprojet, $curY); @@ -429,7 +433,7 @@ class pdf_standard extends ModeleExpenseReport } $pdf->SetFont('','', 10); - + // Show total area box $posy=$bottomlasttab+5; $pdf->SetXY(100, $posy); @@ -475,7 +479,7 @@ class pdf_standard extends ModeleExpenseReport @chmod($file, octdec($conf->global->MAIN_UMASK)); $this->result = array('fullpath'=>$file); - + return 1; // Pas d'erreur } else @@ -585,7 +589,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->SetFont('','B', $default_font_size + 2); $pdf->SetTextColor(111,81,124); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $object->getLibStatut(0), '', 'R'); - + if ($showaddress) { // Sender properties @@ -731,7 +735,7 @@ class pdf_standard extends ModeleExpenseReport function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='') { global $conf; - + // Force to disable hidetop and hidebottom $hidebottom=0; if ($hidetop) $hidetop=-1; @@ -789,7 +793,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell($this->posxprojet-$this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C'); } - if (!empty($conf->projet->enabled)) + if (!empty($conf->projet->enabled)) { // Project $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 9a839a826be..139e192a077 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -382,6 +382,10 @@ class pdf_crabe extends ModelePDFFactures } if ($notetoshow) { + $substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); + $tab_top = 88 + $height_incoterms; $pdf->SetFont('','', $default_font_size - 1); diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 93e5aa11182..f63f05b07f9 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -211,6 +211,10 @@ class pdf_soleil extends ModelePDFFicheinter $notetoshow=empty($object->note_public)?'':$object->note_public; if ($notetoshow) { + $substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); + $tab_top = 88; $pdf->SetFont('','', $default_font_size - 1); @@ -401,7 +405,7 @@ class pdf_soleil extends ModelePDFFicheinter @chmod($file, octdec($conf->global->MAIN_UMASK)); $this->result = array('fullpath'=>$file); - + return 1; } else diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index b42fa3a1fb2..a4b65bbe38a 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -287,6 +287,10 @@ class pdf_standard extends ModelePDFProduct } if ($notetoshow) { + $substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); + $tab_top = 88; $pdf->SetFont('','', $default_font_size - 1); @@ -540,7 +544,7 @@ class pdf_standard extends ModelePDFProduct @chmod($file, octdec($conf->global->MAIN_UMASK)); $this->result = array('fullpath'=>$file); - + return 1; // Pas d'erreur } else diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index dc687b0d2c9..87437138812 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -388,6 +388,10 @@ class pdf_azur extends ModelePDFPropales } if ($notetoshow) { + $substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); + $tab_top = 88 + $height_incoterms; $pdf->SetFont('','', $default_font_size - 1); 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 ecdd99d140f..3dfda4a30dd 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -314,6 +314,10 @@ class pdf_aurore extends ModelePDFSupplierProposal } if ($notetoshow) { + $substitutionarray=pdf_getSubstitutionArray($outputlangs, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs); + $tab_top = 88; $pdf->SetFont('','', $default_font_size - 1); @@ -380,11 +384,11 @@ class pdf_aurore extends ModelePDFSupplierProposal $curX = $this->posxdesc-1; $pdf->startTransaction(); - if ($posYAfterImage > 0) + if ($posYAfterImage > 0) { $descWidth = $this->posxpicture-$curX; - } - else + } + else { $descWidth = $this->posxtva-$curX; } @@ -606,7 +610,7 @@ class pdf_aurore extends ModelePDFSupplierProposal @chmod($file, octdec($conf->global->MAIN_UMASK)); $this->result = array('fullpath'=>$file); - + return 1; // Pas d'erreur } else From 710cefa3a8d9f98db7c4acf7cf1c52472d2515c4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Jan 2018 21:30:11 +0100 Subject: [PATCH 021/203] Add missing vat rates --- htdocs/install/mysql/data/llx_c_tva.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 18ecfc82ba0..9d343f46a8f 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -277,8 +277,13 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.5','0','VAT super-reduced rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '0','0','VAT Rate 0', 1); +-- SRI LANKA (id country=207) +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2071, 207, '0','0','VAT 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2072, 207, '15','0','VAT 15%', 1); + -- TAIWAN (id country=213) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2131, 213, '5','0','VAT 5%',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2132, 213, '0','0','VAT 0', 1); -- TUNISIA (id country=10) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (101,10, '6','0','VAT 6%', 1, 1, '4', 0, 0); From 3c3e02dbeada807e70cb3e774c437c808fdda489 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Jan 2018 22:47:15 +0100 Subject: [PATCH 022/203] Fix missing fields --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index b3b109bd076..0d48fa89718 100644 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -343,6 +343,8 @@ CREATE TABLE llx_opensurvey_user_studs ( tms timestamp ) ENGINE=InnoDB; +ALTER TABLE llx_opensurvey_sondage ADD COLUMN id_sondage_admin CHAR(24); + ALTER TABLE llx_opensurvey_comments ADD INDEX idx_id_comment (id_comment); ALTER TABLE llx_opensurvey_comments ADD INDEX idx_id_sondage (id_sondage); ALTER TABLE llx_opensurvey_sondage ADD INDEX idx_id_sondage_admin (id_sondage_admin); From 273e88a599179ff701de33714b6f3c9286a70115 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jan 2018 03:07:11 +0100 Subject: [PATCH 023/203] Fix send into ledger for expense report. Show accounted status. --- htdocs/accountancy/expensereport/list.php | 2 +- .../journal/expensereportsjournal.php | 13 +++---- .../accountancy/journal/purchasesjournal.php | 1 + htdocs/accountancy/journal/sellsjournal.php | 1 + htdocs/core/class/commoninvoice.class.php | 2 +- htdocs/core/lib/functions.lib.php | 15 +++++++- .../class/expensereport.class.php | 35 +++++++++++++++++++ htdocs/langs/en_US/accountancy.lang | 8 +++-- htdocs/theme/eldy/style.css.php | 8 +++++ htdocs/theme/md/style.css.php | 8 +++++ 10 files changed, 81 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index eed1479ab0a..2beadebf46c 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -200,7 +200,7 @@ $sql.= " aa.rowid as aarowid"; $sql.= " FROM " . MAIN_DB_PREFIX . "expensereport as er"; $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport_det as erd ON er.rowid = erd.fk_expensereport"; $sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees"; -$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'"; +$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'"; $sql.= " WHERE er.fk_statut > 4 AND erd.fk_code_ventilation <= 0"; // Add search filter like if (strlen(trim($search_expensereport))) { diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 4a4dafbe2b4..13b97ffb8d3 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -554,14 +554,15 @@ if (empty($action) || $action == 'view') { print ' '; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index e8af356a245..7f25cd63df8 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -709,6 +709,7 @@ if (empty($action) || $action == 'view') { $("div.fiche form input[name=\"action\"]").val(""); } function writebookkeeping() { + console.log("click on writebookkeeping"); $("div.fiche form input[name=\"action\"]").val("writebookkeeping"); $("div.fiche form input[type=\"submit\"]").click(); $("div.fiche form input[name=\"action\"]").val(""); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 128c6be1471..d8d20978ab7 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -643,6 +643,7 @@ if (empty($action) || $action == 'view') { $("div.fiche form input[name=\"action\"]").val(""); } function writebookkeeping() { + console.log("click on writebookkeeping"); $("div.fiche form input[name=\"action\"]").val("writebookkeeping"); $("div.fiche form input[type=\"submit\"]").click(); $("div.fiche form input[name=\"action\"]").val(""); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index b69f55ba1a8..9d7ae9d0998 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -338,7 +338,7 @@ abstract class CommonInvoice extends CommonObject * * @return int <0 if KO, 0=no, 1=yes */ - function getVentilExportCompta() + public function getVentilExportCompta() { $alreadydispatched = 0; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d2333028203..a47cc32e44b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1494,7 +1494,20 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3) || $conf->browser->layout=='phone') $tmptxt=$object->getLibStatut(5); $morehtmlstatus.=$tmptxt; } - if (! empty($object->name_alias)) $morehtmlref.='
'.$object->name_alias.'
'; // For thirdparty + + // Add if object was dispatched "into accountancy" + if (! empty($conf->accounting->enabled) && in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'expensereport'))) + { + if (method_exists($object, 'getVentilExportCompta')) + { + $accounted = $object->getVentilExportCompta(); + $langs->load("accountancy"); + $morehtmlstatus.='
'.($accounted > 0 ? $langs->trans("Accounted") : $langs->trans("NotYetAccounted")); + } + } + + // Add alias for thirdparty + if (! empty($object->name_alias)) $morehtmlref.='
'.$object->name_alias.'
'; // Add label if ($object->element == 'product' || $object->element == 'bank_account' || $object->element == 'project_task') diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 796be33104f..2052b63fe0c 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2326,6 +2326,41 @@ class ExpenseReport extends CommonObject else return ($this->datevalid?$this->datevalid:$this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); } + + /** + * Return if an expensereport was dispatched into bookkeeping + * + * @return int <0 if KO, 0=no, 1=yes + */ + public function getVentilExportCompta() + { + $alreadydispatched = 0; + + $type = 'expense_report'; + + $sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$type."' AND ab.fk_doc = ".$this->id; + $resql = $this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); + if ($obj) + { + $alreadydispatched = $obj->nb; + } + } + else + { + $this->error = $this->db->lasterror(); + return -1; + } + + if ($alreadydispatched) + { + return 1; + } + return 0; + } + } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index 949b16109f0..c23e13a6bff 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -25,8 +25,8 @@ Chartofaccounts=Chart of accounts CurrentDedicatedAccountingAccount=Current dedicated account AssignDedicatedAccountingAccount=New account to assign InvoiceLabel=Invoice label -OverviewOfAmountOfLinesNotBound=Overview of amount of lines not bound to accounting account -OverviewOfAmountOfLinesBound=Overview of amount of lines already bound to accounting account +OverviewOfAmountOfLinesNotBound=Overview of amount of lines not bound to an accounting account +OverviewOfAmountOfLinesBound=Overview of amount of lines already bound to an accounting account OtherInfo=Other information DeleteCptCategory=Remove accounting account from group ConfirmDeleteCptCategory=Are you sure you want to remove this accounting account from the accounting account group ? @@ -173,7 +173,7 @@ DelBookKeeping=Delete record of the Ledger FinanceJournal=Finance journal ExpenseReportsJournal=Expense reports journal DescFinanceJournal=Finance journal including all the types of payments by bank account -DescJournalOnlyBindedVisible=This is a view of record that are bound to accounting account and can be recorded into the Ledger. +DescJournalOnlyBindedVisible=This is a view of record that are bound to an accounting account and can be recorded into the Ledger. VATAccountNotDefined=Account for VAT not defined ThirdpartyAccountNotDefined=Account for third party not defined ProductAccountNotDefined=Account for product not defined @@ -224,6 +224,8 @@ GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be disp NoNewRecordSaved=No more record to journalize ListOfProductsWithoutAccountingAccount=List of products not bound to any accounting account ChangeBinding=Change the binding +Accounted=Accounted in ledger +NotYetAccounted=Not yet accounted in ledger ## Admin ApplyMassCategories=Apply mass categories diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 2ccdac53c52..27fb07d414d 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1025,6 +1025,9 @@ select.selectarrowonleft option { div.statusref img { padding-right: 3px !important; } + div.statusrefbis { + padding-right: 3px !important; + } input.buttonpayment { min-width: 300px; @@ -1332,6 +1335,11 @@ div.statusref img { padding-right: 9px; vertical-align: text-bottom; } +div.statusrefbis { + padding-left: 8px; + padding-right: 9px; + vertical-align: text-bottom; +} img.photoref, div.photoref { border: 1px solid #CCC; -webkit-box-shadow: 2px 2px 4px #ccc; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index ebe69f736e0..cf872bb117d 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1015,6 +1015,9 @@ select.selectarrowonleft option { div.statusref img { padding-right: 3px !important; } + div.statusrefbis { + padding-right: 3px !important; + } input.buttonpayment { min-width: 300px; @@ -1345,6 +1348,11 @@ div.statusref img { padding-right: 9px; vertical-align: text-bottom; } +div.statusrefbis { + padding-left: 8px; + padding-right: 9px; + vertical-align: text-bottom; +} img.photoref, div.photoref { border: 1px solid #CCC; -webkit-box-shadow: 3px 3px 4px #DDD; From 7a1a2cf90d4b3e5c45e199e1c095d81bd75a3328 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jan 2018 04:13:29 +0100 Subject: [PATCH 024/203] Fix send into ledger for bank line record. Show accounted status. --- htdocs/accountancy/bookkeeping/list.php | 11 ++---- htdocs/accountancy/journal/bankjournal.php | 5 ++- htdocs/compta/bank/class/account.class.php | 35 +++++++++++++++++ htdocs/compta/bank/ligne.php | 10 ++++- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/menus/init_menu_auguria.sql | 4 +- htdocs/core/menus/standard/eldy.lib.php | 45 +++++++++++----------- 7 files changed, 75 insertions(+), 37 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 29dfbeeec59..8ecf04fdbc8 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -35,9 +35,6 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; // Langs $langs->load("accountancy"); -$page = GETPOST("page"); -$sortorder = GETPOST("sortorder"); -$sortfield = GETPOST("sortfield"); $action = GETPOST('action', 'alpha'); $search_mvt_num = GETPOST('search_mvt_num', 'int'); $search_doc_type = GETPOST("search_doc_type"); @@ -49,7 +46,7 @@ $search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmo $search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int')); $search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int')); $search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int')); - +//var_dump($search_date_start);exit; if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) { $action = 'delbookkeepingyear'; } @@ -99,10 +96,10 @@ $formaccounting = new FormAccounting($db); $formother = new FormOther($db); $form = new Form($db); -if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && empty($page) && ! GETPOST('noreset','int')) +if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page','int') == '' && ! GETPOST('noreset','int')) { - $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; - $query .= " where date_start < now() and date_end > now() limit 1"; + $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; + $query.= " where date_start < '".$this->idate(dol_now())."' and date_end > '".$this->idate(dol_now())."' limit 1"; $res = $db->query($query); if ($res->num_rows > 0) { $fiscalYear = $db->fetch_object($res); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 32396a9333c..b9b079067b8 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -225,7 +225,7 @@ if ($result) { 'accountancy_code' => $compta_user, ); - // Variable bookkeeping + // Variable bookkeeping ($obj->rowid is Bank Id) $tabpay[$obj->rowid]["date"] = $obj->do; $tabpay[$obj->rowid]["type_payment"] = $obj->fk_type; // CHQ, VIR, LIQ, CB, ... $tabpay[$obj->rowid]["ref"] = $obj->label; // By default. Not unique. May be changed later @@ -1101,7 +1101,7 @@ function getSourceDocRef($val, $typerecord) $sqlmid = 'SELECT payd.fk_donation as ref'; $sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_donation as payd"; $sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"]; - $ref = $langs->trans("Donation").' '; + $ref = $langs->trans("Donation"); } elseif ($typerecord == 'payment_various') { @@ -1129,5 +1129,6 @@ function getSourceDocRef($val, $typerecord) else dol_print_error($db); } + $ref = dol_trunc($langs->trans("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 ... i< < than max size of 300 return $ref; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ff396f344e4..1dba4a5b221 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -2227,5 +2227,40 @@ class AccountLine extends CommonObject }*/ } + + /** + * Return if a bank line was dispatched into bookkeeping + * + * @return int <0 if KO, 0=no, 1=yes + */ + public function getVentilExportCompta() + { + $alreadydispatched = 0; + + $type = 'bank'; + + $sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$type."' AND ab.fk_doc = ".$this->id; + $resql = $this->db->query($sql); + if ($resql) + { + $obj = $this->db->fetch_object($resql); + if ($obj) + { + $alreadydispatched = $obj->nb; + } + } + else + { + $this->error = $this->db->lasterror(); + return -1; + } + + if ($alreadydispatched) + { + return 1; + } + return 0; + } + } diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 579ca2ce886..33621d4b9a9 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -291,7 +291,6 @@ if ($result) if ($action == 'delete_categ') { print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1); - } print '
'; @@ -300,13 +299,14 @@ if ($result) print ''; print ''; - dol_fiche_head($tabs, 0, $langs->trans('LineRecord'), 0, 'account'); + dol_fiche_head($tabs, 0, $langs->trans('LineRecord'), -1, 'account', 0); $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($bankline, 'rowid', $linkback); + print '
'; print '
'; print '
'.$langs->trans("Project")."
'.$langs->trans("Project")." (".count($projects).")
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1); print '
'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''; + print ''; + print '
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''.yn($conf->global->MAIN_DISABLE_ALL_MAILS).'
'.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.$conf->global->MAIN_MAIL_FORCE_SENDTO; + if (! empty($conf->global->MAIN_MAIL_FORCE_SENDTO) && ! isValidEmail($conf->global->MAIN_MAIL_FORCE_SENDTO)) print img_warning($langs->trans("ErrorBadEMail")); + print '
' . $langs->trans("CalculatedWeight") . ''; + print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no'); + print '
' . $langs->trans("CalculatedVolume") . ''; + print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no'); + print '
'.$langs->trans("CalculatedWeight").''; print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND)?$conf->global->MAIN_WEIGHT_DEFAULT_ROUND:-1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT)?$conf->global->MAIN_WEIGHT_DEFAULT_UNIT:'no'); print '
'.$langs->trans("CalculatedVolume").''; print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND)?$conf->global->MAIN_VOLUME_DEFAULT_ROUND:-1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT)?$conf->global->MAIN_VOLUME_DEFAULT_UNIT:'no'); From 12e414509ca3bf9c1a956bc11a558a2adee9c035 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 2 Jan 2018 11:24:28 +0100 Subject: [PATCH 007/203] Add a hook in dol_print_phone To allow more controls in this print function as in dol_print_address (there is a hook so we can create links to maps...). Eg : create a other click to dial functions (different from dolibarr ones with more parameters, because each provider give differents api ) etc Hope this one will be accepted and usefull for the community. And happy new year :) --- htdocs/core/lib/functions.lib.php | 44 +++++++++++++++++++------------ 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9e7bb7f7ce8..77882d590d6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2172,7 +2172,7 @@ function dol_print_skype($skype,$cid=0,$socid=0,$addlink=0,$max=64) */ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$separ=" ",$withpicto='',$titlealt='',$adddivfloat=0) { - global $conf,$user,$langs,$mysoc; + global $conf, $user, $langs, $mysoc, $hookmanager; // Clean phone parameter $phone = preg_replace("/[\s.-]/","",trim($phone)); @@ -2262,23 +2262,33 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $titlealt=($withpicto=='fax'?$langs->trans("Fax"):$langs->trans("Phone")); } $rep=''; - $picto = ''; - if($withpicto){ - if($withpicto=='fax'){ - $picto = 'phoning_fax'; - }elseif($withpicto=='phone'){ - $picto = 'phoning'; - }elseif($withpicto=='mobile'){ - $picto = 'phoning_mobile'; - }else{ - $picto = ''; + + if ($hookmanager) { + $parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid); + $reshook = $hookmanager->executeHooks('printPhone', $parameters, $phone); + $rep.=$hookmanager->resPrint; + } + if (empty($reshook)) + { + $picto = ''; + if($withpicto){ + if($withpicto=='fax'){ + $picto = 'phoning_fax'; + }elseif($withpicto=='phone'){ + $picto = 'phoning'; + }elseif($withpicto=='mobile'){ + $picto = 'phoning_mobile'; + }else{ + $picto = ''; + } } - } - if ($adddivfloat) $rep.='
'; - else $rep.=''; - $rep.=($withpicto?img_picto($titlealt, 'object_'.$picto.'.png').' ':'').$newphone; - if ($adddivfloat) $rep.='
'; - else $rep.=''; + if ($adddivfloat) $rep.='
'; + else $rep.=''; + $rep.=($withpicto?img_picto($titlealt, 'object_'.$picto.'.png').' ':'').$newphone; + if ($adddivfloat) $rep.='
'; + else $rep.=''; + } + return $rep; } From ab896dc49d50448c6bcd68d0ac76023340fd493e Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 2 Jan 2018 11:39:00 +0100 Subject: [PATCH 008/203] Update functions.lib.php --- htdocs/core/lib/functions.lib.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 77882d590d6..06574be96a5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2268,8 +2268,7 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $reshook = $hookmanager->executeHooks('printPhone', $parameters, $phone); $rep.=$hookmanager->resPrint; } - if (empty($reshook)) - { + $picto = ''; if($withpicto){ if($withpicto=='fax'){ @@ -2287,7 +2286,7 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $rep.=($withpicto?img_picto($titlealt, 'object_'.$picto.'.png').' ':'').$newphone; if ($adddivfloat) $rep.=''; else $rep.=''; - } + return $rep; } From e794a3b321d764fa007ea56532a3412730707dfb Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 2 Jan 2018 11:44:54 +0100 Subject: [PATCH 009/203] Update functions.lib.php add more parameters and add if empty --- htdocs/core/lib/functions.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 06574be96a5..0fa71c97c49 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2264,11 +2264,12 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $rep=''; if ($hookmanager) { - $parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid); + $parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid,'titlealt' => $titlealt, 'picto' => $picto); $reshook = $hookmanager->executeHooks('printPhone', $parameters, $phone); $rep.=$hookmanager->resPrint; } - + if (empty($reshook)) + { $picto = ''; if($withpicto){ if($withpicto=='fax'){ @@ -2286,7 +2287,7 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $rep.=($withpicto?img_picto($titlealt, 'object_'.$picto.'.png').' ':'').$newphone; if ($adddivfloat) $rep.=''; else $rep.=''; - + } return $rep; } From 3438cfb1e7a63231e2d9a025f82ead63d0d619fe Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Tue, 2 Jan 2018 11:48:41 +0100 Subject: [PATCH 010/203] Update functions.lib.php syntax error $withpicto --- 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 0fa71c97c49..f69bf3979cd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2264,7 +2264,7 @@ function dol_print_phone($phone,$countrycode='',$cid=0,$socid=0,$addlink='',$sep $rep=''; if ($hookmanager) { - $parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid,'titlealt' => $titlealt, 'picto' => $picto); + $parameters = array('countrycode' => $countrycode, 'cid' => $cid, 'socid' => $socid,'titlealt' => $titlealt, 'picto' => $withpicto); $reshook = $hookmanager->executeHooks('printPhone', $parameters, $phone); $rep.=$hookmanager->resPrint; } From 6ba5ca36c4b7a7a666a997effd2cd6001ac66a8e Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Fri, 5 Jan 2018 08:59:31 +0100 Subject: [PATCH 011/203] Update llx_societe.sql Goes with https://github.com/Dolibarr/dolibarr/pull/7975 --- htdocs/install/mysql/tables/llx_societe.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql index c23ca3a183c..fe20f426094 100644 --- a/htdocs/install/mysql/tables/llx_societe.sql +++ b/htdocs/install/mysql/tables/llx_societe.sql @@ -104,5 +104,6 @@ create table llx_societe webservices_key varchar(128), -- supplier webservice key fk_multicurrency integer, - multicurrency_code varchar(255) + multicurrency_code varchar(255), + fk_entrepot int DEFAULT 0 -- Id de l'entrepôt par défaut (Warehouse ID by default) )ENGINE=innodb; From c45e5c91b118dbd985c42c57d91ff898671149ea Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 14 Jan 2018 17:13:42 +0100 Subject: [PATCH 012/203] New hidden option MAIN_DISABLE_FREE_LINES --- htdocs/core/tpl/objectline_create.tpl.php | 80 +++++++++++++---------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 2d6178ed79b..2ea5b6899d7 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -142,49 +142,54 @@ else {
element == 'contrat') + + $freelines = false; + if(empty($conf->global->MAIN_DISABLE_FREE_LINES)) { - if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set - else $forceall=0; - } - - // Free line - echo ''; - // Show radio free line - if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) - { - echo ''; - echo ' '; - } - else - { - echo ''; - // Show type selector - if ($forceall >= 0) + $freelines = true; + $forceall=1; // We always force all type for free lines (module product or service means we use predefined product or service) + if ($object->element == 'contrat') { - if (empty($conf->product->enabled) || empty($conf->service->enabled)) echo $langs->trans("Type"); - else echo $langs->trans("FreeLineOfType"); + if (empty($conf->product->enabled) && empty($conf->service->enabled) && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $forceall=-1; // With contract, by default, no choice at all, except if CONTRACT_SUPPORT_PRODUCTS is set + else $forceall=0; + } + + // Free line + echo ''; + // Show radio free line + if ($forceall >= 0 && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) + { + echo ''; echo ' '; } + else + { + echo ''; + // Show type selector + if ($forceall >= 0) + { + if (empty($conf->product->enabled) || empty($conf->service->enabled)) echo $langs->trans("Type"); + else echo $langs->trans("FreeLineOfType"); + echo ' '; + } + } + + echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type",'alpha',2):-1,'type',1,1,$forceall); + + echo ''; } - echo $form->select_type_of_lines(isset($_POST["type"])?GETPOST("type",'alpha',2):-1,'type',1,1,$forceall); - - echo ''; - // Predefined product/service if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - if ($forceall >= 0) echo '
'; + if ($forceall >= 0 && $freelines) echo '
'; echo ''; echo '
'; @@ -597,6 +597,8 @@ if ($result) print "
"; + print ''; + dol_fiche_end(); @@ -618,6 +620,8 @@ if ($result) print ''; print ''; + print '
'; + print ''; print '"; @@ -656,6 +660,8 @@ if ($result) print ''; print '
'.$langs->trans("Conciliation")."
'; + print '
'; + print '
'; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a47cc32e44b..fa8dadc4a65 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1496,7 +1496,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r } // Add if object was dispatched "into accountancy" - if (! empty($conf->accounting->enabled) && in_array($object->element, array('facture', 'invoice', 'invoice_supplier', 'expensereport'))) + if (! empty($conf->accounting->enabled) && in_array($object->element, array('bank', 'facture', 'invoice', 'invoice_supplier', 'expensereport'))) { if (method_exists($object, 'getVentilExportCompta')) { diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 3991e4ecb69..9fac1aa93b0 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -13,8 +13,8 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('product|service', '$conf->product->enabled || $conf->service->enabled', 3__+MAX_llx_menu__, __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'Products/Services', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('propal|commande|fournisseur|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', 5__+MAX_llx_menu__, __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 6__+MAX_llx_menu__, __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'Accountancy', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 2, 51, __ENTITY__); -insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__); +insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'Accountancy', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 2, 54, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__); insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 110, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 9e9c6b5c63a..7d5e328de9f 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -164,28 +164,6 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $menu->add('/compta/index.php?mainmenu=billing&leftmenu=', $langs->trans("MenuFinancial"), 0, $showmode, $atarget, "billing", '', 50, $id, $idsel, $classname); } - // Accounting - $menuqualified=0; - if (! empty($conf->comptabilite->enabled)) $menuqualified++; - if (! empty($conf->accounting->enabled)) $menuqualified++; - $tmpentry=array( - 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire)), - 'module'=>'comptabilite|accounting'); - $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); - if ($showmode) - { - $langs->load("compta"); - - $classname=""; - if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } - else $classname = 'class="tmenu"'; - $idsel='accountancy'; - - $menu->add('/accountancy/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("MenuAccountancy"), 0, $showmode, $atarget, "accountancy", '', 52, $id, $idsel, $classname); - } - - // Bank $tmpentry=array('enabled'=>(! empty($conf->banque->enabled) || ! empty($conf->prelevement->enabled)), 'perms'=>(! empty($user->rights->banque->lire) || ! empty($user->rights->prelevement->lire)), @@ -201,7 +179,28 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode else $classname = 'class="tmenu"'; $idsel='bank'; - $menu->add('/compta/bank/list.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", '', 60, $id, $idsel, $classname); + $menu->add('/compta/bank/list.php?mainmenu=bank&leftmenu=', $langs->trans("MenuBankCash"), 0, $showmode, $atarget, "bank", '', 52, $id, $idsel, $classname); + } + + // Accounting + $menuqualified=0; + if (! empty($conf->comptabilite->enabled)) $menuqualified++; + if (! empty($conf->accounting->enabled)) $menuqualified++; + $tmpentry=array( + 'enabled'=>$menuqualified, + 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire)), + 'module'=>'comptabilite|accounting'); + $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); + if ($showmode) + { + $langs->load("compta"); + + $classname=""; + if ($_SESSION["mainmenu"] && $_SESSION["mainmenu"] == "accountancy") { $classname='class="tmenusel"'; $_SESSION['idmenu']=''; } + else $classname = 'class="tmenu"'; + $idsel='accountancy'; + + $menu->add('/accountancy/index.php?mainmenu=accountancy&leftmenu=', $langs->trans("MenuAccountancy"), 0, $showmode, $atarget, "accountancy", '', 54, $id, $idsel, $classname); } // Projects From f47f0357d323c3c5486c2da06166f393322256c0 Mon Sep 17 00:00:00 2001 From: Darkjeff Date: Mon, 22 Jan 2018 15:57:17 +0100 Subject: [PATCH 025/203] Fixing Subledger account in lettering --- .../bookkeeping/thirdparty_lettrage.php | 4 ++-- .../thirdparty_lettrage_supplier.php | 4 ++-- htdocs/accountancy/class/lettering.class.php | 22 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php index 782a7de7aa4..550ea1d933a 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php @@ -172,10 +172,10 @@ print ''; print ''; $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; -$sql .= " bk.thirdparty_code, bk.numero_compte , bk.label_compte, bk.debit, "; +$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; $sql .= " bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.lettering_code "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; -$sql .= " WHERE (bk.thirdparty_code = '" . $object->code_compta . "' AND bk.numero_compte = '" . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . "' )"; +$sql .= " WHERE (bk.subledger_account = '" . $object->code_compta . "' AND bk.numero_compte = '" . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . "' )"; if (dol_strlen($search_year)) { $date_start = dol_mktime(0, 0, 0, 1, 1, $search_year); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php index 5ac224673aa..35bdcfa23fe 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php @@ -188,10 +188,10 @@ print ''; print ''; $sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, "; -$sql .= " bk.thirdparty_code, bk.numero_compte , bk.label_compte, bk.debit, "; +$sql .= " bk.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, "; $sql .= " bk.credit, bk.montant , bk.sens , bk.code_journal , bk.piece_num, bk.lettering_code "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; -$sql .= " WHERE (bk.thirdparty_code = '" . $object->code_compta_fournisseur . "' AND bk.numero_compte = '" . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . "' )"; +$sql .= " WHERE (bk.subledger_account = '" . $object->code_compta_fournisseur . "' AND bk.numero_compte = '" . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . "' )"; if (dol_strlen($search_year)) { $date_start = dol_mktime(0, 0, 0, 1, 1, $search_year); diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 0fbb3872489..499f9e4f46c 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -56,18 +56,18 @@ class lettering extends BookKeeping /** * Prise en charge des lettering complexe avec prelevment , virement */ - $sql = "SELECT DISTINCT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.thirdparty_code, "; + $sql = "SELECT DISTINCT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, bk.subledger_account, "; $sql .= " bk.numero_compte , bk.label_compte, bk.debit , bk.credit, bk.montant "; $sql .= " , bk.sens , bk.code_journal , bk.piece_num, bk.date_lettering, bu.url_id , bu.type "; $sql .= " FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as bk"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu ON(bk.fk_doc = bu.fk_bank AND bu.type IN ('payment', 'payment_supplier') ) "; $sql .= " WHERE ( "; if (! empty($object->code_compta)) - $sql .= " bk.thirdparty_code = '" . $object->code_compta . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) $sql .= " OR "; if (! empty($object->code_compta_fournisseur)) - $sql .= " bk.thirdparty_code = '" . $object->code_compta_fournisseur . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; $sql .= " ) AND (bk.date_lettering ='' OR bk.date_lettering IS NULL) "; $sql .= " AND (bk.lettering_code != '' OR bk.lettering_code IS NULL) "; @@ -94,13 +94,13 @@ class lettering extends BookKeeping $sql .= " AND code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=4) "; $sql .= " AND ( "; if (! empty($object->code_compta)) { - $sql .= " bk.thirdparty_code = '" . $object->code_compta . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { $sql .= " OR "; } if (! empty($object->code_compta_fournisseur)) { - $sql .= " bk.thirdparty_code = '" . $object->code_compta_fournisseur . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } $sql .= " ) "; @@ -121,13 +121,13 @@ class lettering extends BookKeeping $sql .= " WHERE bk.code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=3) "; $sql .= " AND ( "; if (! empty($object->code_compta)) { - $sql .= " bk.thirdparty_code = '" . $object->code_compta . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { $sql .= " OR "; } if (! empty($object->code_compta_fournisseur)) { - $sql .= " bk.thirdparty_code = '" . $object->code_compta_fournisseur . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } $sql .= " ) "; @@ -152,13 +152,13 @@ class lettering extends BookKeeping $sql .= " AND bk.code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=4) "; $sql .= " AND ( "; if (! empty($object->code_compta)) { - $sql .= " bk.thirdparty_code = '" . $object->code_compta . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { $sql .= " OR "; } if (! empty($object->code_compta_fournisseur)) { - $sql .= " bk.thirdparty_code = '" . $object->code_compta_fournisseur . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } $sql .= " ) "; @@ -179,13 +179,13 @@ class lettering extends BookKeeping $sql .= " WHERE code_journal IN (SELECT code FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE nature=2) "; $sql .= " AND ( "; if (! empty($object->code_compta)) { - $sql .= " bk.thirdparty_code = '" . $object->code_compta . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta . "' "; } if (! empty($object->code_compta) && ! empty($object->code_compta_fournisseur)) { $sql .= " OR "; } if (! empty($object->code_compta_fournisseur)) { - $sql .= " bk.thirdparty_code = '" . $object->code_compta_fournisseur . "' "; + $sql .= " bk.subledger_account = '" . $object->code_compta_fournisseur . "' "; } $sql .= " ) "; From 2ed34d813df7846f961dc0973eebec1722bedbb0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jan 2018 16:04:58 +0100 Subject: [PATCH 026/203] Css --- htdocs/core/tpl/login.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 49a65d01c5c..0c9086f4e9b 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -110,6 +110,7 @@ if ($disablenofollow) echo '';
+
From 054d98a2baf8f566a41f38dacb857695e9a75173 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Mon, 22 Jan 2018 17:09:17 +0100 Subject: [PATCH 027/203] Fix each total isn't aligned on payment card --- htdocs/compta/paiement.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index e81d0e38345..2b6f47037f0 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -745,7 +745,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { // Print total print ''; - print ''.$langs->trans('TotalTTC').''; + print ''.$langs->trans('TotalTTC').''; + if (!empty($conf->multicurrency->enabled)) print ''; if (!empty($conf->multicurrency->enabled)) print ''; if (!empty($conf->multicurrency->enabled)) print ''; if (!empty($conf->multicurrency->enabled)) print ''; From d1365c249299e11d1f4a56fe7273b3d34bdfbd92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jan 2018 17:15:44 +0100 Subject: [PATCH 028/203] Fix trackid --- htdocs/core/actions_sendmails.inc.php | 3 ++- htdocs/user/card.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index ba930158d90..eea69e37c13 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -102,7 +102,8 @@ if (GETPOST('removAll','alpha')) */ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_POST['removAll'] && ! $_POST['removedfile'] && ! $_POST['cancel'] && !$_POST['modelselected']) { - $trackid = GETPOST('trackid','aZ09'); + if (empty($trackid)) $trackid = GETPOST('trackid','aZ09'); + $subject='';$actionmsg='';$actionmsg2=''; if (! empty($conf->dolimail->enabled)) $langs->load("dolimail@dolimail"); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index a8377be7b15..84665839c6b 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1706,7 +1706,7 @@ else $modelmail='user'; $defaulttopic='Information'; $diroutput = $conf->user->dir_output; - $trackid = 'user'.$object->id; + $trackid = 'use'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; From 7ac286463fc866f4485799175b62fe9b554f5a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 22 Jan 2018 17:23:59 +0100 Subject: [PATCH 029/203] Update bills.lang --- htdocs/langs/en_US/bills.lang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 5027e56b858..5ed49679e04 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -148,6 +148,7 @@ ErrorDiscountAlreadyUsed=Error, discount already used ErrorInvoiceAvoirMustBeNegative=Error, correct invoice must have a negative amount ErrorInvoiceOfThisTypeMustBePositive=Error, this type of invoice must have a positive amount ErrorCantCancelIfReplacementInvoiceNotValidated=Error, can't cancel an invoice that has been replaced by another invoice that is still in draft status +ErrorThisPartOrAnotherIsAlreadyUsedSoDiscountSerieCantBeRemoved=This part or another is already used so discount serie cant be removed. BillFrom=From BillTo=To ActionsOnBill=Actions on invoice @@ -519,4 +520,4 @@ CreateOneBillByThird=Create one invoice per third party (otherwise, one invoice BillCreated=%s bill(s) created StatusOfGeneratedDocuments=Status of document generation DoNotGenerateDoc=Do not generate document file -AutogenerateDoc=Auto generate document file \ No newline at end of file +AutogenerateDoc=Auto generate document file From 39c4df723a91b61eb6d261f846f8a62e9df6dceb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jan 2018 21:07:10 +0100 Subject: [PATCH 030/203] Fix error management when setting product accounts --- htdocs/accountancy/admin/productaccount.php | 30 ++++++++++++------- .../class/accountingaccount.class.php | 4 +-- htdocs/product/card.php | 20 ++++++------- 3 files changed, 31 insertions(+), 23 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index bebca87404c..e07d0c24771 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -136,17 +136,25 @@ if ($action == 'update') { $accounting = new AccountingAccount($db); //$msg .= '
' . count($chk_prod) . ' ' . $langs->trans("SelectedLines") . '
'; + $arrayofdifferentselectedvalues = array(); $cpt = 0; $ok = 0; $ko = 0; - foreach ( $chk_prod as $productid ) { - + foreach ( $chk_prod as $productid ) + { $accounting_account_id = GETPOST('codeventil_' . $productid); - $result = $accounting->fetch($accounting_account_id, null, 1); - if ($result < 0) { + $result = 0; + if ($accounting_account_id > 0) + { + $arrayofdifferentselectedvalues[$accounting_account_id]=$accounting_account_id; + $result = $accounting->fetch($accounting_account_id, null, 1); + } + if ($result <= 0) { // setEventMessages(null, $accounting->errors, 'errors'); $msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : id=' . $accounting_account_id . '
' . $sql . '
'; + $ko++; } else { + $db->begin(); $sql = " UPDATE " . MAIN_DB_PREFIX . "product"; if ($accounting_product_mode == 'ACCOUNTANCY_BUY') { @@ -158,23 +166,23 @@ if ($action == 'update') { $sql .= " WHERE rowid = " . $productid; dol_syslog("/accountancy/admin/productaccount.php sql=" . $sql, LOG_DEBUG); - if ($db->query($sql)) { + if ($db->query($sql)) + { $ok++; - //$msg .= '
' . $langs->trans("Product") . ' ' . $productid . ' - ' . $langs->trans("VentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '
'; + $db->commit(); } else { $ko++; - //$msg .= '
' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Product") . ' ' . $productid . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . length_accountg($accounting->account_number) . '
' . $sql . '
'; + $db->rollback(); } } - $cpt ++; + $cpt++; } - } else { - //$msg .= '
' . $langs->trans("AnyLineVentilate") . '
'; + } + if ($ko) setEventMessages($langs->trans("XLineFailedToBeBinded", $ko), null, 'errors'); if ($ok) setEventMessages($langs->trans("XLineSuccessfullyBinded", $ok), null, 'mesgs'); - //$msg .= '
' . $langs->trans("EndProcessing") . '
'; } } diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index f5dd7159528..6b7e925832b 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -82,7 +82,7 @@ class AccountingAccount extends CommonObject * @param int $rowid Id * @param string $account_number Account number * @param int $limittocurrentchart 1=Do not load record if it is into another accounting system - * @return int <0 if KO, Id of record if OK and found + * @return int <0 if KO, 0 if not found, Id of record if OK and found */ function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0) { global $conf; @@ -135,7 +135,7 @@ class AccountingAccount extends CommonObject $this->errors[] = "Error " . $this->db->lasterror(); } } - return - 1; + return -1; } /** diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 9f91765b92d..a54f1d90885 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1633,20 +1633,20 @@ else print ''; if ($action == 'editbarcode') { - $tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode; - if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type); + $tmpcode=isset($_POST['barcode'])?GETPOST('barcode'):$object->barcode; + if (empty($tmpcode) && ! empty($modBarCodeProduct->code_auto)) $tmpcode=$modBarCodeProduct->getNextValue($object,$type); - print ''; - print ''; - print ''; - print ''; - print ''; - print ' '; - print ''; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ' '; + print '
'; } else { - print $object->barcode; + print $object->barcode; } print ''."\n"; } From c969d58907a9330b2c7e0b465a95eee514ca5df9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Jan 2018 23:51:24 +0100 Subject: [PATCH 031/203] Clean code --- htdocs/user/passwordforgotten.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 4412eb621b3..7731d5b09a6 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -168,24 +168,6 @@ else $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/"; } -// Note: $conf->css looks like '/theme/eldy/style.css.php' -/* -$conf->css = "/theme/".(GETPOST('theme','alpha')?GETPOST('theme','alpha'):$conf->theme)."/style.css.php"; -$themepath=dol_buildpath($conf->css,1); -if (! empty($conf->modules_parts['theme'])) // This slow down -{ - foreach($conf->modules_parts['theme'] as $reldir) - { - if (file_exists(dol_buildpath($reldir.$conf->css, 0))) - { - $themepath=dol_buildpath($reldir.$conf->css, 1); - break; - } - } -} -$conf_css = $themepath."?lang=".$langs->defaultlang; -*/ - if (! $username) $focus_element = 'username'; else $focus_element = 'password'; From f1b63d7cbf1e8fda4bbf8c43008bcf1af4c00e24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Jan 2018 09:00:03 +0100 Subject: [PATCH 032/203] Fix css --- htdocs/core/tpl/login.tpl.php | 6 ++++-- htdocs/core/tpl/passwordforgotten.tpl.php | 10 +++++++--- htdocs/theme/eldy/style.css.php | 6 +----- htdocs/theme/md/style.css.php | 3 --- htdocs/user/passwordforgotten.php | 2 -- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 0c9086f4e9b..0deca9be98d 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -119,7 +119,8 @@ if ($disablenofollow) echo ''; global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> - + + " name="username" class="flat input-icon-user" size="20" value="" tabindex="1" autofocus="autofocus" /> @@ -128,7 +129,8 @@ if ($disablenofollow) echo ''; global->MAIN_OPTIMIZEFORTEXTBROWSER)) { ?> - + + " name="password" class="flat input-icon-password" type="password" size="20" value="" tabindex="2" autocomplete="global->MAIN_LOGIN_ENABLE_PASSWORD_AUTOCOMPLETE)?'off':'on'; ?>" /> diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index ab2d5152315..5a29c8d77be 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -82,6 +82,8 @@ if ($disablenofollow) echo '';
+
+
@@ -89,7 +91,8 @@ if ($disablenofollow) echo ''; @@ -125,7 +128,8 @@ if (! empty($morelogincontent)) {
- + + " id="username" name="username" class="flat input-icon-user" size="20" value="" tabindex="1" />
@@ -146,7 +150,7 @@ if (! empty($morelogincontent)) {
-
class="button" name="password" value="trans('SendNewPassword'); ?>" tabindex="4" /> +
class="button" name="button_password" value="trans('SendNewPassword'); ?>" tabindex="4" />
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 27fb07d414d..f6809425f3e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1731,7 +1731,6 @@ form#login { max-width: 530px; color: #aaa !important; padding-bottom: 20px; - /* text-shadow: 1px 1px 1px #FFF; */ } .login_table label { text-shadow: 1px 1px 1px #FFF; @@ -1759,7 +1758,7 @@ form#login { border: none; border-bottom: solid 1px rgba(180,180,180,.4); padding: 5px; - margin-left: 18px; + margin-left: 5px; margin-top: 5px; } .login_table input#username:focus, .login_table input#password:focus, .login_table input#securitycode:focus { @@ -2982,9 +2981,6 @@ ul.noborder li:nth-child(even):not(.liste_titre) { .thumbstat150 { flex: 1 1 110px; } - .boxstats, .boxstats130 { - width: 90px; - } .dashboardlineindicator { float: left; padding-left: 5px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index cf872bb117d..1549b6c72f2 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3053,9 +3053,6 @@ div .tdtop { .thumbstat150 { flex: 1 1 110px; } - .boxstats, .boxstats130 { - width: 90px; - } .dashboardlineindicator { float: left; padding-left: 5px; diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 7731d5b09a6..6d2661a2344 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -133,12 +133,10 @@ if ($action == 'buildnewpassword' && $username) { $message = '
'.$langs->trans("PasswordChangeRequestSent",$edituser->login,dolObfuscateEmail($edituser->email)).'
'; - //$message.=$newpassword; $username=''; } else { - //$message = '
'.$langs->trans("PasswordChangedTo",$newpassword).'
'; $message.= '
'.$edituser->error.'
'; } } From f2ae3ee41d09aa65f89f8c5f048ea3ff85967ea7 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 23 Jan 2018 09:49:21 +0100 Subject: [PATCH 033/203] Fix get entity if multiple --- htdocs/margin/checkMargins.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 5f6f46c4b2b..3938bb18937 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -189,7 +189,7 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "facture as f "; $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as d ON d.fk_facture = f.rowid"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON d.fk_product = p.rowid"; $sql .= " WHERE f.fk_statut > 0"; -$sql .= " AND f.entity = " . getEntity('facture'); +$sql .= " AND f.entity IN (" . getEntity('facture') . ") "; if (! empty($startdate)) $sql .= " AND f.datef >= '" . $db->idate($startdate) . "'"; if (! empty($enddate)) $sql .= " AND f.datef <= '" . $db->idate($enddate) . "'"; if ($search_ref) $sql.=natural_search('f.facnumber', $search_ref); From 19c616756a1b804a21fde819d5cd3413ea5401ca Mon Sep 17 00:00:00 2001 From: arnaud Date: Tue, 23 Jan 2018 12:14:22 +0100 Subject: [PATCH 034/203] FIX email sent was not in HTML --- htdocs/compta/prelevement/class/rejetprelevement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 820d3a34fcc..5343bb7af47 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -239,7 +239,7 @@ class RejetPrelevement $subject = $langs->trans("InfoRejectSubject"); $sendto = $emuser->getFullName($langs)." <".$emuser->email.">"; $from = $this->user->getFullName($langs)." <".$this->user->email.">"; - $msgishtml=0; + $msgishtml=1; $arr_file = array(); $arr_mime = array(); From c0481be8d814bc19cf168226c2a9b500dc9fb9c1 Mon Sep 17 00:00:00 2001 From: arnaud Date: Tue, 23 Jan 2018 17:01:03 +0100 Subject: [PATCH 035/203] FIX subject mail sepa --- htdocs/compta/prelevement/class/rejetprelevement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 5343bb7af47..87de138e63a 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -236,7 +236,7 @@ class RejetPrelevement require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $subject = $langs->trans("InfoRejectSubject"); + $subject = $langs->transnoentities("InfoRejectSubject"); $sendto = $emuser->getFullName($langs)." <".$emuser->email.">"; $from = $this->user->getFullName($langs)." <".$this->user->email.">"; $msgishtml=1; From 561f273900f68ab23391bf8e579bd8ee03d197d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Jan 2018 11:43:34 +0100 Subject: [PATCH 036/203] Minor fix for smartphone --- htdocs/core/tpl/passwordforgotten.tpl.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 5a29c8d77be..0c2f989f150 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -27,7 +27,7 @@ if (empty($conf) || ! is_object($conf)) header('Cache-Control: Public, must-revalidate'); header("Content-type: text/html; charset=".$conf->file->character_set_client); -if (GETPOST('dol_hide_topmenu')) $conf->dol_use_jmobile=1; +if (GETPOST('dol_hide_topmenu')) $conf->dol_hide_topmenu=1; if (GETPOST('dol_hide_leftmenu')) $conf->dol_hide_leftmenu=1; if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1; if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1; @@ -39,7 +39,9 @@ if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1; $php_self = $_SERVER['PHP_SELF']; $php_self.= dol_escape_htmltag($_SERVER["QUERY_STRING"])?'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]):''; -print top_htmlhead('',$langs->trans('SendNewPassword')); +$titleofpage=$langs->trans('SendNewPassword'); + +print top_htmlhead('', $titleofpage); ?> @@ -48,7 +50,7 @@ print top_htmlhead('',$langs->trans('SendNewPassword')); dol_use_jmobile)) { ?> From 64f6e9e5c0db44c61fd4f44be6ba8bab5b9649ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Jan 2018 12:23:52 +0100 Subject: [PATCH 037/203] CSS --- htdocs/core/tpl/passwordforgotten.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index 0c2f989f150..e1b3ebfc21f 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -81,7 +81,7 @@ if ($disablenofollow) echo '';
- +

@@ -128,7 +128,7 @@ if (! empty($morelogincontent)) {
'; + $s.=''; + } + elseif (is_array($val)) + { + $s.=formatObject($val, ($prefix?$prefix.' > ':'').$key); + } + elseif (is_object($val)) + { + $s.=formatObject($val, ($prefix?$prefix.' > ':'').$key); + } + } + } + + return $s; } diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 639d9df909d..b4c0c8e6ef8 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -363,9 +363,27 @@ class BlockedLog { if (in_array($key, array('fields'))) continue; // Discard some properties if (! in_array($key, array( - 'ref','facnumber','ref_client','ref_supplier','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public' + 'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public','lines' ))) continue; // Discard if not into a dedicated list - if (!is_object($value)) $this->object_data->{$key} = $value; + if ($key == 'lines') + { + $lineid=0; + foreach($value as $tmpline) // $tmpline is object FactureLine + { + $lineid++; + foreach($tmpline as $keyline => $valueline) + { + if (! in_array($keyline, array( + 'ref','multicurrency_code','multicurrency_total_ht','multicurrency_total_tva','multicurrency_total_ttc','qty','product_type','vat_src_code','tva_tx','info_bits','localtax1_tx','localtax2_tx','total_ht','total_tva','total_ttc','total_localtax1','total_localtax2' + ))) continue; // Discard if not into a dedicated list + + if (! is_object($this->object_data->invoiceline[$lineid])) $this->object_data->invoiceline[$lineid] = new stdClass(); + + $this->object_data->invoiceline[$lineid]->{$keyline} = $valueline; + } + } + } + else if (!is_object($value)) $this->object_data->{$key} = $value; } if (! empty($object->newref)) $this->object_data->ref = $object->newref; @@ -376,7 +394,7 @@ class BlockedLog { if (in_array($key, array('fields'))) continue; // Discard some properties if (! in_array($key, array( - 'ref','facnumber','ref_client','ref_supplier','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public' + 'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public' ))) continue; // Discard if not into a dedicated list if (!is_object($value)) $this->object_data->{$key} = $value; } @@ -467,7 +485,7 @@ class BlockedLog { if (in_array($key, array('fields'))) continue; // Discard some properties if (! in_array($key, array( - 'ref','facnumber','ref_client','ref_supplier','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public' + 'ref','facnumber','ref_client','ref_supplier','date','datef','type','total_ht','total_tva','total_ttc','localtax1','localtax2','revenuestamp','datepointoftax','note_public' ))) continue; // Discard if not into a dedicated list if (!is_object($value)) { diff --git a/htdocs/core/lib/json.lib.php b/htdocs/core/lib/json.lib.php index 4d31308b4b3..61d6a923c1f 100644 --- a/htdocs/core/lib/json.lib.php +++ b/htdocs/core/lib/json.lib.php @@ -38,7 +38,8 @@ if (! function_exists('json_encode')) } /** - * Implement json_encode for PHP that does not support it + * Implement json_encode for PHP that does not support it. + * Use json_encode and json_decode in your code ! * * @param mixed $elements PHP Object to json encode * @return string Json encoded string @@ -221,6 +222,7 @@ if (! function_exists('json_decode')) /** * Implement json_decode for PHP that does not support it + * Use json_encode and json_decode in your code ! * * @param string $json Json encoded to PHP Object or Array * @param bool $assoc False return an object, true return an array. Try to always use it with true ! diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang index bb6c9c155ee..b11e9194a8e 100644 --- a/htdocs/langs/en_US/blockedlog.lang +++ b/htdocs/langs/en_US/blockedlog.lang @@ -2,9 +2,9 @@ BlockedLog=Unalterable Logs Field=Field BlockedLogDesc=This module tracks some events into an unalterable log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Fincance 2016 - Norme NF535). Fingerprints=Archived events and fingerprints -FingerprintsDesc=This is the tool to browse the archived unalterable logs. Note that, by definition, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non valid fingerprint. If you really need to purge this table because you used your application for a demo/test purpose and want to clean your data to start your production, you can ask your reseller or integrator to reset your database (all your data will be removed). +FingerprintsDesc=This is the tool to browse or extract the unalterable logs. Unalterable logs are generated and archived locally into a dedicated table, in real time when you record a business event. You can use this tool to export this archive and save it into an external support (some countries, like France, ask you do it every year). Note that, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non valid fingerprint. If you really need to purge this table because you used your application for a demo/test purpose and want to clean your data to start your production, you can ask your reseller or integrator to reset your database (all your data will be removed). CompanyInitialKey=Company initial key (hash of genesis block) -BrowseBlockedLog=Browse unalterable logs +BrowseBlockedLog=Unalterable logs ShowAllFingerPrintsMightBeTooLong=Show all archived logs (might be long) ShowAllFingerPrintsErrorsMightBeTooLong=Show all non valid archive logs (might be long) DownloadBlockChain=Download fingerprints @@ -46,4 +46,5 @@ BlockedLogAreRequiredByYourCountryLegislation=Unalterable Logs module may be req BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs module was activated because of the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit. BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first) OnlyNonValid=Non valid -TooManyRecordToScanRestrictFilters=Too many record to scan/analyze. Please restrict list with more restrictive filters. \ No newline at end of file +TooManyRecordToScanRestrictFilters=Too many record to scan/analyze. Please restrict list with more restrictive filters. +YearToExport=Year to export \ No newline at end of file From 59c907260bcad346f0c41f8e4d41e40cdb7daf6d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jan 2018 13:18:52 +0100 Subject: [PATCH 050/203] Export of unalterablelog must contains init hash --- htdocs/blockedlog/admin/blockedlog_list.php | 10 +++++----- htdocs/langs/en_US/blockedlog.lang | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index f85b1c35a4e..633f84b6582 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -160,7 +160,7 @@ else if (GETPOST('downloadcsv','alpha')) { header('Content-Type: application/octet-stream'); header("Content-Transfer-Encoding: Binary"); - header("Content-disposition: attachment; filename=\"archive-log-" .(GETPOST('yeartoexport','int')>0?GETPOST('yeartoexport','int').'-':'').'-'.$previoushash. ".csv\""); + header("Content-disposition: attachment; filename=\"unalterable-log-archive-" .$dolibarr_main_db_name."-".(GETPOST('yeartoexport','int')>0?GETPOST('yeartoexport','int').'-':'').$previoushash. ".csv\""); print $langs->transnoentities('Id') .';'.$langs->transnoentities('Date') @@ -319,12 +319,12 @@ if (GETPOST('withtab','alpha')) $param.='&withtab='.urlencode(GETPOST('withtab', print '
'; print '
'; -print $langs->trans("YearToExport").': '; -print ''; +print $langs->trans("RestrictYearToExport").': '; +print ''; print ''; print ''; if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) print ' | '.$langs->trans('DownloadBlockChain').''; -print '
'; +print '
'; print ''; @@ -471,7 +471,7 @@ if (is_array($blocks)) print '
'; print ''; // Status diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang index b11e9194a8e..93f64bddbaa 100644 --- a/htdocs/langs/en_US/blockedlog.lang +++ b/htdocs/langs/en_US/blockedlog.lang @@ -1,6 +1,6 @@ BlockedLog=Unalterable Logs Field=Field -BlockedLogDesc=This module tracks some events into an unalterable log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Fincance 2016 - Norme NF535). +BlockedLogDesc=This module tracks some events into an unalterable log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Finance 2016 - Norme NF535). Fingerprints=Archived events and fingerprints FingerprintsDesc=This is the tool to browse or extract the unalterable logs. Unalterable logs are generated and archived locally into a dedicated table, in real time when you record a business event. You can use this tool to export this archive and save it into an external support (some countries, like France, ask you do it every year). Note that, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non valid fingerprint. If you really need to purge this table because you used your application for a demo/test purpose and want to clean your data to start your production, you can ask your reseller or integrator to reset your database (all your data will be removed). CompanyInitialKey=Company initial key (hash of genesis block) @@ -37,14 +37,14 @@ BlockedLogBillPreview=Customer invoice preview BlockedlogInfoDialog=Log Details ListOfTrackedEvents=List of tracked events Fingerprint=Fingerprint -DownloadLogCSV=Download archive logs (CSV) +DownloadLogCSV=Export archived logs (CSV) logDOC_PREVIEW=Preview of a validated document in order to print or download logDOC_DOWNLOAD=Download of a validated document in order to print or send DataOfArchivedEvent=Full datas of archived event ImpossibleToReloadObject=Object (type %s, id %s) removed (see 'Full data' link for unerasable saved data) BlockedLogAreRequiredByYourCountryLegislation=Unalterable Logs module may be required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit. BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs module was activated because of the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit. -BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first) +BlockedLogDisableNotAllowedForCountry=List of countries where usage of this module is mandatory (just to prevent to disable the module by error, if your country is in this list, disable of module is not possible without editing this list first. Note also that enabling/disabling this module will keep a track into the unalterable log). OnlyNonValid=Non valid TooManyRecordToScanRestrictFilters=Too many record to scan/analyze. Please restrict list with more restrictive filters. -YearToExport=Year to export \ No newline at end of file +RestrictYearToExport=Restrict year to export \ No newline at end of file From 496ac644eb1cfc9977144b7bee49fed0e4924e83 Mon Sep 17 00:00:00 2001 From: Rui Strecht Date: Thu, 25 Jan 2018 16:10:04 +0000 Subject: [PATCH 051/203] Updated label and added new translation for label --- htdocs/contact/card.php | 20 ++++++++++++++++++-- htdocs/langs/en_US/companies.lang | 1 + htdocs/langs/pt_PT/companies.lang | 1 + 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index bc0031b5992..87189528d5a 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -607,7 +607,15 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 7cff22df092..c5bc84acaf8 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -56,6 +56,7 @@ Address=Address State=State/Province StateShort=State Region=Region +Region-State=Region - State Country=Country CountryCode=Country code CountryId=Country id diff --git a/htdocs/langs/pt_PT/companies.lang b/htdocs/langs/pt_PT/companies.lang index 4875dc8e3de..8f797802925 100644 --- a/htdocs/langs/pt_PT/companies.lang +++ b/htdocs/langs/pt_PT/companies.lang @@ -56,6 +56,7 @@ Address=Direcção State=Distrito StateShort=Estado Region=Região +Region-State=Distrito - Concelho Country=País CountryCode=Código país CountryId=ID país From a13866f091bfa94fd8eabbcb0a19603fa857df7c Mon Sep 17 00:00:00 2001 From: Rui Strecht Date: Thu, 25 Jan 2018 16:14:39 +0000 Subject: [PATCH 052/203] Changed MAIN_SHOW_REGION_IN_STATE to MAIN_SHOW_REGION_IN_STATE_SELECT for clarity --- htdocs/contact/card.php | 4 ++-- htdocs/core/class/html.formcompany.class.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 87189528d5a..9c35714dcd5 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -607,7 +607,7 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE) && ($conf->global->MAIN_SHOW_REGION_IN_STATE == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE == 2)) + if(!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && ($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 || $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 2)) { print ''; @@ -1700,7 +1708,15 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; } From c922498e79d905b8fc86f41a1ba887a69a72da55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jan 2018 20:35:25 +0100 Subject: [PATCH 057/203] Code comment --- htdocs/core/lib/functions.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fa8dadc4a65..bd7fa7b6fd4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5634,7 +5634,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob /** * Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval). - * Texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced + * Texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced. + * Example of usage: + * $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $thirdparty); + * complete_substitutions_array($substitutionarray, $langs, $thirdparty); + * $mesg = make_substitutions($mesg, $substitutionarray, $langs); * * @param string $text Source string in which we must do substitution * @param array $substitutionarray Array with key->val to substitute. Example: array('__MYKEY__' => 'MyVal', ...) From 2c0eeaf8dedf15f7a84c4dbbc272d68c307130ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jan 2018 20:57:51 +0100 Subject: [PATCH 058/203] FIX #8093 --- .../fourn/class/fournisseur.product.class.php | 9 ++++-- htdocs/product/fournisseurs.php | 29 +++++++++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 17f8b2615ee..d34441ffd75 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -468,9 +468,11 @@ class ProductFournisseur extends Product * @param int $prodid Id of product * @param string $sortfield Sort field * @param string $sortorder Sort order + * @param int $limit Limit + * @param int $offset Offset * @return array Array of Products with new properties to define supplier price */ - function list_product_fournisseur_price($prodid, $sortfield='', $sortorder='') + function list_product_fournisseur_price($prodid, $sortfield='', $sortorder='', $limit=0, $offset=0) { global $conf; @@ -484,7 +486,8 @@ class ProductFournisseur extends Product $sql.= " AND s.status=1"; // only enabled company selected $sql.= " AND pfp.fk_product = ".$prodid; if (empty($sortfield)) $sql.= " ORDER BY s.nom, pfp.quantity, pfp.price"; - else $sql.= $this->db->order($sortfield,$sortorder); + else $sql.= $this->db->order($sortfield, $sortorder); + $sql.=$this->db->plimit($limit, $offset); dol_syslog(get_class($this)."::list_product_fournisseur_price", LOG_DEBUG); $resql = $this->db->query($sql); @@ -516,7 +519,7 @@ class ProductFournisseur extends Product $prodfourn->id = $prodid; $prodfourn->fourn_tva_npr = $record["info_bits"]; $prodfourn->fk_supplier_price_expression = $record["fk_supplier_price_expression"]; - $prodfourn->supplier_reputation = $record["supplier_reputation"]; + $prodfourn->supplier_reputation = $record["supplier_reputation"]; if (!empty($conf->dynamicprices->enabled) && !empty($prodfourn->fk_supplier_price_expression)) { $priceparser = new PriceParser($this->db); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index cb295012795..2c49319fc19 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -65,6 +65,17 @@ $fieldtype = (! empty($ref) ? 'ref' : 'rowid'); if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user,'produit|service&fournisseur',$fieldvalue,'product&product','','',$fieldtype); +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = (GETPOST("page",'int')?GETPOST("page", 'int'):0); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield="s.nom"; +if (! $sortorder) $sortorder="ASC"; + // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('pricesuppliercard','globalcard')); @@ -589,13 +600,21 @@ if ($id > 0 || $ref) print "\n\n"; print '
'; - if ($user->rights->fournisseur->lire) { + $param=''; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); + $param.='&ref='.urlencode($object->ref); + $product_fourn = new ProductFournisseur($db); - $product_fourn_list = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder); - $nbtotalofrecords = count($product_fourn_list); - print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($product_fourn_list), $nbtotalofrecords, 'title_accountancy.png'); + $product_fourn_list = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder, $limit, $offset); + $product_fourn_list_all = $product_fourn->list_product_fournisseur_price($object->id, $sortfield, $sortorder, 0, 0); + $nbtotalofrecords = count($product_fourn_list_all); + $num = count($product_fourn_list); + if (($num + ($offset * $limit)) < $nbtotalofrecords) $num++; + + print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVEUR ['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); // Suppliers list title print '
'; @@ -606,7 +625,7 @@ if ($id > 0 || $ref) $param="&id=".$object->id; print '
'; print_liste_field_titre("Suppliers",$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); - print_liste_field_titre("SupplierRef"); + print_liste_field_titre("SupplierRef",$_SERVER["PHP_SELF"],"","",$param,"",$sortfield,$sortorder); if (!empty($conf->global->FOURN_PRODUCT_AVAILABILITY)) print_liste_field_titre("Availability",$_SERVER["PHP_SELF"],"pfp.fk_availability","",$param,"",$sortfield,$sortorder); print_liste_field_titre("QtyMin",$_SERVER["PHP_SELF"],"pfp.quantity","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("VATRate",$_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder); From ec38b8a5a25c8e5472a3c694039da62a2b6a8147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 25 Jan 2018 17:50:11 +0100 Subject: [PATCH 059/203] Update interface_99_modMyModule_MyModuleTriggers.class.php --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 06b34ccb8b3..4f1627c2940 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4645,11 +4645,11 @@ abstract class CommonObject } else { - if ($trigger) + if (!$notrigger) { // Call trigger $this->context=array('extrafieldaddupdate'=>1); - $result=$this->call_trigger(strtoupper(get_class($this)) . '_EXTRAFIELDS_MODIFY', $userused); + $result=$this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused); if ($result < 0) $error++; // End call trigger } From d3c0414b4f8f7c4b5cf0ce9979289464f3ea7bca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 01:16:36 +0100 Subject: [PATCH 060/203] Update changelog --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index a5fe90d2bbd..e6d061a58ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ FIX: #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO variable FIX: #7903 FIX: #7933 FIX: #8029 Unable to make leave request in holyday module +FIX: #8093 +FIX: Bad name alias showing in name of third column +FIX: Cashdesk should not sell to inactive third parties FIX: Edit accountancy account and warning message on loan FIX: $accounts[$bid] is a label ! FIX: $oldvatrateclean & $newvatrateclean must be set if preg_match === false @@ -16,6 +19,10 @@ FIX: product best price on product list FIX: search on contact list FIX: stats trad for customerinvoice FIX: translate unactivate on contractline +FIX: email sent was not in HTML +FIX: missing hook invoice index +FIX: subject mail sepa + ***** ChangeLog for 6.0.4 compared to 6.0.3 ***** FIX: #7737 From 4f9f1b51d7e9c2772c98a11056855d389b2dc662 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 01:34:49 +0100 Subject: [PATCH 061/203] Fix translation --- htdocs/langs/en_US/admin.lang | 4 ++-- htdocs/langs/en_US/ecm.lang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f07f79b9cea..cae43a9e3b5 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -573,8 +573,8 @@ Module2300Name=Scheduled jobs Module2300Desc=Scheduled jobs management (alias cron or chrono table) Module2400Name=Events/Agenda Module2400Desc=Follow done and upcoming events. Let application logs automatic events for tracking purposes or record manual events or rendez-vous. -Module2500Name=Electronic Content Management -Module2500Desc=Save and share documents +Module2500Name=DMS / ECM +Module2500Desc=Document Management System / Electronic Content Management. Automatic organization of your generated or stored documents. Share them when you need. Module2600Name=API/Web services (SOAP server) Module2600Desc=Enable the Dolibarr SOAP server providing API services Module2610Name=API/Web services (REST server) diff --git a/htdocs/langs/en_US/ecm.lang b/htdocs/langs/en_US/ecm.lang index 7428d226008..95318155813 100644 --- a/htdocs/langs/en_US/ecm.lang +++ b/htdocs/langs/en_US/ecm.lang @@ -14,8 +14,8 @@ ECMNbOfFilesInDir=Number of files in directory ECMNbOfSubDir=Number of sub-directories ECMNbOfFilesInSubDir=Number of files in sub-directories ECMCreationUser=Creator -ECMArea=EDM area -ECMAreaDesc=The EDM (Electronic Document Management) area allows you to save, share and search quickly all kind of documents in Dolibarr. +ECMArea=DMS/ECM area +ECMAreaDesc=The DMS/ECM (Document Management System / Electronic Content Management) area allows you to save, share and search quickly all kind of documents in Dolibarr. ECMAreaDesc2=* Automatic directories are filled automatically when adding documents from card of an element.
* Manual directories can be used to save documents not linked to a particular element. ECMSectionWasRemoved=Directory %s has been deleted. ECMSectionWasCreated=Directory %s has been created. From c0e719e3d8db0026a28be573abfb36c655e7588a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 01:39:42 +0100 Subject: [PATCH 062/203] Fix package scripts --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 20dfc2579aa..7ead2228b41 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Cwd; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages From 40b63be4b968c585423533adc47a57fb513ef809 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 01:40:32 +0100 Subject: [PATCH 063/203] Fix package --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index bc755ef52a3..7da6d180dcb 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Term::ANSIColor; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages From 1be42a7af8170edad92c88ee79c586f720e5084f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 02:23:26 +0100 Subject: [PATCH 064/203] Fix comment --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 6eeff6cea11..4ff5e2492b7 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -140,7 +140,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex $action=''; } - header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back + header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a redirect to avoid to run twice the job when using back exit; } } From d0e83b79025d7fe922411e725b7b6b0926f9fab3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Jan 2018 08:14:39 +0100 Subject: [PATCH 065/203] trigger on bank account update --- htdocs/core/class/commonobject.class.php | 50 +++++++++++++++++++----- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4f1627c2940..9cc686f22e5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1888,10 +1888,18 @@ abstract class CommonObject * Change the bank account * * @param int $fk_account Id of bank account + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param User $userused Object user * @return int 1 if OK, 0 if KO */ - function setBankAccount($fk_account) + function setBankAccount($fk_account, $notrigger=false, $userused=null) { + global $user; + + if (empty($userused)) $userused=$user; + + $error = 0; + if (! $this->table_element) { dol_syslog(get_class($this)."::setBankAccount was called on objet with property table_element not defined",LOG_ERR); return -1; @@ -1903,15 +1911,37 @@ abstract class CommonObject $sql.= " SET fk_account = ".$fk_account; $sql.= " WHERE rowid=".$this->id; - if ($this->db->query($sql)) { - $this->fk_account = ($fk_account=='NULL')?null:$fk_account; - return 1; - } else { - dol_syslog(get_class($this).'::setBankAccount Error '.$sql.' - '.$this->db->error()); - $this->error=$this->db->error(); - return 0; - } - } + $resql = $this->db->query($sql); + if (! $resql) + { + dol_syslog(get_class($this).'::setBankAccount Error '.$sql.' - '.$this->db->error()); + $this->error = $this->db->lasterror(); + $error++; + } + else + { + if (!$notrigger) + { + // Call trigger + $this->context=array('bankaccountupdate'=>1); + $result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused); + if ($result < 0) $error++; + // End call trigger + } + } + if ($error) + { + $this->db->rollback(); + return -1; + } + else + { + $this->fk_account = ($fk_account=='NULL')?null:$fk_account; + $this->db->commit(); + return 1; + } + } + // TODO: Move line related operations to CommonObjectLine? From 336c44dc8802a1ddf5f4c9ab958df33f90bfcadc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Jan 2018 08:33:35 +0100 Subject: [PATCH 066/203] trigger on shipping method update --- htdocs/core/class/commonobject.class.php | 48 +++++++++++++++++++----- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9cc686f22e5..c0583f09552 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1790,29 +1790,57 @@ abstract class CommonObject * Change the shipping method * * @param int $shipping_method_id Id of shipping method + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @param User $userused Object user + * * @return int 1 if OK, 0 if KO */ - function setShippingMethod($shipping_method_id) + function setShippingMethod($shipping_method_id, $notrigger=false, $userused=null) { + global $user; + + if (empty($userused)) $userused=$user; + + $error = 0; + if (! $this->table_element) { dol_syslog(get_class($this)."::setShippingMethod was called on objet with property table_element not defined",LOG_ERR); return -1; } + + $this->db->begin(); + if ($shipping_method_id<0) $shipping_method_id='NULL'; dol_syslog(get_class($this).'::setShippingMethod('.$shipping_method_id.')'); $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; $sql.= " SET fk_shipping_method = ".$shipping_method_id; $sql.= " WHERE rowid=".$this->id; - - if ($this->db->query($sql)) { - $this->shipping_method_id = ($shipping_method_id=='NULL')?null:$shipping_method_id; - return 1; - } else { + $resql = $this->db->query($sql); + if (! $resql) { dol_syslog(get_class($this).'::setShippingMethod Error ', LOG_DEBUG); - $this->error=$this->db->error(); - return 0; - } + $this->error = $this->db->lasterror(); + $error++; + } else { + if (!$notrigger) + { + // Call trigger + $this->context=array('shippingmethodupdate'=>1); + $result = $this->call_trigger(strtoupper(get_class($this)) . '_MODIFY', $userused); + if ($result < 0) $error++; + // End call trigger + } + } + if ($error) + { + $this->db->rollback(); + return -1; + } else { + $this->shipping_method_id = ($shipping_method_id=='NULL')?null:$shipping_method_id; + $this->db->commit(); + return 1; + } + } @@ -1904,6 +1932,8 @@ abstract class CommonObject dol_syslog(get_class($this)."::setBankAccount was called on objet with property table_element not defined",LOG_ERR); return -1; } + $this->db->begin(); + if ($fk_account<0) $fk_account='NULL'; dol_syslog(get_class($this).'::setBankAccount('.$fk_account.')'); From d751f9153fb5311c91782b4b82519d540390dd93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 10:21:53 +0100 Subject: [PATCH 067/203] Fix look and feel v7 --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 4ff5e2492b7..3933a30a54b 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -270,7 +270,7 @@ else $buttontoshow.=''.$langs->trans("CronCreateJob").''; } -print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttontoshow, $num, $nbtotalofrecords, 'title_setup', 0, '', '', $limit); +print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_setup', 0, $buttontoshow, '', $limit); print $langs->trans('CronInfo').'
'; From 82c2079d40b9c69837bf517a6555cba474fa3a91 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 10:23:24 +0100 Subject: [PATCH 068/203] Fix var not initialized --- htdocs/core/lib/admin.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 8ee3a8054e9..65cc2965bea 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -618,6 +618,7 @@ function security_prepare_head() // Show permissions lines + $nbPerms=0; $sql = "SELECT COUNT(r.id) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" From 5b917c039efb01ac083ee95e30a4716982ef098b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 11:08:08 +0100 Subject: [PATCH 069/203] Prepare 6.0.6 --- 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 879205cb491..660e81e7ee6 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 1834be79a090f2050390c7c8cc2af7d072ff55c5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 11:31:34 +0100 Subject: [PATCH 070/203] Fix supplier suggested when creating order from project overview --- htdocs/projet/element.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index ae9872b70a0..17b3cbd65f9 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -301,7 +301,7 @@ $listofreferent=array( 'class'=>'CommandeFournisseur', 'table'=>'commande_fournisseur', 'datefieldname'=>'date_commande', - 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierOrder', 'testnew'=>$user->rights->fournisseur->commande->creer, @@ -313,7 +313,7 @@ $listofreferent=array( 'margin'=>'minus', 'table'=>'facture_fourn', 'datefieldname'=>'datef', - 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id, + 'urlnew'=>DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'suppliers', 'buttonnew'=>'AddSupplierInvoice', 'testnew'=>$user->rights->fournisseur->facture->creer, From b9d5ed37ddb900c3b15038ef47fcfc01b7484c68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 12:46:44 +0100 Subject: [PATCH 071/203] Prepare 8.0 --- 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 c270e2f44fa..a38376e8294 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','8.0.0-alpha'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 3239187f6b48c7f5c36aededdf36b25b437dc4ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 13:14:30 +0100 Subject: [PATCH 072/203] Prepare 7.0 --- ChangeLog | 311 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 275 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98323f61bc1..2a72296477c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,281 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 7.0.0 compared to 6.0.5 ***** +For users: +NEW: #5711 Add shipment line deleting and editing for draft shipments. +NEW: Accept substitution key __[ABC]__ replaced with value of const ABC +NEW: Accountancy Add variant on sell account for intracommunity sales & export sales +NEW: Add a button "Activate all services" on contracts +NEW: Add a confirmation for all mass action 'delete' +NEW: Add a group task line for tasks on same level on gantt diagram +NEW: Add and edit country for chart of accounts systems +NEW: add a new notification for the signed closed event of a proposal. +NEW: Add a parameter to specify char used as separator for variant product label +NEW: Add a profile to import product translations +NEW: Add a protection so we can't journalize non balanced transactions +NEW: Add a status enabled/disabled on recurring invoices +NEW: add burger menu to list action comm +NEW: Add button cancel on shipment creation +NEW: Add chart of account for england +NEW: Add Chile accounting plan +NEW: Add class in societe/card.php +NEW: add company alias name when create company from member +NEW: Add date of birth on user card. +NEW: Add date_valid and date_pointoftax on supplier invoices. +NEW: Added Region name to state/province form field +NEW: Added regions to third party/societe lists, can be filtered +NEW: Add error message +NEW: Add expense report rules and ik +NEW: Add filter on event code on automatic filling setup page +NEW: Add filters on month/year on the accountancy binding tools +NEW: add fk_unit field into product/service import/export +NEW: add 'formObjectOptions' hook to the form setting the product selling price +NEW: Add hidden option PROJECT_DISABLE_UNLINK_FROM_OVERVIEW +NEW: add image object_phoning_mobile.png +NEW: Adding Field "First date of expire" + filter on contract list +NEW: add ldap_rename for avoid password if ldap key changed +NEW: Add mass action "validate" on supplier invoices. +NEW: add members types ldap group management +NEW: Add new property visible dy default on lists on extrafields +NEW: Add Next/Previous button on operation date of bank line +NEW: Add option EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS +NEW: Add option PROPOSAL/ORDER/INVOICE_ALLOW_EXTERNAL_DOWNLOAD +NEW: Add product unit fields for ODT substitution +NEW: Add project on a various payment +NEW: Add project related fields to ODT +NEW: Add protection to avoid to send to much emails using builk actions +NEW: Add search field for date on supplier payment page +NEW: Add search on date and accounting account in various payment list +NEW: add specific translation for title of documents (Invoice, Order, Proposal) +NEW: Adds the payment reference to the return of the function getListOfPayements +NEW: Add supplier proposals into stats of product page. +NEW: Add tab "Expense report" on user card +NEW: add the ability to regenerate a pdf for the order module +NEW: Add The accountancy Switzerland chart of accounts +NEW: Add The developed French chart of accounts 2014 +NEW: Add The Luxembourg chart of accounts +NEW: Add The Moroccan chart of accounts +NEW: Add The Switzerland chart of accounts +NEW: Add The SYSCOHADA chart of accounts +NEW: Add the total in the perday view of the time spent form. +NEW: Add The Tunisia chart of accounts +NEW: Add toolkit for StockLimit and DesiredStock +NEW: add translation and possibility to change month and year +NEW: Add view of status of template invoice +NEW: All search boxes are available on smartphone +NEW: All setup of accountancy can be done from menu "Accountancy-Setup" +NEW: Attaching doc automatically in email is now a parameter of template. +NEW: automatic activation of external module on country set +NEW: Better autoselect customer or supplier fields to save clicks +NEW: Better behaviour when using a text browser +NEW: Break lines per project on the new timesheet page +NEW: Bulk action validate on customer invoices +NEW: Bulk delete actions available on leave requests +NEW: burger menu and hooks on list action +NEW: Can add html content on right of tabs +NEW: Can add link to other element on a donation +NEW: Can create intervention from a proposal +NEW: Can create thirdparty from card proposal, order or invoice +NEW: Can download PDF document from the payment page +NEW: Can edit the language into the email templates editor. +NEW: Can edit with delete/insert a forced translation +NEW: Can export list of stock movements +NEW: Can filter on date on the page showing existing bindings +NEW: Can filter on document name in ECM module for automatic tree +NEW: can filter on status of template invoices +NEW: Can filter on the "other" column on emailing target list +NEW: Can filter on type of email template +NEW: Can filter on user on unalterable log +NEW: Can import local tax rates in prices +NEW: Can include extrafields into member card templates +NEW: Can include tag {uuu} into some numbering masks to replace with user +NEW: Can make a specific setup for SMTP sending for emailing module +NEW: Can rename (so reorder) bank receipts +NEW: Can send email from contract card +NEW: Can send email from the member card using email templates. +NEW: Can set a dedicated message on payment forms +NEW: Can set email of thirdparty as unique and/or mandatory +NEW: Can setup csv accounting export from admin config +NEW: Can show currency in list of bank accounts +NEW: Can show stock in alert even if alter is set to 0 +NEW: Can sort joined files on thirdparty and user card. +NEW: Can transfer from bank account to bank account with different currencies +NEW: Can use an url like $conf->global>-MYPARAM for menu urls +NEW: change description on click +NEW: Chart of account is loaded when selected into accounting setup +NEW: Classify the order as invoiced in the REST API +NEW: comments system on task +NEW: comment system working with all objects +NEW: Compatibility with PHP 7.2 +NEW: confirm form style to accept or reject proposal +NEW: Create an invoice using an existing order +NEW: Create an order using an existing proposal +NEW: customizable meteo in value or percentage +NEW: Days where user is on vacation use different colors in timesheet. +NEW: Deduct an available credit to an existing invoice +NEW: Default filter and sort order can use partial list of query +NEW: Deposit invoice more explicit in invoice line description +NEW: deposits can be converted even if unpaid +NEW: detection of edge browser +NEW: Each user can edit its own email template (menu tools) +NEW: Enabled sending email in bulk actions for supplier orders +NEW: Enhance the anti XSS filter +NEW: extrafield on facture_rec +NEW: Extrafields "link to object" now use a combo selection and getNomUrl +NEW: filter date for blockedlog +NEW: filter on extrafield on product list (as in company list) +NEW: General ledger : Add field date_creation and selected field +NEW: generate also document when invoice is build from recurring template +NEW: Generated files are now indexed in database +NEW: generate invoice PDF on disount application or payment +NEW: Get a list of payments terms +NEW: hrm details output on user +NEW: If max nb of generation is reached, date for next gen is striked +NEW: improvements of invoices, orders and proposals in the REST API +NEW: Include a color syntaxed HTML editor for emailing edition. +NEW: Introduce code syntax coloration with mode 'ace' for DolEditor. +NEW: Introduce experimental feature to search dolistore from application +NEW: jquery date selector become default date selector +NEW: langs +NEW: link project from other company conf +NEW: manageme extrafields with multientity +NEW: Mass PDF Merging is available on contracts +NEW: merge categories while merging thirdparties +NEW: Merge resource/add.php to resource/card.php +NEW: Module "Product variants" is moved as stable. +NEW: More picto for phone +NEW: Move accountancy features into a dedicated menu +NEW: Move contacts of a thirdparty on tab Contacts/Addresses +NEW: Move the upload input on top right in ECM module +NEW: new columns into extrafields table to get update create information +NEW: new param on load_board() function in ActionComm class to avoid duplicate code +NEW: On bulk email from a list, can uncheck "Join main document". +NEW: On reconciliation, show balance including all reconciliated fields +NEW: Option "one email per recipient" when using bulk actions emails. +NEW: Option STOCK_SUPPORTS_SERVICES become visible. +NEW: option to avoid countries to disable there blockedlog +NEW: option to fix top menu with eldy theme (hidden conf) +NEW: Popup for preview of image add a button "Original size" +NEW: post lines of an invoice using the REST API +NEW: preload comments in task +NEW: Provide a way to download a file from a public URL for files in ECM +NEW: Reduce size of HTML page by removing duplicate tooltips +NEW: Remove background on agenda view when event is a not busy event. +NEW: Retrieves available discounts and payments details from a specific invoice +NEW: Revenue stamp can be a percent +NEW: Search filters in lists are restored when using "back to list" +NEW: Send by email available in bulk for expense report +NEW: Set a proposal to draft +NEW: Show badge with nbr of shipment on shimpen tab of order +NEW: Show country and vat number into company tooltip +NEW: Show direct preview link on contract +NEW: Show expected worked hours on the timesheet form. +NEW: Show line "other filtered task" when using filter on timesheet. +NEW: Show list of tracked events into the module config page. +NEW: Show the supplier ref into supplier cards +NEW: Show user id of web process in system info - web server +NEW: Summary of last events on a card are sorted on decreasing date. +NEW: Support Italian addresses format. Fixes #7785 +NEW: Support visibility on extrafields +NEW: Template invoices are visible on the customer tab +NEW: template invoices support substition key +NEW: The bank account is visible on payment of taxes +NEW: The comment when closing a proposal is added to commercial proposal +NEW: The gantt diagram is now sensitive to hours +NEW: The lot of a product uses the link and picto when shown into list. +NEW: The "Show detail by account" accepts 3 values: yes, no, if non zero +NEW: The unalterable log can be browse by any user with he permission +NEW: Tooltip for substitutions variables on tooltips on admin pages +NEW: unexistant function load_state_board() on several objects +NEW: Update availability +NEW: Update bank account when updating an invoice +NEW: Update bank account when updating an order +NEW: Use autocompletion on selection of chart of account +NEW: view company name if different of fullname in dol_banner +NEW: warning on module blocked log reset if country code is FR + +For developers: +NEW: Add 2 new automatic classification in workflow module +NEW: Add API for contracts +NEW: Add API to activate/unactivate a contract +NEW: Add api validate and close on contracts +NEW: add doActions hook in admin ihm +NEW: add doActions hook in company admin +NEW: Added functionality to get order customer contact as contact_xx tags +NEW: Add hook addAdminLdapOptions and doAction in ldap admin page +NEW: Add method executeCLI and a phpunit +NEW: add '$moreatt' parameter in picto_from_langcode function +NEW: Add non intrusive js library to make syntaxic coloring of textarea +NEW: Add payment line to a specific invoice using the REST API +NEW: add possibility to disabled the LDAP trigger +NEW: add possibility to hide LDAP tab for non admin +NEW: Add possibility to propose last num releve in conciliation +NEW: add possibility to remove address field +NEW: Add REST API for supplier proposals +NEW: Add REST API to add payment line to a specific invoice +NEW: Add the attribute accept to the input form for file upload +NEW: add translation column for extrafields list +NEW: Add performances indexes on calendar events +NEW: A module can change order of element in the quick search combo +NEW: Can test signature of a version from API +NEW: complete_head_from_modules() in ldap_prepare_head() +NEW: Consolidates REST dictionary APIs into a single tree and a single file +NEW: Delete a line of invoice using the REST API +NEW: documents REST API return list of documents by element +NEW: Download a document using the REST API +NEW: Enhance framework so we can use html/icons into SELECT options. +NEW: External module can interact with the customer summary page +NEW: Generates the document before downloading using REST API +NEW: get and post lines of an invoice using the REST API +NEW: Get a payment list of a given invoice using the REST API +NEW: Get available assets of an invoice using the REST API +NEW: Get credit notes or deposits of a thirdparty +NEW: GET lines of an invoice in the REST API +NEW: get payment types using the REST API + consolidates REST dictionary APIs +NEW: Get the list of payments terms. +NEW: hook formObjectOptions in the form setting product selling price +NEW: hook to enrich homepage open elements dashboard +NEW: Insert a discount in a specific invoice using the REST API +NEW: Remove js library fileupload that was not used by core code. +NEW: Remove tooltip tipTip library replaced with standatd jquery tooltip +NEW: Set invoices as draft using the REST API +NEW: Sets an invoice as paid using the REST API +NEW: Tag the order as validated (opened) in the REST API +NEW: Update end of validity date of proposal using the API +NEW: Update in the order REST API +NEW: Upgrade jquery select2 to 4.0.4 + + +WARNING: + +If you enabled (for test) the experimental BlockedLog module before 7.0, you must purge the table llx_blockedlog because +way to save data for final version has changed. + +Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: +* The methode "cloture" on contract were renamed into "closeAll". +* The method "is_erasable" of invoice return a value <= 0 if not erasable (value is meaning) instead of always 0. +* The substitution key for reference of objects is now __REF__ whatever is the object (it replaces __ORDERREF__, + __PROPALREF__, ...) +* The substition key __SIGNATURE__ was renamed into __USER_SIGNATURE__ to follow naming conventions. +* Substitution keys with syntax %XXX% were renamed into __XXX__ to match others. +* Removed old deprecated REST API (APIs found into '/root' section of the REST API explorer in Dolibarr v6). +* Some REST API to access setup features, like dictionaries (country, town, extrafields, ...) were moved into a + common API "/setup". +* The REST API /documents were renamed into /documents/download and /documents/upload. +* Page bank/index.php, bank/bankentries.php and comm/actions/listactions.php were renamed into + bank/list.php, bank/bankentries_list.php and comm/actions/list.php to follow page naming + conventions (so default filter/sort order features can also work for this pages). +* The trigger ORDER_SUPPLIER_STATUS_ONPROCESS was renamed into ORDER_SUPPLIER_STATUS_ORDERED. +* The trigger ORDER_SUPPLIER_STATUS_RECEIVED_ALL was renamed into ORDER_SUPPLIER_STATUS_RECEIVED_COMPLETELY. +* The parameter note into method cloture() is added at end of private note (previously in v6, it replaced). +* The parameter $user is now mandatory for method createFromOrder and createFromPropal. +* Removed js library 'fileupload' that was not used by core code. +* Jquery plugin tableDnd updated. You now need to use decodeURI on the return value of tableDnDSerialize() + and add 'td.' to the beginning of the dragHandle match string. +* IE8 and earlier and Firefox 12 and earlier (< 2012) are no more supported. + + ***** ChangeLog for 6.0.5 compared to 6.0.4 ***** FIX: security vulnerability reported by ADLab of Venustech CVE-2017-17897, CVE-2017-17898, CVE-2017-17899, CVE-2017-17900 @@ -47,42 +322,6 @@ FIX: too much users on holiday list FIX: Wrong alias sql -***** ChangeLog for 7.0.0 compared to 6.0.* ***** -For users: - -For developers: -NEW: Add hook addAdminLdapOptions and doAction in ldap admin page -NEW: complete_head_from_modules() in ldap_prepare_head() - -WARNING: - -If you enabled (for test) the experimental BlockedLog module before 7.0, you must purge the table llx_blockedlog because -way to save data for final version has changed. - -Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* The methode "cloture" on contract were renamed into "closeAll". -* The method "is_erasable" of invoice return a value <= 0 if not erasable (value is meaning) instead of always 0. -* The substitution key for reference of objects is now __REF__ whatever is the object (it replaces __ORDERREF__, - __PROPALREF__, ...) -* The substition key __SIGNATURE__ was renamed into __USER_SIGNATURE__ to follow naming conventions. -* Substitution keys with syntax %XXX% were renamed into __XXX__ to match others. -* Removed old deprecated REST API (APIs found into '/root' section of the REST API explorer in Dolibarr v6). -* Some REST API to access setup features, like dictionaries (country, town, extrafields, ...) were moved into a - common API "/setup". -* The REST API /documents were renamed into /documents/download and /documents/upload. -* Page bank/index.php, bank/bankentries.php and comm/actions/listactions.php were renamed into - bank/list.php, bank/bankentries_list.php and comm/actions/list.php to follow page naming - conventions (so default filter/sort order features can also work for this pages). -* The trigger ORDER_SUPPLIER_STATUS_ONPROCESS was renamed into ORDER_SUPPLIER_STATUS_ORDERED. -* The trigger ORDER_SUPPLIER_STATUS_RECEIVED_ALL was renamed into ORDER_SUPPLIER_STATUS_RECEIVED_COMPLETELY. -* The parameter note into method cloture() is added at end of private note (previously in v6, it replaced). -* The parameter $user is now mandatory for method createFromOrder and createFromPropal. -* Removed js library 'fileupload' that was not used by core code. -* Jquery plugin tableDnd updated. You now need to use decodeURI on the return value of tableDnDSerialize() - and add 'td.' to the beginning of the dragHandle match string. -* IE8 and earlier and Firefox 12 and earlier (< 2012) are no more supported. - - ***** ChangeLog for 6.0.3 compared to 6.0.2 ***** FIX: #7211 Update qty dispatched on qty change FIX: #7458 From c5307e5cac92c3729e006395e4726e3d2d480e7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 15:12:40 +0100 Subject: [PATCH 073/203] Fix option MAILING_LIMIT_SENDBYWEB --- htdocs/comm/mailing/card.php | 48 ++++++++++++++++++++++++---------- htdocs/comm/mailing/cibles.php | 31 ++++++++++++++++------ htdocs/langs/en_US/mails.lang | 1 + 3 files changed, 58 insertions(+), 22 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index cedd04c46c1..b8aa549aa83 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -840,7 +840,7 @@ else if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings'); $_GET["action"]=''; } - else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1') + else if ($conf->global->MAILING_LIMIT_SENDBYWEB < 0) { if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_PHPMAIL), null, 'warnings'); if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($langs->transnoentitiesnoconv($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL), null, 'warnings'); @@ -903,11 +903,11 @@ else print '
'; diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 7729c2737cc..e79b6e6c5d7 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -206,15 +206,30 @@ if ($object->fetch($id) >= 0) print ''; diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 4be167d3061..8e2b093fdc2 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -87,6 +87,7 @@ MailingModuleDescEmailsFromFile=Emails from file MailingModuleDescEmailsFromUser=Emails input by user MailingModuleDescDolibarrUsers=Users with Emails MailingModuleDescThirdPartiesByCategories=Third parties (by categories) +SendingFromWebInterfaceIsNotAllowed=Sending from web interface is not allowed. # Libelle des modules de liste de destinataires mailing LineInFile=Line %s in file From eb3eee9b6a0cc70b9fcf20807d61682ebf5dd9e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 15:25:47 +0100 Subject: [PATCH 074/203] Code comment --- htdocs/core/class/extrafields.class.php | 24 ++++++++++++------------ htdocs/install/mysql/tables/llx_user.sql | 3 +-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c7b2d394a4b..3a3181e14a5 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -140,15 +140,15 @@ class ExtraFields * @param array|string $param Params for field (ex for select list : array('options' => array(value'=>'label of option')) ) * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check - * @param int $list Visibilty - * @param int $ishidden Deprecated. Use visibility instead. + * @param int $list Visibilty (0=never visible, 1=visible on list+forms, 2=list onyl, 3=form only) + * @param int $notused Deprecated. * @param string $computed Computed value * @param string $entity Entity of extrafields (for multicompany modules) * @param string $langfile Language file * @param string $enabled Condition to have the field enabled or not * @return int <=0 if KO, >0 if OK */ - function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list=-1, $ishidden=0, $computed='', $entity='', $langfile='', $enabled='1') + function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list=-1, $notused=0, $computed='', $entity='', $langfile='', $enabled='1') { if (empty($attrname)) return -1; if (empty($label)) return -1; @@ -165,7 +165,7 @@ class ExtraFields if ($result > 0 || $err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' || $type == 'separate') { // Add declaration of field into table - $result2=$this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $ishidden, $default, $computed, $entity, $langfile, $enabled); + $result2=$this->create_label($attrname, $label, $type, $pos, $size, $elementtype, $unique, $required, $param, $alwayseditable, $perms, $list, $notused, $default, $computed, $entity, $langfile, $enabled); $err2=$this->errno; if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { @@ -282,7 +282,7 @@ class ExtraFields * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param int $list Visibily - * @param int $ishidden Deprecated. Use visibility instead. + * @param int $notused Deprecated. * @param string $default Default value (in database. use the default_value feature for default value on screen). * @param string $computed Computed value * @param string $entity Entity of extrafields @@ -290,7 +290,7 @@ class ExtraFields * @param string $enabled Condition to have the field enabled or not * @return int <=0 if KO, >0 if OK */ - private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=-1, $ishidden=0, $default='', $computed='',$entity='', $langfile='', $enabled='1') + private function create_label($attrname, $label='', $type='', $pos=0, $size=0, $elementtype='member', $unique=0, $required=0, $param='', $alwayseditable=0, $perms='', $list=-1, $notused=0, $default='', $computed='',$entity='', $langfile='', $enabled='1') { global $conf,$user; @@ -490,7 +490,7 @@ class ExtraFields * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param int $list Visibility - * @param int $ishidden Deprecated. Use visiblity instead. + * @param int $notused Deprecated. * @param string $default Default value (in database. use the default_value feature for default value on screen). * @param string $computed Computed value * @param string $entity Entity of extrafields @@ -498,7 +498,7 @@ class ExtraFields * @param string $enabled Condition to have the field enabled or not * @return int >0 if OK, <=0 if KO */ - function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $ishidden=0, $default='', $computed='', $entity='', $langfile='', $enabled='1') + function update($attrname, $label, $type, $length, $elementtype, $unique=0, $required=0, $pos=0, $param='', $alwayseditable=0, $perms='', $list='', $notused=0, $default='', $computed='', $entity='', $langfile='', $enabled='1') { if ($elementtype == 'thirdparty') $elementtype='societe'; if ($elementtype == 'contact') $elementtype='socpeople'; @@ -546,7 +546,7 @@ class ExtraFields { if ($label) { - $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$ishidden,$default,$computed,$entity,$langfile,$enabled); + $result=$this->update_label($attrname,$label,$type,$length,$elementtype,$unique,$required,$pos,$param,$alwayseditable,$perms,$list,$notused,$default,$computed,$entity,$langfile,$enabled); } if ($result > 0) { @@ -597,7 +597,7 @@ class ExtraFields * @param int $alwayseditable Is attribute always editable regardless of the document status * @param string $perms Permission to check * @param int $list Visiblity - * @param int $ishidden Deprecated. Use visility instead. + * @param int $notused Deprecated. * @param string $default Default value (in database. use the default_value feature for default value on screen). * @param string $computed Computed value * @param string $entity Entity of extrafields @@ -605,10 +605,10 @@ class ExtraFields * @param string $enabled Condition to have the field enabled or not * @return int <=0 if KO, >0 if OK */ - private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$ishidden=0,$default='',$computed='',$entity='',$langfile='',$enabled='1') + private function update_label($attrname,$label,$type,$size,$elementtype,$unique=0,$required=0,$pos=0,$param='',$alwayseditable=0,$perms='',$list=0,$notused=0,$default='',$computed='',$entity='',$langfile='',$enabled='1') { global $conf, $user; - dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$ishidden.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled); + dol_syslog(get_class($this)."::update_label ".$attrname.", ".$label.", ".$type.", ".$size.", ".$elementtype.", ".$unique.", ".$required.", ".$pos.", ".$alwayseditable.", ".$perms.", ".$list.", ".$notused.", ".$default.", ".$computed.", ".$entity.", ".$langfile.", ".$enabled); // Clean parameters if ($elementtype == 'thirdparty') $elementtype='societe'; diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index 4385483209a..2ecb52511d4 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -15,7 +15,6 @@ -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . --- -- =========================================================================== create table llx_user @@ -37,7 +36,7 @@ create table llx_user pass_encoding varchar(24), pass varchar(128), pass_crypted varchar(128), - pass_temp varchar(128), -- temporary password when asked for forget password + pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validaity) api_key varchar(128), -- key to use REST API by this user gender varchar(10), civility varchar(6), From ba0a96c882779355bab007a2004920fd38cc4d70 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 15:37:23 +0100 Subject: [PATCH 075/203] Missing param limit --- htdocs/comm/mailing/cibles.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index e79b6e6c5d7..37724b62215 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -426,6 +426,8 @@ if ($object->fetch($id) >= 0) $num = $db->num_rows($resql); $param = "&id=".$object->id; + //if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($search_lastname) $param.= "&search_lastname=".urlencode($search_lastname); if ($search_firstname) $param.= "&search_firstname=".urlencode($search_firstname); if ($search_email) $param.= "&search_email=".urlencode($search_email); From 6cae36cc336d7d60ab2b6563e3b79afd86132e76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 17:00:14 +0100 Subject: [PATCH 076/203] NEW Add key __USER_REMOTE_IP__ into available substitution variables --- htdocs/core/lib/functions.lib.php | 3 ++- htdocs/langs/en_US/other.lang | 4 +++- htdocs/langs/en_US/users.lang | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bd7fa7b6fd4..88d4e550b03 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5620,7 +5620,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob '__USER_LASTNAME__' => (string) $user->lastname, '__USER_FIRSTNAME__' => (string) $user->firstname, '__USER_FULLNAME__' => (string) $user->getFullName($outputlangs), - '__USER_SUPERVISOR_ID__' => (string) $user->fk_user + '__USER_SUPERVISOR_ID__' => (string) $user->fk_user, + '__USER_REMOTE_IP__' => (string) $_SERVER['REMOTE_ADDR'] ) ); } diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 132a200ab2e..1585504479e 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -227,7 +227,9 @@ Chart=Chart PassEncoding=Password encoding PermissionsAdd=Permissions added PermissionsDelete=Permissions removed - +YourPasswordMustHaveAtLeastXChars=Your password must have at least %s chars +YourPasswordHasBeenReset=Your password has been reset successfully +ApplicantIpAddress=IP address of applicant ##### Export ##### ExportsArea=Exports area AvailableFormats=Available formats diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 3c1a8644bf0..c149e9d6a53 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -44,7 +44,9 @@ NewGroup=New group CreateGroup=Create group RemoveFromGroup=Remove from group PasswordChangedAndSentTo=Password changed and sent to %s. +PasswordChangeRequest=Request to change password for %s PasswordChangeRequestSent=Request to change password for %s sent to %s. +ConfirmPasswordReset=Confirm password reset MenuUsersAndGroups=Users & Groups LastGroupsCreated=Latest %s created groups LastUsersCreated=Latest %s users created From cdb63bada39a44c7e555c77bd617fb1a1e7e22f6 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 26 Jan 2018 18:13:55 +0100 Subject: [PATCH 077/203] FIX: #7974 Contract - Invalid reference on the document --- htdocs/contrat/card.php | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index a1a38d04626..ae1178adf9a 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani - * Copyright (C) 2010-2015 Juanjo Menent + * Copyright (C) 2010-2017 Juanjo Menent * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2014-2016 Ferran Marcet @@ -753,6 +753,30 @@ if (empty($reshook)) else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->contrat->creer) { $result = $object->validate($user); + + if ($result > 0) + { + // Define output language + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) + { + $outputlangs = $langs; + $newlang = ''; + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang = GETPOST('lang_id','aZ09'); + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang; + if (! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } + $model=$object->modelpdf; + $ret = $object->fetch($id); // Reload to get new records + + $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); + } + } + else + { + setEventMessages($object->error, $object->errors, 'errors'); + } } else if ($action == 'reopen' && $user->rights->contrat->creer) From a61b42075903c5a997224a5c9625ddd46e6ca50b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 23:29:49 +0100 Subject: [PATCH 078/203] Fix css --- htdocs/core/lib/functions.lib.php | 7 ++++--- htdocs/index.php | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 30164def386..9cbf52c1cc8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3367,18 +3367,19 @@ function img_searchclear($titlealt = 'default', $other = '') * @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto * @param int $nodiv No div * @param string $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'xxx'=Other + * @param string $morecss More CSS * @return string String with info text */ -function info_admin($text, $infoonimgalt = 0, $nodiv=0, $admin='1') +function info_admin($text, $infoonimgalt = 0, $nodiv=0, $admin='1', $morecss='') { global $conf, $langs; if ($infoonimgalt) { - return img_picto($text, 'info', 'class="hideonsmartphone"'); + return img_picto($text, 'info', 'class="hideonsmartphone'.($morecss?' '.$morecss:'').'"'); } - return ($nodiv?'':'
').' '.$text.($nodiv?'':'
'); + return ($nodiv?'':'
').' '.$text.($nodiv?'':'
'); } diff --git a/htdocs/index.php b/htdocs/index.php index 867f305a680..b01e37927c4 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -656,7 +656,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { $langs->load("errors"); //if (! empty($message)) $message.='
'; - $message.=info_admin($langs->trans("WarningLockFileDoesNotExists",DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); + $message.=info_admin($langs->trans("WarningLockFileDoesNotExists",DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } // Conf files must be in read only mode @@ -665,7 +665,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) $langs->load("errors"); //$langs->load("other"); //if (! empty($message)) $message.='
'; - $message.=info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); + $message.=info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } if ($message) From 28417a6c248d63684c674d50471ac72cd1062a51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 23:54:45 +0100 Subject: [PATCH 079/203] Fix css --- htdocs/admin/dict.php | 8 ++++---- htdocs/blockedlog/admin/blockedlog_list.php | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index a1fc7c87d68..438c7cd5227 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -187,7 +187,7 @@ $tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAI $tabsql[10]= "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $tabsql[12]= "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = " . getEntity($tabname[12]); -$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.accountancy_code, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = " . getEntity($tabname[13]); +$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = " . getEntity($tabname[13]); $tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1"; $tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16]= "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; @@ -265,7 +265,7 @@ $tabfield[9] = "code,label,unicode"; $tabfield[10]= "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11]= "element,source,code,libelle,position"; $tabfield[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity"; -$tabfield[13]= "code,libelle,type,accountancy_code,entity"; +$tabfield[13]= "code,libelle,type,entity"; $tabfield[14]= "code,libelle,price,organization,country_id,country"; $tabfield[15]= "code,libelle,width,height,unit"; $tabfield[16]= "code,libelle,sortorder"; @@ -304,7 +304,7 @@ $tabfieldvalue[9] = "code,label,unicode"; $tabfieldvalue[10]= "country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[11]= "element,source,code,libelle,position"; $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder"; -$tabfieldvalue[13]= "code,libelle,type,accountancy_code"; +$tabfieldvalue[13]= "code,libelle,type"; $tabfieldvalue[14]= "code,libelle,price,organization,country"; $tabfieldvalue[15]= "code,libelle,width,height,unit"; $tabfieldvalue[16]= "code,libelle,sortorder"; @@ -343,7 +343,7 @@ $tabfieldinsert[9] = "code_iso,label,unicode"; $tabfieldinsert[10]= "fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[11]= "element,source,code,libelle,position"; $tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity"; -$tabfieldinsert[13]= "code,libelle,type,accountancy_code,entity"; +$tabfieldinsert[13]= "code,libelle,type,entity"; $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays"; $tabfieldinsert[15]= "code,label,width,height,unit"; $tabfieldinsert[16]= "code,label,sortorder"; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 633f84b6582..08b384d7ac5 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -359,7 +359,8 @@ print ''; // User print '
'; // Actions code From 13adf06ae428e798831d89a50ac479864262e2ef Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 27 Jan 2018 15:48:11 +0100 Subject: [PATCH 080/203] Trad: more understandable extrafield translation to the end user Trad: fix english words Trad: more accurate accounting translation --- htdocs/langs/es_ES/accountancy.lang | 12 ++-- htdocs/langs/es_ES/admin.lang | 98 ++++++++++++++------------- htdocs/langs/es_ES/bills.lang | 2 +- htdocs/langs/es_ES/categories.lang | 2 +- htdocs/langs/es_ES/companies.lang | 4 +- htdocs/langs/es_ES/compta.lang | 2 +- htdocs/langs/es_ES/donations.lang | 2 +- htdocs/langs/es_ES/languages.lang | 2 +- htdocs/langs/es_ES/main.lang | 10 +-- htdocs/langs/es_ES/modulebuilder.lang | 2 + htdocs/langs/es_ES/multicurrency.lang | 2 +- htdocs/langs/es_ES/other.lang | 4 +- htdocs/langs/es_ES/printing.lang | 2 + htdocs/langs/es_ES/products.lang | 2 +- htdocs/langs/es_ES/users.lang | 2 +- htdocs/langs/es_ES/website.lang | 2 +- htdocs/langs/es_ES/withdrawals.lang | 2 +- 17 files changed, 80 insertions(+), 72 deletions(-) diff --git a/htdocs/langs/es_ES/accountancy.lang b/htdocs/langs/es_ES/accountancy.lang index a5e4fbdf465..59c20932702 100644 --- a/htdocs/langs/es_ES/accountancy.lang +++ b/htdocs/langs/es_ES/accountancy.lang @@ -25,8 +25,8 @@ Chartofaccounts=Plan contable CurrentDedicatedAccountingAccount=Cuenta contable dedicada AssignDedicatedAccountingAccount=Nueva cuenta a asignar InvoiceLabel=Etiqueta factura -OverviewOfAmountOfLinesNotBound=Ver la cantidad de líneas no ligadas a cuentas contables -OverviewOfAmountOfLinesBound=Ver la cantidad de líneas ligadas a cuentas contables +OverviewOfAmountOfLinesNotBound=Ver la cantidad de líneas no vinculadas a una cuenta contable +OverviewOfAmountOfLinesBound=Ver la cantidad de líneas vinculadas a una cuenta contable OtherInfo=Otra información DeleteCptCategory=Eliminar la cuenta contable del grupo ConfirmDeleteCptCategory=¿Está seguro de querer eliminar esta cuenta contable del grupo de cuentas contables? @@ -158,7 +158,7 @@ NumPiece=Apunte TransactionNumShort=Núm. transacción AccountingCategory=Grupos personalizados GroupByAccountAccounting=Agrupar por cuenta contable -AccountingAccountGroupsDesc=You can define here some groups of accounting account. They will be used for personalized accounting reports. +AccountingAccountGroupsDesc=Puedes definir aquí algunos grupos de cuentas contables. Se usarán para informes de contabilidad personalizados. ByAccounts=Por cuentas ByPredefinedAccountGroups=Por grupos predefinidos ByPersonalizedAccountGroups=Por grupos personalizados @@ -173,7 +173,7 @@ DelBookKeeping=Eliminar los registros del Libro Mayor FinanceJournal=Diario financiero ExpenseReportsJournal=Diario informe de gastos DescFinanceJournal=El diario financiero incluye todos los tipos de pagos por cuenta bancaria -DescJournalOnlyBindedVisible=Esta es una vista de registros que están vinculados a una cuenta contable y pueden ser registrados en el Libro Mayor. +DescJournalOnlyBindedVisible=Esta es una vista del registro vinculado a una cuenta contable y que se puede registrar en el Libro Mayor. VATAccountNotDefined=Cuenta contable para IVA no definida ThirdpartyAccountNotDefined=Cuenta contable de tercero no definida ProductAccountNotDefined=Cuenta contable de producto no definida @@ -191,7 +191,7 @@ DescThirdPartyReport=Consulte aquí el listado de clientes y proveedores y sus c ListAccounts=Listado de cuentas contables UnknownAccountForThirdparty=Cuenta contable de tercero desconocida, usaremos %s UnknownAccountForThirdpartyBlocking=Cuenta contable de tercero desconocida. Error de bloqueo -UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third party account and waiting account not defined. Blocking error +UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Cuenta del terceros desconocida y cuenta de espera no definida. Error de bloqueo Pcgtype=Grupo de cuenta Pcgsubtype=Subgrupo de cuenta @@ -224,6 +224,8 @@ GeneralLedgerSomeRecordWasNotRecorded=Algunas de las operaciones que no podrán NoNewRecordSaved=No hay más registros para el diario ListOfProductsWithoutAccountingAccount=Listado de productos sin cuentas contables ChangeBinding=Cambiar la unión +Accounted=Contabilizada en el Libro Mayor +NotYetAccounted=Aún no contabilizada en el Libro Mayor ## Admin ApplyMassCategories=Aplicar categorías en masa diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index c8e8d5cfe43..02057302f8a 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -260,18 +260,18 @@ FontSize=Tamaño de fuente Content=Contenido NoticePeriod=Plazo de aviso NewByMonth=Nuevo por mes -Emails=Emails -EMailsSetup=Configuración emails +Emails=E-Mails +EMailsSetup=Configuración e-mails EMailsDesc=Esta página le permite sobrescribir sus parámetros de PHP para el envío de correos electrónicos. En la mayoría de los casos, en el sistema operativo Unix/Linux, su configuración de PHP es correcta y estos parámetros son inútiles. EmailSenderProfiles=Perfiles de remitentes de e-mails MAIN_MAIL_SMTP_PORT=Puerto del servidor SMTP (Por defecto en php.ini: %s) MAIN_MAIL_SMTP_SERVER=Nombre host o ip del servidor SMTP (Por defecto en php.ini: %s) MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike=Puerto del servidor SMTP (No definido en PHP en sistemas de tipo Unix) MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike=Nombre servidor o ip del servidor SMTP (No definido en PHP en sistemas de tipo Unix) -MAIN_MAIL_EMAIL_FROM=Correo electrónico del remitente para correos electrónicos automáticos (por defecto en php.ini: %s) -MAIN_MAIL_ERRORS_TO=Correo electrónico del remitente utilizado para los correos electrónicos de error enviados +MAIN_MAIL_EMAIL_FROM=E-mail del remitente para e-mails automáticos (por defecto en php.ini: %s) +MAIN_MAIL_ERRORS_TO=E-mail del remitente utilizado para los e-mails de error enviados MAIN_MAIL_AUTOCOPY_TO= Enviar automáticamente copia oculta de los e-mails enviados a -MAIN_DISABLE_ALL_MAILS=Deshabilitar todos los envíos de correos electrónicos (para propósitos de prueba o demostraciones) +MAIN_DISABLE_ALL_MAILS=Deshabilitar todos los envíos de e-mail (para propósitos de prueba o demostraciones) MAIN_MAIL_SENDMODE=Método de envío de e-mails MAIN_MAIL_SMTPS_ID=ID de autentificación SMTP si se requiere autenticación SMTP MAIN_MAIL_SMTPS_PW=Contraseña autentificación SMTP si se requiere autentificación SMTP @@ -410,11 +410,11 @@ ExtrafieldCheckBoxFromList=Casilla de selección de tabla ExtrafieldLink=Objeto adjuntado ComputedFormula=Campo combinado ComputedFormulaDesc=Puede introducir aquí una fórmula utilizando otras propiedades de objeto o cualquier código PHP para obtener un valor calculado dinámico. Puede utilizar cualquier fórmula compatible con PHP, incluido el operador de condición "?" y los objetos globales siguientes: $db, $conf, $langs, $mysoc, $user, $object.
ATENCIÓN: Sólo algunas propiedades de $object pueden estar disponibles. Si necesita propiedades no cargadas, solo busque el objeto en su fórmula como en el segundo ejemplo.
Usando un campo computado significa que no puede ingresar ningún valor de la interfaz. Además, si hay un error de sintaxis, la fórmula puede devolver nada.

Ejemplo de fórmula:
$object->id < 10 ? round($object->id / 2, 2) : ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)

Ejemlo de recarga de objeto
(($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5 : '-1'

Otro ejemplo de fórmula para forzar la carga del objeto y su objeto principal:
(($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : 'Parent project not found' -ExtrafieldParamHelpselect=El listado de parámetros tiene que ser key,valor

por ejemplo:
1,value1
2,value2
3,value3
...

Para tener una lista en funcion de atributos complementarios de lista:
1,value1|options_parent_list_code:parent_key
2,value2|options_parent_list_code:parent_key

Para tener la lista en función de otra:
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key +ExtrafieldParamHelpselect=El listado de parámetros tiene que ser key,valor

por ejemplo:
1,value1
2,value2
3,value3
...

Para tener una lista en funcion de campos adicionales de lista:
1,value1|options_parent_list_code:parent_key
2,value2|options_parent_list_code:parent_key

Para tener la lista en función de otra:
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key ExtrafieldParamHelpcheckbox=El listado de parámetros tiene que ser key,valor

por ejemplo:
1,value1
2,value2
3,value3
... ExtrafieldParamHelpradio=El listado de parámetros tiene que ser key,valor (donde key no puede ser 0)

por ejemplo:
1,value1
2,value2
3,value3
... -ExtrafieldParamHelpsellist=Lista de parámetros proviene de una tabla
Sintaxis: nombre_tabla: etiqueta_field: id_field :: filtro
Ejemplo: c_typent: libelle: id :: filtro

filtro puede ser una prueba simple (por ejemplo, activa = 1) Para mostrar sólo el valor activo
También puede utilizar $ ID $ en el filtro witch es el actual id del objeto actual
Para hacer un SELECT en el filtro de uso $ SEL $
si desea filtrar en extrafields utilizar la sintaxis Extra.fieldcode = ... (donde código de campo es el código de extrafield)

Para que la lista dependa de otra lista de atributos complementarios:
c_typent: libelle: id: options_ parent_list_code | parent_column: filter

Para que la lista dependa de otra lista:
c_typent: libelle: id: parent_list_code | parent_column: filter -ExtrafieldParamHelpchkbxlst=Lista de parámetros proviene de una tabla
Sintaxis: nombre_tabla: etiqueta_field: id_field :: filtro
Ejemplo: c_typent: libelle: id :: filtro

filtro puede ser una prueba simple (por ejemplo, activa = 1) Para mostrar sólo el valor activo
También puede utilizar $ ID $ en el filtro witch es el id actual del objeto actual
Para hacer un SELECT en el filtro de uso $ SEL $
si desea filtrar en extrafields utilizar la sintaxis Extra.fieldcode = ... (donde código de campo es el código de extrafield)

Para que la lista dependa de otra lista de atributos complementarios:
c_typent: libelle: id: options_ parent_list_code | parent_column: filter

Para que la lista dependa de otra lista:
c_typent: libelle: id: parent_list_code | parent_column: filter +ExtrafieldParamHelpsellist=Lista de parámetros proviene de una tabla
Sintaxis: nombre_tabla: etiqueta_field: id_field :: filtro
Ejemplo: c_typent: libelle: id :: filtro

filtro puede ser una prueba simple (por ejemplo, activa = 1) Para mostrar sólo el valor activo
También puede utilizar $ ID $ en el filtro witch es el actual id del objeto actual
Para hacer un SELECT en el filtro de uso $ SEL $
si desea filtrar en campos adicionales utilizar la sintaxis Extra.fieldcode = ... (donde código de campo es el código de campo adicional)

Para que la lista dependa de otra lista de campos adicionales:
c_typent: libelle: id: options_ parent_list_code | parent_column: filter

Para que la lista dependa de otra lista:
c_typent: libelle: id: parent_list_code | parent_column: filter +ExtrafieldParamHelpchkbxlst=Lista de parámetros proviene de una tabla
Sintaxis: nombre_tabla: etiqueta_field: id_field :: filtro
Ejemplo: c_typent: libelle: id :: filtro

filtro puede ser una prueba simple (por ejemplo, activa = 1) Para mostrar sólo el valor activo
También puede utilizar $ ID $ en el filtro witch es el id actual del objeto actual
Para hacer un SELECT en el filtro de uso $ SEL $
si desea filtrar en campos adicionales utilizar la sintaxis Extra.fieldcode = ... (donde código de campo es el código de campo adicional)

Para que la lista dependa de otra lista de campos adicionales:
c_typent: libelle: id: options_ parent_list_code | parent_column: filter

Para que la lista dependa de otra lista:
c_typent: libelle: id: parent_list_code | parent_column: filter ExtrafieldParamHelplink=Los parámetros deben ser ObjectName: Classpath
Sintaxis: ObjectName:Classpath
Ejemplo: Societe:societe/class/societe.class.php LibraryToBuildPDF=Libreria usada en la generación de los PDF WarningUsingFPDF=Atención: Su archivo conf.php contiene la directiva dolibarr_pdf_force_fpdf=1. Esto hace que se use la librería FPDF para generar sus archivos PDF. Esta librería es antigua y no cubre algunas funcionalidades (Unicode, transparencia de imágenes, idiomas cirílicos, árabes o asiáticos, etc.), por lo que puede tener problemas en la generación de los PDF.
Para resolverlo, y disponer de un soporte completo de PDF, puede descargar la librería TCPDF , y a continuación comentar o eliminar la línea $dolibarr_pdf_force_fpdf=1, y añadir en su lugar $dolibarr_lib_TCPDF_PATH='ruta_a_TCPDF' @@ -551,6 +551,8 @@ Module520Desc=Gestión de créditos Module600Name=Notificaciones Module600Desc=Enviar notificaciones por e-mail (desencadenados por algunos eventos) a los usuarios (configuración definida para cada usuario), los contactos de terceros (configuración definida en cada tercero) o e-mails fijos Module600Long=Tenga en cuenta que este módulo está dedicado a enviar mensajes de e-mail en tiempo real cuando se produce un evento. Si está buscando una función para enviar recordatorios por e-mail de los eventos de su agenda, vaya a la configuración del módulo Agenda. +Module610Name=Variantes de productos +Module610Desc=Permite la creación de variantes de productos en función de los atributos (color, tamaño, ...) Module700Name=Donaciones Module700Desc=Gestión de donaciones Module770Name=Informes de gastos @@ -598,7 +600,7 @@ Module10000Name=Sitios web Module10000Desc=Cree sitios web públicos con un editor WYSIWYG. Configure el servidor web (Apache, Nginx,...) para que apunte al directorio dedicado para tenerlo en línea en Internet. Module20000Name=Gestión de días libres retribuidos Module20000Desc=Gestión de los días libres retribuidos de los empleados -Module39000Name=Lotes de producto +Module39000Name=Lotes de productos Module39000Desc=Gestión de lotes o series, fechas de caducidad y venta de los productos Module50000Name=PayBox Module50000Desc=Módulo para ofrecer pagos online aceptando pagos con tarjeta de Débito/Crédito via PayBox. Esto puede ser usado para permitir a tus clientes realizar pagos libres o pagos en un objeto de Dolibarr en particular (factura, pedido...) @@ -824,12 +826,12 @@ Permission1232=Crear facturas de proveedores Permission1233=Validar facturas de proveedores Permission1234=Eliminar facturas de proveedores Permission1235=Enviar facturas de proveedores por correo -Permission1236=Exportar facturas de proveedores, atributos y pagos +Permission1236=Exportar facturas de proveedores, campos adicionales y pagos Permission1237=Exportar pedidos de proveedores junto con sus detalles Permission1251=Lanzar las importaciones en masa a la base de datos (carga de datos) -Permission1321=Exportar facturas a clientes, atributos y cobros +Permission1321=Exportar facturas a clientes, campos adicionales y cobros Permission1322=Reabrir una factura pagada -Permission1421=Exportar pedidos de clientes y atributos +Permission1421=Exportar pedidos de clientes y campos adicionales Permission20001=Leer peticiones días retribuidos (suyos y subordinados) Permission20002=Cear/modificar sus días retribuidos Permission20003=Eliminar peticiones de días retribuidos @@ -890,7 +892,7 @@ DictionaryStaff=Empleados DictionaryAvailability=Tiempos de entrega DictionaryOrderMethods=Métodos de pedido DictionarySource=Orígenes de presupuestos/pedidos -DictionaryAccountancyCategory=Personalized groups for reports +DictionaryAccountancyCategory=Grupos personalizados para imformes DictionaryAccountancysystem=Modelos de planes contables DictionaryAccountancyJournal=Diarios contables DictionaryEMailTemplates=Plantillas E-Mails @@ -1108,23 +1110,23 @@ MAIN_PROXY_HOST=Nombre/Dirección del servidor proxy MAIN_PROXY_PORT=Puerto del servidor proxy MAIN_PROXY_USER=Login del servidor proxy MAIN_PROXY_PASS=Contraseña del servidor proxy -DefineHereComplementaryAttributes=Defina aquí la lista de atributos adicionales, no disponibles por defecto, y que desea gestionar para %s. -ExtraFields=Atributos adicionales -ExtraFieldsLines=Atributos adicionales (líneas) -ExtraFieldsLinesRec=Atributos complementarios (plantillas de líneas de facturas) -ExtraFieldsSupplierOrdersLines=Atributos complementarios (líneas de pedido) -ExtraFieldsSupplierInvoicesLines=Atributos complementarios (líneas de factura) -ExtraFieldsThirdParties=Atributos adicionales (terceros) -ExtraFieldsContacts=Atributos adicionales (contactos/direcciones) -ExtraFieldsMember=Atributos adicionales (miembros) -ExtraFieldsMemberType=Atributos adicionales (tipos de miembros) -ExtraFieldsCustomerInvoices=Atributos adicionales (facturas a clientes) -ExtraFieldsCustomerInvoicesRec=Atributos complementarios (plantillas de facturas) -ExtraFieldsSupplierOrders=Atributos adicionales (pedidos a proveedores) -ExtraFieldsSupplierInvoices=Atributos adicionales (facturas) -ExtraFieldsProject=Atributos adicionales (proyectos) -ExtraFieldsProjectTask=Atributos adicionales (tareas) -ExtraFieldHasWrongValue=El atributo %s tiene un valor no válido +DefineHereComplementaryAttributes=Defina aquí la lista de campos adicionales, no disponibles por defecto, y que desea gestionar para %s. +ExtraFields=Campos adicionales +ExtraFieldsLines=Campos adicionales (líneas) +ExtraFieldsLinesRec=Campos adicionales (plantillas de líneas de facturas) +ExtraFieldsSupplierOrdersLines=Campos adicionales (líneas de pedido) +ExtraFieldsSupplierInvoicesLines=Campos adicionales (líneas de factura) +ExtraFieldsThirdParties=Campos adicionales (terceros) +ExtraFieldsContacts=Campos adicionales (contactos/direcciones) +ExtraFieldsMember=Campos adicionales (miembros) +ExtraFieldsMemberType=Campos adicionales (tipos de miembros) +ExtraFieldsCustomerInvoices=Campos adicionales (facturas a clientes) +ExtraFieldsCustomerInvoicesRec=Campos adicionales (plantillas de facturas) +ExtraFieldsSupplierOrders=Campos adicionales (pedidos a proveedores) +ExtraFieldsSupplierInvoices=Campos adicionales (facturas) +ExtraFieldsProject=Campos adicionales (proyectos) +ExtraFieldsProjectTask=Campos adicionales (tareas) +ExtraFieldHasWrongValue=El campo %s tiene un valor no válido AlphaNumOnlyLowerCharsAndNoSpace=sólo alfanuméricos y minúsculas sin espacio SendmailOptionNotComplete=Atención, en algunos sistemas Linux, con este método de envio, para poder enviar mails en su nombre, la configuración de sendmail debe contener la opción -ba (parámetro mail.force_extra_parameters en el archivo php.ini). Si algunos de sus destinatarios no reciben sus mensajes, pruebe a modificar este parámetro PHP con mail.force_extra_parameters=-ba. PathToDocuments=Rutas de acceso a documentos @@ -1303,17 +1305,17 @@ LDAPContactDnExample=DN completo (ej: ou=contacts,dc=example,dc=com) LDAPMemberDn=DN de los miembros LDAPMemberDnExample=DN completo (ex: ou=members,dc=society,dc=com) LDAPMemberObjectClassList=Lista de objectClass -LDAPMemberObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory) +LDAPMemberObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user para active directory) LDAPMemberTypeDn=Tipos DN de miembros de Dolibar LDAPMemberTypepDnExample=DN completo (por ejemplo, ou=memberstypes, dc=example, dc=com) LDAPMemberTypeObjectClassList=Lista de objectClass LDAPMemberTypeObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,groupOfUniqueNames) LDAPUserObjectClassList=Lista de objectClass -LDAPUserObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory) +LDAPUserObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user para active directory) LDAPGroupObjectClassList=Lista de objectClass LDAPGroupObjectClassListExample=Lista de ObjectClass que definen los atributos de un registro (ej: top,groupOfUniqueNames) LDAPContactObjectClassList=Lista de objectClass -LDAPContactObjectClassListExample=Lista de objectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user for active directory) +LDAPContactObjectClassListExample=Lista de objectClass que definen los atributos de un registro (ej: top,inetOrgPerson o top,user para active directory) LDAPTestConnect=Probar la conexión LDAP LDAPTestSynchroContact=Probar la sincronización de contactos LDAPTestSynchroUser=Probar la sincronización de usuarios @@ -1728,21 +1730,21 @@ SeeSubstitutionVars=Vea * nota para un listado de posibles variables de sustituc SeeChangeLog=Ver archivo ChangeLog (solo inglés) AllPublishers=Todos los editores UnknownPublishers=Editores desconocidos -AddRemoveTabs=Añadir o eliminar pestañas -AddDataTables=Añadir tablas de objetos -AddDictionaries=Añadir diccionarios -AddData=Agregar objetos o datos de diccionarios -AddBoxes=Añadir paneles -AddSheduledJobs=Añadir tareas programadas -AddHooks=Añadir hooks -AddTriggers=Añadir triggers -AddMenus=Añadir menús -AddPermissions=Añadir permisos -AddExportProfiles=Añadir perfiles de exportación -AddImportProfiles=Añadir perfiles de importación -AddOtherPagesOrServices=Añadir otras páginas o servicios -AddModels=Añadir modelos de documentos o numeración -AddSubstitutions=Añadir substituciones de claves +AddRemoveTabs=Añade o elimina pestañas +AddDataTables=Añade tablas de objetos +AddDictionaries=Añade diccionarios +AddData=Añade objetos o datos de diccionarios +AddBoxes=Añade paneles +AddSheduledJobs=Añade tareas programadas +AddHooks=Añade hooks +AddTriggers=Añade triggers +AddMenus=Añade menús +AddPermissions=Añade permisos +AddExportProfiles=Añade perfiles de exportación +AddImportProfiles=Añade perfiles de importación +AddOtherPagesOrServices=Añade otras páginas o servicios +AddModels=Añade modelos de documentos o numeración +AddSubstitutions=Añade substituciones de claves DetectionNotPossible=No es posible la detección UrlToGetKeyToUseAPIs=Url para conseguir token para usar la API (una vez recibido el token se guarda en la tabla de usuarios de la base de datos y se debe proporcionar en cada llamada API) ListOfAvailableAPIs=Listado de APIs disponibles diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 7cf978aba75..2ece66711c7 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -178,7 +178,7 @@ ConfirmCancelBillQuestion=¿Porqué quiere clasificar esta factura como 'abandon ConfirmClassifyPaidPartially=¿Está seguro de querer cambiar el estado de la factura %s a pagado? ConfirmClassifyPaidPartiallyQuestion=Esta factura no ha sido pagado completamente. ¿Cual es la razón para cerrar esta factura? ConfirmClassifyPaidPartiallyReasonAvoir=El resto a pagar (%s %s) es un descuento otorgado por pronto pago. Regularizaré el IVA con un abono. -ConfirmClassifyPaidPartiallyReasonDiscount=Remaining unpaid (%s %s) is a discount granted because payment was made before term. +ConfirmClassifyPaidPartiallyReasonDiscount=El resto a pagar (%s%s) es un descuento otorgado por pronto pago. ConfirmClassifyPaidPartiallyReasonDiscountNoVat=El resto a pagar (%s %s) es un descuento otorgado por pronto pago. Acepto perder el IVA en este descuento. ConfirmClassifyPaidPartiallyReasonDiscountVat=El resto a pagar (%s %s) es un descuento otorgado por pronto pago. Recuperaré el IVA sin usar un abono. ConfirmClassifyPaidPartiallyReasonBadCustomer=Cliente moroso diff --git a/htdocs/langs/es_ES/categories.lang b/htdocs/langs/es_ES/categories.lang index 9d83ca86817..6a834e36fea 100644 --- a/htdocs/langs/es_ES/categories.lang +++ b/htdocs/langs/es_ES/categories.lang @@ -78,7 +78,7 @@ CatCusLinks=Enlaces entre clientes/clientes potenciales y etiquetas/categorías CatProdLinks=Enlaces entre productos/servicios y etiquetas/categorías CatProJectLinks=Enlaces entre proyectos y etiquetas/categorías DeleteFromCat=Eliminar de la etiqueta/categoría -ExtraFieldsCategories=Atributos complementarios +ExtraFieldsCategories=Campos adicionales CategoriesSetup=Configuración de etiquetas/categorías CategorieRecursiv=Enlazar con la etiqueta/categoría automáticamente CategorieRecursivHelp=Si está activado, el producto se enlazará a la categoría padre si lo añadimos a una subcategoría diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 98fcc553b0d..d70114dacae 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -374,9 +374,9 @@ ContactNotLinkedToCompany=Contacto no vinculado a un tercero DolibarrLogin=Login usuario NoDolibarrAccess=Sin acceso de usuario ExportDataset_company_1=Terceros (Empresas / asociaciones / particulares) y propiedades -ExportDataset_company_2=Contactos de terceros y atributos +ExportDataset_company_2=Contactos de terceros y campos adicionales ImportDataset_company_1=Terceros (Empresas / asociaciones / particulares) y propiedades -ImportDataset_company_2=Contactos/Direcciones (de terceros o no) y atributos +ImportDataset_company_2=Contactos/Direcciones (de terceros o no) y campos adicionales ImportDataset_company_3=Cuentas bancarias ImportDataset_company_4=Terceros/Comerciales (Afecta a los usuarios comerciales de terceros) PriceLevel=Nivel de precios diff --git a/htdocs/langs/es_ES/compta.lang b/htdocs/langs/es_ES/compta.lang index 18eb89f6dbd..277c8f8fcf5 100644 --- a/htdocs/langs/es_ES/compta.lang +++ b/htdocs/langs/es_ES/compta.lang @@ -24,7 +24,7 @@ PaymentsNotLinkedToInvoice=Pagos vinculados a ninguna factura, por lo que ningu PaymentsNotLinkedToUser=Pagos no vinculados a un usuario Profit=Beneficio AccountingResult=Resultado contable -BalanceBefore=Balance (before) +BalanceBefore=Balance (antes) Balance=Saldo Debit=Debe Credit=Haber diff --git a/htdocs/langs/es_ES/donations.lang b/htdocs/langs/es_ES/donations.lang index fddc435971d..0b6c7d207f3 100644 --- a/htdocs/langs/es_ES/donations.lang +++ b/htdocs/langs/es_ES/donations.lang @@ -31,4 +31,4 @@ DONATION_ART200=Mostrar artículo 200 del CGI si se está interesado DONATION_ART238=Mostrar artículo 238 del CGI si se está interesado DONATION_ART885=Mostrar artículo 885 del CGI si se está interesado DonationPayment=Pago de donación -DonationValidated=Donation %s validated +DonationValidated=Donación %s validada diff --git a/htdocs/langs/es_ES/languages.lang b/htdocs/langs/es_ES/languages.lang index d460b1e968f..ec9b14b68fc 100644 --- a/htdocs/langs/es_ES/languages.lang +++ b/htdocs/langs/es_ES/languages.lang @@ -35,7 +35,7 @@ Language_es_PA=Español (Panamá) Language_es_PY=Español (Paraguay) Language_es_PE=Español (Perú) Language_es_PR=Español (Puerto Rico) -Language_es_UY=Spanish (Uruguay) +Language_es_UY=Español (Uruguay) Language_es_VE=Español (Venezuela) Language_et_EE=Estonio Language_eu_ES=Vasco diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index 729daa6ebcf..310a4b5dd6c 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -722,8 +722,8 @@ After=Después IPAddress=Dirección IP Frequency=Frecuencia IM=Mensajería instantánea -NewAttribute=Nuevo atributo -AttributeCode=Código atributo +NewAttribute=Nuevo campo +AttributeCode=Código URLPhoto=Url de la foto/logo SetLinkToAnotherThirdParty=Vincular a otro tercero LinkTo=Enlazar a @@ -885,7 +885,7 @@ Select2NotFound=No se han encontrado registros Select2Enter=Introducir Select2MoreCharacter=o más caracteres Select2MoreCharacters=o más caracteres -Select2MoreCharactersMore=Sintaxis de búsqueda:
| OR (a|b)
* Cualquier caracter (a*b)
^Empezar con (^ab)
$Terminar con (ab$)
+Select2MoreCharactersMore=Sintaxis de búsqueda:
| O (a|b)
* Cualquier carácter (a*b)
^ Empieza con (^ab)
$ Termina con (ab$)
Select2LoadingMoreResults=Cargando más resultados... Select2SearchInProgress=Búsqueda en progreso... SearchIntoThirdparties=Terceros @@ -912,5 +912,5 @@ CommentPage=Espacio de comentarios CommentAdded=Comentario añadido CommentDeleted=Comentario borrado Everybody=Proyecto compartido -PayedBy=Payed by -PayedTo=Payed to +PayedBy=Pagado por +PayedTo=Pagado a diff --git a/htdocs/langs/es_ES/modulebuilder.lang b/htdocs/langs/es_ES/modulebuilder.lang index 6be47b732bf..188887b7a06 100644 --- a/htdocs/langs/es_ES/modulebuilder.lang +++ b/htdocs/langs/es_ES/modulebuilder.lang @@ -43,6 +43,8 @@ PathToModulePackage=Ruta al zip del módulo/aplicación PathToModuleDocumentation=Ruta a la documentación del módulo/aplicación SpaceOrSpecialCharAreNotAllowed=Espacios o caracteres especiales no son permitidos. FileNotYetGenerated=Fichero todavía no generado +RegenerateClassAndSql=Borrar y regenerar archivos de clase y sql +RegenerateMissingFiles=Generar archivos no encontrados SpecificationFile=Fichero con las reglas de negocio LanguageFile=Archivo para el idioma ConfirmDeleteProperty=¿Estás seguro que quieres eliminar la propiedad %s? Esto cambiará código en la clase PHP pero también eliminará la columna de la definición de la tabla del objeto. diff --git a/htdocs/langs/es_ES/multicurrency.lang b/htdocs/langs/es_ES/multicurrency.lang index dba8d088ca5..493c5f400a5 100644 --- a/htdocs/langs/es_ES/multicurrency.lang +++ b/htdocs/langs/es_ES/multicurrency.lang @@ -7,7 +7,7 @@ multicurrency_syncronize_error=Error sincronización: %s MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE=Usar fecha del documento para encontrar la tasa de la divisa, en lugar de usar la última tasa conocida multicurrency_useOriginTx=Cuando un objeto se crea desde otro, mantenga la conversión original del objeto de origen (de lo contrario, utilice la tasa de conversión más reciente conocida) CurrencyLayerAccount=CurrencyLayer API -CurrencyLayerAccount_help_to_synchronize=Debe crear una cuenta en su sitio web para utilizar esta función.
Obtenga su clave API
Si utiliza una cuenta gratuita, no puede cambiar la divisa origen (USD por defecto)
. Pero si su divisa principal no es USD, puede usar la divisa origen alternativa para forzar su divisa principal.

Está limitado a 1000 sincronizaciones por mes +CurrencyLayerAccount_help_to_synchronize=Debe crear una cuenta en su sitio web para usar esta funcionalidad
Obtenga su Clave API
Si usa una cuenta gratuita no puede cambiar la moneda origen (por defecto USD)
Pero si su moneda principal no es USD puede usar la moneda origen alternativa para forzar su moneda principal

Estará limitado a 1000 sincronizaciones por mes multicurrency_appId=Clave API multicurrency_appCurrencySource=Divisa origen multicurrency_alternateCurrencySource=Divisa origen alternativa diff --git a/htdocs/langs/es_ES/other.lang b/htdocs/langs/es_ES/other.lang index 2646aea5291..99dfadd2d7d 100644 --- a/htdocs/langs/es_ES/other.lang +++ b/htdocs/langs/es_ES/other.lang @@ -162,9 +162,9 @@ SizeUnitinch=pulgada SizeUnitfoot=pie SizeUnitpoint=punto BugTracker=Incidencias -SendNewPasswordDesc=Este formulario le permite solicitar una nueva contraseña. Se le enviará a su dirección de e-mail.
El cambio se hará efectivo una vez que haga clic en el enlace de confirmación en el e-mail.
Compruebe su bandeja de entrada. +SendNewPasswordDesc=Este formulario le permite obtener una nueva contraseña. Le será enviada a su e-mail.
El cambio será efectivo una vez haga clic en el enlace de confirmación del e-mail.
Revise su e-mail. BackToLoginPage=Volver a la página de conexión -AuthenticationDoesNotAllowSendNewPassword=El modo de autenticación es %s.
En este modo, Dolibarr no conoce ni cambia su contraseña.
Póngase en contacto con el administrador del sistema si desea cambiar su contraseña. +AuthenticationDoesNotAllowSendNewPassword=El modo de autentificación de Dolibarr está configurado como "%s".
En este modo Dolibarr no puede conocer ni modificar su contraseña
Contacte con su administrador para conocer las modalidades de cambio. EnableGDLibraryDesc=Instale o active la libreria GD en su PHP para poder usar esta opción ProfIdShortDesc=Prof Id %s es una información dependiente del país del tercero.
Por ejemplo, para el país %s, és el código %s. DolibarrDemo=Demo de Dolibarr ERP/CRM diff --git a/htdocs/langs/es_ES/printing.lang b/htdocs/langs/es_ES/printing.lang index 352718f6cb9..f9735557d02 100644 --- a/htdocs/langs/es_ES/printing.lang +++ b/htdocs/langs/es_ES/printing.lang @@ -49,4 +49,6 @@ DirectPrintingJobsDesc=Esta página lista los trabajos encontrados en las impres GoogleAuthNotConfigured=Configuración de Google OAuth no realizada. Habilite el módulo de OAuth y establezca un Google ID / Secreto. GoogleAuthConfigured=Las credenciales OAuth de Google se encuentran en la configuración del módulo OAuth. PrintingDriverDescprintgcp=Configuración variables del driver de impresión Google Cloud Print. +PrintingDriverDescprintipp=Configuración variables para el driver de impresión Cups. PrintTestDescprintgcp=Listado de impresoras para Google Cloud Print. +PrintTestDescprintipp=Listado de Impresoras para Cups. diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index 394aa9e6be1..7234df78d8e 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -239,7 +239,7 @@ MinimumRecommendedPrice=El precio mínimo recomendado es: %s PriceExpressionEditor=Editor de expresión de precios PriceExpressionSelected=Expresión de precios seleccionada PriceExpressionEditorHelp1="price = 2 + 2" o "2 + 2" para configurar un precio. Use ; para separar expresiones -PriceExpressionEditorHelp2=Puede acceder a los atributos adicionales con variables como #extrafield_myextrafieldkey# y variables globales con #global_mycode# +PriceExpressionEditorHelp2=Puede acceder a los campos adicionales con variables como #extrafield_myextrafieldkey# y variables globales con #global_mycode# PriceExpressionEditorHelp3=En productos y servicios, y precios de proveedor están disponibles las siguientes variables
#tva_tx# #localtax1_tx# #localtax2_tx# #weight# #length# #surface# #price_min# PriceExpressionEditorHelp4=Solamente en los precios de productos y servicios: #supplier_min_price#
In supplier prices only: #supplier_quantity# and #supplier_tva_tx# PriceExpressionEditorHelp5=Valores globales disponibles: diff --git a/htdocs/langs/es_ES/users.lang b/htdocs/langs/es_ES/users.lang index daddb0fcf66..f089a880b64 100644 --- a/htdocs/langs/es_ES/users.lang +++ b/htdocs/langs/es_ES/users.lang @@ -63,7 +63,7 @@ CreateDolibarrThirdParty=Crear un tercero LoginAccountDisableInDolibarr=La cuenta está desactivada en Dolibarr UsePersonalValue=Utilizar valores personalizados InternalUser=Usuario interno -ExportDataset_user_1=Usuarios Dolibarr y atributos +ExportDataset_user_1=Usuarios Dolibarr y campos adicionales DomainUser=Usuario de dominio Reactivate=Reactivar CreateInternalUserDesc=Este formulario le permite crear un usuario interno para su empresa/asociación. Para crear un usuario externo (cliente, proveedor, etc), use el botón "Crear una cuenta de usuario" desde una ficha de un contacto del tercero. diff --git a/htdocs/langs/es_ES/website.lang b/htdocs/langs/es_ES/website.lang index 38a2155f292..14f1f3c2083 100644 --- a/htdocs/langs/es_ES/website.lang +++ b/htdocs/langs/es_ES/website.lang @@ -41,7 +41,7 @@ VirtualHostUrlNotDefined=URL del Host Virtual servido por un servidor externo no NoPageYet=No hay páginas todavía SyntaxHelp=Ayuda en la sintaxis del código YouCanEditHtmlSourceckeditor=Puede editar código fuente HTML utilizando el botón "Origen" en el editor. -YouCanEditHtmlSource=Puede editar el código fuente HTML usando el botón "Origen" en el editor. También puede incluir código PHP en esta fuente mediante etiquetas <?php ?>. Las siguientes variables globales están disponibles: $conf, $langs, $db, $mysoc, $user, $website.

También puede incluir contenido de otra Página/Contenedor con la siguiente sintaxis: <?php dolIncludeHtmlContent ($websitekey. '/contentaliastoinclude.php'); ?>

Para incluir un vínculo para descargar un archivo almacenado en el directorio de documentos/medios, utilice la sintaxis:
<a href="/document.php?modulepart=medias&file=filename.ext". +YouCanEditHtmlSource=
Puede incluir código PHP en este fuente usando los tags <?php ?>. Dispone de estas variables globales: $conf, $langs, $db, $mysoc, $user, $website.

También puede incluir contenido de otra Página/Contenedor con la siguiente sintaxis:
<?php includeContainer('alias_of_container_to_include'); ?>

Para incluir un enlace para descargar un archivo guardado en el directorio documents, use el wrapper document.php :
Por ejemplo, para un archivo de documents/ecm (es necesario estar logueado), la sintaxis:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
Para un archivo de into documents/medias (directorio abierto para acceso público), la sintaxis es:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Para un archivo compartido mediante un enlace compartido (acceso abierto utilizando la clave hash para compartir del archivo), la sintaxis es:
<a href="/document.php?hashp=publicsharekeyoffile">

Para incluir una imagen guardada en el directorio documents , use el wrapper viewimage.php :
Ejemplo para una imagen de documents/medias (acceso abierto), la sintaxis es:
<a href="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
ClonePage=Clonar página/contenedor CloneSite=Clonar sitio SiteAdded=Sitio web agregado diff --git a/htdocs/langs/es_ES/withdrawals.lang b/htdocs/langs/es_ES/withdrawals.lang index a8b25e5088e..355380794e6 100644 --- a/htdocs/langs/es_ES/withdrawals.lang +++ b/htdocs/langs/es_ES/withdrawals.lang @@ -26,7 +26,7 @@ LastWithdrawalReceipt=Las %s últimas domiciliaciones MakeWithdrawRequest=Realizar una petición de domiciliación WithdrawRequestsDone=%s domiciliaciones registradas ThirdPartyBankCode=Código banco del tercero -NoInvoiceCouldBeWithdrawed=No se ha domiciliado ninguna factura. Asegúrese de que las facturas son de empresas con los datos de cuentas bancarias correctos. +NoInvoiceCouldBeWithdrawed=No se ha podido realizar la petición de domiciliación de ninguna factura. Compruebe que los terceros de las facturas relacionadas tienen una cuenta IBAN válida y dicho IBAN tiene un RUM con modo %s. ClassCredited=Clasificar como "Abonada" ClassCreditedConfirm=¿Está seguro de querer clasificar esta domiciliación como abonada en su cuenta bancaria? TransData=Fecha envío From f2a3c83053a6fe1d126b03b7bec467add770917c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2018 18:46:52 +0100 Subject: [PATCH 081/203] Better error messages --- htdocs/comm/card.php | 7 ++++--- htdocs/societe/consumption.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 8fb590d61b4..fa2af2dc3eb 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -211,7 +211,7 @@ if ($id > 0 && empty($object->id)) { // Load data of third party $res=$object->fetch($id); - if ($object->id <= 0) dol_print_error($db,$object->error,$object->errors); + if ($object->id < 0) dol_print_error($db, $object->error, $object->errors); } $title=$langs->trans("CustomerCard"); @@ -220,7 +220,7 @@ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$title,$help_url); -if ($id > 0) +if ($object->id > 0) { $head = societe_prepare_head($object); @@ -1271,7 +1271,8 @@ if ($id > 0) } else { - dol_print_error($db,'Bad value for socid parameter'); + $langs->load("errors"); + print $langs->trans('ErrorRecordNotFound'); } // End of page diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index c9c26326426..ffb4cac77fa 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -268,7 +268,7 @@ if ($type_element == 'supplier_order') $thirdTypeSelect='supplier'; } if ($type_element == 'contract') -{ // Supplier : Show products from orders. +{ // Order require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $documentstatic=new Contrat($db); $documentstaticline=new ContratLigne($db); From b48bcc9ab88fe704751da5469e5b2bbf276f9fb7 Mon Sep 17 00:00:00 2001 From: kadogo Date: Sat, 27 Jan 2018 18:59:07 +0100 Subject: [PATCH 082/203] NEW: Add an API for fichinter We missed an API for fichinter It add list, create and create line functions --- htdocs/api/admin/explorer.php | 7 + htdocs/api/index.php | 6 + .../fichinter/class/api_fichinters.class.php | 333 ++++++++++++++++++ 3 files changed, 346 insertions(+) create mode 100644 htdocs/fichinter/class/api_fichinters.class.php diff --git a/htdocs/api/admin/explorer.php b/htdocs/api/admin/explorer.php index b09acb6772a..35b082c6d65 100644 --- a/htdocs/api/admin/explorer.php +++ b/htdocs/api/admin/explorer.php @@ -89,6 +89,13 @@ foreach ($modulesdir as $dir) } if (empty($conf->$module->enabled)) $enabled=false; + if ($module == 'ficheinter') { + $obj = 'fichinter'; + $part = 'fichinter'; + $enabled=true; + $module='fichinter'; + } + if ($enabled) { /* diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 7bb062c03df..aefe8ff495a 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -148,6 +148,11 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' | $enabled=true; if (empty($conf->$modulenameforenabled->enabled)) $enabled=false; + if ($module == 'ficheinter'){ + $enabled=true; + $moduledirforclass='fichinter'; + } + if ($enabled) { // If exists, load the API class for enable module @@ -249,6 +254,7 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json' $classfile = str_replace('_', '', $module); if ($module == 'supplierinvoices') $classfile = 'supplier_invoices'; if ($module == 'supplierorders') $classfile = 'supplier_orders'; + if ($module == 'fichinters') $moduledirforclass = 'fichinter'; $dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php'); $classname=ucwords($module); diff --git a/htdocs/fichinter/class/api_fichinters.class.php b/htdocs/fichinter/class/api_fichinters.class.php new file mode 100644 index 00000000000..2f5be83393b --- /dev/null +++ b/htdocs/fichinter/class/api_fichinters.class.php @@ -0,0 +1,333 @@ + + * Copyright (C) 2016 Laurent Destailleur + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + use Luracast\Restler\RestException; + + require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; + +/** + * API class for fichinters + * + * @access protected + * @class DolibarrApiAccess {@requires user,external} + */ +class Fichinters extends DolibarrApi +{ + + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + static $FIELDS = array( + 'socid', + 'fk_project', + 'description' + ); + + /** + * @var array $FIELDS Mandatory fields, checked when create and update object + */ + static $FIELDSLINE = array( + 'fk_fichinter', + 'description', + 'date', + 'duree' + ); + + /** + * @var fichinter $fichinter {@type fichinter} + */ + public $fichinter; + + /** + * Constructor + */ + function __construct() + { + global $db, $conf; + $this->db = $db; + $this->fichinter = new Fichinter($this->db); + } + + /** + * List fichinters + * + * Get a list of fichinters + * + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @param int $limit Limit for list + * @param int $page Page number + * @param string $thirdparty_ids Thirdparty ids to filter orders of. {@example '1' or '1,2,3'} {@pattern /^[0-9,]*$/i} + * @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + * @return array Array of order objects + * + * @throws RestException + */ + function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') { + global $db, $conf; + + $obj_ret = array(); + + // case of external user, $thirdparty_ids param is ignored and replaced by user's socid + $socids = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : $thirdparty_ids; + + // If the internal user must only see his customers, force searching by him + $search_sale = 0; + if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) $search_sale = DolibarrApiAccess::$user->id; + + $sql = "SELECT t.rowid"; + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) + $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as t"; + + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale + + $sql.= ' WHERE t.entity IN ('.getEntity('fichinter').')'; + if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; + if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; + if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale + // Insert sale filter + if ($search_sale > 0) + { + $sql .= " AND sc.fk_user = ".$search_sale; + } + // Add sql filters + if ($sqlfilters) + { + if (! DolibarrApi::_checkFilters($sqlfilters)) + { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$sqlfilters); + } + $regexstring='\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql.=" AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")"; + } + + $sql.= $db->order($sortfield, $sortorder); + if ($limit) { + if ($page < 0) + { + $page = 0; + } + $offset = $limit * $page; + + $sql.= $db->plimit($limit + 1, $offset); + } + + dol_syslog("API Rest request"); + $result = $db->query($sql); + + if ($result) + { + $num = $db->num_rows($result); + $min = min($num, ($limit <= 0 ? $num : $limit)); + while ($i < $min) + { + $obj = $db->fetch_object($result); + $fichinter_static = new Fichinter($db); + if($fichinter_static->fetch($obj->rowid)) { + $obj_ret[] = $fichinter_static; + } + $i++; + } + } + else { + throw new RestException(503, 'Error when retrieve fichinter list : '.$db->lasterror()); + } + if( ! count($obj_ret)) { + throw new RestException(404, 'No finchinter found'); + } + return $obj_ret; + } + + /** + * Create fichinter object + * + * @param array $request_data Request data + * @return int ID of fichinter + */ + function post($request_data = NULL) + { + if(! DolibarrApiAccess::$user->rights->ficheinter->creer) { + throw new RestException(401, "Insuffisant rights"); + } + // Check mandatory fields + $result = $this->_validate($request_data); + foreach($request_data as $field => $value) { + $this->fichinter->$field = $value; + } + + if ($this->fichinter->create(DolibarrApiAccess::$user) < 0) { + throw new RestException(500, "Error creating fichinter", array_merge(array($this->fichinter->error), $this->fichinter->errors)); + } + + return $this->fichinter->id; + } + + /** + * Create fichinter line object + * + * @param array $request_data Request data + * + * @url POST /line + * + * @return boolean Create line fichinter work + */ + function postLine($request_data = NULL) + { + if(! DolibarrApiAccess::$user->rights->ficheinter->creer) { + throw new RestException(401, "Insuffisant rights"); + } + // Check mandatory fields + $result = $this->_validateLine($request_data); + + foreach($request_data as $field => $value) { + $this->fichinter->$field = $value; + } + + if( ! $result ) { + throw new RestException(404, 'Fichinter not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('fichinter',$this->fichinter->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + if ($this->fichinter->addLine( + DolibarrApiAccess::$user, + $this->fichinter->fk_fichinter, + $this->fichinter->description, + $this->fichinter->date, + $this->fichinter->duree) < 0) { + throw new RestException(500, "Error creating fichinter line", array_merge(array($this->fichinter->error), $this->fichinter->errors)); + } + + return $this->fichinter; + } + + /** + * Validate a fichinter + * + * @param int $id fichinter ID + * + * @url POST validate + * + * @return array + * + */ + function validFichinter($id) + { + if(! DolibarrApiAccess::$user->rights->ficheinter->creer) { + throw new RestException(401, "Insuffisant rights"); + } + $result = $this->fichinter->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Fichinter not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('fichinter',$this->fichinter->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + if( ! $this->fichinter->setValid(DolibarrApiAccess::$user)) { + throw new RestException(500, 'Error when validate fichinter'); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Fichinter validated' + ) + ); + } + + /** + * Close a fichinter + * + * @param int $id fichinter ID + * + * @url POST close + * + * @return array + * + */ + + function closeFichinter($id) + { + if(! DolibarrApiAccess::$user->rights->ficheinter->creer) { + throw new RestException(401, "Insuffisant rights"); + } + $result = $this->fichinter->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Fichinter not found'); + } + + if( ! DolibarrApi::_checkAccessToResource('fichinter',$this->fichinter->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + + if(! $this->fichinter->setStatut(3) ) { + throw new RestException(500, 'Error when closed fichinter'); + } + + return array( + 'success' => array( + 'code' => 200, + 'message' => 'Fichinter closed' + ) + ); + } + + /** + * Validate fields before create or update object + * + * @param array $data Data to validate + * @return array + * + * @throws RestException + */ + function _validate($data) + { + $fichinter = array(); + foreach (Fichinters::$FIELDS as $field) { + if (!isset($data[$field])) + throw new RestException(400, "$field field missing"); + $fichinter[$field] = $data[$field]; + } + return $fichinter; + } + + /** + * Validate fields before create or update object + * + * @param array $data Data to validate + * @return array + * + * @throws RestException + */ + function _validateLine($data) + { + $fichinter = array(); + foreach (Fichinters::$FIELDSLINE as $field) { + if (!isset($data[$field])) + throw new RestException(400, "$field field missing"); + $fichinter[$field] = $data[$field]; + } + return $fichinter; + } + + +} From f1cd905bf174dede00914b62f34701068d007e8f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2018 19:29:57 +0100 Subject: [PATCH 083/203] Fix var not initialized --- htdocs/core/class/extrafields.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 3a3181e14a5..226d367140b 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -111,6 +111,9 @@ class ExtraFields { $this->db = $db; $this->error = array(); + $this->attributes = array(); + + // For old usage $this->attribute_elementtype = array(); $this->attribute_type = array(); $this->attribute_label = array(); From ba58578d602796643c7612c34d3c38a6992f57fb Mon Sep 17 00:00:00 2001 From: kadogo Date: Sat, 27 Jan 2018 19:31:48 +0100 Subject: [PATCH 084/203] FIX: Global on $user parameter reset the variable When we use the fichinter API with global, the $user object is reset If global is not applied on $user we can retrieve the informations from it --- htdocs/fichinter/class/fichinter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 70192c460d2..fb2359092a0 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -140,7 +140,7 @@ class Fichinter extends CommonObject */ function create($user, $notrigger=0) { - global $conf, $user, $langs; + global $conf, $langs; dol_syslog(get_class($this)."::create ref=".$this->ref); From 7a2992bc4b29f311fb9a54f69bb7298e4f7adb84 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2018 19:35:30 +0100 Subject: [PATCH 085/203] Fix var serialized twice --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 226d367140b..bc37c428bb6 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -311,7 +311,7 @@ class ExtraFields { if(is_array($param) && count($param) > 0) { - $params = $this->db->escape(serialize($param)); + $params = serialize($param); } elseif (strlen($param) > 0) { From bee64962fe95ede645af09f60650a1c68231ded6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 23:29:49 +0100 Subject: [PATCH 086/203] Fix css --- htdocs/core/lib/functions.lib.php | 7 ++++--- htdocs/index.php | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bd7fa7b6fd4..cedbbfbbc58 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3357,18 +3357,19 @@ function img_searchclear($titlealt = 'default', $other = '') * @param integer $infoonimgalt Info is shown only on alt of star picto, otherwise it is show on output after the star picto * @param int $nodiv No div * @param string $admin '1'=Info for admin users. '0'=Info for standard users (change only the look), 'xxx'=Other + * @param string $morecss More CSS * @return string String with info text */ -function info_admin($text, $infoonimgalt = 0, $nodiv=0, $admin='1') +function info_admin($text, $infoonimgalt = 0, $nodiv=0, $admin='1', $morecss='') { global $conf, $langs; if ($infoonimgalt) { - return img_picto($text, 'info', 'class="hideonsmartphone"'); + return img_picto($text, 'info', 'class="hideonsmartphone'.($morecss?' '.$morecss:'').'"'); } - return ($nodiv?'':'
').' '.$text.($nodiv?'':'
'); + return ($nodiv?'':'
').' '.$text.($nodiv?'':'
'); } diff --git a/htdocs/index.php b/htdocs/index.php index 867f305a680..b01e37927c4 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -656,7 +656,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { $langs->load("errors"); //if (! empty($message)) $message.='
'; - $message.=info_admin($langs->trans("WarningLockFileDoesNotExists",DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); + $message.=info_admin($langs->trans("WarningLockFileDoesNotExists",DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } // Conf files must be in read only mode @@ -665,7 +665,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) $langs->load("errors"); //$langs->load("other"); //if (! empty($message)) $message.='
'; - $message.=info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install")); + $message.=info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } if ($message) From a63930860133ba904f23595f7f0e007a27c02f30 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2018 23:54:45 +0100 Subject: [PATCH 087/203] Fix css --- htdocs/admin/dict.php | 8 ++++---- htdocs/blockedlog/admin/blockedlog_list.php | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index a1fc7c87d68..438c7cd5227 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -187,7 +187,7 @@ $tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAI $tabsql[10]= "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $tabsql[12]= "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = " . getEntity($tabname[12]); -$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.accountancy_code, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = " . getEntity($tabname[13]); +$tabsql[13]= "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = " . getEntity($tabname[13]); $tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1"; $tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16]= "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; @@ -265,7 +265,7 @@ $tabfield[9] = "code,label,unicode"; $tabfield[10]= "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11]= "element,source,code,libelle,position"; $tabfield[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity"; -$tabfield[13]= "code,libelle,type,accountancy_code,entity"; +$tabfield[13]= "code,libelle,type,entity"; $tabfield[14]= "code,libelle,price,organization,country_id,country"; $tabfield[15]= "code,libelle,width,height,unit"; $tabfield[16]= "code,libelle,sortorder"; @@ -304,7 +304,7 @@ $tabfieldvalue[9] = "code,label,unicode"; $tabfieldvalue[10]= "country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldvalue[11]= "element,source,code,libelle,position"; $tabfieldvalue[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder"; -$tabfieldvalue[13]= "code,libelle,type,accountancy_code"; +$tabfieldvalue[13]= "code,libelle,type"; $tabfieldvalue[14]= "code,libelle,price,organization,country"; $tabfieldvalue[15]= "code,libelle,width,height,unit"; $tabfieldvalue[16]= "code,libelle,sortorder"; @@ -343,7 +343,7 @@ $tabfieldinsert[9] = "code_iso,label,unicode"; $tabfieldinsert[10]= "fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[11]= "element,source,code,libelle,position"; $tabfieldinsert[12]= "code,libelle,libelle_facture,nbjour,type_cdr,decalage,sortorder,entity"; -$tabfieldinsert[13]= "code,libelle,type,accountancy_code,entity"; +$tabfieldinsert[13]= "code,libelle,type,entity"; $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays"; $tabfieldinsert[15]= "code,label,width,height,unit"; $tabfieldinsert[16]= "code,label,sortorder"; diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 633f84b6582..08b384d7ac5 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -359,7 +359,8 @@ print ''; // User print '
'; // Actions code From 7dcb3bf6fcaa93a107335ce489b7ae4b9a7a2fd1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2018 19:29:57 +0100 Subject: [PATCH 088/203] Fix var not initialized --- htdocs/core/class/extrafields.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c7b2d394a4b..3c24b304184 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -111,6 +111,9 @@ class ExtraFields { $this->db = $db; $this->error = array(); + $this->attributes = array(); + + // For old usage $this->attribute_elementtype = array(); $this->attribute_type = array(); $this->attribute_label = array(); From 65c71172405f7fc0c29646dbe2de2ac6b7581f61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Jan 2018 19:35:30 +0100 Subject: [PATCH 089/203] Fix var serialized twice --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 3c24b304184..577dd57b566 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -311,7 +311,7 @@ class ExtraFields { if(is_array($param) && count($param) > 0) { - $params = $this->db->escape(serialize($param)); + $params = serialize($param); } elseif (strlen($param) > 0) { From 97c2828d04cd808c3116011ae690737e8f8beaa9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jan 2018 10:57:01 +0100 Subject: [PATCH 090/203] Fix install.lock not always saved --- htdocs/install/step5.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 91c517f9644..5181c35f2f9 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -345,7 +345,8 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action)) // Create lock file // If first install -if ($action == "set" && $success) { +if ($action == "set" && $success) +{ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { // Install is finished @@ -353,14 +354,14 @@ if ($action == "set" && $success) { $createlock=0; - if (! empty($force_install_lockinstall)) + if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Install is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; $fp = @fopen($lockfile, "w"); if ($fp) { - if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility + if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")"); fclose($fp); @chmod($lockfile, octdec($force_install_lockinstall)); @@ -403,14 +404,14 @@ elseif (empty($action) || preg_match('/upgrade/i',$action)) $createlock=0; - if (! empty($force_install_lockinstall)) + if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Upgrade is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; $fp = @fopen($lockfile, "w"); if ($fp) { - if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility + if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")"); fclose($fp); @chmod($lockfile, octdec($force_install_lockinstall)); From cebda2b141ee3c5c5eb694911cdbeb93640d17a9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jan 2018 10:57:12 +0100 Subject: [PATCH 091/203] Prepare 8.0 --- htdocs/install/check.php | 11 ++++++----- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 50409fb55e5..8262a5f05df 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -421,11 +421,12 @@ else array('from'=>'3.5.0', 'to'=>'3.6.0'), array('from'=>'3.6.0', 'to'=>'3.7.0'), array('from'=>'3.7.0', 'to'=>'3.8.0'), - array('from'=>'3.8.0', 'to'=>'3.9.0'), - array('from'=>'3.9.0', 'to'=>'4.0.0'), - array('from'=>'4.0.0', 'to'=>'5.0.0'), - array('from'=>'5.0.0', 'to'=>'6.0.0'), - array('from'=>'6.0.0', 'to'=>'7.0.0') + array('from'=>'3.8.0', 'to'=>'3.9.0'), + array('from'=>'3.9.0', 'to'=>'4.0.0'), + array('from'=>'4.0.0', 'to'=>'5.0.0'), + array('from'=>'5.0.0', 'to'=>'6.0.0'), + array('from'=>'6.0.0', 'to'=>'7.0.0'), + array('from'=>'7.0.0', 'to'=>'8.0.0') ); $count=0; diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index e9a72ab9360..1b9375ef1a8 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -23,4 +23,4 @@ -- Note: fields with type BLOB/TEXT can't have default value. -- For 8.0 -ALTER TABLE llx_societe ADD COLUMN fk_entrepot int DEFAULT 0; +ALTER TABLE llx_societe ADD COLUMN fk_entrepot integer DEFAULT 0; From a87ecc14eca0d50884b05df68f5d5bcfae56541a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Jan 2018 10:57:01 +0100 Subject: [PATCH 092/203] Fix install.lock not always saved --- htdocs/install/step5.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 8a39faf526a..b7d320aab59 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -342,7 +342,8 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action)) // Create lock file // If first install -if ($action == "set" && $success) { +if ($action == "set" && $success) +{ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) { // Install is finished @@ -350,14 +351,14 @@ if ($action == "set" && $success) { $createlock=0; - if (! empty($force_install_lockinstall)) + if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Install is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; $fp = @fopen($lockfile, "w"); if ($fp) { - if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility + if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")"); fclose($fp); @chmod($lockfile, octdec($force_install_lockinstall)); @@ -400,14 +401,14 @@ elseif (empty($action) || preg_match('/upgrade/i',$action)) $createlock=0; - if (! empty($force_install_lockinstall)) + if (! empty($force_install_lockinstall) || ! empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE)) { // Upgrade is finished, we create the lock file $lockfile=DOL_DATA_ROOT.'/install.lock'; $fp = @fopen($lockfile, "w"); if ($fp) { - if ($force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility + if (empty($force_install_lockinstall) || $force_install_lockinstall == 1) $force_install_lockinstall=444; // For backward compatibility fwrite($fp, "This is a lock file to prevent use of install pages (set with permission ".$force_install_lockinstall.")"); fclose($fp); @chmod($lockfile, octdec($force_install_lockinstall)); From 857c03eeb94d7315d7213a30911df58f667dd06d Mon Sep 17 00:00:00 2001 From: De Coninck Laurent Date: Sun, 28 Jan 2018 20:55:03 +0100 Subject: [PATCH 093/203] fix issue on Big book --- htdocs/accountancy/bookkeeping/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 8ecf04fdbc8..0e0066e3702 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -99,7 +99,7 @@ $form = new Form($db); if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page','int') == '' && ! GETPOST('noreset','int')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; - $query.= " where date_start < '".$this->idate(dol_now())."' and date_end > '".$this->idate(dol_now())."' limit 1"; + $query.= " where date_start < '".idate(dol_now())."' and date_end > '".idate(dol_now())."' limit 1"; $res = $db->query($query); if ($res->num_rows > 0) { $fiscalYear = $db->fetch_object($res); From 9825586d41256e4b529a3d809ea3c21e0e5fa441 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Jan 2018 11:12:56 +0100 Subject: [PATCH 094/203] Fix css --- htdocs/public/paybox/newpayment.php | 10 +++++----- htdocs/public/payment/newpayment.php | 10 +++++----- htdocs/public/paypal/newpayment.php | 10 +++++----- htdocs/public/stripe/newpayment.php | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index c386dc7e84e..eb90814eb7b 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -321,7 +321,7 @@ if (! GETPOST("source") && $valid) // Tag print ''."\n"; @@ -407,7 +407,7 @@ if (GETPOST("source") == 'order' && $valid) // Tag print ''."\n"; @@ -495,7 +495,7 @@ if (GETPOST("source") == 'invoice' && $valid) // Tag print ''."\n"; @@ -671,7 +671,7 @@ if (GETPOST("source") == 'contractline' && $valid) // Tag print ''."\n"; @@ -784,7 +784,7 @@ if (GETPOST("source") == 'membersubscription' && $valid) // Tag print ''."\n"; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 3f2c2979e00..fd1389ba8cb 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -661,7 +661,7 @@ if (! $source) // Tag print ''."\n"; @@ -752,7 +752,7 @@ if ($source == 'order') // Tag print ''."\n"; @@ -877,7 +877,7 @@ if ($source == 'invoice') // Tag print ''."\n"; @@ -1093,7 +1093,7 @@ if ($source == 'contractline') // Tag print ''."\n"; @@ -1252,7 +1252,7 @@ if ($source == 'membersubscription') // Tag print ''."\n"; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 2bb58e4b676..27024d48de1 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -404,7 +404,7 @@ if (! GETPOST("source")) // Tag print ''."\n"; @@ -490,7 +490,7 @@ if (GETPOST("source") == 'order') // Tag print ''."\n"; @@ -600,7 +600,7 @@ if (GETPOST("source") == 'invoice') // Tag print ''."\n"; @@ -798,7 +798,7 @@ if (GETPOST("source") == 'contractline') // Tag print ''."\n"; @@ -937,7 +937,7 @@ if (GETPOST("source") == 'membersubscription') // Tag print ''."\n"; diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index 38d81f7e991..dfd0425bb26 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -470,7 +470,7 @@ if (! GETPOST("source")) // Tag print ''."\n"; @@ -556,7 +556,7 @@ if (GETPOST("source") == 'order') // Tag print ''."\n"; @@ -667,7 +667,7 @@ if (GETPOST("source") == 'invoice') // Tag print ''."\n"; @@ -867,7 +867,7 @@ if (GETPOST("source") == 'contractline') // Tag print ''."\n"; @@ -1006,7 +1006,7 @@ if (GETPOST("source") == 'membersubscription') // Tag print ''."\n"; From c41374220e71f22cda43b4f019cb9d1cbdc1121f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Jan 2018 11:12:56 +0100 Subject: [PATCH 095/203] Fix css --- htdocs/public/paybox/newpayment.php | 10 +++++----- htdocs/public/payment/newpayment.php | 10 +++++----- htdocs/public/paypal/newpayment.php | 10 +++++----- htdocs/public/stripe/newpayment.php | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index c386dc7e84e..eb90814eb7b 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -321,7 +321,7 @@ if (! GETPOST("source") && $valid) // Tag print ''."\n"; @@ -407,7 +407,7 @@ if (GETPOST("source") == 'order' && $valid) // Tag print ''."\n"; @@ -495,7 +495,7 @@ if (GETPOST("source") == 'invoice' && $valid) // Tag print ''."\n"; @@ -671,7 +671,7 @@ if (GETPOST("source") == 'contractline' && $valid) // Tag print ''."\n"; @@ -784,7 +784,7 @@ if (GETPOST("source") == 'membersubscription' && $valid) // Tag print ''."\n"; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 3f2c2979e00..fd1389ba8cb 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -661,7 +661,7 @@ if (! $source) // Tag print ''."\n"; @@ -752,7 +752,7 @@ if ($source == 'order') // Tag print ''."\n"; @@ -877,7 +877,7 @@ if ($source == 'invoice') // Tag print ''."\n"; @@ -1093,7 +1093,7 @@ if ($source == 'contractline') // Tag print ''."\n"; @@ -1252,7 +1252,7 @@ if ($source == 'membersubscription') // Tag print ''."\n"; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 2bb58e4b676..27024d48de1 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -404,7 +404,7 @@ if (! GETPOST("source")) // Tag print ''."\n"; @@ -490,7 +490,7 @@ if (GETPOST("source") == 'order') // Tag print ''."\n"; @@ -600,7 +600,7 @@ if (GETPOST("source") == 'invoice') // Tag print ''."\n"; @@ -798,7 +798,7 @@ if (GETPOST("source") == 'contractline') // Tag print ''."\n"; @@ -937,7 +937,7 @@ if (GETPOST("source") == 'membersubscription') // Tag print ''."\n"; diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index 38d81f7e991..dfd0425bb26 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -470,7 +470,7 @@ if (! GETPOST("source")) // Tag print ''."\n"; @@ -556,7 +556,7 @@ if (GETPOST("source") == 'order') // Tag print ''."\n"; @@ -667,7 +667,7 @@ if (GETPOST("source") == 'invoice') // Tag print ''."\n"; @@ -867,7 +867,7 @@ if (GETPOST("source") == 'contractline') // Tag print ''."\n"; @@ -1006,7 +1006,7 @@ if (GETPOST("source") == 'membersubscription') // Tag print ''."\n"; From 97da464343be809e06952e5745c544b52d0721d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Jan 2018 11:21:40 +0100 Subject: [PATCH 096/203] Fix price in member public form --- htdocs/public/paybox/newpayment.php | 2 +- htdocs/public/payment/newpayment.php | 2 +- htdocs/public/paypal/newpayment.php | 2 +- htdocs/public/stripe/newpayment.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index eb90814eb7b..9d7f79081a9 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -767,7 +767,7 @@ if (GETPOST("source") == 'membersubscription' && $valid) $valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; - print ''; + print ''; } else { $valtoshow=$amount; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index fd1389ba8cb..efeb1323a3d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1235,7 +1235,7 @@ if ($source == 'membersubscription') //$valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; - print ''; + print ''; } else { $valtoshow=$amount; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 27024d48de1..fac192bd318 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -920,7 +920,7 @@ if (GETPOST("source") == 'membersubscription') $valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; - print ''; + print ''; } else { $valtoshow=$amount; diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index dfd0425bb26..36b27658ee0 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -989,7 +989,7 @@ if (GETPOST("source") == 'membersubscription') $valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; - print ''; + print ''; } else { $valtoshow=$amount; From 716d44a610a221ce15332c48a5f170a3d00d0ddc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Jan 2018 11:21:40 +0100 Subject: [PATCH 097/203] Fix price in member public form --- htdocs/public/paybox/newpayment.php | 2 +- htdocs/public/payment/newpayment.php | 2 +- htdocs/public/paypal/newpayment.php | 2 +- htdocs/public/stripe/newpayment.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index eb90814eb7b..9d7f79081a9 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -767,7 +767,7 @@ if (GETPOST("source") == 'membersubscription' && $valid) $valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; - print ''; + print ''; } else { $valtoshow=$amount; diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index fd1389ba8cb..efeb1323a3d 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1235,7 +1235,7 @@ if ($source == 'membersubscription') //$valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; - print ''; + print ''; } else { $valtoshow=$amount; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 27024d48de1..fac192bd318 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -920,7 +920,7 @@ if (GETPOST("source") == 'membersubscription') $valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; - print ''; + print ''; } else { $valtoshow=$amount; diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php index dfd0425bb26..36b27658ee0 100644 --- a/htdocs/public/stripe/newpayment.php +++ b/htdocs/public/stripe/newpayment.php @@ -989,7 +989,7 @@ if (GETPOST("source") == 'membersubscription') $valtoshow=GETPOST("newamount",'int'); if (! empty($conf->global->MEMBER_MIN_AMOUNT) && $valtoshow) $valtoshow=max($conf->global->MEMBER_MIN_AMOUNT,$valtoshow); print ''; - print ''; + print ''; } else { $valtoshow=$amount; From 3c4ed55179c8b42bdf09e756cbc03dfca84112c2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Jan 2018 11:32:56 +0100 Subject: [PATCH 098/203] Fix css --- htdocs/public/paybox/newpayment.php | 4 ++-- htdocs/public/payment/newpayment.php | 2 +- htdocs/public/paypal/newpayment.php | 4 ++-- htdocs/public/stripe/newpayment.php | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index 9d7f79081a9..1cba4d909a3 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -275,7 +275,7 @@ print $text; // Output payment summary form print '