Skip to content

Commit

Permalink
Ticket Merge: Close Children
Browse files Browse the repository at this point in the history
When tickets are merged, we should automatically close children Tickets. This commit gives the Agent an option of which closed status they want children tickets to be set to.

This references issue #5049
  • Loading branch information
aydreeihn committed Oct 29, 2019
1 parent 3a41a8a commit 6fef208
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/class.ticket.php
Expand Up @@ -2533,6 +2533,7 @@ function merge($tickets) {
$child->getThread()->setExtra($parentThread); $child->getThread()->setExtra($parentThread);


$child->setMergeType($options['combine']); $child->setMergeType($options['combine']);
$child->setStatus(intval($options['statusId']));


if ($options['delete-child'] || $options['move-tasks']) { if ($options['delete-child'] || $options['move-tasks']) {
if ($tasks = Task::objects() if ($tasks = Task::objects()
Expand Down
5 changes: 5 additions & 0 deletions include/i18n/en_US/help/tips/tickets.queue.yaml
Expand Up @@ -85,6 +85,11 @@ merge_types:
<b>Separate Threads:</b> <b>Separate Threads:</b>
Threads from Tickets will be displayed one Ticket at a time. Threads from Tickets will be displayed one Ticket at a time.
child_status:
title: Child Ticket Status
content: >
All Child Tickets will be set to a closed status since thread entries will all be moved to the Parent Ticket.
reply_types: reply_types:
title: Reply Types title: Reply Types
content: > content: >
Expand Down
20 changes: 20 additions & 0 deletions include/staff/templates/merge-tickets.tmpl.php
Expand Up @@ -97,6 +97,26 @@
</label> </label>
</div> </div>
<br/><br/> <br/><br/>
<div id="child-status">
&nbsp;&nbsp;&nbsp;
<label class="inline checkbox">
<?php echo __('Child Status');?>
<select id="statusId" name="statusId">
<?php
$states = array('closed');
foreach (TicketStatusList::getStatuses(
array('states' => $states)) as $s) {
if (!$s->isEnabled()) continue;
echo sprintf('<option value="%d">%s</option>',
$s->getId(),
$s->getLocalName());
}
?>
</select>
<i class="help-tip icon-question-sign" href="#child_status"></i>
</label>
</div>
<br/>
<?php } ?> <?php } ?>


<div> <div>
Expand Down

0 comments on commit 6fef208

Please sign in to comment.