diff --git a/ChangeLog b/ChangeLog
index c477a17d684..66bccd31c06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,16 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
+***** ChangeLog for 15.0.0 compared to 14.0.0 *****
+
+For developers:
+---------------
+
+WARNING:
+
+Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
+* Update hook 'printOriginObjectLine', removed check on product type and special code. Need now reshook.
+
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
For users:
diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php
index f03bfc6a5ec..d50476528cb 100644
--- a/htdocs/admin/pdf_other.php
+++ b/htdocs/admin/pdf_other.php
@@ -53,7 +53,15 @@ if ($cancel) {
}
if ($action == 'update') {
- if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
+ if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) {
+ dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity);
+ }
+ if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTMODE')) {
+ dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTMODE", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTMODE"), 'chaine', 0, '', $conf->entity);
+ }
+ if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) {
+ dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
+ }
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
@@ -105,6 +113,26 @@ if ($conf->use_javascript_ajax) {
}
print '';
+print '
| '.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTTERM");
+print ' | ';
+if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTTERM');
+} else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTTERM", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM);
+}
+print ' |
';
+
+print '| '.$langs->trans("PROPOSAL_PDF_HIDE_PAYMENTMODE");
+print ' | ';
+if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('PROPOSAL_PDF_HIDE_PAYMENTMODE');
+} else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("PROPOSAL_PDF_HIDE_PAYMENTMODE", $arrval, $conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE);
+}
+print ' |
';
+
/*
print '| '.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").' | ';
if ($conf->use_javascript_ajax) {
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 7e781e6c2eb..7f26c83a727 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -4811,13 +4811,18 @@ abstract class CommonObject
if (!empty($this->lines)) {
foreach ($this->lines as $line) {
- if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) {
+ $reshook = 0;
+ //if (is_object($hookmanager) && (($line->product_type == 9 && !empty($line->special_code)) || !empty($line->fk_parent_line))) {
+ if (is_object($hookmanager)) { // Old code is commented on preceding line.
if (empty($line->fk_parent_line)) {
- $parameters = array('line'=>$line, 'i'=>$i);
- $action = '';
- $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines);
+ $reshook = $hookmanager->executeHooks('printOriginObjectLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ } else {
+ $parameters = array('line'=>$line, 'i'=>$i, 'restrictlist'=>$restrictlist, 'selectedLines'=> $selectedLines, 'fk_parent_line'=>$line->fk_parent_line);
+ $reshook = $hookmanager->executeHooks('printOriginObjectSubLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
}
- } else {
+ }
+ if (empty($reshook)) {
$this->printOriginLine($line, '', $restrictlist, '/core/tpl', $selectedLines);
}
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index db435d13c96..5c29d9a31a0 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1995,6 +1995,8 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF
MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF
MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF
MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add picture on proposal line
+PROPOSAL_PDF_HIDE_PAYMENTTERM=Hide payments conditions
+PROPOSAL_PDF_HIDE_PAYMENTMODE=Hide payment mode
MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING=Add electronic sign in PDF
NothingToSetup=There is no specific setup required for this module.
SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups
|