root/trunk/gui/reseller/ticket_closed.php

Revision 1374, 5.4 kB (checked in by rats, 2 months ago)

* Added Mailsize function
* Fixed #1594: (CentOS) More perl dependencies on CentOS
* Fixed #1595: (CentOS) CentOS perl docs: Advice to autoconfigure first
* Fixed #1483: Misleading information in INSTALL-files
* Fixed #1512: Subdomains for domain-aliases
* Fixed #1509: New subdomain management system
* Fixed Order delete bug
* Fixed #1507: Some errors on around "Execute Query" option on a database
* Fixed #1511: e-mail aliases & autoreply
* Fixed #1151: Update Hosting Package should only visible for a customer if a hosting plan to update is available (thanks Feg)
* Fixed #1556: Special Characters like Umlauts (äüöÄÜÖ) and Ligatures (ß) in Javascript messages are encoded, wrongly.
* PHPmyAdmin 3.0.0

Line 
1 <?php
2 /**
3  * ispCP ω (OMEGA) a Virtual Hosting Control System
4  *
5  * @copyright     2001-2006 by moleSoftware GmbH
6  * @copyright     2006-2008 by ispCP | http://isp-control.net
7  * @version     SVN: $Id$
8  * @link         http://isp-control.net
9  * @author         ispCP Team
10  *
11  * @license
12  *   This program is free software; you can redistribute it and/or modify it under
13  *   the terms of the MPL General Public License as published by the Free Software
14  *   Foundation; either version 1.1 of the License, or (at your option) any later
15  *   version.
16  *   You should have received a copy of the MPL Mozilla Public License along with
17  *   this program; if not, write to the Open Source Initiative (OSI)
18  *   http://opensource.org | osi@opensource.org
19  */
20
21 require '../include/ispcp-lib.php';
22
23 check_login(__FILE__);
24
25 $tpl = new pTemplate();
26 $tpl->define_dynamic('page', Config::get('RESELLER_TEMPLATE_PATH') . '/ticket_closed.tpl');
27 $tpl->define_dynamic('page_message', 'page');
28 $tpl->define_dynamic('logged_from', 'page');
29 $tpl->define_dynamic('tickets_list', 'page');
30 $tpl->define_dynamic('tickets_item', 'tickets_list');
31 $tpl->define_dynamic('scroll_prev_gray', 'page');
32 $tpl->define_dynamic('scroll_prev', 'page');
33 $tpl->define_dynamic('scroll_next_gray', 'page');
34 $tpl->define_dynamic('scroll_next', 'page');
35
36 // page functions.
37 function gen_tickets_list(&$tpl, &$sql, $user_id) {
38     $start_index = 0;
39
40     $rows_per_page = Config::get('DOMAIN_ROWS_PER_PAGE');
41
42     if (isset($_GET['psi'])) $start_index = $_GET['psi'];
43
44     $count_query = <<<SQL_QUERY
45                 select
46                     count(ticket_id) as cnt
47                 from
48                     tickets
49                 where
50                     (ticket_from = ? or ticket_to = ?)
51                   and
52                     ticket_status = 0
53                   and
54                     ticket_reply  = 0
55 SQL_QUERY;
56
57     $rs = exec_query($sql, $count_query, array($user_id, $user_id));
58     $records_count = $rs->fields['cnt'];
59
60     $query = <<<SQL_QUERY
61         SELECT
62             ticket_id,
63             ticket_status,
64             ticket_urgency,
65             ticket_date,
66             ticket_subject,
67             ticket_message
68         FROM
69             tickets
70         WHERE
71             (ticket_from = ? OR ticket_to = ?)
72           AND
73             ticket_status = 0
74           AND
75             ticket_reply  = 0
76         ORDER BY
77             ticket_date DESC
78         LIMIT
79             $start_index, $rows_per_page
80 SQL_QUERY;
81
82     $rs = exec_query($sql, $query, array($user_id, $user_id));
83
84     if ($rs->RecordCount() == 0) {
85         $tpl->assign(
86             array('TICKETS_LIST' => '',
87                 'SCROLL_PREV' => '',
88                 'SCROLL_NEXT' => ''
89                 )
90             );
91
92         set_page_message(tr('You have no support tickets.'));
93     } else {
94         $prev_si = $start_index - $rows_per_page;
95
96         if ($start_index == 0) {
97             $tpl->assign('SCROLL_PREV', '');
98         } else {
99             $tpl->assign(
100                 array('SCROLL_PREV_GRAY' => '',
101                     'PREV_PSI' => $prev_si
102                     )
103                 );
104         }
105
106         $next_si = $start_index + $rows_per_page;
107
108         if ($next_si + 1 > $records_count) {
109             $tpl->assign('SCROLL_NEXT', '');
110         } else {
111             $tpl->assign(
112                 array('SCROLL_NEXT_GRAY' => '',
113                     'NEXT_PSI' => $next_si
114                     )
115                 );
116         }
117
118         global $i ;
119
120         while (!$rs->EOF) {
121             $ticket_id        = $rs->fields['ticket_id'];
122             $ticket_urgency = $rs->fields['ticket_urgency'];
123             $ticket_status    = $rs->fields['ticket_status'];
124             $date            = ticketGetLastDate($sql, $ticket_id);
125
126             if ($ticket_urgency == 1) {
127                 $tpl->assign(array('URGENCY' => tr("Low")));
128             } elseif ($ticket_urgency == 2) {
129                 $tpl->assign(array('URGENCY' => tr("Medium")));
130             } elseif ($ticket_urgency == 3) {
131                 $tpl->assign(array('URGENCY' => tr("High")));
132             } elseif ($ticket_urgency == 4) {
133                 $tpl->assign(array('URGENCY' => tr("Very high")));
134             }
135
136             $tpl->assign(array('NEW' => " "));
137
138             $tpl->assign(
139                     array(
140                         'LAST_DATE'    => $date,
141                         'SUBJECT'    => stripslashes($rs->fields['ticket_subject']),
142                         'MESSAGE'    => $rs->fields['ticket_message'],
143                         'ID'        => $ticket_id,
144                         'CONTENT'    => ($i % 2 == 0) ? 'content' : 'content2'
145                         )
146                     );
147
148             $tpl->parse('TICKETS_ITEM', '.tickets_item');
149             $rs->MoveNext();
150             $i++;
151         }
152     }
153 }
154
155 // common page data.
156
157 if (!Config::get('ISPCP_SUPPORT_SYSTEM')) {
158     header("Location: index.php");
159     die();
160 }
161
162 $theme_color = Config::get('USER_INITIAL_THEME');
163
164 $tpl->assign(
165     array('TR_CLIENT_QUESTION_PAGE_TITLE' => tr('ispCP - Client/Questions & Comments'),
166         'THEME_COLOR_PATH' => "../themes/$theme_color",
167         'THEME_CHARSET' => tr('encoding'),
168         'ISP_LOGO' => get_logo($_SESSION['user_id']),
169
170         )
171     );
172
173 gen_tickets_list($tpl, $sql, $_SESSION['user_id']);
174
175 // static page messages.
176
177 gen_reseller_mainmenu($tpl, Config::get('RESELLER_TEMPLATE_PATH') . '/main_menu_ticket_system.tpl');
178 gen_reseller_menu($tpl, Config::get('RESELLER_TEMPLATE_PATH') . '/menu_ticket_system.tpl');
179
180 gen_logged_from($tpl);
181
182 $tpl->assign(
183         array(
184             'TR_SUPPORT_SYSTEM' => tr('Support system'),
185             'TR_SUPPORT_TICKETS' => tr('Support tickets'),
186             'TR_STATUS' => tr('Status'),
187             'TR_NEW' => ' ',
188             'TR_ACTION' => tr('Action'),
189             'TR_URGENCY' => tr('Priority'),
190             'TR_SUBJECT' => tr('Subject'),
191             'TR_LAST_DATA' => tr('Last reply'),
192             'TR_DELETE_ALL' => tr('Delete all'),
193             'TR_OPEN_TICKETS' => tr('Open tickets'),
194             'TR_CLOSED_TICKETS' => tr('Closed tickets'),
195             'TR_DELETE' => tr('Delete'),
196             'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete %s?', true, '%s'),
197         )
198     );
199
200 gen_page_message($tpl);
201
202 $tpl->parse('PAGE', 'page');
203 $tpl->prnt();
204
205 if (Config::get('DUMP_GUI_DEBUG'))
206     dump_gui_debug();
207
208 unset_messages();
209
210 ?>
211
Note: See TracBrowser for help on using the browser.