diff --git a/ChangeLog b/ChangeLog index e45d746e4da..900dff4a9ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ Following changes may create regressions for some external modules, but were nec * Deprecated property libelle removed from entrepot class. * The type 'text' in ->fields property dos not accept html content anymore. Use the type 'html' for that. * The module for WebService SOAP API have been deprecated. Use instead the Webservice REST API module. +* The method htmlPrintOnlinePaymentFooter() used for public footer pages has been renamed into htmlPrintOnlineFooter() and moved into company.lib.php + ***** ChangeLog for 17.0.1 compared to 17.0.0 ***** diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 04874dd9d90..29b8a15564d 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2297,3 +2297,109 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj) return ''; } } + + + +/** + * Show footer of company in HTML pages + * + * @param Societe $fromcompany Third party + * @param Translate $langs Output language + * @param int $addformmessage Add the payment form message + * @param string $suffix Suffix to use on constants + * @param Object $object Object related to payment + * @return void + */ +function htmlPrintOnlineFooter($fromcompany, $langs, $addformmessage = 0, $suffix = '', $object = null) +{ + global $conf; + + $reg = array(); + + // Juridical status + $line1 = ""; + if ($fromcompany->forme_juridique_code) { + $line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel($fromcompany->forme_juridique_code); + } + // Capital + if ($fromcompany->capital) { + $line1 .= ($line1 ? " - " : "").$langs->transnoentities("CapitalOf", $fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency); + } + // Prof Id 1 + if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) { + $field = $langs->transcountrynoentities("ProfId1", $fromcompany->country_code); + if (preg_match('/\((.*)\)/i', $field, $reg)) { + $field = $reg[1]; + } + $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof1; + } + // Prof Id 2 + if ($fromcompany->idprof2) { + $field = $langs->transcountrynoentities("ProfId2", $fromcompany->country_code); + if (preg_match('/\((.*)\)/i', $field, $reg)) { + $field = $reg[1]; + } + $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof2; + } + + // Second line of company infos + $line2 = ""; + // Prof Id 3 + if ($fromcompany->idprof3) { + $field = $langs->transcountrynoentities("ProfId3", $fromcompany->country_code); + if (preg_match('/\((.*)\)/i', $field, $reg)) { + $field = $reg[1]; + } + $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof3; + } + // Prof Id 4 + if ($fromcompany->idprof4) { + $field = $langs->transcountrynoentities("ProfId4", $fromcompany->country_code); + if (preg_match('/\((.*)\)/i', $field, $reg)) { + $field = $reg[1]; + } + $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof4; + } + // IntraCommunautary VAT + if ($fromcompany->tva_intra != '') { + $line2 .= ($line2 ? " - " : "").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra; + } + + print ''."\n"; + + print ''."\n"; +} diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 2a5b8a182eb..ef89c65bdf1 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -417,109 +417,3 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag return $out; } - - - -/** - * Show footer of company in HTML pages - * - * @param Societe $fromcompany Third party - * @param Translate $langs Output language - * @param int $addformmessage Add the payment form message - * @param string $suffix Suffix to use on constants - * @param Object $object Object related to payment - * @return void - */ -function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, $suffix = '', $object = null) -{ - global $conf; - - $reg = array(); - - // Juridical status - $line1 = ""; - if ($fromcompany->forme_juridique_code) { - $line1 .= ($line1 ? " - " : "").getFormeJuridiqueLabel($fromcompany->forme_juridique_code); - } - // Capital - if ($fromcompany->capital) { - $line1 .= ($line1 ? " - " : "").$langs->transnoentities("CapitalOf", $fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency); - } - // Prof Id 1 - if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) { - $field = $langs->transcountrynoentities("ProfId1", $fromcompany->country_code); - if (preg_match('/\((.*)\)/i', $field, $reg)) { - $field = $reg[1]; - } - $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof1; - } - // Prof Id 2 - if ($fromcompany->idprof2) { - $field = $langs->transcountrynoentities("ProfId2", $fromcompany->country_code); - if (preg_match('/\((.*)\)/i', $field, $reg)) { - $field = $reg[1]; - } - $line1 .= ($line1 ? " - " : "").$field.": ".$fromcompany->idprof2; - } - - // Second line of company infos - $line2 = ""; - // Prof Id 3 - if ($fromcompany->idprof3) { - $field = $langs->transcountrynoentities("ProfId3", $fromcompany->country_code); - if (preg_match('/\((.*)\)/i', $field, $reg)) { - $field = $reg[1]; - } - $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof3; - } - // Prof Id 4 - if ($fromcompany->idprof4) { - $field = $langs->transcountrynoentities("ProfId4", $fromcompany->country_code); - if (preg_match('/\((.*)\)/i', $field, $reg)) { - $field = $reg[1]; - } - $line2 .= ($line2 ? " - " : "").$field.": ".$fromcompany->idprof4; - } - // IntraCommunautary VAT - if ($fromcompany->tva_intra != '') { - $line2 .= ($line2 ? " - " : "").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra; - } - - print ''."\n"; - - print ''."\n"; -} diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index 043e0e8d021..d87d231d599 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -167,7 +167,7 @@ print $langs->trans("SubscriptionOk"); print "\n\n"; -htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix); +htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix); // Clean session variables to avoid duplicate actions if post is resent diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 03cae42c094..d05ad3558c5 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -650,7 +650,7 @@ print ''."\n"; print '
'; -htmlPrintOnlinePaymentFooter($mysoc, $langs); +htmlPrintOnlineFooter($mysoc, $langs); llxFooter('', 'public'); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 17474adddf8..f6b5b03aac2 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2678,7 +2678,7 @@ if (preg_match('/^dopayment/', $action)) { // If we choosed/click on the payme } } -htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); +htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $object); llxFooter('', 'public'); diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 4174267a769..627a9e1ff5e 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -286,7 +286,7 @@ if ($type || $tag) { print "\n\n"; -htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix); +htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix); llxFooter('', 'public'); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index cb9eaab2863..f34aced8c16 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1799,7 +1799,7 @@ print "\n\n"; print "\n"; -htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix); +htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix); // Clean session variables to avoid duplicate actions if post is resent diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ef3f1d1dab0..8cefe20909b 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -251,7 +251,7 @@ print ''."\n"; print '
'; -htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); +htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $object); llxFooter('', 'public'); diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 5659fd00dfd..c4d840afbfc 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -294,7 +294,7 @@ print ''."\n"; $object = null; -htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); +htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $object); llxFooter('', 'public'); diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 4f82139656c..7fa61c93cf7 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/public/recruitment/view.php + * \file htdocs/public/recruitment/index.php * \ingroup recruitment * \brief Public file to show on job */ @@ -302,7 +302,7 @@ print ''."\n"; print '
'; -htmlPrintOnlinePaymentFooter($mysoc, $langs); +htmlPrintOnlineFooter($mysoc, $langs); llxFooter('', 'public'); diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index 3626693ce89..0f7f7933e58 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -350,7 +350,7 @@ print ''."\n"; print '
'; -htmlPrintOnlinePaymentFooter($mysoc, $langs); +htmlPrintOnlineFooter($mysoc, $langs); llxFooter('', 'public'); diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 2bb574def50..68cd4eb87d6 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -545,7 +545,7 @@ if ($action != "infos_success") { print ''; // End of page -htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); +htmlPrintOnlineFooter($mysoc, $langs, 1, $suffix, $object); llxFooter('', 'public'); diff --git a/htdocs/public/ticket/index.php b/htdocs/public/ticket/index.php index a36a0023324..f97bdd15966 100644 --- a/htdocs/public/ticket/index.php +++ b/htdocs/public/ticket/index.php @@ -94,7 +94,7 @@ print ''; print ''; // End of page -htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object); +htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); llxFooter('', 'public'); diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index 8e56d57e871..f7ad050df96 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -758,7 +758,7 @@ if ($action == "view_ticketlist") { } // End of page -htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object); +htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); llxFooter('', 'public'); diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index b8f5b48fbac..3364a3b7850 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -425,7 +425,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a print ""; // End of page -htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object); +htmlPrintOnlineFooter($mysoc, $langs, 0, $suffix, $object); llxFooter('', 'public');