diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 26c39df5b63..08e9f617750 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -234,7 +234,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { // Can edit print ''; - print $langs->trans("CanEditAmount"); + print $langs->trans("CanEditAmountDetail"); print ''; print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0), 1); print "\n"; diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 4516b132982..6ab65697745 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -319,7 +319,7 @@ class AdherentType extends CommonObject $sql .= ") VALUES ("; $sql .= "'".$this->db->escape($this->morphy)."'"; $sql .= ", '".$this->db->escape($this->label)."'"; - $sql .= ", ".$conf->entity; + $sql .= ", ".((int) $conf->entity); $sql .= ")"; dol_syslog("Adherent_type::create", LOG_DEBUG); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 257e7266e5a..962624db428 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -81,6 +81,7 @@ $duration_unit = GETPOST('duration_unit', 'alpha'); $vote = GETPOST("vote", "int"); $comment = GETPOST("comment", 'restricthtml'); $mail_valid = GETPOST("mail_valid", 'restricthtml'); +$caneditamount = GETPOSTINT("caneditamount"); // Security check $result = restrictedArea($user, 'adherent', $rowid, 'adherent_type'); @@ -124,11 +125,11 @@ if ($action == 'add' && $user->hasRight('adherent', 'configurer')) { $object->status = (int) $status; $object->subscription = (int) $subscription; $object->amount = ($amount == '' ? '' : price2num($amount, 'MT')); - $object->caneditamount = GETPOSTINT("caneditamount"); + $object->caneditamount = $caneditamount; $object->duration_value = $duration_value; $object->duration_unit = $duration_unit; - $object->note = trim($comment); $object->note_public = trim($comment); + $object->note_private = ''; $object->mail_valid = trim($mail_valid); $object->vote = (int) $vote; @@ -142,7 +143,7 @@ if ($action == 'add' && $user->hasRight('adherent', 'configurer')) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); } else { - $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle='".$db->escape($object->label)."'"; + $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle = '".$db->escape($object->label)."'"; $sql .= " WHERE entity IN (".getEntity('member_type').")"; $result = $db->query($sql); $num = null; @@ -183,8 +184,8 @@ if ($action == 'update' && $user->rights->adherent->configurer) { $object->caneditamount = $caneditamount; $object->duration_value = $duration_value; $object->duration_unit = $duration_unit; - $object->note = trim($comment); $object->note_public = trim($comment); + $object->note_private = ''; $object->mail_valid = trim($mail_valid); $object->vote = (boolean) trim($vote); @@ -390,8 +391,8 @@ if ($action == 'create') { print ''; print ''; - print ''.$langs->trans("CanEditAmount").''; - print $form->selectyesno("caneditamount", 0, 1); + print ''.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).''; + print $form->selectyesno("caneditamount", GETPOSTISSET('caneditamount') ? GETPOST('caneditamount') : 0, 1); print ''; print ''.$langs->trans("VoteAllowed").''; @@ -832,7 +833,7 @@ if ($rowid > 0) { print ''; print ''.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmountDetail")).''; - print $form->selectyesno("caneditamount", $object->caneditamount); + print $form->selectyesno("caneditamount", $object->caneditamount, 1); print ''; print ''.$langs->trans("VoteAllowed").''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 538309a6342..0debee1d72d 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1487,7 +1487,7 @@ AdherentLoginRequired= Manage a Login for each member AdherentMailRequired=Email required to create a new member MemberSendInformationByMailByDefault=Checkbox to send mail confirmation to members (validation or new subscription) is on by default MemberCreateAnExternalUserForSubscriptionValidated=Create an external user login for each new member subscription validated -VisitorCanChooseItsPaymentMode=Visitor can choose from available payment modes +VisitorCanChooseItsPaymentMode=Visitor can choose from any available payment modes MEMBER_REMINDER_EMAIL=Enable automatic reminder by email of expired subscriptions. Note: Module %s must be enabled and correctly setup to send reminders. MembersDocModules=Document templates for documents generated from member record ##### LDAP setup ##### diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index dfb4ed1d0bd..4cd36aa76fd 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -207,9 +207,10 @@ NbOfSubscriptions=Number of contributions AmountOfSubscriptions=Amount collected from contributions TurnoverOrBudget=Turnover (for a company) or Budget (for a foundation) DefaultAmount=Default amount of contribution -CanEditAmount=Visitor can choose/edit amount of its contribution regardless of the member type +CanEditAmount=Subscription amount is free +CanEditAmountDetail=Visitor can choose/edit amount of its contribution regardless of the member type AmountIsLowerToMinimumNotice=sur un dû total de %s -MEMBER_NEWFORM_PAYONLINE=Jump on integrated online payment page +MEMBER_NEWFORM_PAYONLINE=After the online registration, switch automatically on the online payment page ByProperties=By nature MembersStatisticsByProperties=Members statistics by nature VATToUseForSubscriptions=VAT rate to use for contributionss diff --git a/htdocs/partnership/admin/website.php b/htdocs/partnership/admin/website.php index bb86f95269b..717783f68d9 100644 --- a/htdocs/partnership/admin/website.php +++ b/htdocs/partnership/admin/website.php @@ -175,13 +175,6 @@ if (!empty($conf->global->PARTNERSHIP_ENABLE_PUBLIC)) { print ''; print "\n"; - // Can edit - print ''; - print $langs->trans("CanEditAmount"); - print ''; - print $form->selectyesno("PARTNERSHIP_NEWFORM_EDITAMOUNT", (!empty($conf->global->PARTNERSHIP_NEWFORM_EDITAMOUNT) ? $conf->global->PARTNERSHIP_NEWFORM_EDITAMOUNT : 0), 1); - print "\n"; - // Jump to an online payment page print ''; print $langs->trans("PARTNERSHIP_NEWFORM_PAYONLINE");