diff --git a/ChangeLog b/ChangeLog index b379c13036e..06f749cbc34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -112,6 +112,7 @@ NEW: When you create product or service, sell accountancy account by default is NEW: Widget birthdays of the month. NEW: Option in workflow module to set a reception billed on validate supplier bill. NEW: Autocompletion on lists should be available on mobile applications. +NEW: Add mass action to close several members. For Developers: NEW: Module "DebugBar" is available as a stable module. diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 5d57208eb0e..85720de5156 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1567,7 +1567,7 @@ else $formquestion=array(); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false')); if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); - print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ResiliateMember"), $langs->trans("ConfirmResiliateMember"), "confirm_resign", $formquestion, 'no', 1, 220); + print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ResiliateMember"), $langs->trans("ConfirmResiliateMember"), "confirm_resign", $formquestion, 'no', 1, 240); } // Confirm remove member diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 13b231f15d6..eaeb1fe305c 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -189,6 +189,42 @@ if (empty($reshook)) $search_array_options=array(); } + // Close + if ($massaction == 'close' && $user->rights->adherent->creer) + { + $tmpmember = new Adherent($db); + $error=0; + $nbclose=0; + + $db->begin(); + + foreach($toselect as $idtoclose) + { + $tmpmember->fetch($idtoclose); + $result=$tmpmember->resiliate($user); + + if ($result < 0 && ! count($tmpmember->errors)) + { + setEventMessages($tmpmember->error, $tmpmember->errors, 'errors'); + } + else + { + if ($result > 0) $nbclose++; + } + } + + if (! $error) + { + setEventMessages($langs->trans("XMembersClosed", $nbclose), null, 'mesgs'); + + $db->commit(); + } + else + { + $db->rollback(); + } + } + // Mass actions $objectclass='Adherent'; $objectlabel='Members'; @@ -326,12 +362,11 @@ if ($search_type > 0) } $param=''; -if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; -if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($sall != "") $param.="&sall=".urlencode($sall); if ($statut != "") $param.="&statut=".urlencode($statut); if ($search_ref) $param.="&search_ref=".urlencode($search_ref); -if ($search_nom) $param.="&search_nom=".urlencode($search_nom); if ($search_civility) $param.="&search_civility=".urlencode($search_civility); if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); @@ -358,6 +393,7 @@ $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); +if ($user->rights->adherent->creer) $arrayofmassactions['close']=$langs->trans("Resiliate"); if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); @@ -455,7 +491,7 @@ if (! empty($arrayfields['d.lastname']['checked'])) if (! empty($arrayfields['d.gender']['checked'])) { print ''; - $arraygender=array('man'=>$langs->trans("Genderman"),'woman'=>$langs->trans("Genderwoman")); + $arraygender=array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman")); print $form->selectarray('search_gender', $arraygender, $search_gender, 1); print ''; } diff --git a/htdocs/install/mysql/data/llx_c_type_contact.sql b/htdocs/install/mysql/data/llx_c_type_contact.sql index 62107525ff9..006a65d2641 100644 --- a/htdocs/install/mysql/data/llx_c_type_contact.sql +++ b/htdocs/install/mysql/data/llx_c_type_contact.sql @@ -92,3 +92,10 @@ INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, m INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(157, 'ticket', 'external', 'SUPPORTCLI', 'Contact client suivi incident', 1, NULL); INSERT INTO llx_c_type_contact (rowid, element, source, code, libelle, active, module) VALUES(158, 'ticket', 'external', 'CONTRIBUTOR', 'Intervenant', 1, NULL); +-- Supplier proposal + +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); + diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index c85c1ff9167..27449c9e9e9 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -368,4 +368,10 @@ ALTER TABLE llx_reception_extrafields ADD INDEX idx_reception_extrafields (fk_ob ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_projet integer DEFAULT NULL; ALTER TABLE llx_commande_fournisseur_dispatch ADD COLUMN fk_reception integer DEFAULT NULL; + + +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (110, 'supplier_proposal', 'internal', 'SALESREPFOLL', 'Responsable suivi de la demande', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (111, 'supplier_proposal', 'external', 'BILLING', 'Contact fournisseur facturation', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (112, 'supplier_proposal', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1); +insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); \ No newline at end of file diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 299edcbb714..8b33117cc66 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -196,4 +196,5 @@ EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind. It can be a list of days separated by a semicolon, for example '10;5;0;-5') MembershipPaid=Membership paid for current period (until %s) -YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email \ No newline at end of file +YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email +XMembersClosed=%s member(s) closed \ No newline at end of file diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 51b4c0580e0..7eea7e45df6 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1947,24 +1947,24 @@ if (preg_match('/^dopayment/', $action)) { print info_admin($langs->trans("ErrorModuleSetupNotComplete", "stripe"), 0, 0, 'error'); } - else + else { print ''."\n"; - + // Code to ask the credit card. This use the default "API version". No way to force API version when using JS code. print ''; } }