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

Merge pull request #325 from protich/issue/fixes


fix: user +  collaborators update

Reviewed-By: default avatarJared Hancock <jared@osticket.com>
parents 52fed4ca 997e484c
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
......@@ -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">
......
......@@ -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
} ?>
......
......@@ -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;
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment