Hi Pascal,
thank you for your kind answer.
At this moment, when an alaram is wrote inside the DB, the Appgini, using the hook file table.php sends an email, so the receiver knows that an alarm is arrived and the same when the record is changed. Inside the th eemail there is the link to arrive, directly, to the alarm received.
I would like to add another function to add a pop-up windows to all operators with te same link under the button and when one of them, the first, push the button inside the windows, take in charge the alarm.
This is the hook file now:
<?php
function ticket_init(&$options, $memberInfo, &$args) {
return TRUE;
}
function ticket_header($contentType, $memberInfo, &$args) {
$header='';
switch($contentType) {
case 'tableview':
$header='';
break;
case 'detailview':
$header='';
break;
case 'tableview+detailview':
$header='';
break;
case 'print-tableview':
$header='';
break;
case 'print-detailview':
$header='';
break;
case 'filters':
$header='';
break;
}
return $header;
}
function ticket_footer($contentType, $memberInfo, &$args) {
$footer='';
switch($contentType) {
case 'tableview':
$footer='';
break;
case 'detailview':
$footer='';
break;
case 'tableview+detailview':
$footer='';
break;
case 'print-tableview':
$footer='';
break;
case 'print-detailview':
$footer='';
break;
case 'filters':
$footer='';
break;
}
return $footer;
}
function ticket_before_insert(&$data, $memberInfo, &$args) {
return TRUE;
}
function ticket_after_insert($data, $memberInfo, &$args) {
// our modified code for sending the email notification
$userEmail=sqlValue("select email from membership_users where memberID='".getLoggedMemberID()."'");
// our modified code for sending the email notification
@mail("
[email protected], ",
/* comma-separated list of recipients */
/* message subject */
"New ticket arrived",
/* message contents */
"A new record has been added by ".getLoggedMemberID().
".\n\n".
"To view it, please go to:\n".
"
http://www.company.com/ticket_view.php? ... dID=$recID",
/* we must add sender email similar to this */
"
[email protected]
);
return TRUE;
}
function ticket_before_update(&$data, $memberInfo, &$args) {
return TRUE;
}
function ticket_after_update($data, $memberInfo, &$args) {
// our modified code for sending the email notification
$userEmail=sqlValue("select email from membership_users where memberID='".getLoggedMemberID()."'");
// our modified code for sending the email notification
@mail("
[email protected]",
/* comma-separated list of recipients */
/* message subject */
"Ticket modified",
/* message contents */
"A record has been changed by ".getLoggedMemberID().
".\n\n".
"To view it, please go to:\n".
"
http://www.company.com/ticket_view.php? ... dID=$recID",
/* we must add sender email similar to this */
"
[email protected]"
);
return TRUE;
}
function ticket_before_delete($selectedID, &$skipChecks, $memberInfo, &$args) {
return TRUE;
}
function ticket_after_delete($selectedID, $memberInfo, &$args) {
}
function ticket_dv($selectedID, $memberInfo, &$html, &$args) {
}
function ticket_csv($query, $memberInfo, &$args) {
return $query;
}
function ticket_batch_actions(&$args) {
return array();
}
What do you think, is it possible to do this?
Thank you so much
Davide