execution two batch actions

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
jbarge
Posts: 18
Joined: 2020-01-28 18:26

execution two batch actions

Post by jbarge » 2020-05-03 10:25

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);
}

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: execution two batch actions

Post by jsetzer » 2020-05-03 12:58

Where is your function courriel_contacts?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

jbarge
Posts: 18
Joined: 2020-01-28 18:26

Re: execution two batch actions

Post by jbarge » 2020-05-03 17:54

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);
}

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: execution two batch actions

Post by jsetzer » 2020-05-03 18:02

Sorry, I did not see it in your first post.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

jbarge
Posts: 18
Joined: 2020-01-28 18:26

Re: execution two batch actions

Post by jbarge » 2020-05-04 14:01

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

Post Reply