Page 1 of 1

execution two batch actions

Posted: 2020-05-03 10:25
by jbarge
Hi,

I developped an alumni members application with APPGINI.
I coded a first SMS batch action which runs successfully and I coded a second EMAIL batch action for selected members but the second one can't execute associated javascript function.

Any help will be appreciated.

Here is my coding :

In my table batch hook :

function membres_batch_actions(&$args) {
return array(
array(
'title' => 'Envoi Textos',
'function' => 'text_contacts',
'icon' => 'th-list'
),
array(
'title' => 'Envoi Courriels',
'function' => 'courriel_contacts',
'icon' => 'envelope'
)
);
}

In my javascript file :

function text_contacts(table_name, ids){
/*
we'll open the mail labels page in a new window
that page is a server-side PHP script named mail-labels.php
but first, let's prepare the parameters to send to that script
*/
var url = '/alls-alumni/hooks/text-contacts.php?table=' + table_name;
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids);
}

alert("URL : " + url);

// window.open(url);
}

Re: execution two batch actions

Posted: 2020-05-03 12:58
by jsetzer
Where is your function courriel_contacts?

Re: execution two batch actions

Posted: 2020-05-03 17:54
by jbarge
Thanks for your response.
My function "courriel_contacts" is under my function 'text_contacts" in the same javascript file "membres-tv.js"

Here is it :

function text_contacts(table_name, ids){
/*
we'll open the mail labels page in a new window
that page is a server-side PHP script named mail-labels.php
but first, let's prepare the parameters to send to that script
*/
var url = '/alls-alumni/hooks/text-contacts.php?table=' + table_name;
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids);
}

alert("URL : " + url);

// window.open(url);
}

function courriel_contacts(table_name, ids){
/*
we'll open the mail labels page in a new window
that page is a server-side PHP script named mail-labels.php
but first, let's prepare the parameters to send to that script
*/
var url = '/alls-alumni/hooks/courriel-contacts.php?table=' + table_name;
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids);
}

alert("URL : " + url);

// window.open(url);
}

Re: execution two batch actions

Posted: 2020-05-03 18:02
by jsetzer
Sorry, I did not see it in your first post.

Re: execution two batch actions

Posted: 2020-05-04 14:01
by jbarge
Hi,
I found the solution after seeing that any changes done to my javasript file "membres-tv.js were never applied.
I suppressed all the content of my navigator cashe and now it's OK.
André BARGE