From cvs w lms.org.pl Thu Sep 1 16:13:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 1 Sep 2011 16:13:39 +0200 (CEST) Subject: [lms-commits] CVS update of lms/bin (lms-cutoff) Message-ID: <20110901141339.7347B30278A0@eftep.altec.pl> Date: Thursday, September 1, 2011 @ 16:13:39 Author: maniac Path: /cvsroot/lms/bin Modified: lms-cutoff Fixed SQL QUERRY. LEFT JOIN insteed of JOIN Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-cutoff.diff?&r1=1.43&r2=1.44 Index: lms/bin/lms-cutoff diff -u lms/bin/lms-cutoff:1.43 lms/bin/lms-cutoff:1.44 --- lms/bin/lms-cutoff:1.43 Wed Aug 31 12:58:12 2011 +++ lms/bin/lms-cutoff Thu Sep 1 16:13:38 2011 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-cutoff,v 1.43 2011/08/31 10:58:12 alec Exp $ +# $Id: lms-cutoff,v 1.44 2011/09/01 14:13:38 maniac Exp $ use strict; use DBI; @@ -134,12 +134,12 @@ my $dbq = $dbase->prepare(" SELECT customers.id AS id, UPPER(lastname) AS lastname, name, SUM(cash.value) AS balance - FROM customers + FROM customers JOIN cash ON customers.id = cash.customerid - JOIN documents ON cash.docid=documents.id + LEFT JOIN documents ON cash.docid=documents.id WHERE $filter GROUP BY customers.id, lastname, name - HAVING SUM(cash.value) < $limit + HAVING SUM(cash.value) < $limit ORDER BY lastname, name "); From cvs w lms.org.pl Thu Sep 1 16:51:28 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 1 Sep 2011 16:51:28 +0200 (CEST) Subject: [lms-commits] CVS update of lms/bin (lms-cutoff) Message-ID: <20110901145128.5E40B30278A0@eftep.altec.pl> Date: Thursday, September 1, 2011 @ 16:51:28 Author: maniac Path: /cvsroot/lms/bin Modified: lms-cutoff one more fix in sql query (name is ambiguous) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-cutoff.diff?&r1=1.44&r2=1.45 Index: lms/bin/lms-cutoff diff -u lms/bin/lms-cutoff:1.44 lms/bin/lms-cutoff:1.45 --- lms/bin/lms-cutoff:1.44 Thu Sep 1 16:13:38 2011 +++ lms/bin/lms-cutoff Thu Sep 1 16:51:28 2011 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-cutoff,v 1.44 2011/09/01 14:13:38 maniac Exp $ +# $Id: lms-cutoff,v 1.45 2011/09/01 14:51:28 maniac Exp $ use strict; use DBI; @@ -133,7 +133,7 @@ my $dbq = $dbase->prepare(" SELECT customers.id AS id, UPPER(lastname) AS lastname, - name, SUM(cash.value) AS balance + customers.name AS name, SUM(cash.value) AS balance FROM customers JOIN cash ON customers.id = cash.customerid LEFT JOIN documents ON cash.docid=documents.id From cvs w lms.org.pl Sat Sep 3 19:40:50 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 3 Sep 2011 19:40:50 +0200 (CEST) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20110903174050.48B3630278A0@eftep.altec.pl> Date: Saturday, September 3, 2011 @ 19:40:50 Author: maniac Path: /cvsroot/lms/doc Modified: ChangeLog added 'customergroups' & 'excluded_customergroups' options Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1587&r2=1.1588 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1587 lms/doc/ChangeLog:1.1588 --- lms/doc/ChangeLog:1.1587 Wed Aug 31 14:16:36 2011 +++ lms/doc/ChangeLog Sat Sep 3 19:40:49 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1587 2011/08/31 12:16:36 alec Exp $ +$Id: ChangeLog,v 1.1588 2011/09/03 17:40:49 maniac Exp $ version ? (????-??-??): @@ -25,6 +25,7 @@ - BTS#0000877: Fixed node assignments for all promotion periods [alec] - BTS#0000876: contrib/customer: Fixed customer tariff is always zero [alec] - BTS#0000878: Fixed calculation of first promotion period length [alec] + - lms-cutoff: added 'customergroups' & 'excluded_customergroups' opts [maniac] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Sat Sep 3 19:40:50 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 3 Sep 2011 19:40:50 +0200 (CEST) Subject: [lms-commits] CVS update of lms/bin (lms-cutoff) Message-ID: <20110903174050.6630C30278A1@eftep.altec.pl> Date: Saturday, September 3, 2011 @ 19:40:50 Author: maniac Path: /cvsroot/lms/bin Modified: lms-cutoff added 'customergroups' & 'excluded_customergroups' options Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-cutoff.diff?&r1=1.45&r2=1.46 Index: lms/bin/lms-cutoff diff -u lms/bin/lms-cutoff:1.45 lms/bin/lms-cutoff:1.46 --- lms/bin/lms-cutoff:1.45 Thu Sep 1 16:51:28 2011 +++ lms/bin/lms-cutoff Sat Sep 3 19:40:50 2011 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-cutoff,v 1.45 2011/09/01 14:51:28 maniac Exp $ +# $Id: lms-cutoff,v 1.46 2011/09/03 17:40:50 maniac Exp $ use strict; use DBI; @@ -96,7 +96,9 @@ my $limit = $ini->val('cutoff', 'limit') || 0; my $message = $ini->val('cutoff', 'message') || 'Automatic cutoff caused by exceeding of liabilities limit on %now'; my $only_due = $ini->val('cutoff', 'only_due') || '1'; -my $extend_deadline = $ini->val('cutoff', '$extend_deadline') || '7'; +my $extend_deadline = $ini->val('cutoff', 'extend_deadline') || '7'; +my $excluded_customergroups = $ini->val('cutoff', 'excluded_customergroups') || ''; +my $customergroups = $ini->val('cutoff', 'customergroups') || ''; my $dbase; my $utsfmt; @@ -131,6 +133,18 @@ OR documents.paytime IS NULL)"; } +if ($excluded_customergroups ne '') { + $filter = $filter . " AND (SELECT count(*) FROM customerassignments + WHERE customerassignments.customerid = customers.id + AND customerassignments.customergroupid IN ($excluded_customergroups)) = 0"; +} + +if ($customergroups ne '') { + $filter = $filter . " AND (SELECT count(*) FROM customerassignments + WHERE customerassignments.customerid = customers.id + AND customerassignments.customergroupid IN ($customergroups)) = 0"; +} + my $dbq = $dbase->prepare(" SELECT customers.id AS id, UPPER(lastname) AS lastname, customers.name AS name, SUM(cash.value) AS balance From cvs w lms.org.pl Fri Sep 9 20:16:52 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 9 Sep 2011 20:16:52 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20110909181652.3AB0930278A3@eftep.altec.pl> Date: Friday, September 9, 2011 @ 20:16:52 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - welcome: added posibility of hiding links, system information and registration info Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.391&r2=1.392 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.391 lms/lib/locale/pl/strings.php:1.392 --- lms/lib/locale/pl/strings.php:1.391 Wed Aug 31 12:46:45 2011 +++ lms/lib/locale/pl/strings.php Fri Sep 9 20:16:52 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.391 2011/08/31 10:46:45 alec Exp $ + * $Id: strings.php,v 1.392 2011/09/09 18:16:52 chilek Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresów)'; @@ -2482,5 +2482,7 @@ $_LANG['Flat number is too long (max. 8 characters)!'] = 'Numer mieszkania jest za długi (max. 8 znaków)!'; $_LANG['House number is required!'] = 'Numer domu jest wymagany!'; $_LANG['House number is too long (max. 8 characters)!'] = 'Numer domu jest za długi (max. 8 znaków)!'; +$_LANG['links hiding'] = 'ukrywanie użytecznych linków'; +$_LANG['system information hiding'] = 'ukrywanie informacji systemowych'; ?> From cvs w lms.org.pl Fri Sep 9 20:16:52 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 9 Sep 2011 20:16:52 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib (accesstable.php) Message-ID: <20110909181652.145F730278A2@eftep.altec.pl> Date: Friday, September 9, 2011 @ 20:16:52 Author: chilek Path: /cvsroot/lms/lib Modified: accesstable.php - welcome: added posibility of hiding links, system information and registration info Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/accesstable.php.diff?&r1=1.141&r2=1.142 Index: lms/lib/accesstable.php diff -u lms/lib/accesstable.php:1.141 lms/lib/accesstable.php:1.142 --- lms/lib/accesstable.php:1.141 Wed Aug 31 12:46:45 2011 +++ lms/lib/accesstable.php Fri Sep 9 20:16:51 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: accesstable.php,v 1.141 2011/08/31 10:46:45 alec Exp $ + * $Id: accesstable.php,v 1.142 2011/09/09 18:16:51 chilek Exp $ */ unset($access); @@ -100,6 +100,12 @@ $access['table'][23]['name'] = trans('Userpanel management'); $access['table'][23]['allow_reg'] = '^userpanel$'; +$access['table'][24]['name'] = trans('system information hiding'); +$access['table'][24]['privilege'] = 'hide_sysinfo'; + +$access['table'][25]['name'] = trans('links hiding'); +$access['table'][25]['privilege'] = 'hide_links'; + $access['table'][253]['name'] = trans('users edition and addition forbidden'); $access['table'][253]['deny_reg'] = '^(user(add|del|edit|passwd))$'; From cvs w lms.org.pl Fri Sep 9 20:16:52 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 9 Sep 2011 20:16:52 +0200 (CEST) Subject: [lms-commits] CVS update of lms/modules (welcome.php) Message-ID: <20110909181652.5E14B30278A4@eftep.altec.pl> Date: Friday, September 9, 2011 @ 20:16:52 Author: chilek Path: /cvsroot/lms/modules Modified: welcome.php - welcome: added posibility of hiding links, system information and registration info Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/welcome.php.diff?&r1=1.60&r2=1.61 Index: lms/modules/welcome.php diff -u lms/modules/welcome.php:1.60 lms/modules/welcome.php:1.61 --- lms/modules/welcome.php:1.60 Tue Jan 18 09:12:26 2011 +++ lms/modules/welcome.php Fri Sep 9 20:16:52 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: welcome.php,v 1.60 2011/01/18 08:12:26 alec Exp $ + * $Id: welcome.php,v 1.61 2011/09/09 18:16:52 chilek Exp $ */ require_once(LIB_DIR.'/Sysinfo.class.php'); @@ -45,11 +45,16 @@ } $SMARTY->assign('_dochref', is_dir('doc/html/'.$LMS->ui_lang) ? 'doc/html/'.$LMS->ui_lang.'/' : 'doc/html/en/'); -$SMARTY->assign('regdata', $LMS->GetRegisterData()); +if ($adminuser) + $SMARTY->assign('regdata', $LMS->GetRegisterData()); $SMARTY->assign('rtstats', $LMS->RTStats()); -$SMARTY->assign('sysinfo',$SI->get_sysinfo()); -$SMARTY->assign('customerstats',$LMS->CustomerStats()); -$SMARTY->assign('nodestats',$LMS->NodeStats()); +if (!$CONFIG['phpui']['hide_sysinfo']) + $SMARTY->assign('sysinfo',$SI->get_sysinfo()); +if (!$CONFIG['phpui']['hide_summaries']) +{ + $SMARTY->assign('customerstats',$LMS->CustomerStats()); + $SMARTY->assign('nodestats',$LMS->NodeStats()); +} $SMARTY->display('welcome.html'); ?> From cvs w lms.org.pl Fri Sep 9 20:16:51 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 9 Sep 2011 20:16:51 +0200 (CEST) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20110909181651.E819130278A1@eftep.altec.pl> Date: Friday, September 9, 2011 @ 20:16:51 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - welcome: added posibility of hiding links, system information and registration info Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1588&r2=1.1589 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1588 lms/doc/ChangeLog:1.1589 --- lms/doc/ChangeLog:1.1588 Sat Sep 3 19:40:49 2011 +++ lms/doc/ChangeLog Fri Sep 9 20:16:51 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1588 2011/09/03 17:40:49 maniac Exp $ +$Id: ChangeLog,v 1.1589 2011/09/09 18:16:51 chilek Exp $ version ? (????-??-??): @@ -26,6 +26,7 @@ - BTS#0000876: contrib/customer: Fixed customer tariff is always zero [alec] - BTS#0000878: Fixed calculation of first promotion period length [alec] - lms-cutoff: added 'customergroups' & 'excluded_customergroups' opts [maniac] + - welcome: added posibility of hiding links, system information and registration info [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Fri Sep 9 20:16:52 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 9 Sep 2011 20:16:52 +0200 (CEST) Subject: [lms-commits] CVS update of lms/templates (welcome.html) Message-ID: <20110909181652.7D1B230278A5@eftep.altec.pl> Date: Friday, September 9, 2011 @ 20:16:52 Author: chilek Path: /cvsroot/lms/templates Modified: welcome.html - welcome: added posibility of hiding links, system information and registration info Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/welcome.html.diff?&r1=1.86&r2=1.87 Index: lms/templates/welcome.html diff -u lms/templates/welcome.html:1.86 lms/templates/welcome.html:1.87 --- lms/templates/welcome.html:1.86 Thu Apr 30 19:26:35 2009 +++ lms/templates/welcome.html Fri Sep 9 20:16:52 2011 @@ -1,9 +1,10 @@ {include file="header.html"} - +

{$layout.pagetitle}

+ {if !$_config.phpui.hide_sysinfo|chkconfig} + {/if} {if !$_config.phpui.hide_summaries|chkconfig} @@ -254,6 +256,7 @@
@@ -107,6 +108,7 @@
+ {if !$_config.phpui.hide_links|chkconfig} @@ -274,8 +277,10 @@
+ {/if} + {if $adminuser} @@ -300,6 +305,7 @@ + {/if}

From cvs w lms.org.pl Fri Sep 9 20:16:51 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 9 Sep 2011 20:16:51 +0200 (CEST) Subject: [lms-commits] CVS update of lms (index.php) Message-ID: <20110909181651.BEDF430278A0@eftep.altec.pl> Date: Friday, September 9, 2011 @ 20:16:51 Author: chilek Path: /cvsroot/lms Modified: index.php - welcome: added posibility of hiding links, system information and registration info Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/index.php.diff?&r1=1.224&r2=1.225 Index: lms/index.php diff -u lms/index.php:1.224 lms/index.php:1.225 --- lms/index.php:1.224 Tue Apr 26 15:03:00 2011 +++ lms/index.php Fri Sep 9 20:16:51 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: index.php,v 1.224 2011/04/26 13:03:00 alec Exp $ + * $Id: index.php,v 1.225 2011/09/09 18:16:51 chilek Exp $ */ // REPLACE THIS WITH PATH TO YOUR CONFIG FILE @@ -196,9 +196,12 @@ { $allow = !$AUTH->id || (!empty($access['allow']) && preg_match('/'.$access['allow'].'/i', $module)); + $adminuser = FALSE; if($AUTH->id && ($rights = $LMS->GetUserRights($AUTH->id))) foreach($rights as $level) { + if($level === 0) + $adminuser = TRUE; if(!$allow) { if(isset($access['table'][$level]['deny_reg'])) @@ -215,6 +218,7 @@ { $layout['module'] = $module; $LMS->InitUI(); + $SMARTY->assign('adminuser', $adminuser); include(MODULES_DIR.'/'.$module.'.php'); } else From cvs w lms.org.pl Sun Sep 11 16:23:07 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 11 Sep 2011 16:23:07 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/upgradedb (mysql.2011082800.php) Message-ID: <20110911142307.5022330278A0@eftep.altec.pl> Date: Sunday, September 11, 2011 @ 16:23:07 Author: maniac Path: /cvsroot/lms/lib/upgradedb Modified: mysql.2011082800.php fixed datbase version for mysql Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2011082800.php.diff?&r1=1.1&r2=1.2 Index: lms/lib/upgradedb/mysql.2011082800.php diff -u lms/lib/upgradedb/mysql.2011082800.php:1.1 lms/lib/upgradedb/mysql.2011082800.php:1.2 --- lms/lib/upgradedb/mysql.2011082800.php:1.1 Wed Aug 31 12:46:46 2011 +++ lms/lib/upgradedb/mysql.2011082800.php Sun Sep 11 16:23:06 2011 @@ -176,7 +176,7 @@ FROM macs GROUP BY nodeid) m ON (n.id = m.nodeid); "); -$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2011060100', 'dbversion')); +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2011082800', 'dbversion')); $DB->CommitTrans(); From cvs w lms.org.pl Sun Sep 11 17:26:51 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 11 Sep 2011 17:26:51 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/upgradedb (mysql.2011082800.php) Message-ID: <20110911152651.F00C830278A0@eftep.altec.pl> Date: Sunday, September 11, 2011 @ 17:26:51 Author: maniac Path: /cvsroot/lms/lib/upgradedb Modified: mysql.2011082800.php Fixed typos in sql queries Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2011082800.php.diff?&r1=1.2&r2=1.3 Index: lms/lib/upgradedb/mysql.2011082800.php diff -u lms/lib/upgradedb/mysql.2011082800.php:1.2 lms/lib/upgradedb/mysql.2011082800.php:1.3 --- lms/lib/upgradedb/mysql.2011082800.php:1.2 Sun Sep 11 16:23:06 2011 +++ lms/lib/upgradedb/mysql.2011082800.php Sun Sep 11 17:26:51 2011 @@ -38,9 +38,9 @@ $DB->Execute(" CREATE TABLE location_districts ( id int(11) NOT NULL auto_increment, - name varchar(64) NOT NULL, --TERYT: NAZWA - ident varchar(8) NOT NULL, --TERYT: POW - stateid int(11) NOT NULL --TERYT: WOJ + name varchar(64) NOT NULL, -- TERYT: NAZWA + ident varchar(8) NOT NULL, -- TERYT: POW + stateid int(11) NOT NULL -- TERYT: WOJ REFERENCES location_states (id) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (id), UNIQUE KEY stateid (stateid, name) @@ -63,12 +63,12 @@ id int(11) NOT NULL auto_increment, ident varchar(8) NOT NULL, -- TERYT: SYM / SYMPOD name varchar(64) NOT NULL, -- TERYT: NAZWA - cityid int(11) DEFAULT NULL + cityid int(11) DEFAULT NULL, boroughid int(11) DEFAULT NULL REFERENCES location_boroughs (id) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (id), - INDEX cityid (cityid); - INDEX boroughid (boroughid, name); + INDEX cityid (cityid), + INDEX boroughid (boroughid, name) ) ENGINE=INNODB"); // cechy ulic $DB->Execute(" From cvs w lms.org.pl Sun Sep 11 18:06:05 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 11 Sep 2011 18:06:05 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/upgradedb (mysql.2011082800.php) Message-ID: <20110911160605.925C530278A0@eftep.altec.pl> Date: Sunday, September 11, 2011 @ 18:06:05 Author: maniac Path: /cvsroot/lms/lib/upgradedb Modified: mysql.2011082800.php fixed query for myql compatibility Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2011082800.php.diff?&r1=1.3&r2=1.4 Index: lms/lib/upgradedb/mysql.2011082800.php diff -u lms/lib/upgradedb/mysql.2011082800.php:1.3 lms/lib/upgradedb/mysql.2011082800.php:1.4 --- lms/lib/upgradedb/mysql.2011082800.php:1.3 Sun Sep 11 17:26:51 2011 +++ lms/lib/upgradedb/mysql.2011082800.php Sun Sep 11 18:06:05 2011 @@ -25,6 +25,8 @@ $DB->BeginTrans(); +$DB->Execute("DROP VIEW vnodes"); + // wojewodztwa $DB->Execute(" CREATE TABLE location_states ( @@ -172,8 +174,7 @@ CREATE VIEW vnodes AS SELECT n.*, m.mac FROM nodes n - LEFT JOIN (SELECT nodeid, array_to_string(array_agg(mac), ',') AS mac - FROM macs GROUP BY nodeid) m ON (n.id = m.nodeid); + LEFT JOIN vnodes_mac m ON (n.id = m.nodeid); "); $DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2011082800', 'dbversion')); From cvs w lms.org.pl Wed Sep 14 12:38:08 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 14 Sep 2011 12:38:08 +0200 (CEST) Subject: [lms-commits] CVS update of lms/modules (rtsearch.php) Message-ID: <20110914103808.1DADB30278A0@eftep.altec.pl> Date: Wednesday, September 14, 2011 @ 12:38:08 Author: chilek Path: /cvsroot/lms/modules Modified: rtsearch.php - fixed two rtsearch bugs: 1) invalid state assertion when it's set to empty 2) checking user privileges for case when queue is array Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtsearch.php.diff?&r1=1.49&r2=1.50 Index: lms/modules/rtsearch.php diff -u lms/modules/rtsearch.php:1.49 lms/modules/rtsearch.php:1.50 --- lms/modules/rtsearch.php:1.49 Fri Apr 1 12:35:12 2011 +++ lms/modules/rtsearch.php Wed Sep 14 12:38:07 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: rtsearch.php,v 1.49 2011/04/01 10:35:12 alec Exp $ + * $Id: rtsearch.php,v 1.50 2011/09/14 10:38:07 chilek Exp $ */ function RTSearch($search, $order='createtime,desc') @@ -66,7 +66,7 @@ $where[] = 't.customerid = '.intval($search['customerid']); if(!empty($search['subject'])) $where[] = 't.subject ?LIKE? '.$DB->Escape('%'.$search['subject'].'%'); - if(isset($search['state'])) + if(!empty($search['state'])) { if($search['state'] == '-1') $where[] = 'state != '.RT_RESOLVED; @@ -162,8 +162,16 @@ if(sizeof($queues) != $DB->GetOne('SELECT COUNT(*) FROM rtqueues')) $search['queue'] = $queues; } - elseif(!$LMS->GetUserRightsRT($AUTH->id, $search['queue'])) - $error['queue'] = trans('You have no privileges to review this queue!'); + else + if(is_array($search['queue'])) + foreach($search['queue'] as $queue) + { + if(!$LMS->GetUserRightsRT($AUTH->id, $queue)) + $error['queue'] = trans('You have no privileges to review this queue!'); + } + else + if(!$LMS->GetUserRightsRT($AUTH->id, $search['queue'])) + $error['queue'] = trans('You have no privileges to review this queue!'); if(!$error) { From cvs w lms.org.pl Thu Sep 15 18:26:10 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 15 Sep 2011 18:26:10 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib (LMS.class.php) Message-ID: <20110915162610.A795F30278A0@eftep.altec.pl> Date: Thursday, September 15, 2011 @ 18:26:10 Author: maniac Path: /cvsroot/lms/lib Modified: LMS.class.php Adding on/off switch to voip accounts Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMS.class.php.diff?&r1=1.1074&r2=1.1075 Index: lms/lib/LMS.class.php diff -u lms/lib/LMS.class.php:1.1074 lms/lib/LMS.class.php:1.1075 --- lms/lib/LMS.class.php:1.1074 Wed Aug 31 14:16:36 2011 +++ lms/lib/LMS.class.php Thu Sep 15 18:26:10 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMS.class.php,v 1.1074 2011/08/31 12:16:36 alec Exp $ + * $Id: LMS.class.php,v 1.1075 2011/09/15 16:26:10 maniac Exp $ */ // LMS Class - contains internal LMS database functions used @@ -35,7 +35,7 @@ var $cache = array(); // internal cache var $hooks = array(); // registered plugin hooks var $_version = '1.11-cvs'; // class version - var $_revision = '$Revision: 1.1074 $'; + var $_revision = '$Revision: 1.1075 $'; function LMS(&$DB, &$AUTH, &$CONFIG) // class variables setting { @@ -4703,7 +4703,7 @@ $voipaccountlist = $this->DB->GetAll('SELECT v.id, v.login, v.passwd, v.phone, v.ownerid, ' - .$this->DB->Concat('c.lastname',"' '",'c.name').' AS owner + .$this->DB->Concat('c.lastname',"' '",'c.name').' AS owner, v.access FROM voipaccounts v JOIN customersview c ON (v.ownerid = c.id) ' .(isset($searchargs) ? $searchargs : '') @@ -4716,15 +4716,50 @@ return $voipaccountlist; } + function VoipAccountSet($id, $access=-1) + { + if($access != -1) + { + if($access) + return $this->DB->Execute('UPDATE voipaccounts SET access = 1 WHERE id = ? + AND EXISTS (SELECT 1 FROM customers WHERE id = ownerid + AND status = 3)', array($id)); + else + return $this->DB->Execute('UPDATE voipaccounts SET access = 0 WHERE id = ?', + array($id)); + } + elseif($this->DB->GetOne('SELECT access FROM voipaccounts WHERE id = ?', array($id)) == 1 ) + return $this->DB->Execute('UPDATE voipaccounts SET access=0 WHERE id = ?', array($id)); + else + return $this->DB->Execute('UPDATE voipaccounts SET access = 1 WHERE id = ? + AND EXISTS (SELECT 1 FROM customers WHERE id = ownerid + AND status = 3)', array($id)); + } + + function VoipAccountSetU($id,$access=FALSE) + { + if($access) + { + if($this->DB->GetOne('SELECT status FROM customers WHERE id = ?', array($id)) == 3) + { + return $this->DB->Execute('UPDATE voipaccounts SET access=1 WHERE ownerid=?', array($id)); + } + } + else + return $this->DB->Execute('UPDATE voipaccounts SET access=0 WHERE ownerid=?', array($id)); + } + + function VoipAccountAdd($voipaccountdata) { - if($this->DB->Execute('INSERT INTO voipaccounts (ownerid, login, passwd, phone, creatorid, creationdate) - VALUES (?, ?, ?, ?, ?, ?NOW?)', + if($this->DB->Execute('INSERT INTO voipaccounts (ownerid, login, passwd, phone, creatorid, creationdate, access) + VALUES (?, ?, ?, ?, ?, ?NOW?, ?)', array($voipaccountdata['ownerid'], $voipaccountdata['login'], $voipaccountdata['passwd'], $voipaccountdata['phone'], - $this->AUTH->id + $this->AUTH->id, + $voipaccountdata['access'] ))) { $id = $this->DB->GetLastInsertID('voipaccounts'); @@ -4752,7 +4787,7 @@ function GetVoipAccount($id) { if($result = $this->DB->GetRow('SELECT id, ownerid, login, passwd, phone, - creationdate, moddate, creatorid, modid + creationdate, moddate, creatorid, modid, access FROM voipaccounts WHERE id = ?', array($id))) { $result['createdby'] = $this->GetUserName($result['creatorid']); @@ -4790,20 +4825,21 @@ function VoipAccountUpdate($voipaccountdata) { - $this->DB->Execute('UPDATE voipaccounts SET login=?, passwd=?, phone=?, moddate=?NOW?, + $this->DB->Execute('UPDATE voipaccounts SET login=?, passwd=?, phone=?, moddate=?NOW?, access=? modid=?, ownerid=? WHERE id=?', array($voipaccountdata['login'], $voipaccountdata['passwd'], $voipaccountdata['phone'], $this->AUTH->id, $voipaccountdata['ownerid'], - $voipaccountdata['id'] + $voipaccountdata['id'], + $voipaccountdata['access'] )); } function GetCustomerVoipAccounts($id) { - if($result['accounts'] = $this->DB->GetAll('SELECT id, login, passwd, phone, ownerid + if($result['accounts'] = $this->DB->GetAll('SELECT id, login, passwd, phone, ownerid, access FROM voipaccounts WHERE ownerid=? ORDER BY login ASC', array($id))) { From cvs w lms.org.pl Thu Sep 15 18:26:10 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 15 Sep 2011 18:26:10 +0200 (CEST) Subject: [lms-commits] CVS update of lms/templates (4 files) Message-ID: <20110915162611.0020D30278A1@eftep.altec.pl> Date: Thursday, September 15, 2011 @ 18:26:10 Author: maniac Path: /cvsroot/lms/templates Modified: voipaccountaddbox.html voipaccounteditbox.html voipaccountinfobox.html voipaccountlist.html Adding on/off switch to voip accounts Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/voipaccountaddbox.html.diff?&r1=1.4&r2=1.5 http://cvs.lms.org.pl/viewvc/Development/lms/templates/voipaccounteditbox.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/voipaccountinfobox.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/voipaccountlist.html.diff?&r1=1.3&r2=1.4 Index: lms/templates/voipaccountaddbox.html diff -u lms/templates/voipaccountaddbox.html:1.4 lms/templates/voipaccountaddbox.html:1.5 --- lms/templates/voipaccountaddbox.html:1.4 Sun Dec 28 20:03:29 2008 +++ lms/templates/voipaccountaddbox.html Thu Sep 15 18:26:10 2011 @@ -1,4 +1,4 @@ - +
@@ -35,6 +35,20 @@ + + + + + + + + + + Index: lms/templates/rtqueueview.html diff -u lms/templates/rtqueueview.html:1.54 lms/templates/rtqueueview.html:1.55 --- lms/templates/rtqueueview.html:1.54 Fri Jul 9 10:45:52 2010 +++ lms/templates/rtqueueview.html Fri Sep 16 22:48:17 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

+ + + {t}Status:{/t} + + +
{t}Customer:{/t} Index: lms/templates/voipaccounteditbox.html diff -u lms/templates/voipaccounteditbox.html:1.3 lms/templates/voipaccounteditbox.html:1.4 --- lms/templates/voipaccounteditbox.html:1.3 Fri Nov 28 09:42:01 2008 +++ lms/templates/voipaccounteditbox.html Thu Sep 15 18:26:10 2011 @@ -1,4 +1,4 @@ - + @@ -37,6 +37,20 @@
+ + + {t}Status:{/t} + + +
{t}Customer:{/t} Index: lms/templates/voipaccountinfobox.html diff -u lms/templates/voipaccountinfobox.html:1.3 lms/templates/voipaccountinfobox.html:1.4 --- lms/templates/voipaccountinfobox.html:1.3 Mon Mar 8 10:59:21 2010 +++ lms/templates/voipaccountinfobox.html Thu Sep 15 18:26:10 2011 @@ -1,4 +1,4 @@ - + + + + + + @@ -137,6 +156,25 @@ {t 0="" 1=""}Customers requesting more than $0 times in last $1 days{/t} + + + +
@@ -36,6 +36,17 @@ {$voipaccountinfo.phone}
+ + + {t}Status:{/t} + + {if $voipaccountinfo.access}{t}connected{/t}{else}{t}disconnected{/t}{/if} +
Index: lms/templates/voipaccountlist.html diff -u lms/templates/voipaccountlist.html:1.3 lms/templates/voipaccountlist.html:1.4 --- lms/templates/voipaccountlist.html:1.3 Sun Dec 28 20:03:29 2008 +++ lms/templates/voipaccountlist.html Thu Sep 15 18:26:10 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -65,6 +65,7 @@ + + + +
+ [ {if ! $voipaccountlist[voipaccountlist].access}{t}Connect{/t}{else}{t}Disconnect{/t}{/if} ] [ {t}Delete{/t} ] [ {t}Edit{/t} ] [ {t}Info{/t} ] From cvs w lms.org.pl Thu Sep 15 18:26:11 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 15 Sep 2011 18:26:11 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/upgradedb (2 files) Message-ID: <20110915162611.74C5830278A3@eftep.altec.pl> Date: Thursday, September 15, 2011 @ 18:26:11 Author: maniac Path: /cvsroot/lms/lib/upgradedb Added: mysql.2011091100.php postgres.2011091100.php Adding on/off switch to voip accounts Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2011091100.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2011091100.php?rev=1.1 Index: lms/lib/upgradedb/mysql.2011091100.php diff -u /dev/null lms/lib/upgradedb/mysql.2011091100.php:1.1 --- /dev/null Thu Sep 15 18:26:11 2011 +++ lms/lib/upgradedb/mysql.2011091100.php Thu Sep 15 18:26:11 2011 @@ -0,0 +1,34 @@ +BeginTrans(); + +$DB->Execute("ALTER TABLE voipaccounts ADD COLUMN access tinyint(1) NOT NULL DEFAULT '1'"); +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?",array('2011091100', 'dbversion')); + +$DB->CommitTrans(); + +?> Index: lms/lib/upgradedb/postgres.2011091100.php diff -u /dev/null lms/lib/upgradedb/postgres.2011091100.php:1.1 --- /dev/null Thu Sep 15 18:26:11 2011 +++ lms/lib/upgradedb/postgres.2011091100.php Thu Sep 15 18:26:11 2011 @@ -0,0 +1,40 @@ +BeginTrans(); + +$DB->Execute(" + ALTER TABLE voipaccounts ADD COLUMN access smallint; + UPDATE voipaccounts SET access = 0; + ALTER TABLE voipaccounts ALTER access SET NOT NULL; + ALTER TABLE voipaccounts ALTER access SET DEFAULT 0; +"); + +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?",array('2011091100', 'dbversion')); + +$DB->CommitTrans(); + +?> From cvs w lms.org.pl Thu Sep 15 18:26:11 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 15 Sep 2011 18:26:11 +0200 (CEST) Subject: [lms-commits] CVS update of lms/modules (voipaccountadd.php, voipaccountset.php) Message-ID: <20110915162611.39A0C30278A2@eftep.altec.pl> Date: Thursday, September 15, 2011 @ 18:26:11 Author: maniac Path: /cvsroot/lms/modules Added: voipaccountset.php Modified: voipaccountadd.php Adding on/off switch to voip accounts Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/voipaccountadd.php.diff?&r1=1.7&r2=1.8 http://cvs.lms.org.pl/viewvc/Development/lms/modules/voipaccountset.php?rev=1.1 Index: lms/modules/voipaccountadd.php diff -u lms/modules/voipaccountadd.php:1.7 lms/modules/voipaccountadd.php:1.8 --- lms/modules/voipaccountadd.php:1.7 Thu Mar 10 12:36:39 2011 +++ lms/modules/voipaccountadd.php Thu Sep 15 18:26:11 2011 @@ -21,9 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: voipaccountadd.php,v 1.7 2011/03/10 11:36:39 alec Exp $ + * $Id: voipaccountadd.php,v 1.8 2011/09/15 16:26:11 maniac Exp $ */ +$voipaccountdata['access'] = 1; $voipaccountdata['ownerid'] = 0; if(isset($_GET['ownerid'])) Index: lms/modules/voipaccountset.php diff -u /dev/null lms/modules/voipaccountset.php:1.1 --- /dev/null Thu Sep 15 18:26:11 2011 +++ lms/modules/voipaccountset.php Thu Sep 15 18:26:11 2011 @@ -0,0 +1,81 @@ +CustomerExists($ownerid)) +{ + $res = $LMS->VoipAccountSetU($ownerid, $access); + + if ($res) { + $data = array('ownerid' => $ownerid, 'access' => $access); + $LMS->ExecHook('voip_account_set_after', $data); + } + + $backid = $ownerid; + $redir = $SESSION->get('backto'); + if($SESSION->get('lastmodule')=='customersearch') + $redir .= '&search=1'; + + $SESSION->redirect('?'.$redir.'#'.$backid); +} + +// One voip account +if($id && $LMS->VoipAccountExists($id)) +{ + $res = $LMS->VoipAccountSet($id); + $backid = $id; + + if ($res) { + $data = array('voipaccountid' => $id); + $LMS->ExecHook('voip_account_set_after', $data); + } +} +// Selected voipaccounts +else if(!empty($_POST['marks'])) { + $voipaccounts = array(); + foreach($_POST['marks'] as $id) { + if ($LMS->VoipAccountSet($id, $access)) { + $voipaccounts[] = $id; + } + } + if (!empty($voipaccounts)) { + $data = array('voipaccounts' => $voipaccounts); + $LMS->ExecHook('voip_account_set_after', $data); + } +} + +if(!empty($_GET['shortlist'])) +{ + header('Location: ?m=voipaccountlistshort&id='.$LMS->GetVoipAccountOwner($id)); +} +else + header('Location: ?'.$SESSION->get('backto').(isset($backid) ? '#'.$backid : '')); + +?> From cvs w lms.org.pl Fri Sep 16 22:48:16 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 16 Sep 2011 22:48:16 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib (4 files) Message-ID: <20110916204817.115BB30278A0@eftep.altec.pl> Date: Friday, September 16, 2011 @ 22:48:16 Author: chilek Path: /cvsroot/lms/lib Modified: LMS.class.php accesstable.php menu.php upgradedb.php - helpdesk: ticket categories introduced Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMS.class.php.diff?&r1=1.1075&r2=1.1076 http://cvs.lms.org.pl/viewvc/Development/lms/lib/accesstable.php.diff?&r1=1.142&r2=1.143 http://cvs.lms.org.pl/viewvc/Development/lms/lib/menu.php.diff?&r1=1.62&r2=1.63 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb.php.diff?&r1=1.193&r2=1.194 Index: lms/lib/LMS.class.php diff -u lms/lib/LMS.class.php:1.1075 lms/lib/LMS.class.php:1.1076 --- lms/lib/LMS.class.php:1.1075 Thu Sep 15 18:26:10 2011 +++ lms/lib/LMS.class.php Fri Sep 16 22:48:16 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMS.class.php,v 1.1075 2011/09/15 16:26:10 maniac Exp $ + * $Id: LMS.class.php,v 1.1076 2011/09/16 20:48:16 chilek Exp $ */ // LMS Class - contains internal LMS database functions used @@ -35,7 +35,7 @@ var $cache = array(); // internal cache var $hooks = array(); // registered plugin hooks var $_version = '1.11-cvs'; // class version - var $_revision = '$Revision: 1.1075 $'; + var $_revision = '$Revision: 1.1076 $'; function LMS(&$DB, &$AUTH, &$CONFIG) // class variables setting { @@ -3479,7 +3479,7 @@ return NULL; } - function GetQueueContents($ids, $order='createtime,desc', $state=NULL, $owner=0) + function GetQueueContents($ids, $order='createtime,desc', $state=NULL, $owner=0, $catids=NULL) { if(!$order) $order = 'createtime,desc'; @@ -3530,18 +3530,20 @@ } if($result = $this->DB->GetAll( - 'SELECT t.id, t.customerid, c.address, users.name AS ownername, + 'SELECT DISTINCT t.id, t.customerid, c.address, users.name AS ownername, t.subject, state, owner AS ownerid, t.requestor AS req, CASE WHEN customerid = 0 THEN t.requestor ELSE ' .$this->DB->Concat('c.lastname',"' '",'c.name').' END AS requestor, t.createtime AS createtime, u.name AS creatorname, (SELECT MAX(createtime) FROM rtmessages WHERE ticketid = t.id) AS lastmodified FROM rttickets t + LEFT JOIN rtticketcategories tc ON (t.id = tc.ticketid) LEFT JOIN users ON (owner = users.id) LEFT JOIN customers c ON (t.customerid = c.id) LEFT JOIN users u ON (t.creatorid = u.id) WHERE 1=1 ' - .(is_array($ids) ? ' AND queueid IN ('.implode(',', $ids).')' : ($ids != 0 ? ' AND queueid = '.$ids : '')) + .(is_array($ids) ? ' AND t.queueid IN ('.implode(',', $ids).')' : ($ids != 0 ? ' AND t.queueid = '.$ids : '')) + .(is_array($catids) ? ' AND tc.categoryid IN ('.implode(',', $catids).')' : ($catids != 0 ? ' AND tc.categoryid = '.$catids : '')) .$statefilter .($owner ? ' AND t.owner = '.intval($owner) : '') .($sqlord !='' ? $sqlord.' '.$direction:''))) @@ -3584,6 +3586,8 @@ return ($rights ? $rights : 0); } + + function GetQueueList($stats=true) { if($result = $this->DB->GetAll('SELECT id, name, email, description @@ -3638,14 +3642,111 @@ return $stats; } + function GetCategory($id) + { + if($category = $this->DB->GetRow('SELECT * FROM rtcategories WHERE id=?', array($id))) + { + $users = $this->DB->GetAll('SELECT id, name FROM users WHERE deleted=0 ORDER BY login asc'); + foreach($users as $user) + { + $user['owner'] = $this->DB->GetOne('SELECT 1 FROM rtcategoryusers WHERE userid = ? AND categoryid = ?', + array($user['id'], $id)); + $category['owners'][] = $user; + } + return $category; + } + else + return NULL; + } + + function GetUserRightsToCategory($user, $category, $ticket=NULL) + { + if(!$category && $ticket) + { + if(!($category = $this->GetCache('rttickets', $ticket, 'categoryid'))) + $category = $this->DB->GetCol('SELECT categoryid FROM rtticketcategories WHERE ticketid=?', array($ticket)); + } + + // grant access to ticket when no categories assigned to this ticket + if (!$category) + return 1; + + $owner = $this->DB->GetOne('SELECT 1 FROM rtcategoryusers WHERE userid=? AND categoryid '. + (is_array($category) ? 'IN ('.implode(',', $category).')' : '= '.$category), + array($user)); + + return ($owner === '1'); + } + + function GetCategoryList($stats = true) + { + if($result = $this->DB->GetAll('SELECT id, name, description + FROM rtcategories ORDER BY name')) + { + if($stats) + foreach($result as $idx => $row) + foreach($this->GetCategoryStats($row['id']) as $sidx => $row) + $result[$idx][$sidx] = $row; + foreach($result as $idx => $category) + $result[$idx]['owners'] = $this->DB->GetAll('SELECT u.id, name FROM rtcategoryusers cu + LEFT JOIN users u ON cu.userid = u.id + WHERE categoryid = ?', + array($category['id'])); + } + return $result; + } + + function GetCategoryStats($id) + { + if($result = $this->DB->GetAll('SELECT state, COUNT(state) AS scount + FROM rttickets LEFT JOIN rtticketcategories ON rttickets.id = rtticketcategories.ticketid + WHERE rtticketcategories.categoryid = ? GROUP BY state ORDER BY state ASC', array($id))) + { + foreach($result as $row) + $stats[$row['state']] = $row['scount']; + foreach(array('new', 'open', 'resolved', 'dead') as $idx => $value) + $stats[$value] = isset($stats[$idx]) ? $stats[$idx] : 0; + } + $stats['lastticket'] = $this->DB->GetOne('SELECT createtime FROM rttickets + LEFT JOIN rtticketcategories ON rttickets.id = rtticketcategories.ticketid + WHERE rtticketcategories.categoryid = ? ORDER BY createtime DESC', array($id)); + + return $stats; + } + + function CategoryExists($id) + { + return ($this->DB->GetOne('SELECT * FROM rtcategories WHERE id=?', array($id)) ? TRUE : FALSE); + } + + function GetCategoryIdByName($category) + { + return $this->DB->GetOne('SELECT id FROM rtcategories WHERE name=?', array($category)); + } + + function GetCategoryListByUser($userid=NULL) + { + return $this->DB->GetAll('SELECT c.id, name FROM rtcategories c LEFT JOIN rtcategoryusers cu + ON c.id = cu.categoryid '.($userid ? 'WHERE userid = '.$userid : '' ).' ORDER BY name'); + } + function RTStats() { - return $this->DB->GetRow('SELECT COUNT(CASE state WHEN '.RT_NEW.' THEN 1 END) AS new, + $categories = $this->GetCategoryListByUser($this->AUTH->id); + foreach ($categories as $category) + $catids[] = $category['id']; + return $this->DB->GetAll('SELECT tc.categoryid AS id, c.name, + COUNT(CASE state WHEN '.RT_NEW.' THEN 1 END) AS new, COUNT(CASE state WHEN '.RT_OPEN.' THEN 1 END) AS opened, COUNT(CASE state WHEN '.RT_RESOLVED.' THEN 1 END) AS resolved, COUNT(CASE state WHEN '.RT_DEAD.' THEN 1 END) AS dead, COUNT(CASE WHEN state != '.RT_RESOLVED.' THEN 1 END) AS unresolved - FROM rttickets'); + FROM rttickets t + LEFT JOIN rtticketcategories tc ON t.id = tc.ticketid + LEFT JOIN rtcategories c ON c.id = tc.categoryid + WHERE tc.categoryid IN ('.implode(',', $catids).') + GROUP BY tc.categoryid, c.name + ORDER BY c.name'); } function GetQueueByTicketId($id) @@ -3690,6 +3791,11 @@ preg_replace("/\r/", "", $ticket['body']), $ticket['mailfrom'])); + foreach(array_keys($ticket['categories']) as $catid) + $this->DB->Execute('INSERT INTO rtticketcategories (ticketid, categoryid) + VALUES (?, ?)', + array($id, $catid)); + return $id; } @@ -3708,6 +3814,8 @@ LEFT JOIN customers ON (customers.id = t.customerid) WHERE t.id = ?', array($id)); + $ticket['categories'] = $this->DB->GetAllByKey('SELECT categoryid AS id FROM rtticketcategories WHERE ticketid = ?', 'id', array($id)); + $ticket['messages'] = $this->DB->GetAll( '(SELECT rtmessages.id AS id, mailfrom, subject, body, createtime, ' .$this->DB->Concat('customers.lastname',"' '",'customers.name').' AS customername, Index: lms/lib/accesstable.php diff -u lms/lib/accesstable.php:1.142 lms/lib/accesstable.php:1.143 --- lms/lib/accesstable.php:1.142 Fri Sep 9 20:16:51 2011 +++ lms/lib/accesstable.php Fri Sep 16 22:48:16 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: accesstable.php,v 1.142 2011/09/09 18:16:51 chilek Exp $ + * $Id: accesstable.php,v 1.143 2011/09/16 20:48:16 chilek Exp $ */ unset($access); @@ -56,7 +56,7 @@ $access['table'][8]['allow_reg'] = '^message(add|list|info)$'; $access['table'][9]['name'] = trans('Helpdesk (RT) administration'); -$access['table'][9]['allow_reg'] = '^(rtsearch|rtprint|(rtqueue|rtticket|rtmessage|rtnote)(add|del|edit|info|view|list|print))$'; +$access['table'][9]['allow_reg'] = '^(rtsearch|rtprint|(rtqueue|rtticket|rtmessage|rtnote|rtcategory)(add|del|edit|info|view|list|print))$'; $access['table'][10]['name'] = trans('Helpdesk (RT) operation'); $access['table'][10]['allow_reg'] = '^(rtsearch|rtqueue(list|info|view)|(rtticket|rtmessage|rtnote)(add|edit|info|view|del|print))$'; Index: lms/lib/menu.php diff -u lms/lib/menu.php:1.62 lms/lib/menu.php:1.63 --- lms/lib/menu.php:1.62 Wed Mar 2 11:31:04 2011 +++ lms/lib/menu.php Fri Sep 16 22:48:16 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: menu.php,v 1.62 2011/03/02 10:31:04 alec Exp $ + * $Id: menu.php,v 1.63 2011/09/16 20:48:16 chilek Exp $ */ $menu = array( @@ -559,22 +559,34 @@ 'prio' => 20, ), array( + 'name' => trans('Categories List'), + 'link' => '?m=rtcategorylist', + 'tip' => trans('List of categories'), + 'prio' => 30, + ), + array( + 'name' => trans('New Category'), + 'link' => '?m=rtcategoryadd', + 'tip' => trans('Add new category'), + 'prio' => 40, + ), + array( 'name' => trans('Search'), 'link' => '?m=rtsearch', 'tip' => trans('Tickets searching'), - 'prio' => 30, + 'prio' => 50, ), array( 'name' => trans('New Ticket'), 'link' => '?m=rtticketadd', 'tip' => trans('Add new ticket'), - 'prio' => 40, + 'prio' => 60, ), array( 'name' => trans('Reports'), 'link' => '?m=rtprint', 'tip' => trans('Lists and reports printing'), - 'prio' => 50, + 'prio' => 70, ), ), ), Index: lms/lib/upgradedb.php diff -u lms/lib/upgradedb.php:1.193 lms/lib/upgradedb.php:1.194 --- lms/lib/upgradedb.php:1.193 Wed Aug 31 12:46:45 2011 +++ lms/lib/upgradedb.php Fri Sep 16 22:48:16 2011 @@ -21,10 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: upgradedb.php,v 1.193 2011/08/31 10:46:45 alec Exp $ + * $Id: upgradedb.php,v 1.194 2011/09/16 20:48:16 chilek Exp $ */ -define('DBVERSION', '2011082800'); // here should be always the newest version of database! +define('DBVERSION', '2011091600'); // here should be always the newest version of database! // it placed here to avoid read disk every time when we call this file. /* From cvs w lms.org.pl Fri Sep 16 22:48:18 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 16 Sep 2011 22:48:18 +0200 (CEST) Subject: [lms-commits] CVS update of lms/userpanel/modules/helpdesk (functions.php) Message-ID: <20110916204818.3D0AC30278A4@eftep.altec.pl> Date: Friday, September 16, 2011 @ 22:48:18 Author: chilek Path: /cvsroot/lms/userpanel/modules/helpdesk Modified: functions.php - helpdesk: ticket categories introduced Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/userpanel/modules/helpdesk/functions.php.diff?&r1=1.7&r2=1.8 Index: lms/userpanel/modules/helpdesk/functions.php diff -u lms/userpanel/modules/helpdesk/functions.php:1.7 lms/userpanel/modules/helpdesk/functions.php:1.8 --- lms/userpanel/modules/helpdesk/functions.php:1.7 Thu Mar 10 12:36:40 2011 +++ lms/userpanel/modules/helpdesk/functions.php Fri Sep 16 22:48:18 2011 @@ -21,20 +21,31 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: functions.php,v 1.7 2011/03/10 11:36:40 alec Exp $ + * $Id: functions.php,v 1.8 2011/09/16 20:48:18 chilek Exp $ */ if (defined('USERPANEL_SETUPMODE')) { function module_setup() { - global $SMARTY, $LMS; + global $SMARTY, $LMS, $AUTH; + + $default_categories = explode(',', $LMS->CONFIG['userpanel']['default_categories']); + $categories = $LMS->GetCategoryListByUser($AUTH->id); + foreach($categories as $category) + { + if (in_array($category['id'], $default_categories)) + $category['checked'] = true; + $ncategories[] = $category; + } + $categories = $ncategories; $SMARTY->assign('userlist', $LMS->GetUserNames()); $SMARTY->assign('queuelist', $LMS->GetQueueNames()); $SMARTY->assign('default_queue', $LMS->CONFIG['userpanel']['default_queue']); $SMARTY->assign('default_userid', $LMS->CONFIG['userpanel']['default_userid']); $SMARTY->assign('lms_url', $LMS->CONFIG['userpanel']['lms_url']); + $SMARTY->assign('categories', $categories); $SMARTY->display('module:helpdesk:setup.html'); } @@ -44,6 +55,8 @@ $DB->Execute('UPDATE uiconfig SET value = ? WHERE section = \'userpanel\' AND var = \'default_queue\'',array($_POST['default_queue'])); $DB->Execute('UPDATE uiconfig SET value = ? WHERE section = \'userpanel\' AND var = \'default_userid\'',array($_POST['default_userid'])); $DB->Execute('UPDATE uiconfig SET value = ? WHERE section = \'userpanel\' AND var = \'lms_url\'',array($_POST['lms_url'])); + $categories = array_keys((isset($_POST['lms_categories']) ? $_POST['lms_categories'] : array())); + $DB->Execute('UPDATE uiconfig SET value = ? WHERE section = \'userpanel\' AND var = \'default_categories\'', array(implode(',', $categories))); header('Location: ?m=userpanel&module=helpdesk'); } } @@ -59,10 +72,11 @@ $ticket = $_POST['helpdesk']; $ticket['queue'] = $CONFIG['userpanel']['default_queue']; + $ticket['categories'] = $CONFIG['userpanel']['default_categories']; $ticket['subject'] = strip_tags($ticket['subject']); $ticket['body'] = strip_tags($ticket['body']); - if(!$ticket['queue']) + if(!$ticket['queue'] || !$ticket['categories']) { header('Location: ?m=helpdesk'); die; @@ -106,6 +120,10 @@ $ticket['mailfrom'] )); + foreach(explode(',', $ticket['categories']) as $catid) + $DB->Execute('INSERT INTO rtticketcategories (ticketid, categoryid) VALUES (?, ?)', + array($id, $catid)); + if(isset($CONFIG['phpui']['newticket_notify']) && chkconfig($CONFIG['phpui']['newticket_notify'])) { $user = $LMS->GetUserInfo($CONFIG['userpanel']['default_userid']); From cvs w lms.org.pl Fri Sep 16 22:48:17 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 16 Sep 2011 22:48:17 +0200 (CEST) Subject: [lms-commits] CVS update of lms/modules (13 files) Message-ID: <20110916204817.ABF8F30278A2@eftep.altec.pl> Date: Friday, September 16, 2011 @ 22:48:17 Author: chilek Path: /cvsroot/lms/modules Added: rtcategoryadd.php rtcategorydel.php rtcategoryedit.php rtcategoryinfo.php rtcategorylist.php Modified: quicksearch.php rtprint.php rtqueueview.php rtsearch.php rtticketadd.php rtticketedit.php rtticketinfo.php rtticketview.php - helpdesk: ticket categories introduced Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/quicksearch.php.diff?&r1=1.74&r2=1.75 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtcategoryadd.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtcategorydel.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtcategoryedit.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtcategoryinfo.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtcategorylist.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtprint.php.diff?&r1=1.17&r2=1.18 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtqueueview.php.diff?&r1=1.51&r2=1.52 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtsearch.php.diff?&r1=1.50&r2=1.51 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtticketadd.php.diff?&r1=1.57&r2=1.58 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtticketedit.php.diff?&r1=1.44&r2=1.45 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtticketinfo.php.diff?&r1=1.5&r2=1.6 http://cvs.lms.org.pl/viewvc/Development/lms/modules/rtticketview.php.diff?&r1=1.43&r2=1.44 Index: lms/modules/quicksearch.php diff -u lms/modules/quicksearch.php:1.74 lms/modules/quicksearch.php:1.75 --- lms/modules/quicksearch.php:1.74 Fri Apr 1 12:35:12 2011 +++ lms/modules/quicksearch.php Fri Sep 16 22:48:17 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: quicksearch.php,v 1.74 2011/04/01 10:35:12 alec Exp $ + * $Id: quicksearch.php,v 1.75 2011/09/16 20:48:17 chilek Exp $ */ function macformat($mac, $escape=false) @@ -273,14 +273,19 @@ case 'ticket': if(isset($_GET['ajax'])) // support for AutoSuggest { + $categories = $LMS->GetCategoryListByUser($AUTH->id); + foreach($categories as $category) + $catids[] = $category['id']; $candidates = $DB->GetAll("SELECT t.id, t.subject, t.requestor, c.name, c.lastname FROM rttickets t + LEFT JOIN rtticketcategories tc ON t.id = tc.ticketid LEFT JOIN customersview c on (t.customerid = c.id) - WHERE ".(preg_match('/^[0-9]+$/',$search) ? 't.id = '.intval($search).' OR ' : '')." + WHERE ".(is_array($catids) ? "tc.categoryid IN (".implode(',', $catids).")" : "tc.categoryid IS NULL") + ." AND (".(preg_match('/^[0-9]+$/',$search) ? 't.id = '.intval($search).' OR ' : '')." LOWER(t.subject) ?LIKE? LOWER($sql_search) OR LOWER(t.requestor) ?LIKE? LOWER($sql_search) OR LOWER(c.name) ?LIKE? LOWER($sql_search) - OR LOWER(c.lastname) ?LIKE? LOWER($sql_search) + OR LOWER(c.lastname) ?LIKE? LOWER($sql_search)) ORDER BY t.subject, t.id, c.lastname, c.name, t.requestor LIMIT 15"); Index: lms/modules/rtcategoryadd.php diff -u /dev/null lms/modules/rtcategoryadd.php:1.1 --- /dev/null Fri Sep 16 22:48:17 2011 +++ lms/modules/rtcategoryadd.php Fri Sep 16 22:48:17 2011 @@ -0,0 +1,79 @@ +redirect('?m=rtcategorylist'); + } + + if($category['name'] == '') + $error['name'] = trans('Category name must be defined!'); + + if($category['name'] != '' && $LMS->GetCategoryIdByName($category['name'])) + $error['name'] = trans('Category with specified name already exists!'); + + if(isset($category['users'])) + foreach($category['users'] as $key => $value) + $category['owners'][] = array('id' => $key, 'value' => $value); + + if(!$error) + { + $DB->Execute('INSERT INTO rtcategories (name, description) VALUES (?, ?)', + array($category['name'], $category['description'])); + + $id = $DB->GetLastInsertId('rtcategories'); + + if(isset($category['owners']) && $id) + foreach ($category['owners'] as $val) + $DB->Execute('INSERT INTO rtcategoryusers(userid, categoryid) VALUES(?, ?)', + array($val['id'], $id)); + + $SESSION->redirect('?m=rtcategoryinfo&id='.$id); + } +} + +$users = $LMS->GetUserNames(); + +foreach($users as $user) +{ + $user['owner'] = isset($category['users'][$user['id']]); + $category['nowners'][] = $user; +} +$category['owners'] = $category['nowners']; + +$layout['pagetitle'] = trans('New Category'); + +$SESSION->save('backto', $_SERVER['QUERY_STRING']); + +$SMARTY->assign('category', $category); +$SMARTY->assign('error', $error); +$SMARTY->display('rtcategoryadd.html'); + +?> Index: lms/modules/rtcategorydel.php diff -u /dev/null lms/modules/rtcategorydel.php:1.1 --- /dev/null Fri Sep 16 22:48:17 2011 +++ lms/modules/rtcategorydel.php Fri Sep 16 22:48:17 2011 @@ -0,0 +1,54 @@ +CategoryExists($_GET['id'])) +{ + $body = '

'.trans('Specified ID is not proper or does not exist!').'

'; +} +else +{ + if($_GET['is_sure'] != 1) + { + $body = '

'.trans('Do you want to remove category called $0?',$LMS->GetQueueName($_GET['id'])).'

'; + $body .= '

'.trans('Yes, I know what I do.').' '; + $body .= ''.trans('No, I\'ve changed my mind.').'

'; + } + else + { + $category = intval($_GET['id']); + + $DB->Execute('DELETE FROM rtcategories WHERE id=?', array($category)); + + $SESSION->redirect('?m=rtcategorylist'); + } +} + +$SMARTY->assign('body',$body); +$SMARTY->display('dialog.html'); + +?> Index: lms/modules/rtcategoryedit.php diff -u /dev/null lms/modules/rtcategoryedit.php:1.1 --- /dev/null Fri Sep 16 22:48:17 2011 +++ lms/modules/rtcategoryedit.php Fri Sep 16 22:48:17 2011 @@ -0,0 +1,82 @@ +CategoryExists($_GET['id'])) +{ + $SESSION->redirect('?m=rtcategorylist'); +} + +if(isset($_POST['category'])) +{ + $category = $_POST['category']; + + $category['id'] = $_GET['id']; + + if($category['name'] == '') + $error['name'] = trans('Category name must be defined!'); + + if(isset($category['users'])) + foreach($category['users'] as $key => $value) + $category['owners'][] = array('id' => $key, 'value' => $value); + + if(!$error) + { + $DB->Execute('UPDATE rtcategories SET name=?, description=? WHERE id=?', + array($category['name'], + $category['description'], + $category['id'])); + + $DB->Execute('DELETE FROM rtcategoryusers WHERE categoryid=?', array($category['id'])); + + if(isset($category['owners'])) + foreach($category['owners'] as $val) + $DB->Execute('INSERT INTO rtcategoryusers(userid, categoryid) VALUES(?, ?)', + array($val['id'], $category['id'])); + + $SESSION->redirect('?m=rtcategoryinfo&id='.$category['id']); + } + + $users = $LMS->GetUserNames(); + + foreach ($users as $user) + { + $user['owner'] = isset($category['users'][$user['id']]); + $category['nowners'][] = $user; + } + $category['owners'] = $category['nowners']; +} +else + $category = $LMS->GetCategory($_GET['id']); + +$layout['pagetitle'] = trans('Category Edit: $0', $category['name']); + +$SESSION->save('backto', $_SERVER['QUERY_STRING']); + +$SMARTY->assign('category', $category); +$SMARTY->assign('error', $error); +$SMARTY->display('rtcategoryedit.html'); + +?> Index: lms/modules/rtcategoryinfo.php diff -u /dev/null lms/modules/rtcategoryinfo.php:1.1 --- /dev/null Fri Sep 16 22:48:17 2011 +++ lms/modules/rtcategoryinfo.php Fri Sep 16 22:48:17 2011 @@ -0,0 +1,41 @@ +CategoryExists($_GET['id'])) +{ + $SESSION->redirect('?m=rtcategorylist'); +} + +$category = $LMS->GetCategory($_GET['id']); + +$layout['pagetitle'] = trans('Category Info: $0',$category['name']); + +$SESSION->save('backto', $_SERVER['QUERY_STRING']); + +$SMARTY->assign('category', $category); +$SMARTY->display('rtcategoryinfo.html'); + +?> Index: lms/modules/rtcategorylist.php diff -u /dev/null lms/modules/rtcategorylist.php:1.1 --- /dev/null Fri Sep 16 22:48:17 2011 +++ lms/modules/rtcategorylist.php Fri Sep 16 22:48:17 2011 @@ -0,0 +1,35 @@ +GetCategoryList(); + +$SESSION->save('backto', $_SERVER['QUERY_STRING']); + +$SMARTY->assign('categories', $categories); +$SMARTY->display('rtcategorylist.html'); +?> Index: lms/modules/rtprint.php diff -u lms/modules/rtprint.php:1.17 lms/modules/rtprint.php:1.18 --- lms/modules/rtprint.php:1.17 Tue Jan 18 09:12:25 2011 +++ lms/modules/rtprint.php Fri Sep 16 22:48:17 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: rtprint.php,v 1.17 2011/01/18 08:12:25 alec Exp $ + * $Id: rtprint.php,v 1.18 2011/09/16 20:48:17 chilek Exp $ */ $type = isset($_GET['type']) ? $_GET['type'] : ''; @@ -33,15 +33,22 @@ $days = !empty($_GET['days']) ? intval($_GET['days']) : intval($_POST['days']); $times = !empty($_GET['times']) ? intval($_GET['times']) : intval($_POST['times']); $queue = !empty($_GET['queue']) ? intval($_GET['queue']) : intval($_POST['queue']); + $categories = !empty($_GET['categories']) ? $_GET['categories'] : $_POST['categories']; if($queue) $where[] = 'queueid = '.$queue; if($days) $where[] = 'rttickets.createtime > '.mktime(0, 0, 0, date('n'), date('j')-$days); + $catids = (is_array($categories) ? array_keys($categories) : NULL); + if (!empty($catids)) + $where[] = 'tc.categoryid IN ('.implode(',', $catids).')'; + else + $where[] = 'tc.categoryid IS NULL'; if($list = $DB->GetAll('SELECT COUNT(*) AS total, customerid, ' .$DB->Concat('UPPER(customers.lastname)',"' '",'customers.name').' AS customername FROM rttickets + LEFT JOIN rtticketcategories tc ON tc.ticketid = rttickets.id LEFT JOIN customers ON (customerid = customers.id) WHERE customerid != 0' .(isset($where) ? ' AND '.implode(' AND ', $where) : '') @@ -51,11 +58,13 @@ { $customer = $DB->GetAllByKey('SELECT COUNT(*) AS total, customerid FROM rttickets + LEFT JOIN rtticketcategories tc ON tc.ticketid = rttickets.id WHERE cause = 1' .(isset($where) ? ' AND '.implode(' AND ', $where) : '') .' GROUP BY customerid', 'customerid'); $company = $DB->GetAllByKey('SELECT COUNT(*) AS total, customerid FROM rttickets + LEFT JOIN rtticketcategories tc ON tc.ticketid = rttickets.id WHERE cause = 2' .(isset($where) ? ' AND '.implode(' AND ', $where) : '') .' GROUP BY customerid', 'customerid'); @@ -82,6 +91,7 @@ $status = isset($_GET['status']) ? $_GET['status'] : $_POST['status']; $subject = !empty($_GET['subject']) ? $_GET['subject'] : $_POST['subject']; $extended = !empty($_GET['extended']) ? true : !empty($_POST['extended']) ? true : false; + $categories = !empty($_GET['categories']) ? $_GET['categories'] : $_POST['categories']; if($queue) $where[] = 'queueid = '.$queue; @@ -91,6 +101,11 @@ $where[] = 'rttickets.createtime < '.mktime(0, 0, 0, date('n'), date('j')-$days); if($subject) $where[] = 'rttickets.subject ?LIKE? '.$DB->Escape("%$subject%"); + $catids = (is_array($categories) ? array_keys($categories) : NULL); + if (!empty($catids)) + $where[] = 'tc.categoryid IN ('.implode(',', $catids).')'; + else + $where[] = 'tc.categoryid IS NULL'; if($status != '') { @@ -107,6 +122,7 @@ FROM customercontacts WHERE customerid = customers.id LIMIT 1) AS phone ' : '') .'FROM rttickets + LEFT JOIN rtticketcategories tc ON tc.ticketid = rttickets.id LEFT JOIN customers ON (customerid = customers.id) WHERE state != '.RT_RESOLVED .(isset($where) ? ' AND '.implode(' AND ', $where) : '') @@ -142,6 +158,8 @@ break; default: + $categories = $LMS->GetCategoryListByUser($AUTH->id); + $layout['pagetitle'] = trans('Reports'); if(!isset($CONFIG['phpui']['big_networks']) || !chkconfig($CONFIG['phpui']['big_networks'])) @@ -149,6 +167,7 @@ $SMARTY->assign('customers', $LMS->GetCustomerNames()); } $SMARTY->assign('queues', $LMS->GetQueueList()); + $SMARTY->assign('categories', $categories); $SMARTY->display('rtprintindex.html'); break; } Index: lms/modules/rtqueueview.php diff -u lms/modules/rtqueueview.php:1.51 lms/modules/rtqueueview.php:1.52 --- lms/modules/rtqueueview.php:1.51 Tue Jan 18 09:12:25 2011 +++ lms/modules/rtqueueview.php Fri Sep 16 22:48:17 2011 @@ -21,11 +21,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: rtqueueview.php,v 1.51 2011/01/18 08:12:25 alec Exp $ + * $Id: rtqueueview.php,v 1.52 2011/09/16 20:48:17 chilek Exp $ */ if(isset($_GET['id'])) $queuedata['id'] = ($_GET['id'] == '' ? 0 : $_GET['id']); +if(isset($_GET['catid'])) + $queuedata['catid'] = ($_GET['catid'] == '' ? 0 : $_GET['catid']); if(! $LMS->QueueExists($queuedata['id']) && $queuedata['id'] != 0) { @@ -57,6 +59,31 @@ $queuedata['id'] = $queues; } +if($queuedata['catid'] != 0) +{ + $catrights = $LMS->GetUserRightsToCategory($AUTH->id, $queuedata['catid']); + + if(!$catrights) + { + $SMARTY->display('noaccess.html'); + $SESSION->close(); + die; + } +} +else +{ + $categories = $DB->GetCol('SELECT categoryid FROM rtcategoryusers WHERE userid=?', array($AUTH->id)); + + if (!$categories) { + $SMARTY->display('noaccess.html'); + $SESSION->close(); + die; + } + + if(sizeof($categories) != $DB->GetOne('SELECT COUNT(*) FROM rtcategories')) + $queuedata['catid'] = $categories; +} + if(!isset($_GET['o'])) $SESSION->restore('rto', $o); else @@ -80,7 +107,7 @@ $SESSION->save('rts', $s); $layout['pagetitle'] = trans('Tickets List'); -$queue = $LMS->GetQueueContents($queuedata['id'], $o, $s, $owner); +$queue = $LMS->GetQueueContents($queuedata['id'], $o, $s, $owner, $queuedata['catid']); $SESSION->save('backto', $_SERVER['QUERY_STRING']); @@ -106,8 +133,10 @@ $SESSION->save('rtp', $page); $queues = $LMS->GetQueueList(false); +$categories = $LMS->GetCategoryList(false); $SMARTY->assign('queues', $queues); +$SMARTY->assign('categories', $categories); $SMARTY->assign('queue', $queue); $SMARTY->assign('queuedata', $queuedata); $SMARTY->assign('pagelimit',$pagelimit); Index: lms/modules/rtsearch.php diff -u lms/modules/rtsearch.php:1.50 lms/modules/rtsearch.php:1.51 --- lms/modules/rtsearch.php:1.50 Wed Sep 14 12:38:07 2011 +++ lms/modules/rtsearch.php Fri Sep 16 22:48:17 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: rtsearch.php,v 1.50 2011/09/14 10:38:07 chilek Exp $ + * $Id: rtsearch.php,v 1.51 2011/09/16 20:48:17 chilek Exp $ */ function RTSearch($search, $order='createtime,desc') @@ -85,17 +85,22 @@ $where[] = 'queueid IN ('.implode(',', $search['queue']).')'; elseif(!empty($search['queue'])) $where[] = 'queueid = '.intval($search['queue']); - + if(isset($search['catids'])) + $where[] = 'tc.categoryid IN ('.implode(',', $search['catids']).')'; + else + $where[] = 'tc.categoryid IS NULL'; + if(isset($where)) $where = ' WHERE '.implode($op, $where); - if($result = $DB->GetAll('SELECT t.id, t.customerid, t.subject, t.state, t.owner AS ownerid, + if($result = $DB->GetAll('SELECT DISTINCT t.id, t.customerid, t.subject, t.state, t.owner AS ownerid, users.name AS ownername, CASE WHEN customerid = 0 THEN t.requestor ELSE ' .$DB->Concat('UPPER(customers.lastname)',"' '",'customers.name').' END AS requestor, t.requestor AS req, t.createtime, (SELECT MAX(createtime) FROM rtmessages WHERE t.id = ticketid) AS lastmodified FROM rttickets t + LEFT JOIN rtticketcategories tc ON t.id = tc.ticketid LEFT JOIN users ON (t.owner = users.id) LEFT JOIN customers ON (t.customerid = customers.id)' .(isset($where) ? $where : '') @@ -119,6 +124,8 @@ return $result; } +$categories = $LMS->GetCategoryListByUser($AUTH->id); + $layout['pagetitle'] = trans('Ticket Search'); if(isset($_POST['search'])) @@ -139,7 +146,8 @@ 'email' => '', 'owner' => '0', 'queue' => '0', - 'uptime' => '' + 'uptime' => '', + 'catids' => NULL ); } @@ -163,7 +171,7 @@ $search['queue'] = $queues; } else - if(is_array($search['queue'])) + if (is_array($search['queue'])) foreach($search['queue'] as $queue) { if(!$LMS->GetUserRightsRT($AUTH->id, $queue)) @@ -173,6 +181,12 @@ if(!$LMS->GetUserRightsRT($AUTH->id, $search['queue'])) $error['queue'] = trans('You have no privileges to review this queue!'); + if(!isset($search['categories'])) + $search['catids'] = NULL; + else + foreach($search['categories'] as $catid => $val) + $search['catids'][] = $catid; + if(!$error) { $queue = RTSearch($search, $o); @@ -204,10 +218,20 @@ die; } } +else +{ + foreach($categories as $category) + { + $category['checked'] = true; + $ncategories[] = $category; + } + $categories = $ncategories; +} $SESSION->save('backto', $_SERVER['QUERY_STRING']); $SMARTY->assign('queuelist', $LMS->GetQueueNames()); +$SMARTY->assign('categories', $categories); $SMARTY->assign('userlist', $LMS->GetUserNames()); $SMARTY->assign('customerlist', $LMS->GetAllCustomerNames()); $SMARTY->assign('search', isset($search) ? $search : NULL); Index: lms/modules/rtticketadd.php diff -u lms/modules/rtticketadd.php:1.57 lms/modules/rtticketadd.php:1.58 --- lms/modules/rtticketadd.php:1.57 Fri Mar 18 13:37:54 2011 +++ lms/modules/rtticketadd.php Fri Sep 16 22:48:17 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: rtticketadd.php,v 1.57 2011/03/18 12:37:54 alec Exp $ + * $Id: rtticketadd.php,v 1.58 2011/09/16 20:48:17 chilek Exp $ */ $queue = isset($_GET['id']) ? intval($_GET['id']) : 0; @@ -37,6 +37,9 @@ $SESSION->redirect('?m=rtticketadd&id='.$queue); } + if(empty($ticket['categories'])) + $error = true; + if(($LMS->GetUserRightsRT($AUTH->id, $queue) & 2) != 2) $error['queue'] = trans('You have no privileges to this queue!'); @@ -158,6 +161,15 @@ $SMARTY->assign('error', $error); } +$categories = $LMS->GetCategoryListByUser($AUTH->id); + +foreach ($categories as $category) +{ + $category['checked'] = isset($ticket['categories'][$category['id']]) || count($categories) == 1; + $ncategories[] = $category; +} +$categories = $ncategories; + $layout['pagetitle'] = trans('New Ticket'); $SESSION->save('backto', $_SERVER['QUERY_STRING']); @@ -174,6 +186,7 @@ $SMARTY->assign('queue', $queue); $SMARTY->assign('queuelist', $LMS->GetQueueNames()); +$SMARTY->assign('categories', $categories); $SMARTY->assign('customerid', $ticket['customerid']); $SMARTY->display('rtticketadd.html'); Index: lms/modules/rtticketedit.php diff -u lms/modules/rtticketedit.php:1.44 lms/modules/rtticketedit.php:1.45 --- lms/modules/rtticketedit.php:1.44 Fri Mar 18 13:37:54 2011 +++ lms/modules/rtticketedit.php Fri Sep 16 22:48:17 2011 @@ -21,12 +21,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: rtticketedit.php,v 1.44 2011/03/18 12:37:54 alec Exp $ + * $Id: rtticketedit.php,v 1.45 2011/09/16 20:48:17 chilek Exp $ */ if(($id = $_GET['id']) && !isset($_POST['ticket'])) { - if(($LMS->GetUserRightsRT($AUTH->id, 0, $id) & 2) != 2) + if(($LMS->GetUserRightsRT($AUTH->id, 0, $id) & 2) != 2 || !$LMS->GetUserRightsToCategory($AUTH->id, 0, $id)) { $SMARTY->display('noaccess.html'); $SESSION->close(); @@ -41,12 +41,16 @@ } $ticket = $LMS->GetTicketContents($id); +$categories = $LMS->GetCategoryListByUser($AUTH->id); if(isset($_POST['ticket'])) { $ticketedit = $_POST['ticket']; $ticketedit['ticketid'] = $ticket['ticketid']; + if(!count($ticketedit['categories'])) + $error = true; + if(($LMS->GetUserRightsRT($AUTH->id, $ticketedit['queueid']) & 2) != 2) $error['queue'] = trans('You have no privileges to this queue!'); @@ -60,7 +64,7 @@ $ticketedit['state'] = 1; $ticketedit['customerid'] = ($ticketedit['custid'] ? $ticketedit['custid'] : 0); - + if(!$error) { if($ticketedit['state'] == 2) @@ -104,6 +108,11 @@ } } + $DB->Execute('DELETE FROM rtticketcategories WHERE ticketid = ?', array($id)); + foreach($ticketedit['categories'] as $categoryid => $val) + $DB->Execute('INSERT INTO rtticketcategories (ticketid, categoryid) VALUES(?, ?)', + array($id, $categoryid)); + // przy zmianie kolejki powiadamiamy o "nowym" zgloszeniu if( $ticket['queueid'] != $ticketedit['queueid'] && isset($CONFIG['phpui']['newticket_notify']) @@ -215,6 +224,15 @@ $ticket['state'] = $ticketedit['state']; $ticket['owner'] = $ticketedit['owner']; } +else + $ticketedit['categories'] = $ticket['categories']; + +foreach ($categories as $category) +{ + $category['checked'] = isset($ticketedit['categories'][$category['id']]); + $ncategories[] = $category; +} +$categories = $ncategories; $layout['pagetitle'] = trans('Ticket Edit: $0',sprintf("%06d",$ticket['ticketid'])); @@ -227,6 +245,7 @@ $SMARTY->assign('ticket', $ticket); $SMARTY->assign('queuelist', $LMS->GetQueueNames()); +$SMARTY->assign('categories', $categories); $SMARTY->assign('userlist', $LMS->GetUserNames()); $SMARTY->assign('error', $error); $SMARTY->display('rtticketedit.html'); Index: lms/modules/rtticketinfo.php diff -u lms/modules/rtticketinfo.php:1.5 lms/modules/rtticketinfo.php:1.6 --- lms/modules/rtticketinfo.php:1.5 Tue Jan 18 09:12:25 2011 +++ lms/modules/rtticketinfo.php Fri Sep 16 22:48:17 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: rtticketinfo.php,v 1.5 2011/01/18 08:12:25 alec Exp $ + * $Id: rtticketinfo.php,v 1.6 2011/09/16 20:48:17 chilek Exp $ */ $id = $_GET['id']; @@ -32,8 +32,8 @@ } $rights = $LMS->GetUserRightsRT($AUTH->id, 0, $id); - -if(!$rights) +$catrights = $LMS->GetUserRightsToCategory($AUTH->id, 0, $id); +if(!$rights || !$catrights) { $SMARTY->display('noaccess.html'); $SESSION->close(); Index: lms/modules/rtticketview.php diff -u lms/modules/rtticketview.php:1.43 lms/modules/rtticketview.php:1.44 --- lms/modules/rtticketview.php:1.43 Fri Apr 1 12:35:12 2011 +++ lms/modules/rtticketview.php Fri Sep 16 22:48:17 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: rtticketview.php,v 1.43 2011/04/01 10:35:12 alec Exp $ + * $Id: rtticketview.php,v 1.44 2011/09/16 20:48:17 chilek Exp $ */ if(! $LMS->TicketExists($_GET['id'])) @@ -30,8 +30,9 @@ } $rights = $LMS->GetUserRightsRT($AUTH->id, 0, $_GET['id']); +$catrights = $LMS->GetUserRightsToCategory($AUTH->id, 0, $_GET['id']); -if(!$rights) +if(!$rights || !$catrights) { $SMARTY->display('noaccess.html'); $SESSION->close(); @@ -39,6 +40,7 @@ } $ticket = $LMS->GetTicketContents($_GET['id']); +$categories = $LMS->GetCategoryListByUser($AUTH->id); if($ticket['customerid'] && isset($CONFIG['phpui']['helpdesk_stats']) && chkconfig($CONFIG['phpui']['helpdesk_stats'])) { @@ -65,7 +67,9 @@ $SMARTY->assign('allnodegroups', $allnodegroups); } -$iteration = $LMS->GetQueueContents($ticket['queueid'], $order='createtime,desc', $state=-1); +foreach($categories as $category) + $catids[] = $category['id']; +$iteration = $LMS->GetQueueContents($ticket['queueid'], $order='createtime,desc', $state=-1, 0, $catids); foreach($iteration as $idx => $element) { if (intval($element['id']) == intval($_GET['id'])) @@ -79,11 +83,19 @@ $ticket['next_ticketid'] = $next_ticketid; $ticket['prev_ticketid'] = $prev_ticketid; +foreach ($categories as $category) +{ + $category['checked'] = isset($ticket['categories'][$category['id']]); + $ncategories[] = $category; +} +$categories = $ncategories; + $layout['pagetitle'] = trans('Ticket Review: $0',sprintf("%06d", $ticket['ticketid'])); $SESSION->save('backto', $_SERVER['QUERY_STRING']); $SMARTY->assign('ticket', $ticket); +$SMARTY->assign('categories', $categories); $SMARTY->display('rtticketview.html'); ?> From cvs w lms.org.pl Fri Sep 16 22:48:18 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 16 Sep 2011 22:48:18 +0200 (CEST) Subject: [lms-commits] CVS update of lms/userpanel/modules/helpdesk/locale/pl (strings.php) Message-ID: <20110916204818.5F09630278A0@eftep.altec.pl> Date: Friday, September 16, 2011 @ 22:48:18 Author: chilek Path: /cvsroot/lms/userpanel/modules/helpdesk/locale/pl Modified: strings.php - helpdesk: ticket categories introduced Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/userpanel/modules/helpdesk/locale/pl/strings.php.diff?&r1=1.6&r2=1.7 Index: lms/userpanel/modules/helpdesk/locale/pl/strings.php diff -u lms/userpanel/modules/helpdesk/locale/pl/strings.php:1.6 lms/userpanel/modules/helpdesk/locale/pl/strings.php:1.7 --- lms/userpanel/modules/helpdesk/locale/pl/strings.php:1.6 Thu Mar 10 12:36:40 2011 +++ lms/userpanel/modules/helpdesk/locale/pl/strings.php Fri Sep 16 22:48:18 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.6 2011/03/10 11:36:40 alec Exp $ + * $Id: strings.php,v 1.7 2011/09/16 20:48:18 chilek Exp $ */ $_LANG['Allows you to contact with network administrator'] = 'Pozwala Ci skontaktować się z administratorem'; @@ -62,4 +62,6 @@ $_LANG['Ticket must have its title!'] = 'Zgłoszenie musi mieć tytuł!'; $_LANG['Message'] = 'Wiadomość'; +$_LANG['Default categories:'] = 'Domyślne kategorie:'; + ?> From cvs w lms.org.pl Fri Sep 16 22:48:18 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 16 Sep 2011 22:48:18 +0200 (CEST) Subject: [lms-commits] CVS update of lms/userpanel/modules/helpdesk/templates (setup.html) Message-ID: <20110916204818.8E3D030278A2@eftep.altec.pl> Date: Friday, September 16, 2011 @ 22:48:18 Author: chilek Path: /cvsroot/lms/userpanel/modules/helpdesk/templates Modified: setup.html - helpdesk: ticket categories introduced Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/userpanel/modules/helpdesk/templates/setup.html.diff?&r1=1.2&r2=1.3 Index: lms/userpanel/modules/helpdesk/templates/setup.html diff -u lms/userpanel/modules/helpdesk/templates/setup.html:1.2 lms/userpanel/modules/helpdesk/templates/setup.html:1.3 --- lms/userpanel/modules/helpdesk/templates/setup.html:1.2 Thu Mar 10 12:36:40 2011 +++ lms/userpanel/modules/helpdesk/templates/setup.html Fri Sep 16 22:48:18 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -40,6 +40,17 @@ + + + +
{t}Module Configuration:{/t}
+ {t}Default categories:{/t} + + {foreach from=$categories item=category} + 0}CHECKED{/if}> + {$category.name}
+ {/foreach} +

From cvs w lms.org.pl Fri Sep 16 22:48:17 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 16 Sep 2011 22:48:17 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20110916204817.4253030278A1@eftep.altec.pl> Date: Friday, September 16, 2011 @ 22:48:17 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - helpdesk: ticket categories introduced Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.392&r2=1.393 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.392 lms/lib/locale/pl/strings.php:1.393 --- lms/lib/locale/pl/strings.php:1.392 Fri Sep 9 20:16:52 2011 +++ lms/lib/locale/pl/strings.php Fri Sep 16 22:48:17 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.392 2011/09/09 18:16:52 chilek Exp $ + * $Id: strings.php,v 1.393 2011/09/16 20:48:17 chilek Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresów)'; @@ -2485,4 +2485,23 @@ $_LANG['links hiding'] = 'ukrywanie użytecznych linków'; $_LANG['system information hiding'] = 'ukrywanie informacji systemowych'; +$_LANG['Enter category name'] = 'Podaj nazwę kategorii'; +$_LANG['Owners:'] = 'Właściciele:'; +$_LANG['Are you sure, you want to remove category \\\'$0\\\'?'] = 'Jesteś pewien, że chcesz usunąć kategorię \\\'$0\\\'?'; +$_LANG['Categories:'] = 'Kategorie:'; +$_LANG['Category'] = 'Kategoria'; +$_LANG['Category:'] = 'Kategoria'; +$_LANG['Owners'] = 'Właściciele'; +$_LANG['There are no categories.'] = 'Nie ma kategorii'; +$_LANG['Category name must be defined!'] = 'Kategoria musi posiadać swoją nazwę!'; +$_LANG['Category with specified name already exists!'] = 'Kategoria o podanej nazwie już istnieje!'; +$_LANG['New Category'] = 'Nowa kategoria'; +$_LANG['Remove category ID: $0'] = 'Usuń kategorię: $0'; +$_LANG['Do you want to remove category called $0?'] = 'Czy chcesz usunąć kategorię $0?'; +$_LANG['Category Edit: $0'] = 'Edycja kategorii: $0'; +$_LANG['Category Info: $0'] = 'Informacje o kategorii: $0'; +$_LANG['Categories List'] = 'Lista kategorii'; +$_LANG['List of categories'] = 'Lista kategorii'; +$_LANG['Add new category'] = 'Utworzenie nowej kategorii'; + ?> From cvs w lms.org.pl Fri Sep 16 22:48:18 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 16 Sep 2011 22:48:18 +0200 (CEST) Subject: [lms-commits] CVS update of lms/templates (11 files) Message-ID: <20110916204818.19A8730278A3@eftep.altec.pl> Date: Friday, September 16, 2011 @ 22:48:18 Author: chilek Path: /cvsroot/lms/templates Added: rtcategoryadd.html rtcategoryedit.html rtcategoryinfo.html rtcategorylist.html Modified: rtprintindex.html rtqueueview.html rtsearch.html rtticketadd.html rtticketeditbox.html rtticketinfobox.html welcome.html - helpdesk: ticket categories introduced Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtcategoryadd.html?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtcategoryedit.html?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtcategoryinfo.html?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtcategorylist.html?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtprintindex.html.diff?&r1=1.7&r2=1.8 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtqueueview.html.diff?&r1=1.54&r2=1.55 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtsearch.html.diff?&r1=1.21&r2=1.22 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtticketadd.html.diff?&r1=1.29&r2=1.30 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtticketeditbox.html.diff?&r1=1.23&r2=1.24 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtticketinfobox.html.diff?&r1=1.31&r2=1.32 http://cvs.lms.org.pl/viewvc/Development/lms/templates/welcome.html.diff?&r1=1.87&r2=1.88 Index: lms/templates/rtcategoryadd.html diff -u /dev/null lms/templates/rtcategoryadd.html:1.1 --- /dev/null Fri Sep 16 22:48:18 2011 +++ lms/templates/rtcategoryadd.html Fri Sep 16 22:48:17 2011 @@ -0,0 +1,67 @@ +{include file="header.html"} + +

{$layout.pagetitle}

+
+ + + + + + + + + + + + + + + + + + + + +
+ + {t}Name:{/t} + +
+ + {t}Description{/t}: + +
+ + {t}Users:{/t} + + + + + + {cycle values="light,lucid" print=false} + {foreach from=$category.owners item=user} + + + + + {/foreach} + + + + +
{t}User{/t} + {t}Owner{/t}
+ {$user.name} + + 0}CHECKED{/if}> +
+
+ {t}Submit{/t} + {t}Cancel{/t} +

+ +{include file="footer.html"} Index: lms/templates/rtcategoryedit.html diff -u /dev/null lms/templates/rtcategoryedit.html:1.1 --- /dev/null Fri Sep 16 22:48:18 2011 +++ lms/templates/rtcategoryedit.html Fri Sep 16 22:48:17 2011 @@ -0,0 +1,68 @@ +{include file="header.html"} + +

{$layout.pagetitle}

+
+ + + + + + + + + + + + + + + + + + + + +
+ + {t}Name:{/t} + ({$category.id|string_format:"%04d"}) +
+ + {t}Description:{/t} + +
+ + {t}Users:{/t} + + + + + + {cycle values="light,lucid" print=false} + {foreach from=$category.owners item=user} + + + + + {/foreach} + + + + +
{t}User{/t} + {t}Owner{/t}
+ {$user.name} + + 0}CHECKED{/if}> +
+
+ {t}Submit{/t} + {t}Delete{/t} + {t}Cancel{/t} +

+ +{include file="footer.html"} Index: lms/templates/rtcategoryinfo.html diff -u /dev/null lms/templates/rtcategoryinfo.html:1.1 --- /dev/null Fri Sep 16 22:48:18 2011 +++ lms/templates/rtcategoryinfo.html Fri Sep 16 22:48:17 2011 @@ -0,0 +1,69 @@ +{include file="header.html"} + +

{$layout.pagetitle}

+ + + + + + {if $category.description} + + + + + + {/if} + + + + + + + + +
+ + {$category.name} ({$category.id|string_format:"%04d"})
+ + {t}Description:{/t} + + + + +
+ {$category.description|replace:"\n":"
"} +
+
+ + {t}Users:{/t} + + + + + + {cycle values="light,lucid" print=false} + {foreach from=$category.owners item=owner} + {if $owner} + + + + + {/if} + {/foreach} + + + + +
{t}User{/t} + {t}Owner{/t}
+ {$owner.name} + + + {if $owner.owner > 0}{/if} +
+
+ {t}Browse{/t} + {t}Edit{/t} + {t}Delete{/t} +

+{include file="footer.html"} Index: lms/templates/rtcategorylist.html diff -u /dev/null lms/templates/rtcategorylist.html:1.1 --- /dev/null Fri Sep 16 22:48:18 2011 +++ lms/templates/rtcategorylist.html Fri Sep 16 22:48:17 2011 @@ -0,0 +1,85 @@ +{include file="header.html"} + +

{$layout.pagetitle}

+ + + + + + + + + + {cycle values="light,lucid" print=false} + {foreach from=$categories item=category} + + + + + + + + {foreachelse} + + + + {/foreach} + + + + + + +
+ + {t}Category{/t}:
+ + {t}Description{/t}: +
+ + {t}Owners{/t}: + + {t}New:{/t} + + {t}Opened:{/t} + + {t}Last:{/t} + +   +
+ + {$category.name}
+ {if $category.description} + {$category.description} + {/if} +
+ {foreach from=$category.owners item=owner key=key} + {$owner.name}{if $key+1 + + {$category.new|default:0} + + {$category.open|default:0} + + {if $category.lastticket}{$category.lastticket|date_format:"%Y/%m/%d %H:%M:%S"}{else}-{/if} + + [ {t}Browse{/t} ] + [ {t}Delete{/t} ] + [ {t}Edit{/t} ] + [ {t}Info{/t} ] +
+

 

+

{t}There are no categories.{/t}

+

 

+
+ + {t}Total:{/t} + + {sum array=$categories column=new} + + {sum array=$categories column=open} + +   +
+{include file="footer.html"} Index: lms/templates/rtprintindex.html diff -u lms/templates/rtprintindex.html:1.7 lms/templates/rtprintindex.html:1.8 --- lms/templates/rtprintindex.html:1.7 Mon Jan 18 09:33:31 2010 +++ lms/templates/rtprintindex.html Fri Sep 16 22:48:17 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -87,6 +87,25 @@
+ {t}Categories:{/t} + + + {foreach from=$categories item=category} + + + + + {/foreach} +
+ + + {$category.name} +
+
+ {t}Categories:{/t} + + + {foreach from=$categories item=category} + + + + + {/foreach} +
+ + + {$category.name} +
+
@@ -36,6 +36,13 @@ {/foreach}   + {t}Category:{/t} +   {t}Status:{/t} @@ -108,6 +108,18 @@ + + + + Index: lms/templates/rtticketadd.html diff -u lms/templates/rtticketadd.html:1.29 lms/templates/rtticketadd.html:1.30 --- lms/templates/rtticketadd.html:1.29 Fri Oct 16 10:45:55 2009 +++ lms/templates/rtticketadd.html Fri Sep 16 22:48:17 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +
+ + {t}Categories:{/t} + + {foreach from=$categories item=category} + 0}CHECKED{/if}> + {$category.name}
+ {/foreach} +
{t}Search{/t}