diff --git a/htdocs/core/ajax/fetchCategories.php b/htdocs/core/ajax/fetchCategories.php index 11bda9a2628..edf01744795 100644 --- a/htdocs/core/ajax/fetchCategories.php +++ b/htdocs/core/ajax/fetchCategories.php @@ -1,5 +1,6 @@ + * Copyright (C) 2025 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 diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4b1bb5c5ba1..66463f273b9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5823,7 +5823,7 @@ class Form * @param int<0,1> $include [=0] Removed or 1=Keep only * @param string $morecss More CSS * @param int<0,2> $useempty 0=No empty value, 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries. Default is 1. - * @return string|array|array|array String list or Array of categories + * @return string|array|array|array String list or Array of categories * @see select_categories() */ public function select_all_categories($type, $selected = '', $htmlname = "parent", $maxlength = 64, $fromid = 0, $outputmode = 0, $include = 0, $morecss = '', $useempty = 1) @@ -10821,18 +10821,18 @@ class Form /** * Return HTML code to output a photo * - * @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') + * @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') * @param Societe|Adherent|Contact|User|CommonObject $object Object containing data to retrieve file name - * @param int $width Width of photo - * @param int $height Height of photo (auto if 0) - * @param int<0,1> $caneditfield Add edit fields - * @param string $cssclass CSS name to use on img for photo - * @param string $imagesize 'mini', 'small' or '' (original) - * @param int<0,1> $addlinktofullsize Add link to fullsize image - * @param int<0,1> $cache 1=Accept to use image in cache - * @param ''|'user'|'environment' $forcecapture '', 'user' or 'environment'. Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''. - * @param int<0,1> $noexternsourceoverwrite No overwrite image with extern source (like 'gravatar' or other module) - * @return string HTML code to output photo + * @param int $width Width of photo + * @param int $height Height of photo (auto if 0) + * @param int<0,1> $caneditfield Add edit fields + * @param string $cssclass CSS name to use on img for photo + * @param string $imagesize 'mini', 'small' or '' (original) + * @param int<0,1> $addlinktofullsize Add link to fullsize image + * @param int<0,1> $cache 1=Accept to use image in cache + * @param ''|'user'|'environment' $forcecapture '', 'user' (user-facing camera) or 'environment' ('outward-facing camera'). Force the parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if ''. + * @param int<0,1> $noexternsourceoverwrite No overwrite image with extern source (like 'gravatar' or other module) + * @return string HTML code to output photo * @see getImagePublicURLOfObject() */ public static function showphoto($modulepart, $object, $width = 100, $height = 0, $caneditfield = 0, $cssclass = 'photowithmargin', $imagesize = '', $addlinktofullsize = 1, $cache = 0, $forcecapture = '', $noexternsourceoverwrite = 0) @@ -11010,7 +11010,7 @@ class Form if ($maxmin > 0) { $ret .= ''; // MAX_FILE_SIZE must precede the field type=file } - $ret .= ''; + $ret .= ''; $ret .= ''; $ret .= ''; } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 008d593686b..fc051325f7e 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1736,7 +1736,7 @@ function complete_elementList_with_modules(&$elementList) /** * Show array with constants to edit * - * @param array|array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label, 'tooltip'=>tooltip) + * @param array|array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label, 'tooltip'=>tooltip) * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... * @param int<2,3> $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended) (typed as int<2,3> to highlight the deprecated values) * @param string $helptext Tooltip help to use for the column name of values diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index cb6b48a3178..2b0973b36f7 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1657,7 +1657,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl // Photo - Name if (!empty($arrayfields['t.name']['checked'])) { print ''; - print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, '1'); + print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 'user'); print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage)); print ''; } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 8dba6c5297d..a4a3044a3cc 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1490,7 +1490,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print $langs->trans('ServiceToUseOnLines'); print ''; print ''; - $form->select_produits(0, 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500'); + $form->select_produits(0, 'productid', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500'); print ''; print ''; } @@ -1884,7 +1884,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (isModEnabled("service") && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { print ''; print img_picto('', 'service'); - print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOSTINT("fk_product") : ''), 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); + print $form->select_produits((GETPOSTISSET('fk_product') ? GETPOSTINT("fk_product") : ''), 'fk_product', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth150', 0, '', null, 1); print ''; } } @@ -2415,7 +2415,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { print img_picto('', 'service'); - print $form->select_produits($task_time->fk_product, 'fk_product', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500', 0, '', null, 1); + print $form->select_produits($task_time->fk_product, 'fk_product', 1, 0, $projectstatic->thirdparty->price_level, 1, 2, '', 1, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500', 0, '', null, 1); } elseif (!empty($task_time->fk_product)) { $product = new Product($db); $resultFetch = $product->fetch($task_time->fk_product); diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index cc08b6dfb19..384053a2e02 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -345,22 +345,22 @@ class Stripe extends CommonObject * Note: This is used when option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on when making a payment from the public/payment/newpayment.php page * but not when using the STRIPE_USE_NEW_CHECKOUT. * - * @param float $amount Amount - * @param string $currency_code Currency code - * @param string $tag Tag - * @param string $description Description - * @param ?CommonObject $object Object to pay with Stripe - * @param ?string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() - * @param ?string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect - * @param int<0,1> $status Status (0=test, 1=live) - * @param int<0,1> $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt - * @param 'automatic'|'manual' $mode automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent - * @param bool $confirmnow false=default, true=try to confirm immediately after create (if conditions are ok) - * @param ?string $payment_method 'pm_....' (if known) - * @param int<0,1> $off_session If we use an already known payment method to pay when customer is not available during the checkout flow. - * @param int<0,1> $noidempotency_key Do not use the idempotency_key when creating the PaymentIntent - * @param int $did ID of an existing line into llx_prelevement_demande (Dolibarr intent). If provided, no new line will be created. - * @return ?\Stripe\PaymentIntent Stripe PaymentIntent or null if not found and failed to create + * @param float $amount Amount + * @param string $currency_code Currency code + * @param string $tag Tag + * @param string $description Description + * @param ?CommonObject $object Object to pay with Stripe + * @param ?string $customer Stripe customer ref 'cus_xxxxxxxxxxxxx' via customerStripe() + * @param ?string $key ''=Use common API. If not '', it is the Stripe connect account 'acc_....' to use Stripe connect + * @param int<0,1> $status Status (0=test, 1=live) + * @param int<0,1> $usethirdpartyemailforreceiptemail 1=use thirdparty email for receipt + * @param 'automatic'|'manual'|'terminal' $mode Automatic=automatic confirmation/payment when conditions are ok, manual=need to call confirm() on intent, terminal=manual + * @param bool $confirmnow False=default, true=try to confirm immediately after create (if conditions are ok) + * @param ?string $payment_method 'pm_....' (if known) + * @param int<0,1> $off_session If we use an already known payment method to pay when customer is not available during the checkout flow. + * @param int<0,1> $noidempotency_key Do not use the idempotency_key when creating the PaymentIntent + * @param int $did ID of an existing line into llx_prelevement_demande (Dolibarr intent). If provided, no new line will be created. + * @return ?\Stripe\PaymentIntent Stripe PaymentIntent or null if not found and failed to create */ public function getPaymentIntent($amount, $currency_code, $tag, $description = '', $object = null, $customer = null, $key = null, $status = 0, $usethirdpartyemailforreceiptemail = 0, $mode = 'automatic', $confirmnow = false, $payment_method = null, $off_session = 0, $noidempotency_key = 1, $did = 0) { @@ -454,6 +454,8 @@ class Stripe extends CommonObject } } + $stripemode = $mode; + // list of payment method types $paymentmethodtypes = array("card"); $descriptor = dol_trunc($tag, 10, 'right', 'UTF-8', 1); @@ -476,8 +478,11 @@ class Stripe extends CommonObject if (getDolGlobalInt('STRIPE_SOFORT')) { $paymentmethodtypes[] = "sofort"; } - if (getDolGlobalInt('STRIPE_CARD_PRESENT') && $mode == 'terminal') { - $paymentmethodtypes = array("card_present"); + if ($mode == 'terminal') { + if (getDolGlobalInt('STRIPE_CARD_PRESENT')) { + $paymentmethodtypes = array("card_present"); + } + $stripemode = 'manual'; } global $dolibarr_main_url_root; @@ -486,7 +491,7 @@ class Stripe extends CommonObject $dataforintent = array( "confirm" => $confirmnow, // try to confirm immediately after create (if conditions are ok) - "confirmation_method" => $mode, + "confirmation_method" => $stripemode, "amount" => $stripeamount, "currency" => $currency_code, "payment_method_types" => $paymentmethodtypes, // When payment_method_types is set, return_url is not required but payment mode can't be managed from dashboard diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index 2dad6640085..d94ea65c236 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -575,7 +575,6 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser) $thirdparty->fax = $thirdpartywithuser['fax']; $thirdparty->email = $thirdpartywithuser['email']; $thirdparty->url = $thirdpartywithuser['url']; - $thirdparty->ape = $thirdpartywithuser['ape']; $thirdparty->idprof1 = $thirdpartywithuser['prof1']; $thirdparty->idprof2 = $thirdpartywithuser['prof2']; $thirdparty->idprof3 = $thirdpartywithuser['prof3'];