Ticket Plugin - refs #6715

1.9.x
Francis Gonzales 11 years ago
parent 27fcdfb271
commit 6419d8b921
  1. 16
      main/inc/lib/plugin.class.php
  2. 1
      plugin/ticket/config.php
  3. 11
      plugin/ticket/database.php
  4. 145
      plugin/ticket/src/myticket.php
  5. 106
      plugin/ticket/src/new_ticket.php
  6. 19
      plugin/ticket/src/ticket.class.php
  7. 28
      plugin/ticket/src/ticket_details.php
  8. 1
      plugin/ticket/src/ticket_plugin.class.php

@ -571,15 +571,17 @@ class Plugin
public function addExtraSettings($settings)
{
$pluginName = $this->get_name();
$resp = false;
foreach ($settings as $setting => $value) {
$attributes = array(
'variable' => 'plugin_settings_' . $pluginName,
'subkey' => $setting,
'selected_value' => $value
'selected_value' => $value,
'category' => 'PluginSettings'
);
$resp = Database::insert('settings_current', $attributes);
if (empty($this->getExtraSettingValue($setting))) {
$resp = Database::insert('settings_current', $attributes);
}
}
return $resp;
@ -610,9 +612,11 @@ class Plugin
{
$pluginName = $this->get_name();
$whereCond = array(
'where' => array('variable = "?"' => 'plugin_settings_' . $pluginName)
'variable = ?' => 'plugin_settings_' . $pluginName
);
Database::delete('settings_current', $whereCond);
$resp = Database::delete('settings_current', $whereCond);
return $resp;
}
/**

@ -31,6 +31,7 @@ define('LOW', 'LOW');
define('SRC_EMAIL', 'MAI');
define('SRC_PHONE', 'TEL');
define('SRC_PRESC', 'PRE');
define('SRC_PLATFORM', 'PLA');
/* Ticket category constants */
define('CAT_DOCU', 'DOC');

@ -129,6 +129,7 @@ foreach ($defaultPriorities as $pId => $priority) {
$attributes = array(
'iid' => $i,
'priority_id' => $pId,
'priority' => $priority,
'priority_desc' => $priority
);
Database::insert($table, $attributes);
@ -197,6 +198,7 @@ $sql = "CREATE TABLE IF NOT EXISTS ".$table." (
category_id char(3) NOT NULL,
priority_id char(3) NOT NULL,
course_id int UNSIGNED NOT NULL,
session_id int UNSIGNED NOT NULL DEFAULT '0',
request_user int UNSIGNED NOT NULL,
personal_email varchar(150) DEFAULT NULL,
assigned_last_user int UNSIGNED NOT NULL DEFAULT '0',
@ -216,7 +218,10 @@ $sql = "CREATE TABLE IF NOT EXISTS ".$table." (
KEY FK_ticket_category (project_id,category_id))";
Database::query($sql);
// Menu main tabs
//Menu main tabs
$objPlugin->addTab('Ticket', '/plugin/ticket/src/myticket.php');
$objPlugin->addExtraSettings('allow_add', '1');
//Extra Settings
$extraSettings = array(
'allow_add' => 'true'
);
$objPlugin->addExtraSettings($extraSettings);

@ -64,15 +64,26 @@ function display_advanced_search_form () {
}
</script>
<style>
div.row div.label2 {
.label2 {
float: left;
width: 35%;
text-align: left;
width: 75px;
}
div.row div.formw2 {
width: 65%;
.label3 {
margin-left: 20px;
float: left;
text-align: left;
margin-top: 5px;
width: 50px;
}
.formw2 {
float: left;
margin-left: 4px;
margin-top: 5px;
}
.blackboard_show {
float: left;
position: absolute;
@ -83,6 +94,7 @@ div.row div.formw2 {
padding: 3px;
display: inline;
}
.blackboard_hide {
display: none;
}
@ -113,11 +125,33 @@ if (isset($_GET['action'])) {
TicketManager::send_alert($_GET['ticket_id'], $user_id);
break;
case 'export':
$data = array(array($plugin->get_lang('TicketNum'), $plugin->get_lang('Date'), $plugin->get_lang('DateLastEdition'), $plugin->get_lang('Category'), $plugin->get_lang('User'), $plugin->get_lang('Program'), $plugin->get_lang('Responsible'), $plugin->get_lang('Status'), $plugin->get_lang('Message'), $plugin->get_lang('Description')));
$data = array(
array(
$plugin->get_lang('TicketNum'),
$plugin->get_lang('Date'),
$plugin->get_lang('DateLastEdition'),
$plugin->get_lang('Category'),
$plugin->get_lang('User'),
$plugin->get_lang('Program'),
$plugin->get_lang('Responsible'),
$plugin->get_lang('Status'),
$plugin->get_lang('Description')
)
);
$datos = $table->get_clean_html();
foreach ($datos as $ticket) {
$ticket[0] = substr(strip_tags($ticket[0]), 0, 12);
$ticket_rem = array(utf8_decode(strip_tags($ticket[0])), utf8_decode(api_html_entity_decode($ticket[1])), utf8_decode(strip_tags($ticket[2])), utf8_decode(strip_tags($ticket[3])), utf8_decode(strip_tags($ticket[4])), utf8_decode(strip_tags($ticket[5])), utf8_decode(strip_tags($ticket[6])), utf8_decode(strip_tags($ticket[7])), utf8_decode(strip_tags($ticket[8])), utf8_decode(strip_tags($ticket[10])));
$ticket_rem = array(
utf8_decode(strip_tags($ticket[0])),
utf8_decode(api_html_entity_decode($ticket[1])),
utf8_decode(strip_tags($ticket[2])),
utf8_decode(strip_tags($ticket[3])),
utf8_decode(strip_tags($ticket[4])),
utf8_decode(strip_tags($ticket[5])),
utf8_decode(strip_tags($ticket[6])),
utf8_decode(strip_tags($ticket[7])),
utf8_decode(strip_tags(str_replace('&nbsp;', ' ', $ticket[9])))
);
$data[] = $ticket_rem;
}
Export::export_table_xls($data, $plugin->get_lang('Tickets'));
@ -146,7 +180,7 @@ if ($isAdmin) {
$get_parameter .= "&submit_simple=";
}
//select categories
$select_types .= '<select class="chzn-select" style="width: 200px; " name = "keyword_category" id="keyword_category" ">';
$select_types .= '<select class="chzn-select" name = "keyword_category" id="keyword_category" ">';
$select_types .= '<option value="">---' . get_lang('Select') . '---</option>';
$types = TicketManager::get_all_tickets_categories();
foreach ($types as $type) {
@ -154,7 +188,7 @@ if ($isAdmin) {
}
$select_types .= "</select>";
//select admins
$select_admins .= '<select class ="chzn-select" style="width: 200px; " name = "keyword_admin" id="keyword_admin" ">';
$select_admins .= '<select class ="chzn-select" name = "keyword_admin" id="keyword_admin" ">';
$select_admins .= '<option value="">---' . get_lang('Select') . '---</option>';
$select_admins .= '<option value = "0">' . $plugin->get_lang('Unassigned') . '</option>';
$admins = UserManager::get_user_list_like(array("status" => "1"), array("username"), true);
@ -163,7 +197,7 @@ if ($isAdmin) {
}
$select_admins .= "</select>";
//select status
$select_status .= '<select class ="chzn-select" style="width: 200px; " name = "keyword_status" id="keyword_status" >';
$select_status .= '<select class ="chzn-select" name = "keyword_status" id="keyword_status" >';
$select_status .= '<option value="">---' . get_lang('Select') . '---</option>';
$status = TicketManager::get_all_tickets_status();
foreach ($status as $stat) {
@ -171,18 +205,18 @@ if ($isAdmin) {
}
$select_status .= "</select>";
//select priority
$select_priority .= '<select style="width: 200px; " name = "keyword_priority" id="keyword_priority" >';
$select_priority .= '<select name = "keyword_priority" id="keyword_priority" >';
$select_priority .= '<option value="">' . get_lang('All') . '</option>';
$select_priority .= '<option value="NRM">' . get_lang('PriorityNormal') . '</option>';
$select_priority .= '<option value="ALT">' . get_lang('PriorityHigh') . '</option>';
$select_priority .= '<option value="HGH">' . get_lang('PriorityHigh') . '</option>';
$select_priority .= '<option value="LOW">' . get_lang('PriorityLow') . '</option>';
$select_priority .= "</select>";
//select unread
$select_unread = '<select style="width: 100px; " name = "keyword_unread" id="keyword_unread" >';
$select_unread = '<select name = "keyword_unread" id="keyword_unread" >';
$select_unread .= '<option value="">' . get_lang('All') . '</option>';
$select_unread .= '<option value="yes">' . get_lang('Read') . '</option>';
$select_unread .= '<option value="no">' . get_lang('Unread') . '</option>';
$select_unread .= '<option value="yes">' . get_lang('Unread') . '</option>';
$select_unread .= '<option value="no">' . get_lang('Read') . '</option>';
$select_unread .= "</select>";
// Create a search-box
$form = new FormValidator('search_simple', 'get', '', '', null, false);
@ -197,14 +231,11 @@ if ($isAdmin) {
array('style' => 'vertical-align:middle')) . ' '
. get_lang('AdvancedSearch') . '</span></a>');
echo '<div class="actions" style="width:100%;">';
echo '<div class="actions" >';
if (api_is_platform_admin()) {
/* echo '<span style="float:right;">'.
'<a href="'.api_get_self().'?action=close_tickets">'.Display::return_icon('warning.png',$plugin->get_lang('TckClose'),'','32').'</a>'.
'</span>'; */
echo '<span style="float:right;">' .
'<a href="' . api_get_self() . '?action=export' . $get_parameter . $get_parameter2 . '">' .
Display::return_icon('import_excel.png', get_lang('Export'), '', '32') . '</a>' .
Display::return_icon('import_excel.png', get_lang('Export'), '', '32') . '</a>' .
'</span>';
echo '<span style="float:right;">' .
'<a href="' . api_get_path(WEB_PLUGIN_PATH) . 'ticket/src/new_ticket.php">' .
@ -217,75 +248,75 @@ if ($isAdmin) {
echo '</div>';
echo '<form action="' . api_get_self() . '" method="get" name="advanced_search" id="advanced_search" display:"none">
<div id="advanced_search_form" style="display: block;">
<div class="row">
<div>
<div class="form_header">' . get_lang('AdvancedSearch') . '</div>
</div>
<table width="100%">
<table >
<tbody>
<tr>
<td width="30%">
<div class="row">
<div class="label2">' . get_lang('Category') . '</div>
<div class="formw2">' . $select_types . '</div>
<td>
<div>
<div class="label2">' . get_lang('Category') . ': </div>
<div class="formw2" style="margin-top: -5px;">' . $select_types . '</div>
</div>
</td>
<td width="25%">
<div class="row">
<div class="label2">' . get_lang('User') . '</div>
<td>
<div>
<div class="label3">' . get_lang('User') . ': </div>
<div class="formw2"><input id="keyword_request_user" name="keyword_request_user" type="text"></div>
</div>
</td>
<td width="25%">
<div class="row">
<div class="label2">' . $plugin->get_lang('RegisterDate') . ':</div>
<td>
<div>
<div class="label3">' . $plugin->get_lang('RegisterDate') . ': </div>
<div class="formw2"><input id="keyword_start_date_start" name="keyword_start_date_start" type="text"></div>
</div>
</td>
<td width="20%">
<div class="row">
<div class="label2"><input type="checkbox" name="keyword_dates" value="1">' . get_lang('Untill') . ':</div>
<td>
<div>
<div class="label3"><input type="checkbox" name="keyword_dates" value="1">' . get_lang('Untill') . ':</div>
<div class="formw2"><input id="keyword_start_date_end" name="keyword_start_date_end" type="text"></div>
</div>
</td>
</tr>
<tr >
<td>
<div class="row">
<div class="label2">' . $plugin->get_lang('AssignedTo') . ':</div>
<div class="formw2">' . $select_admins . '</div>
<div>
<div class="label2">' . $plugin->get_lang('AssignedTo') . ': </div>
<div class="formw2" style="margin-top: -5px;">' . $select_admins . '</div>
</div>
</td>
<td>
<div class="row">
<div class="label2">' . get_lang('Status') . ':</div>
<div class="formw2">' . $select_status . '</div>
<div>
<div class="label3">' . get_lang('Status') . ':</div>
<div class="formw2" style="margin-top: -5px;">' . $select_status . '</div>
</div>
</td>
<td>
<div class="row">
<div class="row">
<div class="label2">' . $plugin->get_lang('Priority') . ':</div>
<div>
<div>
<div class="label3">' . $plugin->get_lang('Priority') . ': </div>
<div class="formw2">' . $select_priority . '</div>
</div>
</td>
<td>
<div class="row">
<div class="row">
<div class="label2">' . $plugin->get_lang('Priority') . ':</div>
<div>
<div>
<div class="label3">' . $plugin->get_lang('MessageStatus') . ': </div>
<div class="formw2">' . $select_unread . '</div>
</div>
</td>
</tr>
<tr>
<td width="30%">
<div class="row" >
<div class="label2">' . get_lang('Course') . '</div>
<td>
<div >
<div class="label2">' . get_lang('Course') . ': </div>
<div class="formw2">
<input id="keyword_course" name="keyword_course" type="text"></div>
<input id="keyword_course" style="width: 170px;" name="keyword_course" type="text"></div>
</div>
</td>
<td colspan= "3">
<div class="row">
<div>
<button name="submit_advanced" type="submit">' . get_lang('AdvancedSearch') . '</button>
</div>
</td>
@ -296,6 +327,18 @@ if ($isAdmin) {
<input name="_qf__advanced_search" type="hidden" value="">
<div class="clear">&nbsp;</div>
</form>';
} else {
if ($plugin->getExtraSettingValue('allow_add') == 'true') {
echo '<div class="actions" >';
echo '<span style="float:right;">' .
'<a href="' . api_get_path(WEB_PLUGIN_PATH) . 'ticket/src/new_ticket.php">' .
Display::return_icon('add.png', $plugin->get_lang('TckNew'), '', '32') .
'</a>' .
'</span>';
echo '<span style="float:right;">' .
'</span>';
echo '</div>';
}
}

@ -12,6 +12,11 @@ $cidReset = true;
require_once '../config.php';
$plugin = TicketPlugin::create();
if (!api_is_platform_admin() && $plugin->getExtraSettingValue('allow_add') != 'true') {
header('location:' . api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/src/myticket.php');
exit;
}
api_block_anonymous_users();
require_once api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH) . 'group_portal_manager.lib.php';
@ -197,12 +202,16 @@ function show_form_send_ticket()
// Status
$status = array();
$status[NEWTCK] = $plugin->get_lang('StsNew');
$status[PENDING] = $plugin->get_lang('StsPending');
$status[UNCONFIRMED] = $plugin->get_lang('StsUnconfirmed');
$status[CLOSE] = $plugin->get_lang('StsClose');
$status[REENVIADO] = $plugin->get_lang('StsReenviado');
$showStatus = "style='display: none;'";
if (api_is_platform_admin()) {
$showStatus = "";
$status[PENDING] = $plugin->get_lang('StsPending');
$status[UNCONFIRMED] = $plugin->get_lang('StsUnconfirmed');
$status[CLOSE] = $plugin->get_lang('StsClose');
$status[REENVIADO] = $plugin->get_lang('StsReenviado');
}
$select_status = '
<div class="row" >
<div class="row" ' . $showStatus . ' >
<div class="label2" >' . get_lang('Status') . ': </div>
<div class="formw2">
<select style="width: 95%; " name = "status_id" id="status_id">';
@ -222,11 +231,18 @@ function show_form_send_ticket()
// Source
$source = array();
$source[SRC_EMAIL] = $plugin->get_lang('SrcEmail');
$source[SRC_PHONE] = $plugin->get_lang('SrcPhone');
$source[SRC_PRESC] = $plugin->get_lang('SrcPresential');
if (api_is_platform_admin()) {
$showBlock = "";
$source[SRC_EMAIL] = $plugin->get_lang('SrcEmail');
$source[SRC_PHONE] = $plugin->get_lang('SrcPhone');
$source[SRC_PRESC] = $plugin->get_lang('SrcPresential');
} else {
$showBlock = "style='display: none;'";
$source[SRC_PLATFORM] = $plugin->get_lang('SrcPlatform');
}
$select_source = '
<div class="row">
<div class="row" ' . $showBlock . '>
<div class="label2">' . $plugin->get_lang('Source') . ':</div>
<div class="formw2">
<select style="width: 95%; " name="source_id" id="source_id" >';
@ -338,12 +354,13 @@ function save_ticket()
$priority = $_POST['priority_id'];
$status = $_POST['status_id'];
$file_attachments = $_FILES;
$responsible = (api_is_platform_admin() ? api_get_user_id() : 0);
if (TicketManager::insert_new_ticket(
$category_id, $course_id, $project_id,
$other_area, $email, $subject, $content,
$personal_email, $file_attachments,
$source, $priority, $status, $user_id,
api_get_user_id())) {
$responsible)) {
header('location:' . api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/src/myticket.php?message=success');
} else {
Display::display_header(get_lang('ComposeMessage'));
@ -453,36 +470,47 @@ function get_user_data($from, $number_of_items, $column, $direction)
}
if (!isset($_POST['compose'])) {
Display::display_header(get_lang('ComposeMessage'));
echo '
<div class="actions">
<span style="float: right;">&nbsp;</span>
<form id="search_simple" name="search_simple" method="get" action="' . api_get_self() . '" class="form-search">
<fieldset>
<span><label for="keyword">' . get_lang('langSearchAUser') . ': &nbsp;</label><input type="text" name="keyword" size="25"></span>
<span><button type="submit" name="submit" class="btn btn">' . get_lang('Search') . '</button></span>
<div class="clear"></div>
</fieldset>
</form>
</div>';
if (isset($_GET['keyword'])) {
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
$table->set_header(0, '', false, 'width="18px"');
$table->set_header(0, get_lang('Photo'), false);
$table->set_header(1, get_lang('OfficialCode'));
if (api_is_western_name_order()) {
$table->set_header(2, get_lang('FirstName'));
$table->set_header(3, get_lang('LastName'));
} else {
$table->set_header(2, get_lang('LastName'));
$table->set_header(3, get_lang('FirstName'));
if (api_is_platform_admin()) {
Display::display_header(get_lang('ComposeMessage'));
echo '
<div class="actions">
<span style="float: right;">&nbsp;</span>
<form id="search_simple" name="search_simple" method="get" action="' . api_get_self() . '" class="form-search">
<fieldset>
<span><label for="keyword">' . get_lang('langSearchAUser') . ': &nbsp;</label><input type="text" name="keyword" size="25"></span>
<span><button type="submit" name="submit" class="btn btn">' . get_lang('Search') . '</button></span>
<div class="clear"></div>
</fieldset>
</form>
</div>';
if (isset($_GET['keyword'])) {
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
$table->set_header(0, '', false, 'width="18px"');
$table->set_header(0, get_lang('Photo'), false);
$table->set_header(1, get_lang('OfficialCode'));
if (api_is_western_name_order()) {
$table->set_header(2, get_lang('FirstName'));
$table->set_header(3, get_lang('LastName'));
} else {
$table->set_header(2, get_lang('LastName'));
$table->set_header(3, get_lang('FirstName'));
}
$table->set_header(4, get_lang('LoginName'));
$table->set_header(5, get_lang('Email'));
$table->set_header(6, get_lang('Action'));
$table->display();
}
$table->set_header(4, get_lang('LoginName'));
$table->set_header(5, get_lang('Email'));
$table->set_header(6, get_lang('Action'));
$table->display();
}
//if(isset($_GET['user_request']))
} else {
$userInfo = api_get_user_info();
$htmlHeadXtra[] = "
<script>
$(document).ready(function(){
load_course_list('div_{$userInfo['user_id']}', '{$userInfo['user_id']}', '{$userInfo['email']}');
});
</script>
";
Display::display_header(get_lang('ComposeMessage'));
}
show_form_send_ticket();
} else {
save_ticket();

@ -476,7 +476,7 @@ class TicketManager
ticket.total_messages AS col8,
msg.message AS col9,
ticket.request_user AS user_id,
ticket.assigned_last_user AS responsable
ticket.assigned_last_user AS responsible
FROM $table_support_tickets ticket,
$table_support_category cat,
$table_support_priority priority,
@ -641,19 +641,18 @@ class TicketManager
$unread = Database::fetch_object($result_unread)->unread;
$userInfo = UserManager::get_user_info_by_id($row['user_id']);
$hrefUser = $webPath . 'main/admin/user_information.php?user_id=' . $row['user_id'];
$name = "<a href='$hrefUser'> {$userInfo['complete_name']} </a>";
$name = "<a href='$hrefUser'> {$userInfo['username']} </a>";
$actions = "";
if ($row['responsable'] != 0) {
$hrefResp = $webPath . 'main/admin/user_information.php?user_id=' . $row['responsable']['user_id'];
$completRespName = api_get_person_name($row['responsable']['firstname'], $row['responsable']['lastname']);
$row['responsable'] = api_get_user_info($row['responsable']);
$row['responsable'] = "<a href='$hrefResp'> {$completRespName} </a>";
if ($row['responsible'] != 0) {
$hrefResp = $webPath . 'main/admin/user_information.php?user_id=' . $row['responsible']['user_id'];
$row['responsible'] = api_get_user_info($row['responsible']);
$row['responsible'] = "<a href='$hrefResp'> {$row['responsible']['username']} </a>";
} else {
if ($row['status_id'] != 'REE') {
$row['responsable'] = '<span style="color:#ff0000;">' . get_lang('ToBeAssigned') . '</span>';
$row['responsible'] = '<span style="color:#ff0000;">' . get_lang('ToBeAssigned') . '</span>';
} else {
$row['responsable'] = '<span style="color:#00ff00;">' . get_lang('MessageResent') . '</span>';
$row['responsible'] = '<span style="color:#00ff00;">' . get_lang('MessageResent') . '</span>';
}
}
switch ($row['source']) {
@ -692,7 +691,7 @@ class TicketManager
api_format_date($row['col2'], '%d/%m/%y - %I:%M:%S %p'),
$row['col3'],
$name,
$row['responsable'],
$row['responsible'],
$row['col7'],
$row['col8'],
$actions,

@ -156,11 +156,11 @@ if (isset($_POST['response'])) {
if ($response && $ticket['ticket']['status_id'] == 'XCF') {
TicketManager::close_ticket($_GET['ticket_id'], $user_id);
$ticket['ticket']['status_id'] = 'CLS';
$ticket['ticket']['status'] = 'CERRADO';
$ticket['ticket']['status'] = $plugin->get_lang('Closed');
} else if (!is_null($response) && $ticket['ticket']['status_id'] == 'XCF') {
TicketManager::update_ticket_status('PND', $_GET['ticket_id'], $user_id);
$ticket['ticket']['status_id'] = 'PND';
$ticket['ticket']['status'] = 'PENDIENTE';
$ticket['ticket']['status'] = $plugin->get_lang('Pending');
}
}
}
@ -186,7 +186,7 @@ if (!isset($_POST['compose'])) {
$_GET['ticket_id'] = $_POST['ticket_id'];
TicketManager::close_ticket($_GET['ticket_id'], $user_id);
$ticket['ticket']['status_id'] = 'CLS';
$ticket['ticket']['status'] = 'CERRADO';
$ticket['ticket']['status'] = $plugin->get_lang('Closed');
}
$ticket['ticket']['request_user'] = intval($ticket['ticket']['request_user']);
if ($ticket['ticket']['request_user'] == $user_id || intval($ticket['ticket']['assigned_last_user']) == $user_id) {
@ -208,20 +208,19 @@ if (!isset($_POST['compose'])) {
if ($isAdmin && $ticket['ticket']['status_id'] != 'CLS' && $ticket['ticket']['status_id'] != 'REE') {
if ($ticket['ticket']['assigned_last_user'] != 0 && $ticket['ticket']['assigned_last_user'] == $user_id) {
$img_assing = '<a href="' . api_get_self() . '?ticket_id=' . $ticket['ticket']['ticket_id'] . '&amp;action=unassign" id="unassign">
<img src="../../../main/img/admin_star.png" border="0" title="Unassign" align="center"/>
<img src="' . api_get_path(WEB_CODE_PATH) . 'img/admin_star.png" style="height: 32px; width: 32px;" border="0" title="Unassign" align="center"/>
</a>';
} else {
$img_assing .= '<a href="#" id="assign"><img src="../../../main/img/admin_star_na.png" border="0" title="Assign" align="center"/></a>';
$img_assing .= '<a href="#" id="assign"><img src="' . api_get_path(WEB_CODE_PATH) . 'img/admin_star_na.png" style="height: 32px; width: 32px;" title="Assign" align="center"/></a>';
}
}
$negrita = ($ticket['ticket']['status_id'] == 'CLS') ? 'style = "font-weight: bold;"' : '';
$cadena = ($ticket['ticket']['status_id'] != 'CLS') ? "sas" : "";
$bold = ($ticket['ticket']['status_id'] == 'CLS') ? 'style = "font-weight: bold;"' : '';
echo '<div style="margin-left:20%;margin-right:20%;">
<table width="100%" >
<tr>
<td colspan="3" style="width:65%">' . $titulo . '</td>
<td >' . $img_assing . '</td>
<td>' . $form_close_ticket . '</td>
<td style="width: 15%">' . $img_assing . '</td>
<td style="width: 15%">' . $form_close_ticket . '</td>
</tr>
<tr>
<td style="width:45%;" ><p>' . get_lang('Sent') . ': ' . $ticket['ticket']['start_date'] . '</p></td>
@ -232,7 +231,7 @@ if (!isset($_POST['compose'])) {
<tr>
<td><p>' . get_lang('Subject') . ': ' . $ticket['messages'][0]['subject'] . '</p></td>
<td></td>
<td><p ' . $negrita . '>' . get_lang('Status') . ': ' . $ticket['ticket']['status'] . '</p></td>
<td><p ' . $bold . '>' . get_lang('Status') . ': ' . $ticket['ticket']['status'] . '</p></td>
<td colspan="2"></td>
</tr>
<tr>
@ -251,11 +250,8 @@ if (!isset($_POST['compose'])) {
}
if ($isAdmin) {
echo '<tr>
<td><p>' . get_lang('User') . ':</p></td>
<td></td>
<td>' . $user_info = $ticket['ticket']['user_url'] . ' (' . $ticket['usuario']['username'] . ')</td>
<td colspan="2"></td>
</tr>';
<td><p>' . get_lang('User') . ': &nbsp;' . $user_info = $ticket['ticket']['user_url'] . ' (' . $ticket['usuario']['username'] . ')</p></td>
</tr>';
}
//select admins
$select_admins .= '<select class ="chzn-select" style="width: 350px; " name = "admins" id="admins" ">';
@ -268,7 +264,7 @@ if (!isset($_POST['compose'])) {
echo '<div id="dialog-form" title="' . get_lang('AssignTicket') . '" >';
echo '<form id="genesis" method="POST" action="ticket_details.php?ticket_id=' . $ticket['ticket']['ticket_id'] . '">
<input type="hidden" name ="action" id="action" value="assign"/>
<div class="row">
<div>
<div class="label">' . get_lang('Responsable') . ':</div>
<div class="formw">' . $select_admins . '</div>
</div>

@ -76,5 +76,6 @@ class TicketPlugin extends Plugin
Database::query($sql);
$this->deleteTab($plugSetting['comment']);
$this->deleteExtraSettings();
}
}
Loading…
Cancel
Save