Modifikasi berikut ditujukan untuk menjawab pertanyaan mengenai modifikasi yang hampir sama dengan modifikasi di artikel ini. Anda bisa mengaktifkan dan menonaktifkan fitur ini dari panel admin. Jika Anda ingin supaya Sistem osTicket Anda juga mengirim peringatan melalui email ke semua anggota departemen ketika respon atau balasan yang dikirim oleh staf masuk ke sistem, maka modifikasi berikut yang saya buat ini cocok buat Anda!
-
Pertama sekali, Anda harus mengubah tabel ost_config dengan menambahkan sebuah field atau kolom baru yang bernama note_alert_dept_members. Anda dapat menggunakan skrip SQL berikut melalui phpMyAdmin atau MySQL tool favorit Anda lainnya. Mohon diingat, bahwa ost_ adalah nama awalan tabel, yang mungkin bisa saja berbeda dengan nama awalan tabel yang Anda gunakan. Silahkan sesuaikan sendiri jika memang berbeda:
ALTER TABLE ost_config ADD COLUMN `note_alert_dept_members` tinyint(1) default 0 NOT NULL;
-
Buka file \include\staff\preference.inc.php, dan cari kode ini:
435
<input type="checkbox" name="note_alert_dept_manager" <?=$config['note_alert_dept_manager']?'checked':''?>> Department Manager (spammy)
lalu setelah baris terakhir dari kode tadi, tambahkan kode berikut:
436
<input type="checkbox" name="note_alert_dept_members" <?=$config['note_alert_dept_members']?'checked':''?>> Department Members (spammy)
-
Buka file \include\class.config.php, dan cari kode ini:
322 323 324
function alertDeptManagerONNewNote() { return $this->config['note_alert_dept_manager']?true:false; }
setelah baris terakhir dari kode tadi, tambahkan kode berikut ini:
326 327 328 329
// MOD Alert Dept Members on New Note, added by Masino Sinaga, November 14, 2009 function alertDeptMembersONNewNote() { return $this->config['note_alert_dept_members']?true:false; }
Cari lagi kode yang ini:
476 477 478 479
if($var['note_alert_active'] && (!isset($var['note_alert_laststaff']) && !isset($var['note_alert_assigned']) && !isset($var['note_alert_dept_manager']))){
lalu timpa dengan kode berikut:
476 477 478 479 480
if($var['note_alert_active'] && (!isset($var['note_alert_laststaff']) && !isset($var['note_alert_assigned']) && !isset($var['note_alert_dept_manager']) && !isset($var['note_alert_dept_members']))){ // added by Masino Sinaga, Nov 14, 2009
Cari lagi kode yang ini:
536
',note_alert_dept_manager='.db_input(isset($var['note_alert_dept_manager'])?1:0).
lalu timpa dengan kode berikut:
536 537
',note_alert_dept_manager='.db_input(isset($var['note_alert_dept_manager'])?1:0). ',note_alert_dept_members='.db_input(isset($var['note_alert_dept_members'])?1:0). // added by Masino Sinaga, Nov 14, 2009
-
Buka file \include\class.ticket.php, dan cari kode ini:
827 828 829
//Dept manager if($cfg->alertDeptManagerONNewNote() && $dept) $recipients[]=$dept->getManager();
setelah baris terakhir dari kode tadi, tambahkan kode berikut:
831 832 833 834 835 836 837 838
//Dept members, added by Masino Sinaga, Nov 14, 2009 if($cfg->alertDeptMembersONNewNote() && $dept) { $sql='SELECT staff_id FROM '.STAFF_TABLE.' WHERE onvacation=0 AND dept_id='.db_input($dept->getId()); if(($users=db_query($sql)) && db_num_rows($users)) { while(list($id)=db_fetch_row($users)) $recipients[]= new Staff($id); } }
Itu saja semuanya. Semoga dapat membantu.

Hi Masino,
Is it possible to modify this to alert when different department members replies to the ticket ?, I’ve noticed that when two departments are involved in one ticket , for example if department A and B are involved in a ticket, if member from department A reply to the ticket only members from the department A get the alert, can it be modified so that members from department B also get the alert ?.
Kind Regards,
Dileepa.
Hi Dileepa,
Thanks for your feedback. I will try to implement it. Stay tuned.
Hi Masino,
Any updates on my request.
Kind Regards,
Dileepa.
Hi Dleepa,
I am so sorry, I still have not had time to update the modification above.
Thanks for the code. It works well, but one thing:
When posting an internal note I was getting an error message: “Error(s) occured. Unable to post the note.” But the note was actually posting just fine. The problem was that the variable $id in the postNote function in class.ticket.php (modified in the last code snippet of your post) was getting overwritten by your new code. I replaced $id with another variable name and it seems to be working fine now.
Hi,
Can you please explain to me, what you did to make this work ?? I can’t find out
Hi Guys,
I am just new to OSTicket and I have implemented the change above.
However, it is not working.
I think it may be that I cannot find where to enable this in admin panel.
can someone tell me where this is?
Thanks
Guys,
As far as I can see this only adds funtionality to the ‘New Internal Note Alert’ function.
What I am looking for is functionality where is any staff member or the customer adds data in the form of ‘New Message Alert’ then an email is sent to all staff, even staff memebers that are not assigned to the cases as well as the customer.
Any ideas?
Thanks
Gareth