Skip to content
Snippets Groups Projects
Commit d2a3d163 authored by Jared Hancock's avatar Jared Hancock
Browse files

Merge remote branch 'upstream/develop' into develop-next

parents 21281424 22033909
No related branches found
No related tags found
No related merge requests found
...@@ -147,6 +147,7 @@ class OsticketConfig extends Config { ...@@ -147,6 +147,7 @@ class OsticketConfig extends Config {
'allow_online_attachments' => true, 'allow_online_attachments' => true,
'allow_online_attachments_onlogin' => false, 'allow_online_attachments_onlogin' => false,
'name_format' => 'full', # First Last 'name_format' => 'full', # First Last
'auto_claim_tickets'=> true,
); );
function OsticketConfig($section=null) { function OsticketConfig($section=null) {
...@@ -653,8 +654,8 @@ class OsticketConfig extends Config { ...@@ -653,8 +654,8 @@ class OsticketConfig extends Config {
return ($this->get('overdue_alert_dept_members')); return ($this->get('overdue_alert_dept_members'));
} }
function autoAssignReopenedTickets() { function autoClaimTickets() {
return ($this->get('auto_assign_reopened_tickets')); return $this->get('auto_claim_tickets');
} }
function showAssignedTickets() { function showAssignedTickets() {
......
...@@ -813,10 +813,14 @@ class Ticket { ...@@ -813,10 +813,14 @@ class Ticket {
.' ,isanswered='.db_input($isanswered) .' ,isanswered='.db_input($isanswered)
.' WHERE ticket_id='.db_input($this->getId()); .' WHERE ticket_id='.db_input($this->getId());
//TODO: log reopen event here if (!db_query($sql) || !db_affected_rows())
return false;
$this->logEvent('reopened', 'closed'); $this->logEvent('reopened', 'closed');
return (db_query($sql) && db_affected_rows()); $this->ht['status'] = 'open';
$this->ht['isanswerd'] = $isanswered;
return true;
} }
function onNewTicket($message, $autorespond=true, $alertstaff=true) { function onNewTicket($message, $autorespond=true, $alertstaff=true) {
...@@ -974,7 +978,7 @@ class Ticket { ...@@ -974,7 +978,7 @@ class Ticket {
//auto-assign to closing staff or last respondent //auto-assign to closing staff or last respondent
if(!($staff=$this->getStaff()) || !$staff->isAvailable()) { if(!($staff=$this->getStaff()) || !$staff->isAvailable()) {
if($cfg->autoAssignReopenedTickets() && ($lastrep=$this->getLastRespondent()) && $lastrep->isAvailable()) { if(($lastrep=$this->getLastRespondent()) && $lastrep->isAvailable()) {
$this->setStaffId($lastrep->getId()); //direct assignment; $this->setStaffId($lastrep->getId()); //direct assignment;
} else { } else {
$this->setStaffId(0); //unassign - last respondent is not available. $this->setStaffId(0); //unassign - last respondent is not available.
...@@ -1595,6 +1599,10 @@ class Ticket { ...@@ -1595,6 +1599,10 @@ class Ticket {
if(isset($vars['reply_ticket_status']) && $vars['reply_ticket_status']) if(isset($vars['reply_ticket_status']) && $vars['reply_ticket_status'])
$this->setStatus($vars['reply_ticket_status']); $this->setStatus($vars['reply_ticket_status']);
if($thisstaff && $this->isOpen() && !$this->getStaffId()
&& $cfg->autoClaimTickets())
$this->setStaffId($thisstaff->getId()); //direct assignment;
$this->onResponse(); //do house cleaning.. $this->onResponse(); //do house cleaning..
/* email the user?? - if disabled - the bail out */ /* email the user?? - if disabled - the bail out */
......
...@@ -71,7 +71,7 @@ core: ...@@ -71,7 +71,7 @@ core:
assigned_alert_staff: 1 assigned_alert_staff: 1
assigned_alert_team_lead: 0 assigned_alert_team_lead: 0
assigned_alert_team_members: 0 assigned_alert_team_members: 0
auto_assign_reopened_tickets: 1 auto_claim_tickets: 1
show_related_tickets: 1 show_related_tickets: 1
show_assigned_tickets: 1 show_assigned_tickets: 1
show_answered_tickets: 0 show_answered_tickets: 0
......
...@@ -98,10 +98,12 @@ if(!($maxfileuploads=ini_get('max_file_uploads'))) ...@@ -98,10 +98,12 @@ if(!($maxfileuploads=ini_get('max_file_uploads')))
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Reopened Tickets:</td> <td>Claim Tickets:</td>
<td> <td>
<input type="checkbox" name="auto_assign_reopened_tickets" <?php echo $config['auto_assign_reopened_tickets']?'checked="checked"':''; ?>> <input type="checkbox" name="auto_claim_tickets" <?php echo $config['auto_claim_tickets']?'checked="checked"':''; ?>>
Auto-assign reopened tickets to the last available respondent. Auto-assign unassigned tickets on response
<!-- Help Tip:
Reopened tickets are always assigned to the last respondent -->
</td> </td>
</tr> </tr>
<tr> <tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment