|
|
|
@ -32,14 +32,16 @@ $(function() { |
|
|
|
|
$(this).dialog("close"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
$("a#assign").click(function () { |
|
|
|
|
$( "#dialog-form" ).dialog( "open" ); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$(".responseyes").click(function () { |
|
|
|
|
if(!confirm("'.get_lang('Are you sure').' : '.strtoupper(get_lang('Yes')).'. '.get_lang('If you are certain, the ticket will be closed.').'")){ |
|
|
|
|
if(!confirm("'.get_lang('Are you sure').' : '.strtoupper(get_lang('Yes')).'. '.get_lang( |
|
|
|
|
'If you are certain, the ticket will be closed.' |
|
|
|
|
).'")){ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -130,9 +132,10 @@ if (empty($ticket)) { |
|
|
|
|
} |
|
|
|
|
$projectId = $ticket['ticket']['project_id']; |
|
|
|
|
$userIsAllowInProject = TicketManager::userIsAllowInProject($userInfo, $projectId); |
|
|
|
|
$allowEdition = $ticket['ticket']['assigned_last_user'] == $user_id || |
|
|
|
|
$ticket['ticket']['sys_insert_user_id'] == $user_id || |
|
|
|
|
$isAdmin; |
|
|
|
|
$allowEdition = $ticket['ticket']['assigned_last_user'] == $user_id |
|
|
|
|
|| $ticket['ticket']['sys_insert_user_id'] |
|
|
|
|
== $user_id |
|
|
|
|
|| $isAdmin; |
|
|
|
|
|
|
|
|
|
if (false === $userIsAllowInProject) { |
|
|
|
|
// make sure it's either a user assigned to this ticket, or the reporter, or and admin |
|
|
|
@ -182,7 +185,8 @@ foreach ($messages as $message) { |
|
|
|
|
$entireMessage = $receivedMessage.$attachmentLinks; |
|
|
|
|
$counterLink = Display::url('#'.$counter, api_get_self().'?ticket_id='.$ticket_id.'#note-'.$counter); |
|
|
|
|
|
|
|
|
|
$messageToShow .= '<a id="note-'.$counter.'"> </a><h4>'.sprintf( |
|
|
|
|
$messageToShow .= '<a id="note-'.$counter.'"> </a><h4>' |
|
|
|
|
.sprintf( |
|
|
|
|
get_lang('Update successfulByX'), |
|
|
|
|
$message['user_info']['complete_name_with_message_link'] |
|
|
|
|
); |
|
|
|
@ -201,10 +205,11 @@ foreach ($messages as $message) { |
|
|
|
|
|
|
|
|
|
$subject = get_lang('Re:').': '.Security::remove_XSS($ticket['ticket']['subject']); |
|
|
|
|
|
|
|
|
|
if ($allowEdition && |
|
|
|
|
TicketManager::STATUS_FORWARDED != $ticket['ticket']['status_id'] && |
|
|
|
|
TicketManager::STATUS_CLOSE != $ticket['ticket']['status_id'] |
|
|
|
|
) { |
|
|
|
|
if ($allowEdition |
|
|
|
|
&& TicketManager::STATUS_FORWARDED != $ticket['ticket']['status_id'] |
|
|
|
|
&& TicketManager::STATUS_CLOSE |
|
|
|
|
!= $ticket['ticket']['status_id'] |
|
|
|
|
) { |
|
|
|
|
$form = getForm($ticket['ticket']); |
|
|
|
|
$formToShow = $form->returnForm(); |
|
|
|
|
|
|
|
|
@ -216,8 +221,9 @@ if ($allowEdition && |
|
|
|
|
|
|
|
|
|
if ($isAdmin) { |
|
|
|
|
$oldUserId = $ticket['ticket']['assigned_last_user']; |
|
|
|
|
if (isset($_POST['assigned_last_user']) && !empty($_POST['assigned_last_user']) && |
|
|
|
|
$_POST['assigned_last_user'] != $oldUserId |
|
|
|
|
if (isset($_POST['assigned_last_user']) |
|
|
|
|
&& !empty($_POST['assigned_last_user']) |
|
|
|
|
&& $_POST['assigned_last_user'] != $oldUserId |
|
|
|
|
) { |
|
|
|
|
TicketManager::assignTicketToUser( |
|
|
|
|
$ticket_id, |
|
|
|
@ -414,9 +420,7 @@ if (null != $ticket['ticket']['course_url']) { |
|
|
|
|
|
|
|
|
|
echo '<tr> |
|
|
|
|
<td> |
|
|
|
|
<b>'.get_lang('Description').':</b> <br /> |
|
|
|
|
'.Security::remove_XSS($ticket['ticket']['message']).' |
|
|
|
|
|
|
|
|
|
<b>'.get_lang('Description').':</b><br />'.Security::remove_XSS($ticket['ticket']['message']).' |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
'; |
|
|
|
@ -525,10 +529,13 @@ function getForm($ticket) |
|
|
|
|
); |
|
|
|
|
$form->addLabel( |
|
|
|
|
'', |
|
|
|
|
'<span id="link-more-attach"> |
|
|
|
|
<span class="btn btn-success" onclick="return add_image_form()">'.get_lang('Add one more file').'</span> |
|
|
|
|
</span> |
|
|
|
|
('.sprintf(get_lang('Maximun file size: %s'), format_file_size(api_get_setting('message_max_upload_filesize'))).')' |
|
|
|
|
'<span id="link-more-attach"><span class="btn btn-success" onclick="return add_image_form()">' |
|
|
|
|
.get_lang('Add one more file') |
|
|
|
|
.'</span></span>(' |
|
|
|
|
.sprintf( |
|
|
|
|
get_lang('Maximun file size: %s'), |
|
|
|
|
format_file_size((int) api_get_setting('message_max_upload_filesize')) |
|
|
|
|
).')' |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
$form->addElement('html', '<br/>'); |
|
|
|
|