diff --git a/.github/workflows/ci-checkmajorversion.yml b/.github/workflows/ci-checkfilesetlock.yml similarity index 88% rename from .github/workflows/ci-checkmajorversion.yml rename to .github/workflows/ci-checkfilesetlock.yml index 918f302e73c..bfc1f9fe5b8 100644 --- a/.github/workflows/ci-checkmajorversion.yml +++ b/.github/workflows/ci-checkfilesetlock.yml @@ -1,6 +1,6 @@ --- # This is a basic workflow to check the lock on major version (to lock some files on certified versions) -name: Check lock of major version +name: Check fileset lock on: [push, pull_request] @@ -10,7 +10,7 @@ concurrency: jobs: checkmajorversion: - name: Check lock of major version with generate_filelist_xml.php + name: Check lock on fileset unalterable_files with generate_filelist_xml.php runs-on: ubuntu-latest # Do not run schedule on forks if: | diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 34fe35153ca..1c032c39207 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -93,7 +93,9 @@ if ($action == 'update') { $res = dolibarr_set_const($db, "MEMBER_MIN_AMOUNT", $minamount, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_COUNTERS_ARE_PUBLIC", $publiccounters, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "MEMBER_SKIP_TABLE", $showtable ? 0 : 1, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "skip -> show" - $res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", $showvoteallowed ? 0 : 1, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show" + if (GETPOSTISSET('MEMBER_HIDE_VOTE_ALLOWED')) { + $res = dolibarr_set_const($db, "MEMBER_HIDE_VOTE_ALLOWED", $showvoteallowed ? 0 : 1, 'chaine', 0, '', $conf->entity); // Logic is reversed for retrocompatibility: "hide -> show" + } $res = dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE", $payonline, 'chaine', 0, '', $conf->entity); if ($forcetype < 0) { $res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE", $conf->entity); @@ -225,6 +227,24 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) { print ''; print "\n"; + // Show the table of all available membership types. If not, show a form (as the default was for Dolibarr <=16.0) + $skiptable = getDolGlobalInt('MEMBER_SKIP_TABLE'); + print ''; + print $langs->trans("MembersShowMembershipTypesTable"); + print ''; + print $form->selectyesno("MEMBER_SHOW_TABLE", (int) !$skiptable, 1, false, 0, 1); // Reverse the logic "hide -> show" for retrocompatibility + print "\n"; + + // Show "vote allowed" setting for membership types + if (!$skiptable) { + $hidevoteallowed = getDolGlobalInt('MEMBER_HIDE_VOTE_ALLOWED'); + print ''; + print $langs->trans("MembersShowVotesAllowed"); + print ''; + print $form->selectyesno("MEMBER_SHOW_VOTE_ALLOWED", (int) !$hidevoteallowed, 1, false, 0, 1); // Reverse the logic "hide -> show" for retrocompatibility + print "\n"; + } + // Force Type $adht = new AdherentType($db); print ''; @@ -272,22 +292,6 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) { print $form->selectyesno("MEMBER_COUNTERS_ARE_PUBLIC", getDolGlobalInt('MEMBER_COUNTERS_ARE_PUBLIC'), 1, false, 0, 1); print "\n"; - // Show the table of all available membership types. If not, show a form (as the default was for Dolibarr <=16.0) - $skiptable = getDolGlobalInt('MEMBER_SKIP_TABLE'); - print ''; - print $langs->trans("MembersShowMembershipTypesTable"); - print ''; - print $form->selectyesno("MEMBER_SHOW_TABLE", (int) !$skiptable, 1, false, 0, 1); // Reverse the logic "hide -> show" for retrocompatibility - print "\n"; - - // Show "vote allowed" setting for membership types - $hidevoteallowed = getDolGlobalInt('MEMBER_HIDE_VOTE_ALLOWED'); - print ''; - print $langs->trans("MembersShowVotesAllowed"); - print ''; - print $form->selectyesno("MEMBER_SHOW_VOTE_ALLOWED", (int) !$hidevoteallowed, 1, false, 0, 1); // Reverse the logic "hide -> show" for retrocompatibility - print "\n"; - // Jump to an online payment page print ''; print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index d04e3f77006..3d08bf8edea 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -696,7 +696,7 @@ class AdherentType extends CommonObject while ($i < $nump) { $obj = $this->db->fetch_object($resql); - $amountbytype[$obj->rowid] = $obj->amount; + $amountbytype[$obj->rowid] = (float) $obj->amount; $i++; } } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 08639d66233..9d489f3581f 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -485,7 +485,13 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''.yn($objp->subscription).''; } if (!empty($arrayfields['t.amount']['checked'])) { - print ''.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).''; + print ''; + $amount = (is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)); + print ''.$amount.''; + if ($amount && $amount < (float) getDolGlobalInt("MEMBER_MIN_AMOUNT")) { + print img_warning('Amount lower than minimum of '.price(getDolGlobalInt("MEMBER_MIN_AMOUNT")).' defined in setup'); + } + print ''; } if (!empty($arrayfields['t.caneditamount']['checked'])) { print ''.yn($objp->caneditamount).''; @@ -645,7 +651,11 @@ if ($rowid > 0) { // Amount print ''.$langs->trans("Amount").''; - print((is_null($object->amount) || $object->amount === '') ? '' : ''.price($object->amount).''); + $amount = ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount)); + print ''.$amount.''; + if ($amount && $amount < (float) getDolGlobalInt("MEMBER_MIN_AMOUNT")) { + print ' '.img_warning('Amount lower than minimum of '.price(getDolGlobalInt("MEMBER_MIN_AMOUNT")).' defined in setup'); + } print ''; print ''.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).''; @@ -944,7 +954,6 @@ if ($rowid > 0) { $adh->firstname = $objp->firstname; $adh->datefin = $datefin; $adh->need_subscription = $objp->subscription; - $adh->statut = $objp->status; $adh->status = $objp->status; $adh->email = $objp->email; $adh->photo = $objp->photo; @@ -1089,8 +1098,9 @@ if ($rowid > 0) { print ''; print ''.$langs->trans("Amount").''; + $amount = ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount)); print ''; print ''; diff --git a/htdocs/core/class/cleadstatus.class.php b/htdocs/core/class/cleadstatus.class.php index 87c4e832370..46122f12a54 100644 --- a/htdocs/core/class/cleadstatus.class.php +++ b/htdocs/core/class/cleadstatus.class.php @@ -58,6 +58,9 @@ class CLeadStatus extends CommonDict */ public $percent; + /** + * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> + */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Label of status"), diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 3992d05e1c3..8887397b828 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -381,7 +381,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { $sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql .= " SET unitprice = ".price2num(GETPOST($pu), 'MU', 2); $sql .= ", price = ".price2num(GETPOST($pu), 'MU', 2)." * quantity"; - $sql .= ", remise_percent = ".price2num((empty($dto) ? 0 : $dto), 3, 2)."'"; + $sql .= ", remise_percent = ".price2num((empty($dto) ? 0 : $dto), 3, 2); $sql .= " WHERE fk_soc = ".((int) $object->socid); $sql .= " AND fk_product=".((int) $productId); diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 3a8b3bba7d7..3005c83e03e 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -27,7 +27,7 @@ MembersListNotUpToDate=List of valid members with out-of-date contribution MembersListExcluded=List of excluded members MembersListResiliated=List of terminated members MembersListQualified=List of qualified members -MembersShowMembershipTypesTable=Show a table of all available membership types (if no, show directly the registration form) +MembersShowMembershipTypesTable=Show a table to select its membership types before the registration form (if no, show directly the registration form) MembersShowVotesAllowed=Show whether votes are allowed, in the table of membership types MenuMembersToValidate=Draft members MenuMembersValidated=Validated members @@ -227,7 +227,7 @@ MembershipPaid=Membership paid for current period (until %s) YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email XMembersClosed=%s member(s) closed XExternalUserCreated=%s external user(s) created -ForceMemberNature=Force member nature (Individual or Corporation) +ForceMemberNature=Force member nature (Individual or Legal Entity) CreateDolibarrLoginDesc=The creation of a user login for members allows them to connect to the application. Depending on the authorizations granted, they will be able, for example, to consult or modify their file themselves. CreateDolibarrThirdPartyDesc=A third party is the legal entity that will be used on the invoice if you decide to generate invoice for each contribution. You will be able to create it later during the process of recording the contribution. MemberFirstname=Member firstname diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3973c556505..c909f9d4b24 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1273,13 +1273,15 @@ if (!defined('NOREQUIRETRAN')) { // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + Option + key for all browsers + + // Note: $con->browser->os and $conf->browser->name may not be defined if we are in CLI mode. $conf->browser->stringforfirstkey = $langs->trans("KeyboardShortcut"); - if ($conf->browser->os == 'macintosh') { + if (!empty($conf->browser->os) && $conf->browser->os == 'macintosh') { $conf->browser->stringforfirstkey .= ' CTRL + Option +'; } else { - if ($conf->browser->name == 'chrome') { + if (!empty($conf->browser->name) && $conf->browser->name == 'chrome') { $conf->browser->stringforfirstkey .= ' ALT +'; - } elseif ($conf->browser->name == 'firefox') { + } elseif (!empty($conf->browser->name) && $conf->browser->name == 'firefox') { $conf->browser->stringforfirstkey .= ' ALT + SHIFT +'; } else { $conf->browser->stringforfirstkey .= ' CTL +'; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 8bbf2b9b505..2ddae91637a 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -683,8 +683,8 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR print "\n".'