diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php index bee2c7d6cfcd7be03684f1baedb273979b7205a5..cbb954be403a1289609f8e19810844a5238d3b2f 100644 --- a/include/ajax.tickets.php +++ b/include/ajax.tickets.php @@ -554,12 +554,12 @@ class TicketsAjaxAPI extends AjaxController { || !$ticket->checkStaffAccess($thisstaff)) Http::response(404, 'No such ticket'); - $errors = $info = array(); - if ($ticket->updateCollaborators($_POST, $errors)) { - $info +=array('msg' => 'Collaborators updated successfully'); - } elseif($errors && $errors['err']) { + $errors = $info = array(); + if ($ticket->updateCollaborators($_POST, $errors)) + Http::response(201, sprintf('Recipients (%d)', $ticket->getNumCollaborators())); + + if($errors && $errors['err']) $info +=array('error' => $errors['err']); - } return self::_collaborators($ticket, $info); } diff --git a/include/staff/templates/collaborators.tmpl.php b/include/staff/templates/collaborators.tmpl.php index a10bf0c105b5d9ea5a116a09600d66ac29ca93eb..3136cc96d29c507168cddc3f0d55bdf2d7f71f2f 100644 --- a/include/staff/templates/collaborators.tmpl.php +++ b/include/staff/templates/collaborators.tmpl.php @@ -40,8 +40,8 @@ if(($users=$ticket->getCollaborators())) {?> <div id="savewarning" style="display:none; padding-top:2px;"><p id="msg_warning">You have made changes that you need to save.</p></div> <p class="full-width"> <span class="buttons" style="float:left"> + <input type="button" value="Cancel" class="close"> <input type="reset" value="Reset"> - <input type="button" value="Done" class="close"> </span> <span class="buttons" style="float:right"> <input type="submit" value="Save Changes"> diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index 213c2f4fb845d6493562686e022ba7530bd8762e..d541caa354a9aabeb0f8a013355082f8bc9dbc40 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -439,11 +439,11 @@ $tcount+= $ticket->getNumNotes(); <?php if(1) { //Make CC optional feature? NO, for now. ?> - <tbody id="cc_sec" style="display:<?php echo $emailReply? - 'table-row-group':'none'; ?>;"> - <tr> + <tbody id="cc_sec" + style="display:<?php echo $emailReply? 'table-row-group':'none'; ?>;"> + <tr> <td width="120"> - <label><strong>Recipients:</strong></label> + <label><strong>Collaborators:</strong></label> </td> <td> <?php @@ -451,18 +451,18 @@ $tcount+= $ticket->getNumNotes(); <input type='checkbox' value='1' name="emailcollab" id="emailcollab" <?php echo ((!$info['emailcollab'] && !$errors) || isset($info['emailcollab']))?'checked="checked"':''; ?>> <?php - echo sprintf('<a class="collaborators" - href="#tickets/%d/collaborators/manage">Collaborators (%d)</a>', - $ticket->getId(), - $ticket->getNumCollaborators()); - } else { - echo sprintf('<div><a class="collaborators" - href="#tickets/%d/collaborators/manage" >Add Collaborators</a></div>', - $ticket->getId()); } + $recipients = 'Add Recipients'; + if ($ticket->getNumCollaborators()) + $recipients = sprintf('Recipients (%d)', $ticket->getNumCollaborators()); + + echo sprintf('<span><a class="collaborators" + href="#tickets/%d/collaborators/manage"><span id="recipients">%s</span></a></span>', + $ticket->getId(), + $recipients); ?> </td> - </tr> + </tr> </tbody> <?php } ?> diff --git a/scp/js/ticket.js b/scp/js/ticket.js index c91cacaa9eff51205a25265bdfa210d5e7c3864f..cbe25c1e39f4ae8d6b2917acc5fbe47c5a9a5f73 100644 --- a/scp/js/ticket.js +++ b/scp/js/ticket.js @@ -368,6 +368,7 @@ jQuery(function($) { e.preventDefault(); var url = 'ajax.php/'+$(this).attr('href').substr(1); $.dialog(url, 201, function (resp) { + $('#recipients').text(resp); }); return false; });