@@ -323,15 +323,15 @@ discard block |
||
323 | 323 | global $stripearrayofkeysbyenv; |
324 | 324 | $error = 0; |
325 | 325 | $object = $event->data->object; |
326 | - $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
326 | + $TRANSACTIONID = $object->id; // Example pi_123456789... |
|
327 | 327 | $ipaddress = $object->metadata->ipaddress; |
328 | 328 | $now = dol_now(); |
329 | 329 | $currencyCodeType = strtoupper($object->currency); |
330 | 330 | $paymentmethodstripeid = $object->payment_method; |
331 | 331 | $customer_id = $object->customer; |
332 | 332 | $invoice_id = ""; |
333 | - $paymentTypeId = ""; // payment type according to Stripe |
|
334 | - $paymentTypeIdInDolibarr = ""; // payment type according to Dolibarr |
|
333 | + $paymentTypeId = ""; // payment type according to Stripe |
|
334 | + $paymentTypeIdInDolibarr = ""; // payment type according to Dolibarr |
|
335 | 335 | $payment_amount = 0; |
336 | 336 | $payment_amountInDolibarr = 0; |
337 | 337 | |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $s = new \Stripe\StripeClient($stripeacc); |
397 | 397 | |
398 | 398 | $paymentmethodstripe = $s->paymentMethods->retrieve($paymentmethodstripeid); |
399 | - $paymentTypeId = $paymentmethodstripe->type; |
|
399 | + $paymentTypeId = $paymentmethodstripe->type; |
|
400 | 400 | if ($paymentTypeId == "ban" || $paymentTypeId == "sepa_debit") { |
401 | 401 | $paymentTypeId = "PRE"; |
402 | 402 | } elseif ($paymentTypeId == "card") { |
@@ -422,9 +422,9 @@ discard block |
||
422 | 422 | $paiement->datepaye = $now; |
423 | 423 | $paiement->date = $now; |
424 | 424 | if ($currencyCodeType == $conf->currency) { |
425 | - $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
425 | + $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id |
|
426 | 426 | } else { |
427 | - $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
427 | + $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching |
|
428 | 428 | |
429 | 429 | $postactionmessages[] = 'Payment was done in a currency (' . $currencyCodeType . ') other than the expected currency of company (' . $conf->currency . ')'; |
430 | 430 | $ispostactionok = -1; |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | $paiement->num_payment = ''; |
436 | 436 | $paiement->note_public = ''; |
437 | 437 | $paiement->note_private = 'StripeSepa payment ' . dol_print_date($now, 'standard') . ' using ' . $servicestatus . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID; |
438 | - $paiement->ext_payment_id = $TRANSACTIONID . ':' . $customer_id . '@' . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
438 | + $paiement->ext_payment_id = $TRANSACTIONID . ':' . $customer_id . '@' . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue. |
|
439 | 439 | $paiement->ext_payment_site = $service; |
440 | 440 | |
441 | 441 | $ispaymentdone = 0; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | $error++; |
668 | 668 | } |
669 | 669 | |
670 | - if (! $error) { |
|
670 | + if (!$error) { |
|
671 | 671 | $db->commit(); |
672 | 672 | } else { |
673 | 673 | $db->rollback(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | //permissions |
86 | 86 | |
87 | -$permissiontoadd = $user->hasRight('societe', 'creer'); |
|
87 | +$permissiontoadd = $user->hasRight('societe', 'creer'); |
|
88 | 88 | |
89 | 89 | // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context |
90 | 90 | $hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); |
@@ -218,19 +218,19 @@ discard block |
||
218 | 218 | |
219 | 219 | $societe->client = GETPOSTINT('client') ? GETPOSTINT('client') : $societe->client; |
220 | 220 | |
221 | - $societe->address = GETPOST('address', 'alphanohtml'); |
|
221 | + $societe->address = GETPOST('address', 'alphanohtml'); |
|
222 | 222 | |
223 | - $societe->country_id = GETPOSTINT('country_id'); |
|
223 | + $societe->country_id = GETPOSTINT('country_id'); |
|
224 | 224 | |
225 | - $societe->phone = GETPOST('phone', 'alpha'); |
|
225 | + $societe->phone = GETPOST('phone', 'alpha'); |
|
226 | 226 | |
227 | - $societe->fax = GETPOST('fax', 'alpha'); |
|
227 | + $societe->fax = GETPOST('fax', 'alpha'); |
|
228 | 228 | |
229 | - $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
|
229 | + $societe->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); |
|
230 | 230 | |
231 | - $societe->client = 2 ; // our client is a prospect |
|
231 | + $societe->client = 2; // our client is a prospect |
|
232 | 232 | |
233 | - $societe->code_client = '-1'; |
|
233 | + $societe->code_client = '-1'; |
|
234 | 234 | |
235 | 235 | $societe->name_alias = GETPOST('name_alias', 'alphanohtml'); |
236 | 236 |
@@ -167,7 +167,7 @@ |
||
167 | 167 | if (getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC')) { |
168 | 168 | print '<div class="clearboth"></div><strong>' . (getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC') ? getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC') : $langs->trans("BookCalSystem")) . '</strong>'; |
169 | 169 | } |
170 | - if (empty($urllogo) && ! getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC')) { |
|
170 | + if (empty($urllogo) && !getDolGlobalString('BOOKCAL_PUBLIC_INTERFACE_TOPIC')) { |
|
171 | 171 | print $mysoc->name; |
172 | 172 | } |
173 | 173 | print '</div>'; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $tokenisok = ($conf->global->PAYMENT_SECURITY_TOKEN == $SECUREKEY); |
313 | 313 | } |
314 | 314 | |
315 | - if (! $tokenisok) { |
|
315 | + if (!$tokenisok) { |
|
316 | 316 | if (!getDolGlobalString('PAYMENT_SECURITY_ACCEPT_ANY_TOKEN')) { |
317 | 317 | $valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility |
318 | 318 | } else { |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | if (!empty($conf->global->$paramcreditorlong)) { |
344 | 344 | $creditor = getDolGlobalString($paramcreditorlong); // use label long of the seller to show |
345 | 345 | } elseif (!empty($conf->global->$paramcreditor)) { |
346 | - $creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show |
|
346 | + $creditor = getDolGlobalString($paramcreditor); // use label short of the seller to show |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | $mesg = ''; |
@@ -792,8 +792,8 @@ discard block |
||
792 | 792 | $remoteip = getUserRemoteIP(); |
793 | 793 | |
794 | 794 | $_SESSION["onlinetoken"] = $stripeToken; |
795 | - $_SESSION["FinalPaymentAmt"] = $amount; // amount really paid (coming from Stripe). Will be used for check in paymentok.php. |
|
796 | - $_SESSION["currencyCodeType"] = $currency; // currency really used for payment (coming from Stripe). Will be used for check in paymentok.php. |
|
795 | + $_SESSION["FinalPaymentAmt"] = $amount; // amount really paid (coming from Stripe). Will be used for check in paymentok.php. |
|
796 | + $_SESSION["currencyCodeType"] = $currency; // currency really used for payment (coming from Stripe). Will be used for check in paymentok.php. |
|
797 | 797 | $_SESSION["paymentType"] = ''; |
798 | 798 | $_SESSION['ipaddress'] = ($remoteip ? $remoteip : 'unknown'); // Payer ip |
799 | 799 | $_SESSION['payerID'] = is_object($customer) ? $customer->id : ''; |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | // Currency |
1015 | 1015 | print ' <b>' . $langs->trans("Currency" . $currency) . '</b>'; |
1016 | 1016 | } else { |
1017 | - print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1017 | + print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1018 | 1018 | print '<input type="hidden" name="amount" value="' . $amount . '">'; |
1019 | 1019 | print '<input type="hidden" name="newamount" value="' . $amount . '">'; |
1020 | 1020 | } |
@@ -1115,7 +1115,7 @@ discard block |
||
1115 | 1115 | // Currency |
1116 | 1116 | print ' <b>' . $langs->trans("Currency" . $currency) . '</b>'; |
1117 | 1117 | } else { |
1118 | - print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1118 | + print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1119 | 1119 | print '<input type="hidden" name="amount" value="' . $amount . '">'; |
1120 | 1120 | print '<input type="hidden" name="newamount" value="' . $amount . '">'; |
1121 | 1121 | } |
@@ -1246,12 +1246,12 @@ discard block |
||
1246 | 1246 | print '<input class="flat maxwidth75" type="text" name="newamount" value="' . price2num(GETPOST("newamount", "alpha"), 'MT') . '">'; |
1247 | 1247 | print ' <b>' . $langs->trans("Currency" . $currency) . '</b>'; |
1248 | 1248 | } else { |
1249 | - print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1249 | + print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1250 | 1250 | print '<input type="hidden" name="amount" value="' . $amount . '">'; |
1251 | 1251 | print '<input type="hidden" name="newamount" value="' . $amount . '">'; |
1252 | 1252 | } |
1253 | 1253 | } else { |
1254 | - print '<b class="amount">' . price($object->total_ttc, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1254 | + print '<b class="amount">' . price($object->total_ttc, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1255 | 1255 | } |
1256 | 1256 | print '<input type="hidden" name="currency" value="' . $currency . '">'; |
1257 | 1257 | print '</td></tr>' . "\n"; |
@@ -1446,7 +1446,7 @@ discard block |
||
1446 | 1446 | // Currency |
1447 | 1447 | print ' <b>' . $langs->trans("Currency" . $currency) . '</b>'; |
1448 | 1448 | } else { |
1449 | - print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1449 | + print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1450 | 1450 | print '<input type="hidden" name="amount" value="' . $amount . '">'; |
1451 | 1451 | print '<input type="hidden" name="newamount" value="' . $amount . '">'; |
1452 | 1452 | } |
@@ -1664,7 +1664,7 @@ discard block |
||
1664 | 1664 | print '<input type="text" class="width75" name="newamount" value="' . price($amount, 1, $langs, 1, -1, -1) . '">'; |
1665 | 1665 | } |
1666 | 1666 | } else { |
1667 | - print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1667 | + print '<b class="amount">' . price($amount, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1668 | 1668 | if ($minimumamount > $amount) { |
1669 | 1669 | print ' <span class="opacitymedium small">' . $langs->trans("AmountIsLowerToMinimumNotice", price($minimumamount, 1, $langs, 1, -1, -1, $currency)) . '</span>'; |
1670 | 1670 | } |
@@ -1825,7 +1825,7 @@ discard block |
||
1825 | 1825 | $valtoshow = max(getDolGlobalString('DONATION_MIN_AMOUNT'), $valtoshow); |
1826 | 1826 | $amount = $valtoshow; |
1827 | 1827 | } |
1828 | - print '<b class="amount">' . price($valtoshow, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1828 | + print '<b class="amount">' . price($valtoshow, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1829 | 1829 | print '<input type="hidden" name="amount" value="' . $valtoshow . '">'; |
1830 | 1830 | print '<input type="hidden" name="newamount" value="' . $valtoshow . '">'; |
1831 | 1831 | } |
@@ -1901,7 +1901,7 @@ discard block |
||
1901 | 1901 | print '</b>'; |
1902 | 1902 | print '</td></tr>' . "\n"; |
1903 | 1903 | |
1904 | - if (! is_object($attendee->project)) { |
|
1904 | + if (!is_object($attendee->project)) { |
|
1905 | 1905 | $text = 'ErrorProjectNotFound'; |
1906 | 1906 | } else { |
1907 | 1907 | $text = $langs->trans("PaymentEvent") . ' - ' . $attendee->project->title; |
@@ -1918,7 +1918,7 @@ discard block |
||
1918 | 1918 | print '<tr class="CTableRow2"><td class="CTableRow2">' . $langs->trans("Amount"); |
1919 | 1919 | print '</td><td class="CTableRow2">'; |
1920 | 1920 | $valtoshow = $amount; |
1921 | - print '<b class="amount">' . price($valtoshow, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1921 | + print '<b class="amount">' . price($valtoshow, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
1922 | 1922 | print '<input type="hidden" name="amount" value="' . $valtoshow . '">'; |
1923 | 1923 | print '<input type="hidden" name="newamount" value="' . $valtoshow . '">'; |
1924 | 1924 | print '<input type="hidden" name="currency" value="' . $currency . '">'; |
@@ -2002,7 +2002,7 @@ discard block |
||
2002 | 2002 | print '<tr class="CTableRow2"><td class="CTableRow2">' . $langs->trans("Amount"); |
2003 | 2003 | print '</td><td class="CTableRow2">'; |
2004 | 2004 | $valtoshow = $amount; |
2005 | - print '<b class="amount">' . price($valtoshow, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
2005 | + print '<b class="amount">' . price($valtoshow, 1, $langs, 1, -1, -1, $currency) . '</b>'; // Price with currency |
|
2006 | 2006 | print '<input type="hidden" name="amount" value="' . $valtoshow . '">'; |
2007 | 2007 | print '<input type="hidden" name="newamount" value="' . $valtoshow . '">'; |
2008 | 2008 | print '<input type="hidden" name="currency" value="' . $currency . '">'; |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | } |
708 | 708 | |
709 | 709 | // Other attributes |
710 | - $parameters['tpl_context'] = 'public'; // define template context to public |
|
710 | + $parameters['tpl_context'] = 'public'; // define template context to public |
|
711 | 711 | include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
712 | 712 | |
713 | 713 | // Comments |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | |
770 | 770 | // Set amount for the subscription: |
771 | 771 | // - First check the amount of the member type. |
772 | - $amountbytype = $adht->amountByType(1); // Load the array of amount per type |
|
772 | + $amountbytype = $adht->amountByType(1); // Load the array of amount per type |
|
773 | 773 | $amount = empty($amountbytype[$typeid]) ? (isset($amount) ? $amount : 0) : $amountbytype[$typeid]; |
774 | 774 | // - If not found, take the default amount only of the user is authorized to edit it |
775 | 775 | if ($caneditamount && empty($amount) && getDolGlobalString('MEMBER_NEWFORM_AMOUNT')) { |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT . '/' . $object->last_main_doc)) { |
394 | 394 | // It seems document has never been generated, or was generated and then deleted. |
395 | 395 | // So we try to regenerate it with its default template. |
396 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
396 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
397 | 397 | $object->generateDocument($defaulttemplate, $langs); |
398 | 398 | } |
399 | 399 | |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT . '/' . $object->last_main_doc)) { |
465 | 465 | // It seems document has never been generated, or was generated and then deleted. |
466 | 466 | // So we try to regenerate it with its default template. |
467 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
467 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
468 | 468 | $object->generateDocument($defaulttemplate, $langs); |
469 | 469 | } |
470 | 470 | |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT . '/' . $object->last_main_doc)) { |
516 | 516 | // It seems document has never been generated, or was generated and then deleted. |
517 | 517 | // So we try to regenerate it with its default template. |
518 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
518 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
519 | 519 | $object->generateDocument($defaulttemplate, $langs); |
520 | 520 | } |
521 | 521 | |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT . '/' . $object->last_main_doc)) { |
624 | 624 | // It seems document has never been generated, or was generated and then deleted. |
625 | 625 | // So we try to regenerate it with its default template. |
626 | - $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
626 | + $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used. |
|
627 | 627 | $object->generateDocument($defaulttemplate, $langs); |
628 | 628 | } |
629 | 629 |
@@ -683,7 +683,7 @@ |
||
683 | 683 | //print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n"; |
684 | 684 | // Other attributes |
685 | 685 | $parameters['tdclass'] = 'titlefieldauto'; |
686 | -$parameters['tpl_context'] = 'public'; // define template context to public |
|
686 | +$parameters['tpl_context'] = 'public'; // define template context to public |
|
687 | 687 | include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
688 | 688 | // Comments |
689 | 689 | print '<tr>'; |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | } else { |
221 | 221 | // Create the prospect |
222 | 222 | if (GETPOST('societe')) { |
223 | - $thirdparty->name = GETPOST('societe'); |
|
223 | + $thirdparty->name = GETPOST('societe'); |
|
224 | 224 | $thirdparty->name_alias = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname')); |
225 | 225 | } else { |
226 | 226 | $thirdparty->name = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname')); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $proj->title = $langs->trans("LeadFromPublicForm"); |
306 | 306 | $proj->description = GETPOST("description", "alphanohtml"); |
307 | 307 | $proj->opp_status = $defaultoppstatus; |
308 | - $proj->fk_opp_status = $defaultoppstatus; |
|
308 | + $proj->fk_opp_status = $defaultoppstatus; |
|
309 | 309 | |
310 | 310 | $proj->ip = getUserRemoteIP(); |
311 | 311 | $nb_post_max = getDolGlobalInt("MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200); |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | } |
549 | 549 | |
550 | 550 | // Other attributes |
551 | -$parameters['tpl_context'] = 'public'; // define template context to public |
|
551 | +$parameters['tpl_context'] = 'public'; // define template context to public |
|
552 | 552 | include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; |
553 | 553 | // Comments |
554 | 554 | print '<tr>'; |
@@ -312,7 +312,7 @@ |
||
312 | 312 | print '<input type="submit" value="' . $langs->trans("ViewAndVote") . '" id="viewandvote" name="viewandvote" class="button minwidth250">'; |
313 | 313 | } |
314 | 314 | |
315 | -if (! $foundaction) { |
|
315 | +if (!$foundaction) { |
|
316 | 316 | print '<span class="opacitymedium">' . $langs->trans("NoPublicActionsAllowedForThisEvent") . '</span>'; |
317 | 317 | } |
318 | 318 |