Skip to content
Snippets Groups Projects
Commit 45cb100f authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #692 from greezybacon/feature/disable-collaboration


Allow disabling the collaborator features

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents d6f29f30 3dd9a242
Branches
Tags
No related merge requests found
...@@ -151,6 +151,8 @@ class OsticketConfig extends Config { ...@@ -151,6 +151,8 @@ class OsticketConfig extends Config {
'system_language' => 'en_US', 'system_language' => 'en_US',
'default_storage_bk' => 'D', 'default_storage_bk' => 'D',
'allow_client_updates' => false, 'allow_client_updates' => false,
'message_autoresponder_collabs' => true,
'add_email_collabs' => true,
); );
function OsticketConfig($section=null) { function OsticketConfig($section=null) {
...@@ -531,6 +533,10 @@ class OsticketConfig extends Config { ...@@ -531,6 +533,10 @@ class OsticketConfig extends Config {
return ($this->get('use_email_priority')); return ($this->get('use_email_priority'));
} }
function addCollabsViaEmail() {
return ($this->get('add_email_collabs'));
}
function getAdminEmail() { function getAdminEmail() {
return $this->get('admin_email'); return $this->get('admin_email');
} }
...@@ -560,6 +566,10 @@ class OsticketConfig extends Config { ...@@ -560,6 +566,10 @@ class OsticketConfig extends Config {
return ($this->get('message_autoresponder')); return ($this->get('message_autoresponder'));
} }
function notifyCollabsONNewMessage() {
return ($this->get('message_autoresponder_collabs'));
}
function notifyONNewStaffTicket() { function notifyONNewStaffTicket() {
return ($this->get('ticket_notice_active')); return ($this->get('ticket_notice_active'));
} }
...@@ -874,7 +884,6 @@ class OsticketConfig extends Config { ...@@ -874,7 +884,6 @@ class OsticketConfig extends Config {
'default_sla_id'=>$vars['default_sla_id'], 'default_sla_id'=>$vars['default_sla_id'],
'max_open_tickets'=>$vars['max_open_tickets'], 'max_open_tickets'=>$vars['max_open_tickets'],
'autolock_minutes'=>$vars['autolock_minutes'], 'autolock_minutes'=>$vars['autolock_minutes'],
'use_email_priority'=>isset($vars['use_email_priority'])?1:0,
'enable_captcha'=>isset($vars['enable_captcha'])?1:0, 'enable_captcha'=>isset($vars['enable_captcha'])?1:0,
'auto_claim_tickets'=>isset($vars['auto_claim_tickets'])?1:0, 'auto_claim_tickets'=>isset($vars['auto_claim_tickets'])?1:0,
'show_assigned_tickets'=>isset($vars['show_assigned_tickets'])?1:0, 'show_assigned_tickets'=>isset($vars['show_assigned_tickets'])?1:0,
...@@ -922,6 +931,8 @@ class OsticketConfig extends Config { ...@@ -922,6 +931,8 @@ class OsticketConfig extends Config {
'enable_auto_cron'=>isset($vars['enable_auto_cron'])?1:0, 'enable_auto_cron'=>isset($vars['enable_auto_cron'])?1:0,
'enable_mail_polling'=>isset($vars['enable_mail_polling'])?1:0, 'enable_mail_polling'=>isset($vars['enable_mail_polling'])?1:0,
'strip_quoted_reply'=>isset($vars['strip_quoted_reply'])?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'], 'reply_separator'=>$vars['reply_separator'],
)); ));
} }
...@@ -992,6 +1003,7 @@ class OsticketConfig extends Config { ...@@ -992,6 +1003,7 @@ class OsticketConfig extends Config {
return $this->updateAll(array( return $this->updateAll(array(
'ticket_autoresponder'=>$vars['ticket_autoresponder'], 'ticket_autoresponder'=>$vars['ticket_autoresponder'],
'message_autoresponder'=>$vars['message_autoresponder'], 'message_autoresponder'=>$vars['message_autoresponder'],
'message_autoresponder_collabs'=>$vars['message_autoresponder_collabs'],
'ticket_notice_active'=>$vars['ticket_notice_active'], 'ticket_notice_active'=>$vars['ticket_notice_active'],
'overlimit_notice_active'=>$vars['overlimit_notice_active'], 'overlimit_notice_active'=>$vars['overlimit_notice_active'],
)); ));
......
...@@ -1548,6 +1548,7 @@ class Ticket { ...@@ -1548,6 +1548,7 @@ class Ticket {
//Add email recipients as collaborators... //Add email recipients as collaborators...
if ($vars['recipients'] if ($vars['recipients']
&& (strtolower($origin) != 'email' || ($cfg && $cfg->addCollabsViaEmail()))
//Only add if we have a matched local address //Only add if we have a matched local address
&& $vars['to-email-id']) { && $vars['to-email-id']) {
//New collaborators added by other collaborators are disable -- //New collaborators added by other collaborators are disable --
...@@ -1584,6 +1585,9 @@ class Ticket { ...@@ -1584,6 +1585,9 @@ class Ticket {
$this->onMessage($message, $autorespond); //must be called b4 sending alerts to staff. $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(); $dept = $this->getDept();
...@@ -1627,8 +1631,6 @@ class Ticket { ...@@ -1627,8 +1631,6 @@ class Ticket {
} }
} }
$this->notifyCollaborators($message, array('signature' => ''));
return $message; return $message;
} }
......
...@@ -34,17 +34,28 @@ new_staff_ticket: ...@@ -34,17 +34,28 @@ new_staff_ticket:
new_message: new_message:
title: New Message Confirmation title: New Message Confirmation
content: > content: >
Confirmation notice sent when a new message is appended to an Send a confirmation receipt to the message submitter when a new
existing ticket message is appended to an existing ticket.
links: links:
- title: Default New Message Confirmation Template - title: Default New Message Confirmation Template
href: /scp/templates.php?default_for=message.autoresp 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: overlimit_notice:
title: Overlimit Notice title: Overlimit Notice
content: > content: >
Ticket denied notice sent to user on limit violation. Admin gets Send ticket denied notice to <offending> user when the <em>maximum
alerts on <em>ALL</em> denials by default open tickets</em> limit is reached. Admin gets alerts on
<em>ALL</em> denials by default
links: links:
- title: Default Overlimit Notice Template - title: Default Overlimit Notice Template
href: /scp/templates.php?default_for=ticket.overlimit href: /scp/templates.php?default_for=ticket.overlimit
- title: Set <em>Maximum Open Tickets</em>
href: /scp/settings?t=tickets
...@@ -81,3 +81,19 @@ enable_autocron_poll: ...@@ -81,3 +81,19 @@ enable_autocron_poll:
periodically run cleanup routines called the auto-cron. This setting periodically run cleanup routines called the auto-cron. This setting
enables fetching email during this cleanup. 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>
...@@ -16,36 +16,45 @@ ...@@ -16,36 +16,45 @@
<tr> <tr>
<td width="160">New Ticket:</td> <td width="160">New Ticket:</td>
<td> <td>
<input type="radio" name="ticket_autoresponder" value="1" <?php echo $config['ticket_autoresponder']?'checked="checked"':''; ?> /><b>Enable</b> <input type="checkbox" name="ticket_autoresponder" <?php
<input type="radio" name="ticket_autoresponder" value="0" <?php echo !$config['ticket_autoresponder']?'checked="checked"':''; ?> />Disable echo $config['ticket_autoresponder'] ? 'checked="checked"' : ''; ?>/>
&nbsp; Ticket Owner&nbsp;
<i class="help-tip icon-question-sign" href="#new_ticket"></i> <i class="help-tip icon-question-sign" href="#new_ticket"></i>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="160">New Ticket by staff:</td> <td width="160">New Ticket by Staff:</td>
<td> <td>
<input type="radio" name="ticket_notice_active" value="1" <?php echo $config['ticket_notice_active']?'checked="checked"':''; ?> /><b>Enable</b> <input type="checkbox" name="ticket_notice_active" <?php
<input type="radio" name="ticket_notice_active" value="0" <?php echo !$config['ticket_notice_active']?'checked="checked"':''; ?> />Disable echo $config['ticket_notice_active'] ? 'checked="checked"' : ''; ?>/>
&nbsp; Ticket Owner&nbsp;
<i class="help-tip icon-question-sign" href="#new_staff_ticket"></i> <i class="help-tip icon-question-sign" href="#new_staff_ticket"></i>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="160">New Message:</td> <td width="160" rowspan="2">New Message:</td>
<td> <td>
<input type="radio" name="message_autoresponder" value="1" <?php echo $config['message_autoresponder']?'checked="checked"':''; ?> /><b>Enable</b> <input type="checkbox" name="message_autoresponder" <?php
<input type="radio" name="message_autoresponder" value="0" <?php echo !$config['message_autoresponder']?'checked="checked"':''; ?> />Disable echo $config['message_autoresponder'] ? 'checked="checked"' : ''; ?>/>
&nbsp; Submitter: Send receipt confirmation&nbsp;
<i class="help-tip icon-question-sign" href="#new_message"></i> <i class="help-tip icon-question-sign" href="#new_message"></i>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="160">Overlimit notice:</td>
<td> <td>
<input type="radio" name="overlimit_notice_active" value="1" <?php echo $config['overlimit_notice_active']?'checked="checked"':''; ?> /><b>Enable</b> <input type="checkbox" name="message_autoresponder_collabs" <?php
<input type="radio" name="overlimit_notice_active" value="0" <?php echo !$config['overlimit_notice_active']?'checked="checked"':''; ?> />Disable echo $config['message_autoresponder_collabs'] ? 'checked="checked"' : ''; ?>/>
&nbsp; Participants: Send new activity notice&nbsp;
<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&nbsp;
<i class="help-tip icon-question-sign" href="#overlimit_notice"></i> <i class="help-tip icon-question-sign" href="#overlimit_notice"></i>
</td> </td>
</tr> </tr>
......
...@@ -109,6 +109,21 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) ...@@ -109,6 +109,21 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config)
&nbsp;<font class="error">&nbsp;<?php echo $errors['reply_separator']; ?></font> &nbsp;<font class="error">&nbsp;<?php echo $errors['reply_separator']; ?></font>
</td> </td>
</tr> </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&nbsp;
<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><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> <tr><td width="180">Default Outgoing Email:</td>
<td> <td>
......
...@@ -76,13 +76,6 @@ if(!($maxfileuploads=ini_get('max_file_uploads'))) ...@@ -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> <em>(Minutes to lock a ticket on activity - enter 0 to disable locking)</em>
</td> </td>
</tr> </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> <tr>
<td width="180">Show Related Tickets:</td> <td width="180">Show Related Tickets:</td>
<td> <td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment