Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/core/class/doleditor.class.php
This commit is contained in:
Laurent Destailleur 2022-03-03 00:16:55 +01:00
commit 9bda7ba8c7
9 changed files with 89 additions and 23 deletions

View File

@ -682,13 +682,13 @@ if ($action == 'export_file') {
'name' => 'notifiedexportdate', 'name' => 'notifiedexportdate',
'type' => 'checkbox', 'type' => 'checkbox',
'label' => $langs->trans('NotifiedExportDate'), 'label' => $langs->trans('NotifiedExportDate'),
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'), 'value' => (empty($conf->global->ACCOUNTING_DEFAULT_NOTIFIED_EXPORT_DATE) ? false : true),
); );
$form_question['notifiedvalidationdate'] = array( $form_question['notifiedvalidationdate'] = array(
'name' => 'notifiedvalidationdate', 'name' => 'notifiedvalidationdate',
'type' => 'checkbox', 'type' => 'checkbox',
'label' => $langs->trans('NotifiedValidationDate'), 'label' => $langs->trans('NotifiedValidationDate'),
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'), 'value' => (empty($conf->global->ACCOUNTING_DEFAULT_NOTIFIED_VALIDATION_DATE) ? false : true),
); );
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);

View File

@ -13,7 +13,6 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/ */
/** /**

View File

@ -406,7 +406,7 @@ print '<br><br>';
print '<br>'; print '<br>';
print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder'); print load_fiche_titre($langs->trans("OtherSetup"), '', 'folder');
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: '; //print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
@ -439,19 +439,24 @@ print '<br>';
print '<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 1)</span><br>'; print '<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 1)</span><br>';
print '<br>'; print '<br>';
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 2)</span>'."<br>";
print '<br>';
print '<br>';
print '<br>';
print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>"; print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>";
print '<br>'; print '<br>';
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>"; print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
print '<br>'; print '<br>';
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 2)</span>'."<br>";
print '<br>';
print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>' : $conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL)."<br>"; print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>' : $conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL)."<br>";
print '<br>'; print '<br>';
print '<strong>MAIN_EXEC_USE_POPEN</strong> = '; print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
if (empty($conf->global->MAIN_EXEC_USE_POPEN)) { if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>'; print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>';

View File

@ -326,19 +326,19 @@ class DolEditor
$out .= 'jQuery(document).ready(function() { $out .= 'jQuery(document).ready(function() {
jQuery(".buttonforacesave").click(function() { jQuery(".buttonforacesave").click(function() {
console.log("We click on savefile button for component '.$this->htmlname.'"); console.log("We click on savefile button for component '.dol_escape_js($this->htmlname).'");
var aceEditor = window.ace.edit("'.$this->htmlname.'aceeditorid"); var aceEditor = window.ace.edit("'.dol_escape_js($this->htmlname).'aceeditorid");
if (aceEditor) { if (aceEditor) {
var cursorPos = aceEditor.getCursorPosition(); var cursorPos = aceEditor.getCursorPosition();
//console.log(cursorPos); //console.log(cursorPos);
if (cursorPos) { if (cursorPos) {
jQuery("#'.$this->htmlname.'_x").val(cursorPos.column); jQuery("#'.dol_escape_js($this->htmlname).'_x").val(cursorPos.column);
jQuery("#'.$this->htmlname.'_y").val(cursorPos.row); jQuery("#'.dol_escape_js($this->htmlname).'_y").val(cursorPos.row);
} }
//console.log(aceEditor.getSession().getValue()); //console.log(aceEditor.getSession().getValue());
// Inject content of editor into the original HTML field. // Inject content of editor into the original HTML field.
jQuery("#'.$this->htmlname.'").val(aceEditor.getSession().getValue()); jQuery("#'.dol_escape_js($this->htmlname).'").val(aceEditor.getSession().getValue());
/*if (jQuery("#'.$this->htmlname.'").html().length > 0) return true; /*if (jQuery("#'.dol_escape_js($this->htmlname).'").html().length > 0) return true;
else return false;*/ else return false;*/
return true; return true;
} else { } else {

View File

@ -4901,7 +4901,7 @@ class Form
$more .= '<div class="tagtr">'; $more .= '<div class="tagtr">';
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">'; $more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr; $more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0') { if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
$more .= ' checked'; $more .= ' checked';
} }
if (is_bool($input['value']) && $input['value']) { if (is_bool($input['value']) && $input['value']) {

View File

@ -256,7 +256,7 @@ class modAccounting extends DolibarrModules
$r++; $r++;
$this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_code[$r] = $this->rights_class.'_'.$r;
$this->export_label[$r] = 'Chartofaccounts'; $this->export_label[$r] = 'Chartofaccounts';
$this->export_icon[$r] = 'accounting'; $this->export_icon[$r] = $this->picto;
$this->export_permission[$r] = array(array("accounting", "chartofaccount")); $this->export_permission[$r] = array(array("accounting", "chartofaccount"));
$this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status'); $this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status');
$this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status'); $this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status');

View File

@ -282,7 +282,7 @@ DescClosure=Consult here the number of movements by month who are not validated
OverviewOfMovementsNotValidated=Step 1/ Overview of movements not validated. (Necessary to close a fiscal year) OverviewOfMovementsNotValidated=Step 1/ Overview of movements not validated. (Necessary to close a fiscal year)
AllMovementsWereRecordedAsValidated=All movements were recorded as validated AllMovementsWereRecordedAsValidated=All movements were recorded as validated
NotAllMovementsCouldBeRecordedAsValidated=Not all movements could be recorded as validated NotAllMovementsCouldBeRecordedAsValidated=Not all movements could be recorded as validated
ValidateMovements=Validate movements ValidateMovements=Validate and lock record...
DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible
ValidateHistory=Bind Automatically ValidateHistory=Bind Automatically

View File

@ -243,7 +243,7 @@ if (!empty($conf->paypal->enabled)) {
$fulltag = $FULLTAG; $fulltag = $FULLTAG;
$payerID = $PAYPALPAYERID; $payerID = $PAYPALPAYERID;
// Set by newpayment.php // Set by newpayment.php
$paymentType = $_SESSION['PaymentType']; $paymentType = $_SESSION['PaymentType']; // Value can be 'Mark', 'Sole', 'Sale' for example
$currencyCodeType = $_SESSION['currencyCodeType']; $currencyCodeType = $_SESSION['currencyCodeType'];
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
// From env // From env
@ -404,10 +404,19 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
// May return nothing when paymentType means nothing
// (for example when paymentType is 'Mark', 'Sole', 'Sale', for paypal)
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
// If previous line has returned nothing, we force to get the ID of payment of Credit Card (hard coded code 'CB').
if (empty($paymentTypeId) || $paymentTypeId < 0) {
$paymentTypeId = dol_getIdFromCode($db, 'CB', 'c_paiement', 'code', 'id', 1);
}
} }
dol_syslog("FinalPaymentAmt=".$FinalPaymentAmt." paymentTypeId=".$paymentTypeId." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType, LOG_DEBUG, 0, '_payment'); dol_syslog("FinalPaymentAmt=".$FinalPaymentAmt." paymentTypeId=".$paymentTypeId." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType, LOG_DEBUG, 0, '_payment');
@ -781,10 +790,19 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
// May return nothing when paymentType means nothing
// (for example when paymentType is 'Mark', 'Sole', 'Sale', for paypal)
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
// If previous line has returned nothing, we force to get the ID of payment of Credit Card (hard coded code 'CB').
if (empty($paymentTypeId) || $paymentTypeId < 0) {
$paymentTypeId = dol_getIdFromCode($db, 'CB', 'c_paiement', 'code', 'id', 1);
}
} }
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
@ -874,12 +892,29 @@ if ($ispaymentok) {
$FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"];
$paymentTypeId = 0; $paymentTypeId = 0;
if ($paymentmethod == 'paybox') $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; if ($paymentmethod == 'paybox') {
if ($paymentmethod == 'paypal') $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS;
if ($paymentmethod == 'stripe') $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; }
if ($paymentmethod == 'paypal') {
$paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS;
}
if ($paymentmethod == 'stripe') {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
}
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
if (empty($paymentType)) $paymentType = 'CB'; dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
if (empty($paymentType)) {
$paymentType = 'CB';
}
// May return nothing when paymentType means nothing
// (for example when paymentType is 'Mark', 'Sole', 'Sale', for paypal)
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
// If previous line has returned nothing, we force to get the ID of payment of Credit Card (hard coded code 'CB').
if (empty($paymentTypeId) || $paymentTypeId < 0) {
$paymentTypeId = dol_getIdFromCode($db, 'CB', 'c_paiement', 'code', 'id', 1);
}
} }
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
@ -984,10 +1019,19 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
// May return nothing when paymentType means nothing
// (for example when paymentType is 'Mark', 'Sole', 'Sale', for paypal)
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
// If previous line has returned nothing, we force to get the ID of payment of Credit Card (hard coded code 'CB').
if (empty($paymentTypeId) || $paymentTypeId < 0) {
$paymentTypeId = dol_getIdFromCode($db, 'CB', 'c_paiement', 'code', 'id', 1);
}
} }
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
@ -1089,10 +1133,19 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
// May return nothing when paymentType means nothing
// (for example when paymentType is 'Mark', 'Sole', 'Sale', for paypal)
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
// If previous line has returned nothing, we force to get the ID of payment of Credit Card (hard coded code 'CB').
if (empty($paymentTypeId) || $paymentTypeId < 0) {
$paymentTypeId = dol_getIdFromCode($db, 'CB', 'c_paiement', 'code', 'id', 1);
}
} }
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
@ -1270,10 +1323,19 @@ if ($ispaymentok) {
$paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS;
} }
if (empty($paymentTypeId)) { if (empty($paymentTypeId)) {
dol_syslog("paymentType = ".$paymentType, LOG_DEBUG, 0, '_payment');
if (empty($paymentType)) { if (empty($paymentType)) {
$paymentType = 'CB'; $paymentType = 'CB';
} }
// May return nothing when paymentType means nothing
// (for example when paymentType is 'Mark', 'Sole', 'Sale', for paypal)
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
// If previous line has returned nothing, we force to get the ID of payment of Credit Card (hard coded code 'CB').
if (empty($paymentTypeId) || $paymentTypeId < 0) {
$paymentTypeId = dol_getIdFromCode($db, 'CB', 'c_paiement', 'code', 'id', 1);
}
} }
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)

View File

@ -2853,7 +2853,7 @@ if (!GETPOST('hide_websitemenu')) {
print $langs->trans("PageContainer").': '; print $langs->trans("PageContainer").': ';
print '</span>'; print '</span>';
print '<span class="websiteselection hideonsmartphoneimp">'; print '<span class="websiteselection">';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=createcontainer&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"></span></a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=createcontainer&website='.urlencode($website->ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"><span class="fa fa-plus-circle valignmiddle btnTitle-icon"></span></a>';
print '</span>'; print '</span>';