Minor - Format code - refs BT#18902

pull/3939/head
Angel Fernando Quiroz Campos 4 years ago
parent f1266c26df
commit f0ba2cc175
  1. 13
      public/main/ticket/new_ticket.php
  2. 45
      public/main/ticket/ticket_details.php

@ -109,7 +109,7 @@ $htmlHeadXtra[] = '<script>
var course_required = '.js_array($types, 'course_required', 'course_required').'
var other_area = '.js_array($types, 'other_area', 'other_area').'
var email = '.js_array($types, 'email', 'email').
'</script>';
'</script>';
/**
* @param $array
@ -311,10 +311,13 @@ $form->addLabel('', '<span id="filepaths"><div id="filepath_1"></div></span>');
$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 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/>');

@ -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/>');

Loading…
Cancel
Save