diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php index 48037903077945b7caf6a5871574f3ef5732e59e..d45c32e845d3cd7c9efc40fe4a57d2e8e8d4c553 100644 --- a/include/ajax.tickets.php +++ b/include/ajax.tickets.php @@ -577,12 +577,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 bc6a25e3fd57d8d859f8dd6de2af2113e6235801..d541caa354a9aabeb0f8a013355082f8bc9dbc40 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -154,8 +154,7 @@ if($ticket->isOverdue()) $('#user-'+user.id+'-name').text(user.name); $('#user-'+user.id+'-email').text(user.email); $('#user-'+user.id+'-phone').text(user.phone); - $('#user-to-name').text(user.name); - $('#user-to-email').text(user.email); + $('select#emailreply option[value=1]').text(user.name+' <'+user.email+'>'); }); return false; "><i class="icon-user"></i> <span id="user-<?php echo $ticket->getOwnerId(); ?>-name" @@ -440,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 @@ -452,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; });