diff --git a/include/class.config.php b/include/class.config.php index fd03f9c2ee38ba4b7278dc0dfc1b9dc7fd90f9e6..68704cd7b65523acb6f5610746b4e9741847c962 100644 --- a/include/class.config.php +++ b/include/class.config.php @@ -151,6 +151,8 @@ class OsticketConfig extends Config { 'system_language' => 'en_US', 'default_storage_bk' => 'D', 'allow_client_updates' => false, + 'message_autoresponder_collabs' => true, + 'add_email_collabs' => true, ); function OsticketConfig($section=null) { @@ -531,6 +533,10 @@ class OsticketConfig extends Config { return ($this->get('use_email_priority')); } + function addCollabsViaEmail() { + return ($this->get('add_email_collabs')); + } + function getAdminEmail() { return $this->get('admin_email'); } @@ -560,6 +566,10 @@ class OsticketConfig extends Config { return ($this->get('message_autoresponder')); } + function notifyCollabsONNewMessage() { + return ($this->get('message_autoresponder_collabs')); + } + function notifyONNewStaffTicket() { return ($this->get('ticket_notice_active')); } @@ -874,7 +884,6 @@ class OsticketConfig extends Config { 'default_sla_id'=>$vars['default_sla_id'], 'max_open_tickets'=>$vars['max_open_tickets'], 'autolock_minutes'=>$vars['autolock_minutes'], - 'use_email_priority'=>isset($vars['use_email_priority'])?1:0, 'enable_captcha'=>isset($vars['enable_captcha'])?1:0, 'auto_claim_tickets'=>isset($vars['auto_claim_tickets'])?1:0, 'show_assigned_tickets'=>isset($vars['show_assigned_tickets'])?1:0, @@ -922,6 +931,8 @@ class OsticketConfig extends Config { 'enable_auto_cron'=>isset($vars['enable_auto_cron'])?1:0, 'enable_mail_polling'=>isset($vars['enable_mail_polling'])?1:0, 'strip_quoted_reply'=>isset($vars['strip_quoted_reply'])?1:0, + 'use_email_priority'=>isset($vars['use_email_priority'])?1:0, + 'add_email_collabs'=>isset($vars['add_email_collabs'])?1:0, 'reply_separator'=>$vars['reply_separator'], )); } @@ -992,6 +1003,7 @@ class OsticketConfig extends Config { return $this->updateAll(array( 'ticket_autoresponder'=>$vars['ticket_autoresponder'], 'message_autoresponder'=>$vars['message_autoresponder'], + 'message_autoresponder_collabs'=>$vars['message_autoresponder_collabs'], 'ticket_notice_active'=>$vars['ticket_notice_active'], 'overlimit_notice_active'=>$vars['overlimit_notice_active'], )); diff --git a/include/class.ticket.php b/include/class.ticket.php index 27908b5fe2ecb7a65d86282b421cb2d082e2e68d..38dac6ca59d86e19f6d9192114fe8bcbe8376cd8 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1548,6 +1548,7 @@ class Ticket { //Add email recipients as collaborators... if ($vars['recipients'] + && (strtolower($origin) != 'email' || ($cfg && $cfg->addCollabsViaEmail())) //Only add if we have a matched local address && $vars['to-email-id']) { //New collaborators added by other collaborators are disable -- @@ -1584,6 +1585,9 @@ class Ticket { $this->onMessage($message, $autorespond); //must be called b4 sending alerts to staff. + if ($autorespond && $cfg && $cfg->notifyCollabsONNewMessage()) + $this->notifyCollaborators($message, array('signature' => '')); + $dept = $this->getDept(); @@ -1627,8 +1631,6 @@ class Ticket { } } - $this->notifyCollaborators($message, array('signature' => '')); - return $message; } diff --git a/include/i18n/en_US/help/tips/settings.autoresponder.yaml b/include/i18n/en_US/help/tips/settings.autoresponder.yaml index 89f0d6faf51216be6524299bbc8fe7711cb894c1..8f764de6f48595dfa281c26a3542b52106d8a9b4 100644 --- a/include/i18n/en_US/help/tips/settings.autoresponder.yaml +++ b/include/i18n/en_US/help/tips/settings.autoresponder.yaml @@ -34,17 +34,28 @@ new_staff_ticket: new_message: title: New Message Confirmation content: > - Confirmation notice sent when a new message is appended to an - existing ticket + Send a confirmation receipt to the message submitter when a new + message is appended to an existing ticket. links: - title: Default New Message Confirmation Template href: /scp/templates.php?default_for=message.autoresp +collaborators: + title: New Activity Notice + content: > + Broadcast messages received from message submitter to all other + participants on the ticket. + overlimit_notice: title: Overlimit Notice content: > - Ticket denied notice sent to user on limit violation. Admin gets - alerts on <em>ALL</em> denials by default + Send ticket denied notice to <offending> user when the <em>maximum + open tickets</em> limit is reached. Admin gets alerts on + <em>ALL</em> denials by default links: - title: Default Overlimit Notice Template href: /scp/templates.php?default_for=ticket.overlimit + + - title: Set <em>Maximum Open Tickets</em> + href: /scp/settings?t=tickets + diff --git a/include/i18n/en_US/help/tips/settings.email.yaml b/include/i18n/en_US/help/tips/settings.email.yaml index fa3ddc043919d4de30038208d9eb588097b7f39b..ce58aa7999059ec07ade6244875616ed0ab8dc59 100644 --- a/include/i18n/en_US/help/tips/settings.email.yaml +++ b/include/i18n/en_US/help/tips/settings.email.yaml @@ -81,3 +81,19 @@ enable_autocron_poll: periodically run cleanup routines called the auto-cron. This setting enables fetching email during this cleanup. +use_email_priority: + title: Honor Email Priority + content: > + Honor the priority flag set in incoming email. If enabled, the + priority of new tickets will be set by the priority of the email + used to create them, if available. + +add_email_collabs: + title: Email Collaborators + content: > + Add participants included in the <code><strong>To</strong></code> and + <code><strong>Cc</strong></code> fields of email as ticket + collaborators<br> + <br> + <em>Collaborators can always be added manually by staff members when + viewing a ticket.</em> diff --git a/include/staff/settings-autoresp.inc.php b/include/staff/settings-autoresp.inc.php index 9123164c6a972a28a0e1a8a07a3d3de9a6b7f90e..927bc56a5b3c94ffb0ea14835b6682c99574014f 100644 --- a/include/staff/settings-autoresp.inc.php +++ b/include/staff/settings-autoresp.inc.php @@ -16,36 +16,45 @@ <tr> <td width="160">New Ticket:</td> <td> - <input type="radio" name="ticket_autoresponder" value="1" <?php echo $config['ticket_autoresponder']?'checked="checked"':''; ?> /><b>Enable</b> - <input type="radio" name="ticket_autoresponder" value="0" <?php echo !$config['ticket_autoresponder']?'checked="checked"':''; ?> />Disable - + <input type="checkbox" name="ticket_autoresponder" <?php +echo $config['ticket_autoresponder'] ? 'checked="checked"' : ''; ?>/> + Ticket Owner <i class="help-tip icon-question-sign" href="#new_ticket"></i> </td> </tr> <tr> - <td width="160">New Ticket by staff:</td> + <td width="160">New Ticket by Staff:</td> <td> - <input type="radio" name="ticket_notice_active" value="1" <?php echo $config['ticket_notice_active']?'checked="checked"':''; ?> /><b>Enable</b> - <input type="radio" name="ticket_notice_active" value="0" <?php echo !$config['ticket_notice_active']?'checked="checked"':''; ?> />Disable - + <input type="checkbox" name="ticket_notice_active" <?php +echo $config['ticket_notice_active'] ? 'checked="checked"' : ''; ?>/> + Ticket Owner <i class="help-tip icon-question-sign" href="#new_staff_ticket"></i> </td> </tr> <tr> - <td width="160">New Message:</td> + <td width="160" rowspan="2">New Message:</td> <td> - <input type="radio" name="message_autoresponder" value="1" <?php echo $config['message_autoresponder']?'checked="checked"':''; ?> /><b>Enable</b> - <input type="radio" name="message_autoresponder" value="0" <?php echo !$config['message_autoresponder']?'checked="checked"':''; ?> />Disable - + <input type="checkbox" name="message_autoresponder" <?php +echo $config['message_autoresponder'] ? 'checked="checked"' : ''; ?>/> + Submitter: Send receipt confirmation <i class="help-tip icon-question-sign" href="#new_message"></i> </td> </tr> <tr> - <td width="160">Overlimit notice:</td> <td> - <input type="radio" name="overlimit_notice_active" value="1" <?php echo $config['overlimit_notice_active']?'checked="checked"':''; ?> /><b>Enable</b> - <input type="radio" name="overlimit_notice_active" value="0" <?php echo !$config['overlimit_notice_active']?'checked="checked"':''; ?> />Disable - + <input type="checkbox" name="message_autoresponder_collabs" <?php +echo $config['message_autoresponder_collabs'] ? 'checked="checked"' : ''; ?>/> + Participants: Send new activity notice + <i class="help-tip icon-question-sign" href="#collaborators"></i> + </div> + </td> + </tr> + <tr> + <td width="160">Overlimit Notice:</td> + <td> + <input type="checkbox" name="overlimit_notice_active" <?php +echo $config['overlimit_notice_active'] ? 'checked="checked"' : ''; ?>/> + Ticket Submitter <i class="help-tip icon-question-sign" href="#overlimit_notice"></i> </td> </tr> diff --git a/include/staff/settings-emails.inc.php b/include/staff/settings-emails.inc.php index 0ccbb959046a34b867ef68c324dc8adeffa3b18d..b4c95d0247d77b0199e60ca796d21aa433a26835 100644 --- a/include/staff/settings-emails.inc.php +++ b/include/staff/settings-emails.inc.php @@ -109,6 +109,21 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) <font class="error"> <?php echo $errors['reply_separator']; ?></font> </td> </tr> + <tr> + <td width="180">Emailed Tickets Priority:</td> + <td> + <input type="checkbox" name="use_email_priority" value="1" <?php echo $config['use_email_priority'] ?'checked="checked"':''; ?> > + <em>(Use email priority when available)</em> + <i class="help-tip icon-question-sign" href="#use_email_priority"></i> + </td> + </tr> + <tr> + <td width="180">Accept Email Collaborators:</td> + <td><input type="checkbox" name="add_email_collabs" <?php + echo $config['add_email_collabs'] ? 'checked="checked"' : ''; ?>/> + Automatically add collaborators from email fields + <i class="help-tip icon-question-sign" href="#add_email_collabs"></i> + </tr> <tr><th colspan=2><em><strong>Outgoing Emails</strong>: Default email only applies to outgoing emails without SMTP setting.</em></th></tr> <tr><td width="180">Default Outgoing Email:</td> <td> diff --git a/include/staff/settings-tickets.inc.php b/include/staff/settings-tickets.inc.php index a1e5936e9859e1192835fa3c6b4130e5f99a436a..c3d204328c300e9f8d3235883cf52b1227a14499 100644 --- a/include/staff/settings-tickets.inc.php +++ b/include/staff/settings-tickets.inc.php @@ -76,13 +76,6 @@ if(!($maxfileuploads=ini_get('max_file_uploads'))) <em>(Minutes to lock a ticket on activity - enter 0 to disable locking)</em> </td> </tr> - <tr> - <td width="180">Emailed Tickets Priority:</td> - <td> - <input type="checkbox" name="use_email_priority" value="1" <?php echo $config['use_email_priority'] ?'checked="checked"':''; ?> > - <em>(Use email priority when available)</em> - </td> - </tr> <tr> <td width="180">Show Related Tickets:</td> <td>