diff --git a/plugin/ticket/lang/spanish.php b/plugin/ticket/lang/spanish.php index 009847d0d2..c352caeda2 100755 --- a/plugin/ticket/lang/spanish.php +++ b/plugin/ticket/lang/spanish.php @@ -65,7 +65,5 @@ $strings['SrcPhone'] = "Telefono"; $strings['SrcPresential'] = "Presencial"; // - -$strings['TckAssignedMsg'] = "
Estimado(a):
? ?
-Se le ha sido asignado el ticket ? Ticket
-Mensaje enviado desde el sistema de ticket.
"; \ No newline at end of file +$strings['TicketAssignedMsg'] = "Estimado(a) %s
Se le ha sido asignado el ticket %s
Mensaje enviado desde el sistema de ticket.
"; +$strings['TicketAssignX'] = "[TICKETS] Asignacion de Ticket #%s "; diff --git a/plugin/ticket/src/course_user_list.php b/plugin/ticket/src/course_user_list.php index b99bcf5bce..8dc6877729 100644 --- a/plugin/ticket/src/course_user_list.php +++ b/plugin/ticket/src/course_user_list.php @@ -16,20 +16,20 @@ $user_info = api_get_user_info($user_id); $courses_list = CourseManager::get_courses_list_by_user_id($user_id, false, true); ?>' . get_lang('Phone') . ': ' . $_POST['phone'] . '
'; + } $course_id = $_POST['course_id']; $project_id = $_POST['project_id']; $subject = $_POST['subject']; @@ -342,8 +342,13 @@ function save_ticket() $priority = $_POST['priority_id']; $status = $_POST['status_id']; $file_attachments = $_FILES; - 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())) { - header('location:' . api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/s/myticket.php?message=success'); + 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())) { + header('location:' . api_get_path(WEB_PLUGIN_PATH) . PLUGIN_NAME . '/src/myticket.php?message=success'); } else { Display::display_header(get_lang('ComposeMessage')); Display::display_error_message($plugin->get_lang('ErrorRegisterMessage')); @@ -364,7 +369,13 @@ function get_number_of_users() } if (isset($_GET['keyword'])) { $keyword = Database::escape_string(trim($_GET['keyword'])); - $sql .= " WHERE (u.firstname LIKE '%" . $keyword . "%' OR u.lastname LIKE '%" . $keyword . "%' OR concat(u.firstname,' ',u.lastname) LIKE '%" . $keyword . "%' OR concat(u.lastname,' ',u.firstname) LIKE '%" . $keyword . "%' OR u.username LIKE '%" . $keyword . "%' OR u.email LIKE '%" . $keyword . "%' OR u.official_code LIKE '%" . $keyword . "%') "; + $sql .= " WHERE (u.firstname LIKE '%$keyword%' OR + u.lastname LIKE '%$keyword%' OR + concat(u.firstname,' ',u.lastname) LIKE '%$keyword%' OR + concat(u.lastname,' ',u.firstname) LIKE '%$keyword%' OR + u.username LIKE '%$keyword%' OR + u.email LIKE '%$keyword%' OR + u.official_code LIKE '%$keyword%') "; } $res = Database::query($sql); $obj = Database::fetch_object($res); @@ -383,23 +394,36 @@ function get_user_data($from, $number_of_items, $column, $direction) { $user_table = Database :: get_main_table(TABLE_MAIN_USER); $admin_table = Database :: get_main_table(TABLE_MAIN_ADMIN); + + if (api_is_western_name_order()) { + $col34 = "u.firstname AS col3, + u.lastname AS col4,"; + } else { + $col34 = "u.lastname AS col3, + u.firstname AS col4,"; + } + $sql = "SELECT - u.user_id AS col0, - u.official_code AS col2, - " . (api_is_western_name_order() ? "u.firstname AS col3, - u.lastname AS col4," : "u.lastname AS col3, - u.firstname AS col4,") . " - u.username AS col5, - u.email AS col6, - u.status AS col7, - u.active AS col8, - u.user_id AS col9 " . - ", u.expiration_date AS exp " . - " FROM $user_table u "; + u.user_id AS col0, + u.official_code AS col2, + $col34 + u.username AS col5, + u.email AS col6, + u.status AS col7, + u.active AS col8, + u.user_id AS col9 , + u.expiration_date AS exp + FROM $user_table u "; if (isset($_GET['keyword'])) { $keyword = Database::escape_string(trim($_GET['keyword'])); - $sql .= " WHERE (u.firstname LIKE '%" . $keyword . "%' OR u.lastname LIKE '%" . $keyword . "%' OR concat(u.firstname,' ',u.lastname) LIKE '%" . $keyword . "%' OR concat(u.lastname,' ',u.firstname) LIKE '%" . $keyword . "%' OR u.username LIKE '%" . $keyword . "%' OR u.official_code LIKE '%" . $keyword . "%' OR u.email LIKE '%" . $keyword . "%' )"; + $sql .= " WHERE (u.firstname LIKE '%$keyword%' OR + u.lastname LIKE '%$keyword%' OR + concat(u.firstname,' ',u.lastname) LIKE '%$keyword%' OR + concat(u.lastname,' ',u.firstname) LIKE '%$keyword%' OR + u.username LIKE '%$keyword%' OR + u.official_code LIKE '%$keyword%' OR + u.email LIKE '%$keyword%' )"; } if (!in_array($direction, array('ASC', 'DESC'))) { $direction = 'ASC'; @@ -426,8 +450,8 @@ function get_user_data($from, $number_of_items, $column, $direction) $user_id = $user[0]; $button = '' . Display::return_icon('view_more_stats.gif', get_lang('Info')) . ''; $button = ' -
- ';
+
+ ';
$users[] = array($photo, $user[1], $user[2], $user[3], $user[4], $user[5], $button);
}
return $users;
diff --git a/plugin/ticket/src/report.php b/plugin/ticket/src/report.php
index ccf931f5c1..26c056fef1 100644
--- a/plugin/ticket/src/report.php
+++ b/plugin/ticket/src/report.php
@@ -26,19 +26,19 @@ unset($_SESSION['this_section']);
$htmlHeadXtra[] = '
';
$htmlHeadXtra[] = '';
+/**
+ * @todo Delete this function, it already exists in report.php
+ * @param string $s
+ * @return string
+ */
+
function js_str($s)
{
return '"' . addcslashes($s, "\0..\37\"\\") . '"';
}
+/**
+ * This is a javascript helper to generate and array
+ * @param array $array
+ * @param string $name
+ * @param integer $key
+ * @return string
+ */
function js_array($array, $name, $key)
{
- $temp = array();
$return = "new Array(); ";
foreach ($array as $value) {
$return .= $name . "['" . $value['category_id'] . "'] ='" . $value[$key] . "'; ";
@@ -153,6 +164,11 @@ function js_array($array, $name, $key)
return $return;
}
+/**
+ *
+ * @global array $types
+ * @global object $plugin
+ */
function show_form_send_ticket()
{
global $types, $plugin;
@@ -227,9 +243,12 @@ function show_form_send_ticket()
| ' . get_lang('User') . ' | -' . $user['firstname'] - . ' ' . $user['lastname'] . ' | +' . $user['firstname']. ' ' . $user['lastname'] . ' |
| ' . get_lang('Username') . ' | @@ -207,6 +211,7 @@ class TicketManager */ public static function assign_ticket_user($ticket_id, $user_id) { + global $plugin; $ticket_id = intval($ticket_id); $user_id = intval($user_id); $table_support_tickets = Database::get_main_table(TABLE_TICKET_TICKET); @@ -214,8 +219,8 @@ class TicketManager $now = api_get_utc_datetime(); $sql_update = "UPDATE $table_support_tickets - SET assigned_last_user = '$user_id' - WHERE ticket_id = '$ticket_id'"; + SET assigned_last_user = '$user_id' + WHERE ticket_id = '$ticket_id'"; Database::query($sql_update); if (Database::affected_rows() > 0) { $insert_id = api_get_user_id(); @@ -235,12 +240,11 @@ class TicketManager if ($insert_id != $user_id) { $info = api_get_user_info($user_id); $sender = api_get_user_info($insert_id); - $message = '