Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
099906a73b
@ -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.
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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']='<span class="fa fa-trash paddingrightonly"></span>'.$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 '<td class="liste_titre">';
|
||||
$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 '</td>';
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
YouMayFindYourInvoiceInThisEmail=You may find your invoice attached to this email
|
||||
XMembersClosed=%s member(s) closed
|
||||
@ -1947,24 +1947,24 @@ if (preg_match('/^dopayment/', $action))
|
||||
{
|
||||
print info_admin($langs->trans("ErrorModuleSetupNotComplete", "stripe"), 0, 0, 'error');
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
print '<script src="https://js.stripe.com/v3/"></script>'."\n";
|
||||
|
||||
|
||||
// Code to ask the credit card. This use the default "API version". No way to force API version when using JS code.
|
||||
print '<script type="text/javascript" language="javascript">'."\n";
|
||||
|
||||
|
||||
if (! empty($conf->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION))
|
||||
{
|
||||
?>
|
||||
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION set
|
||||
|
||||
|
||||
// Create a Stripe client.
|
||||
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
||||
|
||||
|
||||
// Create an instance of Elements
|
||||
var elements = stripe.elements();
|
||||
|
||||
|
||||
// Custom styling can be passed to options when creating an Element.
|
||||
// (Note that this demo uses a wider set of styles than the guide below.)
|
||||
var style = {
|
||||
@ -1983,12 +1983,12 @@ if (preg_match('/^dopayment/', $action))
|
||||
iconColor: '#fa755a'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var cardElement = elements.create('card', {style: style});
|
||||
|
||||
|
||||
// Add an instance of the card Element into the `card-element` <div>
|
||||
cardElement.mount('#card-element');
|
||||
|
||||
|
||||
// Handle real-time validation errors from the card Element.
|
||||
cardElement.addEventListener('change', function(event) {
|
||||
var displayError = document.getElementById('card-errors');
|
||||
@ -2000,16 +2000,16 @@ if (preg_match('/^dopayment/', $action))
|
||||
displayError.textContent = '';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Handle form submission
|
||||
var cardholderName = document.getElementById('cardholder-name');
|
||||
var cardButton = document.getElementById('buttontopay');
|
||||
var clientSecret = cardButton.dataset.secret;
|
||||
|
||||
|
||||
cardButton.addEventListener('click', function(event) {
|
||||
console.log("We click on buttontopay");
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
if (cardholderName.value == '')
|
||||
{
|
||||
console.log("Field Card holder is empty");
|
||||
@ -2055,21 +2055,21 @@ if (preg_match('/^dopayment/', $action))
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off
|
||||
|
||||
|
||||
// Create a Stripe client.
|
||||
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
||||
|
||||
|
||||
// Create an instance of Elements
|
||||
var elements = stripe.elements();
|
||||
|
||||
|
||||
// Custom styling can be passed to options when creating an Element.
|
||||
// (Note that this demo uses a wider set of styles than the guide below.)
|
||||
var style = {
|
||||
@ -2088,13 +2088,13 @@ if (preg_match('/^dopayment/', $action))
|
||||
iconColor: '#fa755a'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Create an instance of the card Element
|
||||
var card = elements.create('card', {style: style});
|
||||
|
||||
|
||||
// Add an instance of the card Element into the `card-element` <div>
|
||||
card.mount('#card-element');
|
||||
|
||||
|
||||
// Handle real-time validation errors from the card Element.
|
||||
card.addEventListener('change', function(event) {
|
||||
var displayError = document.getElementById('card-errors');
|
||||
@ -2104,7 +2104,7 @@ if (preg_match('/^dopayment/', $action))
|
||||
displayError.textContent = '';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Handle form submission
|
||||
var form = document.getElementById('payment-form');
|
||||
console.log(form);
|
||||
@ -2145,8 +2145,8 @@ if (preg_match('/^dopayment/', $action))
|
||||
}
|
||||
?>
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/* Insert the Token into the form so it gets submitted to the server */
|
||||
function stripeTokenHandler(token) {
|
||||
// Insert the token ID into the form so it gets submitted to the server
|
||||
@ -2156,14 +2156,14 @@ if (preg_match('/^dopayment/', $action))
|
||||
hiddenInput.setAttribute('name', 'stripeToken');
|
||||
hiddenInput.setAttribute('value', token.id);
|
||||
form.appendChild(hiddenInput);
|
||||
|
||||
|
||||
// Submit the form
|
||||
jQuery('#buttontopay').hide();
|
||||
jQuery('#hourglasstopay').show();
|
||||
console.log("submit token");
|
||||
form.submit();
|
||||
}
|
||||
|
||||
|
||||
/* Insert the Source into the form so it gets submitted to the server */
|
||||
function stripeSourceHandler(source) {
|
||||
// Insert the source ID into the form so it gets submitted to the server
|
||||
@ -2173,17 +2173,17 @@ if (preg_match('/^dopayment/', $action))
|
||||
hiddenInput.setAttribute('name', 'stripeSource');
|
||||
hiddenInput.setAttribute('value', source.id);
|
||||
form.appendChild(hiddenInput);
|
||||
|
||||
|
||||
// Submit the form
|
||||
jQuery('#buttontopay').hide();
|
||||
jQuery('#hourglasstopay').show();
|
||||
console.log("submit source");
|
||||
form.submit();
|
||||
}
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
print '</script>';
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user