Pemberitahuan Pesan Baru untuk Semua Anggota Departemen di osTicket v1.6 RC5

Modifikasi berikut ini dimaksudkan untuk menjawab pertanyaan yang terdapat di Forum Diskusi osTicket yang isinya menanyakan hal yang sama dengan judul artikel ini. Jika Anda menginginkan agar osTicket Anda dapat mengirim sebuah peringatan kepada semua anggota departemen ketika pesan baru masuk ke sistem osTicket Anda, maka Anda dapat menggunakan modifikasi yang sudah saya buat ini.

  1. Pertama sekali, Anda harus mengubah tabel ost_config Anda dengan menambahkan sebuah field baru yang bernama message_alert_dept_members. Anda bisa menjalankan skrip SQL berikut dari phpMyAdmin atau tool MySQL lainnya:
    ALTER TABLE ost_config 
    ADD COLUMN `message_alert_dept_members` tinyint(1) default 0 NOT NULL;
  2. Buka file \include\staff\preference.inc.php, dan cari kode ini:
    425
    
                  <input type="checkbox" name="message_alert_dept_manager" <?=$config['message_alert_dept_manager']?'checked':''?>> Department Manager (spammy)

    setelah baris tersebut, tambahkan kode berikut:

    426
    
                  <input type="checkbox" name="message_alert_dept_members" <?=$config['message_alert_dept_members']?'checked':''?>> Department Members (spammy)
  3. Buka file \include\class.config.php, dan cari kode ini:

    306
    307
    308
    
        function alertDeptManagerONNewMessage() {
            return $this->config['message_alert_dept_manager']?true:false;
        }

    setelah baris terakhir dari kode di atas, tambahkan kode berikut ini:

    310
    311
    312
    313
    
        // MOD Alert Dept Members on New Message, added by Masino Sinaga, October 23, 2009
        function alertDeptMembersONNewMessage() {
            return $this->config['message_alert_dept_members']?true:false;
        }

    Cari lagi kode ini:

    469
    470
    471
    472
    
            if($var['message_alert_active']
                    && (!isset($var['message_alert_laststaff'])
                    && !isset($var['message_alert_assigned'])
                    && !isset($var['message_alert_dept_manager']))){

    lalu timpa dengan kode di bawah ini:

    469
    470
    471
    472
    473
    
            if($var['message_alert_active']
                    && (!isset($var['message_alert_laststaff'])
                    && !isset($var['message_alert_assigned'])
                    && !isset($var['message_alert_dept_manager'])
    		&& !isset($var['message_alert_dept_members']))){  // added by Masino Sinaga, Oct 23, 2009

    Cari lagi kode yang ini:

    532
    
                ',message_alert_dept_manager='.db_input(isset($var['message_alert_dept_manager'])?1:0).

    lalu timpa dengan kode berikut ini:

    532
    533
    
                ',message_alert_dept_manager='.db_input(isset($var['message_alert_dept_manager'])?1:0).
                ',message_alert_dept_members='.db_input(isset($var['message_alert_dept_members'])?1:0).  // added by Masino Sinaga, Oct 23, 2009
  4. Buka file \include\class.ticket.phpAnda, dan cari kode ini:
    659
    660
    661
    
                                //Dept manager
                                if($cfg->alertDeptManagerONNewMessage() && $dept)
                                    $recipients[]=$dept->getManager();

    setelah baris terakhir dari kode tadi, tambahkan kode berikut:

    662
    663
    664
    665
    666
    667
    668
    669
    
                                //Dept members, added by Masino Sinaga, Oct 23, 2009
                                if($cfg->alertDeptMembersONNewMessage() && $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);
                                  }													
                                }

Itulah semuanya. Selamat mencoba, dan kabarkan hasilnya! Semoga dapat membantu dan berhasil.

Share

896 kali dibacaCetak Artikel Ini Cetak Artikel Ini

Komentar

  1. Russ Smith mengatakan:

    I have added this code, double checked it – yet it doesn’t appear to be working. When I add a reply to a ticket, that reply should go to all the staff members emails right?

  2. Masino Sinaga mengatakan:

    @Russ Smith

    Let me clarify about the code. As the title stated, this modification is intended to send alert to the department members only on new message. It meant that each time message that sent from client by replying the ticket, then all department members will get the notify via staff members email.

    By contrast, if the staff reply to the ticket, department members will never received email since osTicket create a new response (and not create a new message in osTicket).

    So, to answer your question, it depends on who replies the ticket. If the staff reply the ticket, then they will never get the notify via email. But, if client reply the ticket, then all department members will get the notify via email.

    Hope it makes sense.

  3. Dileepa Navaratne mengatakan:

    Hi Masino, Fist Thanks for the awesome work on the osticket , Just one questions, is there any solution from you for the above question , alert department members on new response ? not new messages.
    Thanks.

  4. Masino Sinaga mengatakan:

    @Dileepa Navaratne

    Sure. I will try to make the modification you requested.

  5. Masino Sinaga mengatakan:

    @Dileepa Navaratne

    As I promised a few minutes ago, you may now get the modification code as you requested from: New Response Alert for All Department Members in osTicket v1.6 RC5. Hope it helps you, and let me know your feedback. Thanks.

  6. Dileepa Navaratne mengatakan:

    Hi Masino,

    Thanks for the mod, it works, you’re doing a great help to all the os ticket users.

    Many Thanks.

  7. Masino Sinaga mengatakan:

    You’re welcome, Dileepa. :-)

  8. Alex mengatakan:

    Hi!

    Did anyone try this mod for the latest osticket version 1.6 ST?

    Regards

    Alex

  9. Gareth Hennedy mengatakan:

    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

Lacakbalik

  1. [...] Go to comments This following modification is being intended to answer the question about the similar modification that asking about the title of this article. You may enable or disable this feature from admin [...]

Utarakan pikiran Anda

*


*