From cvs w lms.org.pl Mon Nov 7 17:15:52 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 7 Nov 2011 17:15:52 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/upgradedb (postgres.2010121400.php) Message-ID: <20111107161552.E5218302A040@eftep.altec.pl> Date: Monday, November 7, 2011 @ 17:15:52 Author: alec Path: /cvsroot/lms/lib/upgradedb Modified: postgres.2010121400.php - Fix: use 4th argument of postgres' regexp_replace() Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2010121400.php.diff?&r1=1.3&r2=1.4 Index: lms/lib/upgradedb/postgres.2010121400.php diff -u lms/lib/upgradedb/postgres.2010121400.php:1.3 lms/lib/upgradedb/postgres.2010121400.php:1.4 --- lms/lib/upgradedb/postgres.2010121400.php:1.3 Tue Jan 18 09:12:17 2011 +++ lms/lib/upgradedb/postgres.2010121400.php Mon Nov 7 17:15:52 2011 @@ -44,7 +44,7 @@ if ($lang == 'pl') { $DB->Execute("UPDATE customercontacts SET type = COALESCE(type, 0) + 1 - WHERE regexp_replace(phone, '[^0-9]', '') ~ '^(\\\\+?[0-9]{2}|0|)(88[0-9]|5[01][0-9]|6[069][0-9]|7[2789][0-9])[0-9]{6}$'"); + WHERE regexp_replace(phone, '[^0-9]', '', 'g') ~ '^(\\\\+?[0-9]{2}|0|)(88[0-9]|5[01][0-9]|6[069][0-9]|7[2789][0-9])[0-9]{6}$'"); } $DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2010121400', 'dbversion')); From cvs w lms.org.pl Tue Nov 8 20:32:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 8 Nov 2011 20:32:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20111108193240.4492E302A042@eftep.altec.pl> Date: Tuesday, November 8, 2011 @ 20:32:40 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - gps coordinates support for nodes and netdevices Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.394&r2=1.395 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.394 lms/lib/locale/pl/strings.php:1.395 --- lms/lib/locale/pl/strings.php:1.394 Fri Oct 14 18:08:57 2011 +++ lms/lib/locale/pl/strings.php Tue Nov 8 20:32:40 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.394 2011/10/14 16:08:57 chilek Exp $ + * $Id: strings.php,v 1.395 2011/11/08 19:32:40 chilek Exp $ */ $_LANG['$a ($b addresses)'] = '$a ($b adresów)'; @@ -2504,4 +2504,10 @@ $_LANG['List of categories'] = 'Lista kategorii'; $_LANG['Add new category'] = 'Utworzenie nowej kategorii'; +$_LANG['Enter device latitude (optional)'] = 'Podaj szerokość geograficzną dla urządzenia (opcjonalne)'; +$_LANG['Enter device longitude (optional)'] = 'Podaj długość geograficzną dla urzą?zenia (opcjonalne)'; +$_LANG['GPS coordinates:'] = 'Współrzędne geograficzne:'; +$_LANG['GPS latitude:'] = 'Szerokość geograficzna:'; +$_LANG['GPS longitude:'] = 'Długość geograficzna:'; + ?> From cvs w lms.org.pl Tue Nov 8 20:32:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 8 Nov 2011 20:32:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (LMS.class.php, upgradedb.php) Message-ID: <20111108193240.1CC3C302A041@eftep.altec.pl> Date: Tuesday, November 8, 2011 @ 20:32:40 Author: chilek Path: /cvsroot/lms/lib Modified: LMS.class.php upgradedb.php - gps coordinates support for nodes and netdevices Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMS.class.php.diff?&r1=1.1080&r2=1.1081 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb.php.diff?&r1=1.194&r2=1.195 Index: lms/lib/LMS.class.php diff -u lms/lib/LMS.class.php:1.1080 lms/lib/LMS.class.php:1.1081 --- lms/lib/LMS.class.php:1.1080 Thu Oct 20 16:22:12 2011 +++ lms/lib/LMS.class.php Tue Nov 8 20:32:39 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMS.class.php,v 1.1080 2011/10/20 14:22:12 chilek Exp $ + * $Id: LMS.class.php,v 1.1081 2011/11/08 19:32:39 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.1080 $'; + var $_revision = '$Revision: 1.1081 $'; function LMS(&$DB, &$AUTH, &$CONFIG) // class variables setting { @@ -1279,7 +1279,8 @@ ipaddr=inet_aton(?), passwd=?, netdev=?, moddate=?NOW?, modid=?, access=?, warning=?, ownerid=?, info=?, location=?, location_city=?, location_street=?, location_house=?, location_flat=?, - chkmac=?, halfduplex=?, linktype=?, port=?, nas=? + chkmac=?, halfduplex=?, linktype=?, port=?, nas=?, + longitude=?, latitude=? WHERE id=?', array($nodedata['name'], $nodedata['ipaddr_pub'], @@ -1301,6 +1302,8 @@ isset($nodedata['linktype']) ? 1 : 0, isset($nodedata['port']) && $nodedata['netdev'] ? intval($nodedata['port']) : 0, isset($nodedata['nas']) ? $nodedata['nas'] : 0, + !empty($nodedata['latitude']) ? $nodedata['latitude'] : NULL, + !empty($nodedata['longitude']) ? $nodedata['longitude'] : NULL, $nodedata['id'] )); @@ -1566,9 +1569,9 @@ if($this->DB->Execute('INSERT INTO nodes (name, ipaddr, ipaddr_pub, ownerid, passwd, creatorid, creationdate, access, warning, info, netdev, location, location_city, location_street, location_house, location_flat, - linktype, port, chkmac, halfduplex, nas) + linktype, port, chkmac, halfduplex, nas, latitude, longitude) VALUES (?, inet_aton(?), inet_aton(?), ?, ?, ?, - ?NOW?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + ?NOW?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array(strtoupper($nodedata['name']), $nodedata['ipaddr'], $nodedata['ipaddr_pub'], @@ -1589,6 +1592,8 @@ $nodedata['chkmac'], $nodedata['halfduplex'], isset($nodedata['nas']) ? $nodedata['nas'] : 0, + isset($nodedata['latitude']) ? $nodedata['latitude'] : NULL, + isset($nodedata['longitude']) ? $nodedata['longitude'] : NULL ))) { $id = $this->DB->GetLastInsertID('nodes'); @@ -3347,8 +3352,9 @@ location_city, location_street, location_house, location_flat, description, producer, model, serialnumber, ports, purchasetime, guaranteeperiod, shortname, - nastype, clients, secret, community, channelid) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + nastype, clients, secret, community, channelid, + latitude, longitude) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($data['name'], $data['location'], $data['location_city'] ? $data['location_city'] : null, @@ -3368,6 +3374,8 @@ $data['secret'], $data['community'], !empty($data['channelid']) ? $data['channelid'] : NULL, + !empty($netdevdata['latitude']) ? $netdevdata['latitude'] : NULL, + !empty($netdevdata['longitude']) ? $netdevdata['longitude'] : NULL ))) { $id = $this->DB->GetLastInsertID('netdevices'); @@ -3402,7 +3410,7 @@ $this->DB->Execute('UPDATE netdevices SET name=?, description=?, producer=?, location=?, location_city=?, location_street=?, location_house=?, location_flat=?, model=?, serialnumber=?, ports=?, purchasetime=?, guaranteeperiod=?, shortname=?, - nastype=?, clients=?, secret=?, community=?, channelid=? + nastype=?, clients=?, secret=?, community=?, channelid=?, latitude=?, longitude=? WHERE id=?', array($data['name'], $data['description'], @@ -3423,6 +3431,8 @@ $data['secret'], $data['community'], !empty($data['channelid']) ? $data['channelid'] : NULL, + !empty($netdevdata['latitude']) ? $netdevdata['latitude'] : NULL, + !empty($netdevdata['longitude']) ? $netdevdata['longitude'] : NULL, $data['id'] )); } Index: lms/lib/upgradedb.php diff -u lms/lib/upgradedb.php:1.194 lms/lib/upgradedb.php:1.195 --- lms/lib/upgradedb.php:1.194 Fri Sep 16 22:48:16 2011 +++ lms/lib/upgradedb.php Tue Nov 8 20:32:39 2011 @@ -21,10 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: upgradedb.php,v 1.194 2011/09/16 20:48:16 chilek Exp $ + * $Id: upgradedb.php,v 1.195 2011/11/08 19:32:39 chilek Exp $ */ -define('DBVERSION', '2011091600'); // here should be always the newest version of database! +define('DBVERSION', '2011110800'); // 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 Tue Nov 8 20:32:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 8 Nov 2011 20:32:39 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111108193239.D9397302A040@eftep.altec.pl> Date: Tuesday, November 8, 2011 @ 20:32:39 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - gps coordinates support for nodes and netdevices Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1596&r2=1.1597 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1596 lms/doc/ChangeLog:1.1597 --- lms/doc/ChangeLog:1.1596 Sat Oct 22 13:25:13 2011 +++ lms/doc/ChangeLog Tue Nov 8 20:32:39 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1596 2011/10/22 11:25:13 alec Exp $ +$Id: ChangeLog,v 1.1597 2011/11/08 19:32:39 chilek Exp $ version ? (????-??-??): @@ -39,6 +39,7 @@ ----------------------------------------------------------------- - quicksearch: fixed search for hosts when exact mac address was entered [chilan] - BTS#0000867: execution node_del_{before,after} hooks while deleting owner [chilan] + - gps coordinates support for nodes and netdevices [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Tue Nov 8 20:32:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 8 Nov 2011 20:32:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/upgradedb (2 files) Message-ID: <20111108193240.681EF302A043@eftep.altec.pl> Date: Tuesday, November 8, 2011 @ 20:32:40 Author: chilek Path: /cvsroot/lms/lib/upgradedb Added: mysql.2011110800.php postgres.2011110800.php - gps coordinates support for nodes and netdevices Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2011110800.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2011110800.php?rev=1.1 Index: lms/lib/upgradedb/mysql.2011110800.php diff -u /dev/null lms/lib/upgradedb/mysql.2011110800.php:1.1 --- /dev/null Tue Nov 8 20:32:40 2011 +++ lms/lib/upgradedb/mysql.2011110800.php Tue Nov 8 20:32:40 2011 @@ -0,0 +1,39 @@ +BeginTrans(); + +$DB->Execute("ALTER TABLE nodes ADD longitude decimal(10, 6) DEFAULT NULL"); +$DB->Execute("ALTER TABLE nodes ADD latitude decimal(10, 6) DEFAULT NULL"); + +$DB->Execute("ALTER TABLE netdevices ADD longitude decimal(10, 6) DEFAULT NULL"); +$DB->Execute("ALTER TABLE netdevices ADD latitude decimal(10, 6) DEFAULT NULL"); + +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?",array('2011110800', 'dbversion')); + +$DB->CommitTrans(); + +?> Index: lms/lib/upgradedb/postgres.2011110800.php diff -u /dev/null lms/lib/upgradedb/postgres.2011110800.php:1.1 --- /dev/null Tue Nov 8 20:32:40 2011 +++ lms/lib/upgradedb/postgres.2011110800.php Tue Nov 8 20:32:40 2011 @@ -0,0 +1,39 @@ +BeginTrans(); + +$DB->Execute("ALTER TABLE nodes ADD longitude numeric(10, 6) DEFAULT NULL"); +$DB->Execute("ALTER TABLE nodes ADD latitude numeric(10, 6) DEFAULT NULL"); + +$DB->Execute("ALTER TABLE netdevices ADD longitude numeric(10, 6) DEFAULT NULL"); +$DB->Execute("ALTER TABLE netdevices ADD latitude numeric(10, 6) DEFAULT NULL"); + +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?",array('2011110800', 'dbversion')); + +$DB->CommitTrans(); + +?> From cvs w lms.org.pl Tue Nov 8 20:32:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 8 Nov 2011 20:32:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (netdevedit.php, nodeedit.php) Message-ID: <20111108193240.9000C302A044@eftep.altec.pl> Date: Tuesday, November 8, 2011 @ 20:32:40 Author: chilek Path: /cvsroot/lms/modules Modified: netdevedit.php nodeedit.php - gps coordinates support for nodes and netdevices Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevedit.php.diff?&r1=1.74&r2=1.75 http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodeedit.php.diff?&r1=1.121&r2=1.122 Index: lms/modules/netdevedit.php diff -u lms/modules/netdevedit.php:1.74 lms/modules/netdevedit.php:1.75 --- lms/modules/netdevedit.php:1.74 Fri Oct 14 18:08:59 2011 +++ lms/modules/netdevedit.php Tue Nov 8 20:32:40 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: netdevedit.php,v 1.74 2011/10/14 16:08:59 chilek Exp $ + * $Id: netdevedit.php,v 1.75 2011/11/08 19:32:40 chilek Exp $ */ if(! $LMS->NetDevExists($_GET['id'])) @@ -81,6 +81,16 @@ $DB->Execute('UPDATE netdevices SET location = ? WHERE id = ?', array($dev2['location'], $dev1['id'])); + $DB->Execute('UPDATE netdevices SET latitude = ? WHERE id = ?', + array($dev1['latitude'], $dev2['id'])); + $DB->Execute('UPDATE netdevices SET latitude = ? WHERE id = ?', + array($dev2['latitude'], $dev1['id'])); + + $DB->Execute('UPDATE netdevices SET longitude = ? WHERE id = ?', + array($dev1['longitude'], $dev2['id'])); + $DB->Execute('UPDATE netdevices SET longitude = ? WHERE id = ?', + array($dev2['longitude'], $dev1['id'])); + $LMS->NetDevDelLinks($dev1['id']); $LMS->NetDevDelLinks($dev2['id']); Index: lms/modules/nodeedit.php diff -u lms/modules/nodeedit.php:1.121 lms/modules/nodeedit.php:1.122 --- lms/modules/nodeedit.php:1.121 Fri Oct 14 18:08:59 2011 +++ lms/modules/nodeedit.php Tue Nov 8 20:32:40 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodeedit.php,v 1.121 2011/10/14 16:08:59 chilek Exp $ + * $Id: nodeedit.php,v 1.122 2011/11/08 19:32:40 chilek Exp $ */ $action = isset($_GET['action']) ? $_GET['action'] : ''; @@ -239,6 +239,8 @@ $nodeinfo['location_flat'] = $nodeedit['location_flat']; $nodeinfo['teryt'] = empty($nodeedit['teryt']) ? 0 : 1; $nodeinfo['stateid'] = $nodeedit['stateid']; + $nodeinfo['latitude'] = $nodeedit['latitude']; + $nodeinfo['longitude'] = $nodeedit['longitude']; if($nodeedit['ipaddr_pub']=='0.0.0.0') $nodeinfo['ipaddr_pub'] = ''; From cvs w lms.org.pl Tue Nov 8 20:32:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 8 Nov 2011 20:32:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (6 files) Message-ID: <20111108193240.DD0E7302A040@eftep.altec.pl> Date: Tuesday, November 8, 2011 @ 20:32:40 Author: chilek Path: /cvsroot/lms/templates Modified: netdevadd.html netdeveditbox.html netdevinfobox.html nodeaddbox.html nodeeditbox.html nodeinfobox.html - gps coordinates support for nodes and netdevices Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevadd.html.diff?&r1=1.30&r2=1.31 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdeveditbox.html.diff?&r1=1.32&r2=1.33 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevinfobox.html.diff?&r1=1.28&r2=1.29 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeaddbox.html.diff?&r1=1.85&r2=1.86 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.89&r2=1.90 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.76&r2=1.77 Index: lms/templates/netdevadd.html diff -u lms/templates/netdevadd.html:1.30 lms/templates/netdevadd.html:1.31 --- lms/templates/netdevadd.html:1.30 Fri Oct 14 18:09:04 2011 +++ lms/templates/netdevadd.html Tue Nov 8 20:32:40 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - + {include file="calendar_js.html"}

{$layout.pagetitle}

@@ -83,6 +83,26 @@ {t}TERRIT-DB{/t} + + + + + {t}GPS latitude:{/t} + + + + + + + + + + {t}GPS longitude:{/t} + + + + + {if $_config.phpui.radius|chkconfig} Index: lms/templates/netdeveditbox.html diff -u lms/templates/netdeveditbox.html:1.32 lms/templates/netdeveditbox.html:1.33 --- lms/templates/netdeveditbox.html:1.32 Wed Aug 31 12:46:46 2011 +++ lms/templates/netdeveditbox.html Tue Nov 8 20:32:40 2011 @@ -1,4 +1,4 @@ - + {include file="calendar_js.html"} @@ -82,6 +82,26 @@ {t}TERRIT-DB{/t} + + + + + + + + + + {if $_config.phpui.radius|chkconfig}
+ + {t}GPS latitude:{/t} + + +
+ + {t}GPS longitude:{/t} + + +
Index: lms/templates/netdevinfobox.html diff -u lms/templates/netdevinfobox.html:1.28 lms/templates/netdevinfobox.html:1.29 --- lms/templates/netdevinfobox.html:1.28 Fri Oct 14 18:09:04 2011 +++ lms/templates/netdevinfobox.html Tue Nov 8 20:32:40 2011 @@ -1,4 +1,4 @@ - + {/if} + {if $netdevinfo.latitude || $netdevinfo.longitude} + + + + + + + + + + + {/if} {if $_config.phpui.radius|chkconfig} {if $netdevinfo.shortname} Index: lms/templates/nodeaddbox.html diff -u lms/templates/nodeaddbox.html:1.85 lms/templates/nodeaddbox.html:1.86 --- lms/templates/nodeaddbox.html:1.85 Wed Aug 31 12:46:46 2011 +++ lms/templates/nodeaddbox.html Tue Nov 8 20:32:40 2011 @@ -1,4 +1,4 @@ - +
@@ -88,6 +88,30 @@
+ + {t}GPS latitude:{/t} + + + {$netdevinfo.latitude} +
+ + {t}GPS longitude:{/t} + + + {$netdevinfo.longitude} +
@@ -135,6 +135,28 @@
+ + + + + + + + + +
+ {t}Location:{/t} + + {t}GPS latitude:{/t} + + +
+ {t}Location:{/t} + + {t}GPS longitude:{/t} + + +
{t}Description:{/t} Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.89 lms/templates/nodeeditbox.html:1.90 --- lms/templates/nodeeditbox.html:1.89 Wed Aug 31 12:46:46 2011 +++ lms/templates/nodeeditbox.html Tue Nov 8 20:32:40 2011 @@ -1,4 +1,4 @@ - + @@ -131,6 +131,27 @@ + + + + + + + + + + Index: lms/templates/invoiceedit.html diff -u lms/templates/invoiceedit.html:1.44 lms/templates/invoiceedit.html:1.45 --- lms/templates/invoiceedit.html:1.44 Mon Apr 4 13:52:03 2011 +++ lms/templates/invoiceedit.html Thu Nov 10 07:41:01 2011 @@ -1,14 +1,15 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} @@ -351,12 +352,12 @@
+ {t}GPS coordinates:{/t} + + {t}GPS latitude:{/t} + + {t}GPS longitude:{/t} +
+ + + + +
{t}Description:{/t} Index: lms/templates/nodeinfobox.html diff -u lms/templates/nodeinfobox.html:1.76 lms/templates/nodeinfobox.html:1.77 --- lms/templates/nodeinfobox.html:1.76 Fri Oct 14 18:09:04 2011 +++ lms/templates/nodeinfobox.html Tue Nov 8 20:32:40 2011 @@ -1,4 +1,4 @@ - + +
+ {elseif $gd} {* default if $type is not set or not 'flash' *}

From cvs w lms.org.pl Wed Nov 9 22:50:06 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 9 Nov 2011 22:50:06 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111109215006.95647302A040@eftep.altec.pl> Date: Wednesday, November 9, 2011 @ 22:50:06 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - netdevmap: show info about netdevices for OpenStreetMap map type Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1598&r2=1.1599 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1598 lms/doc/ChangeLog:1.1599 --- lms/doc/ChangeLog:1.1598 Wed Nov 9 14:33:51 2011 +++ lms/doc/ChangeLog Wed Nov 9 22:50:06 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1598 2011/11/09 13:33:51 chilek Exp $ +$Id: ChangeLog,v 1.1599 2011/11/09 21:50:06 chilek Exp $ version ? (????-??-??): @@ -41,6 +41,7 @@ - BTS#0000867: execution node_del_{before,after} hooks while deleting owner [chilan] - gps coordinates support for nodes and netdevices [chilan] - netdevmap: first version of OpenStreetMap map type support thanks to Grzegorz Cichowski [chilan] + - netdevmap: show info about netdevices for OpenStreetMap map type [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Wed Nov 9 22:50:06 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 9 Nov 2011 22:50:06 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (netdevmap.html) Message-ID: <20111109215006.B30B0302A041@eftep.altec.pl> Date: Wednesday, November 9, 2011 @ 22:50:06 Author: chilek Path: /cvsroot/lms/templates Modified: netdevmap.html - netdevmap: show info about netdevices for OpenStreetMap map type Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevmap.html.diff?&r1=1.22&r2=1.23 Index: lms/templates/netdevmap.html diff -u lms/templates/netdevmap.html:1.22 lms/templates/netdevmap.html:1.23 --- lms/templates/netdevmap.html:1.22 Wed Nov 9 14:33:53 2011 +++ lms/templates/netdevmap.html Wed Nov 9 22:50:06 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $emptydb}
@@ -24,12 +24,47 @@
From cvs w lms.org.pl Thu Nov 10 00:38:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 00:38:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (netdevmap.php) Message-ID: <20111109233840.2B707302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 00:38:40 Author: chilek Path: /cvsroot/lms/modules Modified: netdevmap.php - netdevmap: changed phpui->map_type from osm to openlayers and add google maps base map Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevmap.php.diff?&r1=1.67&r2=1.68 Index: lms/modules/netdevmap.php diff -u lms/modules/netdevmap.php:1.67 lms/modules/netdevmap.php:1.68 --- lms/modules/netdevmap.php:1.67 Wed Nov 9 14:33:52 2011 +++ lms/modules/netdevmap.php Thu Nov 10 00:38:40 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: netdevmap.php,v 1.67 2011/11/09 13:33:52 chilek Exp $ + * $Id: netdevmap.php,v 1.68 2011/11/09 23:38:40 chilek Exp $ */ function drawtext($x, $y, $text, $r, $g, $b) @@ -318,11 +318,11 @@ $type = strtolower(isset($CONFIG['phpui']['map_type']) ? $CONFIG['phpui']['map_type'] : ''); -if ($type == 'osm') +if ($type == 'openlayers') { $devices = $DB->GetAllByKey('SELECT n.id, n.name, n.location, MAX(lastonline) AS lastonline, n.latitude, n.longitude FROM netdevices n - LEFT JOIN nodes ON (n.id = netdev) + LEFT JOIN nodes ON (n.id = netdev) WHERE n.latitude IS NOT NULL AND n.longitude IS NOT NULL GROUP BY n.id, n.name, n.location, n.latitude, n.longitude', 'id'); From cvs w lms.org.pl Thu Nov 10 00:38:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 00:38:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (netdevmap.html) Message-ID: <20111109233840.504C1302A041@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 00:38:40 Author: chilek Path: /cvsroot/lms/templates Modified: netdevmap.html - netdevmap: changed phpui->map_type from osm to openlayers and add google maps base map Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevmap.html.diff?&r1=1.23&r2=1.24 Index: lms/templates/netdevmap.html diff -u lms/templates/netdevmap.html:1.23 lms/templates/netdevmap.html:1.24 --- lms/templates/netdevmap.html:1.23 Wed Nov 9 22:50:06 2011 +++ lms/templates/netdevmap.html Thu Nov 10 00:38:40 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $emptydb} - @@ -101,8 +102,9 @@ - {if $_config.phpui.radius|chkconfig} Index: lms/templates/netdeveditbox.html diff -u lms/templates/netdeveditbox.html:1.35 lms/templates/netdeveditbox.html:1.36 --- lms/templates/netdeveditbox.html:1.35 Wed Nov 9 10:51:56 2011 +++ lms/templates/netdeveditbox.html Thu Nov 10 04:10:42 2011 @@ -1,4 +1,4 @@ - + {include file="calendar_js.html"}
@@ -20,9 +20,10 @@ TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">

-{elseif $type=='osm'} +{elseif $type=='openlayers'} -
+ +
+{if $js}{/if} +{if $part eq "main"} + + + +{/if} + +{if ! $part} + + + + +{/if} +{if $part eq "main"} + +
+ +{/if} +{if $part eq "top"} + + + + + +
+ {t}Select gps coordinates:{/t} +
+{/if} + Index: lms/templates/netdevadd.html diff -u lms/templates/netdevadd.html:1.32 lms/templates/netdevadd.html:1.33 --- lms/templates/netdevadd.html:1.32 Wed Nov 9 10:51:56 2011 +++ lms/templates/netdevadd.html Thu Nov 10 04:10:42 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - + {include file="calendar_js.html"}

{$layout.pagetitle}

@@ -90,8 +90,9 @@
{t}GPS latitude:{/t} + + »»»
{t}GPS longitude:{/t} + + »»»
@@ -89,8 +89,9 @@ - @@ -100,8 +101,9 @@ - {if $_config.phpui.radius|chkconfig} Index: lms/templates/netdevmap.html diff -u lms/templates/netdevmap.html:1.24 lms/templates/netdevmap.html:1.25 --- lms/templates/netdevmap.html:1.24 Thu Nov 10 00:38:40 2011 +++ lms/templates/netdevmap.html Thu Nov 10 04:10:42 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $emptydb}
{t}GPS latitude:{/t} + + »»»
{t}GPS longitude:{/t} + + »»»
@@ -124,9 +124,9 @@ map.addControl(new OpenLayers.Control.ScaleLine()); map.addControl(new OpenLayers.Control.LayerSwitcher()); + map.addControl(new OpenLayers.Control.MousePosition({ displayProjection: new OpenLayers.Projection("EPSG:4326") })); map.zoomToExtent(area); - {elseif $gd} {* default if $type is not set or not 'flash' *}

@@ -145,7 +145,7 @@

{t}Your PHP does not support GD library required for map generation!{/t}

{/if} -{if !$emptydb} +{if !$emptydb && $type != 'openlayers'}

Index: lms/templates/nodeaddbox.html diff -u lms/templates/nodeaddbox.html:1.87 lms/templates/nodeaddbox.html:1.88 --- lms/templates/nodeaddbox.html:1.87 Wed Nov 9 10:00:23 2011 +++ lms/templates/nodeaddbox.html Thu Nov 10 04:10:42 2011 @@ -1,4 +1,4 @@ - + @@ -140,8 +140,9 @@ - @@ -151,8 +152,9 @@ - Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.91 lms/templates/nodeeditbox.html:1.92 --- lms/templates/nodeeditbox.html:1.91 Wed Nov 9 10:47:21 2011 +++ lms/templates/nodeeditbox.html Thu Nov 10 04:10:42 2011 @@ -1,4 +1,4 @@ - + @@ -136,8 +136,9 @@ - @@ -147,8 +148,9 @@ - @@ -239,13 +241,22 @@ } function reset_customer() - { - var val; - if (val = document.forms['editnode'].elements['nodeedit[ownerid]'].value) - document.forms['editnode'].elements['nodeedit[customerid]'].value = val; + { + var val; + if (val = document.forms['editnode'].elements['nodeedit[ownerid]'].value) + document.forms['editnode'].elements['nodeedit[customerid]'].value = val; + } + + function parseGpsCoords() + { + alert('ala'); + var lonlat = documents.forms['editnode'].elements['nodeedit[lonlat]'].value; + alert(lonlat); + document.forms['editnode'].elements['nodeedit[latitude]'].value = ''; + document.forms['editnode'].elements['nodeedit[longitude]'].value = ''; } - check_teryt('location', true); + check_teryt('location', true); //--> {/literal} From cvs w lms.org.pl Thu Nov 10 04:22:30 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 04:22:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20111110032230.5CC9F302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 04:22:30 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - pl locales for gps coords selection Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.395&r2=1.396 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.395 lms/lib/locale/pl/strings.php:1.396 --- lms/lib/locale/pl/strings.php:1.395 Tue Nov 8 20:32:40 2011 +++ lms/lib/locale/pl/strings.php Thu Nov 10 04:22:30 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.395 2011/11/08 19:32:40 chilek Exp $ + * $Id: strings.php,v 1.396 2011/11/10 03:22:30 chilek Exp $ */ $_LANG['$a ($b addresses)'] = '$a ($b adresów)'; @@ -2509,5 +2509,8 @@ $_LANG['GPS coordinates:'] = 'Współrzędne geograficzne:'; $_LANG['GPS latitude:'] = 'Szerokość geograficzna:'; $_LANG['GPS longitude:'] = 'Długość geograficzna:'; +$_LANG['Click to select gps coordinates from map'] = 'Kliknij w celu wybrania współrzędnych geograficznych z mapy'; +$_LANG['Select gps coordinates'] = 'Wybierz współrzędne geograficzne'; +$_LANG['Select gps coordinates:'] = 'Wybierz współprzędne geograficzne:'; ?> From cvs w lms.org.pl Thu Nov 10 07:40:59 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:40:59 +0100 (CET) Subject: [lms-commits] CVS update of lms/contrib/customer (customer.html) Message-ID: <20111110064059.6A880302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:40:59 Author: chilek Path: /cvsroot/lms/contrib/customer Modified: customer.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/contrib/customer/customer.html.diff?&r1=1.23&r2=1.24 Index: lms/contrib/customer/customer.html diff -u lms/contrib/customer/customer.html:1.23 lms/contrib/customer/customer.html:1.24 --- lms/contrib/customer/customer.html:1.23 Fri Oct 14 18:08:54 2011 +++ lms/contrib/customer/customer.html Thu Nov 10 07:40:59 2011 @@ -1,12 +1,11 @@ - + {* INSERT PAGE TITLE / WSTAW SWÓJ TYTUŁ STRONY *} -{literal} -{/literal}
From cvs w lms.org.pl Thu Nov 10 07:40:59 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:40:59 +0100 (CET) Subject: [lms-commits] CVS update of lms/contrib/customer_otherip (customerlogin.html) Message-ID: <20111110064059.83A50302A041@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:40:59 Author: chilek Path: /cvsroot/lms/contrib/customer_otherip Modified: customerlogin.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/contrib/customer_otherip/customerlogin.html.diff?&r1=1.9&r2=1.10 Index: lms/contrib/customer_otherip/customerlogin.html diff -u lms/contrib/customer_otherip/customerlogin.html:1.9 lms/contrib/customer_otherip/customerlogin.html:1.10 --- lms/contrib/customer_otherip/customerlogin.html:1.9 Tue Jan 18 09:11:59 2011 +++ lms/contrib/customer_otherip/customerlogin.html Thu Nov 10 07:40:59 2011 @@ -5,7 +5,6 @@ ::: {t}Welcome to LMS{/t} ::: From cvs w lms.org.pl Thu Nov 10 07:40:59 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:40:59 +0100 (CET) Subject: [lms-commits] CVS update of lms/contrib/squid_redirector (message.html) Message-ID: <20111110064059.D2051302A041@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:40:59 Author: chilek Path: /cvsroot/lms/contrib/squid_redirector Modified: message.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/contrib/squid_redirector/message.html.diff?&r1=1.5&r2=1.6 Index: lms/contrib/squid_redirector/message.html diff -u lms/contrib/squid_redirector/message.html:1.5 lms/contrib/squid_redirector/message.html:1.6 --- lms/contrib/squid_redirector/message.html:1.5 Fri May 27 18:21:36 2005 +++ lms/contrib/squid_redirector/message.html Thu Nov 10 07:40:59 2011 @@ -1,11 +1,11 @@ - + {t}Administration message{/t} -{literal} - -{/literal} From cvs w lms.org.pl Thu Nov 10 07:40:59 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:40:59 +0100 (CET) Subject: [lms-commits] CVS update of lms/contrib/sqlpanel (sql.html) Message-ID: <20111110064059.A5A22302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:40:59 Author: chilek Path: /cvsroot/lms/contrib/sqlpanel Modified: sql.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/contrib/sqlpanel/sql.html.diff?&r1=1.8&r2=1.9 Index: lms/contrib/sqlpanel/sql.html diff -u lms/contrib/sqlpanel/sql.html:1.8 lms/contrib/sqlpanel/sql.html:1.9 --- lms/contrib/sqlpanel/sql.html:1.8 Wed Mar 16 14:15:57 2005 +++ lms/contrib/sqlpanel/sql.html Thu Nov 10 07:40:59 2011 @@ -1,8 +1,7 @@ {include file="header.html"} - -{literal} + -{/literal}

{$layout.pagetitle}

{if $page} From cvs w lms.org.pl Thu Nov 10 07:40:59 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:40:59 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111110064100.01524302A042@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:40:59 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1600&r2=1.1601 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1600 lms/doc/ChangeLog:1.1601 --- lms/doc/ChangeLog:1.1600 Thu Nov 10 04:10:41 2011 +++ lms/doc/ChangeLog Thu Nov 10 07:40:59 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1600 2011/11/10 03:10:41 chilek Exp $ +$Id: ChangeLog,v 1.1601 2011/11/10 06:40:59 chilek Exp $ version ? (????-??-??): @@ -43,6 +43,7 @@ - netdevmap: first version of OpenStreetMap map type support thanks to Grzegorz Cichowski [chilan] - netdevmap: show info about netdevices for OpenStreetMap map type [chilan] - selection of gps coordinates from popup map [chilan] + - javascript smarty literal cleanup [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Thu Nov 10 07:41:00 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:41:00 +0100 (CET) Subject: [lms-commits] CVS update of lms/documents/templates/default (template.html) Message-ID: <20111110064100.20563302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:41:00 Author: chilek Path: /cvsroot/lms/documents/templates/default Modified: template.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/documents/templates/default/template.html.diff?&r1=1.4&r2=1.5 Index: lms/documents/templates/default/template.html diff -u lms/documents/templates/default/template.html:1.4 lms/documents/templates/default/template.html:1.5 --- lms/documents/templates/default/template.html:1.4 Mon Aug 21 15:02:10 2006 +++ lms/documents/templates/default/template.html Thu Nov 10 07:41:00 2011 @@ -1,8 +1,8 @@ {t}Contract{/t} -{literal} - -{/literal} From cvs w lms.org.pl Thu Nov 10 07:41:00 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:41:00 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules/core/templates (logout.html) Message-ID: <20111110064100.424EC302A041@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:41:00 Author: chilek Path: /cvsroot/lms/modules/core/templates Modified: logout.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/core/templates/logout.html.diff?&r1=1.1&r2=1.2 Index: lms/modules/core/templates/logout.html diff -u lms/modules/core/templates/logout.html:1.1 lms/modules/core/templates/logout.html:1.2 --- lms/modules/core/templates/logout.html:1.1 Mon May 15 21:46:44 2006 +++ lms/modules/core/templates/logout.html Thu Nov 10 07:41:00 2011 @@ -1,7 +1,7 @@ - +
From cvs w lms.org.pl Thu Nov 10 07:41:00 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:41:00 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules/mailing/templates (mailing.html) Message-ID: <20111110064100.643F8302A042@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:41:00 Author: chilek Path: /cvsroot/lms/modules/mailing/templates Modified: mailing.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/mailing/templates/mailing.html.diff?&r1=1.2&r2=1.3 Index: lms/modules/mailing/templates/mailing.html diff -u lms/modules/mailing/templates/mailing.html:1.2 lms/modules/mailing/templates/mailing.html:1.3 --- lms/modules/mailing/templates/mailing.html:1.2 Mon May 15 21:46:44 2006 +++ lms/modules/mailing/templates/mailing.html Thu Nov 10 07:41:00 2011 @@ -1,35 +1,31 @@ - +

{$layout.pagetitle}

-{literal} -{/literal}
{t}GPS latitude:{/t} + + »»»
{t}GPS longitude:{/t} + + »»»
{t}GPS latitude:{/t} + + »»»
{t}GPS longitude:{/t} + + »»»
-
+
*{t}Logout{/t} {$layout.logname|truncate:10:"..."}
From cvs w lms.org.pl Thu Nov 10 07:41:03 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:41:03 +0100 (CET) Subject: [lms-commits] CVS update of lms/userpanel/modules/finances/templates (1 file) Message-ID: <20111110064103.C93C5302A041@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:41:03 Author: chilek Path: /cvsroot/lms/userpanel/modules/finances/templates Modified: userbalancebox.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/userpanel/modules/finances/templates/userbalancebox.html.diff?&r1=1.3&r2=1.4 Index: lms/userpanel/modules/finances/templates/userbalancebox.html diff -u lms/userpanel/modules/finances/templates/userbalancebox.html:1.3 lms/userpanel/modules/finances/templates/userbalancebox.html:1.4 --- lms/userpanel/modules/finances/templates/userbalancebox.html:1.3 Wed Aug 31 12:58:13 2011 +++ lms/userpanel/modules/finances/templates/userbalancebox.html Thu Nov 10 07:41:03 2011 @@ -1,22 +1,23 @@ - + {box title="Your balance"} From cvs w lms.org.pl Thu Nov 10 07:41:03 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:41:03 +0100 (CET) Subject: [lms-commits] CVS update of lms/userpanel/templates (setup_rights.html) Message-ID: <20111110064103.E9AFC302A042@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:41:03 Author: chilek Path: /cvsroot/lms/userpanel/templates Modified: setup_rights.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/userpanel/templates/setup_rights.html.diff?&r1=1.2&r2=1.3 Index: lms/userpanel/templates/setup_rights.html diff -u lms/userpanel/templates/setup_rights.html:1.2 lms/userpanel/templates/setup_rights.html:1.3 --- lms/userpanel/templates/setup_rights.html:1.2 Mon May 18 10:25:21 2009 +++ lms/userpanel/templates/setup_rights.html Thu Nov 10 07:41:03 2011 @@ -1,11 +1,10 @@ {include file="header.html"} - -{literal} + -{/literal}

{$layout.pagetitle}

From cvs w lms.org.pl Thu Nov 10 07:41:03 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 07:41:03 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (91 files) Message-ID: <20111110064103.A723C302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 07:41:02 Author: chilek Path: /cvsroot/lms/templates Modified: accountadd.html accountedit.html aliasadd.html aliasedit.html balancelist.html balancenew.html cashimport.html choosegpscoords.html chooselocation.html choosenode.html configadd.html configedit.html customeractions.html customeradd.html customerassignmentinfoshort.html customerassignments.html customerassignmentsedit.html customerbalancebox.html customerdocuments.html customereditbox.html customerevents.html customergroupassignments.html customergroups.html customerinfobox.html customermessages.html customernodesbox.html customersearch.html customersearchresults.html customervoipaccountsbox.html customerwarnings.html daemonconfigadd.html daemonconfigedit.html dblist.html documentadd.html documentedit.html documentgen.html documentlist.html domainadd.html eventadd.html eventedit.html header.html invoiceedit.html invoicelist.html invoicenew.html invoicenote.html messageadd.html multiselect.html netdevconnbox.html netdevinfobox.html netdevipaddbox.html netdevipbox.html netdevipeditbox.html netdevipinfobox.html netdevmap.html netdevnodes.html netdevsearch.html netinfo.html nodeaddbox.html nodeeditbox.html nodegroupassignments.html nodegroups.html nodeinfobox.html nodesearch.html nodewarnings.html noteadd.html noteedit.html notelist.html printindex.html promotionschemaadd.html promotionschemadata.html promotionschemaedit.html promotionschemas.html promotiontariffs.html receiptadd.html receiptadv.html receiptedit.html receiptlist.html recordedit.html reload.html rtmessageadd.html rtticketadd.html rtticketeditbox.html tariffadd.html tariffedit.html tariffinfo.html trafficdbcompact.html useradd.html useredit.html voipaccountaddbox.html voipaccounteditbox.html voipaccountsearch.html - javascript smarty literal cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/accountadd.html.diff?&r1=1.44&r2=1.45 http://cvs.lms.org.pl/viewvc/Development/lms/templates/accountedit.html.diff?&r1=1.37&r2=1.38 http://cvs.lms.org.pl/viewvc/Development/lms/templates/aliasadd.html.diff?&r1=1.18&r2=1.19 http://cvs.lms.org.pl/viewvc/Development/lms/templates/aliasedit.html.diff?&r1=1.6&r2=1.7 http://cvs.lms.org.pl/viewvc/Development/lms/templates/balancelist.html.diff?&r1=1.95&r2=1.96 http://cvs.lms.org.pl/viewvc/Development/lms/templates/balancenew.html.diff?&r1=1.68&r2=1.69 http://cvs.lms.org.pl/viewvc/Development/lms/templates/cashimport.html.diff?&r1=1.24&r2=1.25 http://cvs.lms.org.pl/viewvc/Development/lms/templates/choosegpscoords.html.diff?&r1=1.1&r2=1.2 http://cvs.lms.org.pl/viewvc/Development/lms/templates/chooselocation.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/choosenode.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/configadd.html.diff?&r1=1.21&r2=1.22 http://cvs.lms.org.pl/viewvc/Development/lms/templates/configedit.html.diff?&r1=1.20&r2=1.21 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customeractions.html.diff?&r1=1.4&r2=1.5 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customeradd.html.diff?&r1=1.46&r2=1.47 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerassignmentinfoshort.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerassignments.html.diff?&r1=1.44&r2=1.45 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerassignmentsedit.html.diff?&r1=1.23&r2=1.24 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerbalancebox.html.diff?&r1=1.50&r2=1.51 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerdocuments.html.diff?&r1=1.22&r2=1.23 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customereditbox.html.diff?&r1=1.42&r2=1.43 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerevents.html.diff?&r1=1.4&r2=1.5 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customergroupassignments.html.diff?&r1=1.8&r2=1.9 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customergroups.html.diff?&r1=1.10&r2=1.11 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfobox.html.diff?&r1=1.50&r2=1.51 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customermessages.html.diff?&r1=1.4&r2=1.5 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customernodesbox.html.diff?&r1=1.30&r2=1.31 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customersearch.html.diff?&r1=1.24&r2=1.25 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customersearchresults.html.diff?&r1=1.16&r2=1.17 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customervoipaccountsbox.html.diff?&r1=1.6&r2=1.7 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerwarnings.html.diff?&r1=1.12&r2=1.13 http://cvs.lms.org.pl/viewvc/Development/lms/templates/daemonconfigadd.html.diff?&r1=1.11&r2=1.12 http://cvs.lms.org.pl/viewvc/Development/lms/templates/daemonconfigedit.html.diff?&r1=1.11&r2=1.12 http://cvs.lms.org.pl/viewvc/Development/lms/templates/dblist.html.diff?&r1=1.32&r2=1.33 http://cvs.lms.org.pl/viewvc/Development/lms/templates/documentadd.html.diff?&r1=1.30&r2=1.31 http://cvs.lms.org.pl/viewvc/Development/lms/templates/documentedit.html.diff?&r1=1.8&r2=1.9 http://cvs.lms.org.pl/viewvc/Development/lms/templates/documentgen.html.diff?&r1=1.11&r2=1.12 http://cvs.lms.org.pl/viewvc/Development/lms/templates/documentlist.html.diff?&r1=1.27&r2=1.28 http://cvs.lms.org.pl/viewvc/Development/lms/templates/domainadd.html.diff?&r1=1.20&r2=1.21 http://cvs.lms.org.pl/viewvc/Development/lms/templates/eventadd.html.diff?&r1=1.21&r2=1.22 http://cvs.lms.org.pl/viewvc/Development/lms/templates/eventedit.html.diff?&r1=1.18&r2=1.19 http://cvs.lms.org.pl/viewvc/Development/lms/templates/header.html.diff?&r1=1.135&r2=1.136 http://cvs.lms.org.pl/viewvc/Development/lms/templates/invoiceedit.html.diff?&r1=1.44&r2=1.45 http://cvs.lms.org.pl/viewvc/Development/lms/templates/invoicelist.html.diff?&r1=1.84&r2=1.85 http://cvs.lms.org.pl/viewvc/Development/lms/templates/invoicenew.html.diff?&r1=1.70&r2=1.71 http://cvs.lms.org.pl/viewvc/Development/lms/templates/invoicenote.html.diff?&r1=1.28&r2=1.29 http://cvs.lms.org.pl/viewvc/Development/lms/templates/messageadd.html.diff?&r1=1.4&r2=1.5 http://cvs.lms.org.pl/viewvc/Development/lms/templates/multiselect.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevconnbox.html.diff?&r1=1.31&r2=1.32 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevinfobox.html.diff?&r1=1.30&r2=1.31 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevipaddbox.html.diff?&r1=1.31&r2=1.32 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevipbox.html.diff?&r1=1.21&r2=1.22 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevipeditbox.html.diff?&r1=1.30&r2=1.31 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevipinfobox.html.diff?&r1=1.21&r2=1.22 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevmap.html.diff?&r1=1.25&r2=1.26 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevnodes.html.diff?&r1=1.27&r2=1.28 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevsearch.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netinfo.html.diff?&r1=1.69&r2=1.70 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeaddbox.html.diff?&r1=1.88&r2=1.89 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.92&r2=1.93 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodegroupassignments.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodegroups.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.78&r2=1.79 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodesearch.html.diff?&r1=1.30&r2=1.31 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodewarnings.html.diff?&r1=1.23&r2=1.24 http://cvs.lms.org.pl/viewvc/Development/lms/templates/noteadd.html.diff?&r1=1.6&r2=1.7 http://cvs.lms.org.pl/viewvc/Development/lms/templates/noteedit.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/notelist.html.diff?&r1=1.5&r2=1.6 http://cvs.lms.org.pl/viewvc/Development/lms/templates/printindex.html.diff?&r1=1.100&r2=1.101 http://cvs.lms.org.pl/viewvc/Development/lms/templates/promotionschemaadd.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/promotionschemadata.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/promotionschemaedit.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/promotionschemas.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/promotiontariffs.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/receiptadd.html.diff?&r1=1.55&r2=1.56 http://cvs.lms.org.pl/viewvc/Development/lms/templates/receiptadv.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/receiptedit.html.diff?&r1=1.39&r2=1.40 http://cvs.lms.org.pl/viewvc/Development/lms/templates/receiptlist.html.diff?&r1=1.26&r2=1.27 http://cvs.lms.org.pl/viewvc/Development/lms/templates/recordedit.html.diff?&r1=1.9&r2=1.10 http://cvs.lms.org.pl/viewvc/Development/lms/templates/reload.html.diff?&r1=1.10&r2=1.11 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtmessageadd.html.diff?&r1=1.27&r2=1.28 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtticketadd.html.diff?&r1=1.31&r2=1.32 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtticketeditbox.html.diff?&r1=1.25&r2=1.26 http://cvs.lms.org.pl/viewvc/Development/lms/templates/tariffadd.html.diff?&r1=1.55&r2=1.56 http://cvs.lms.org.pl/viewvc/Development/lms/templates/tariffedit.html.diff?&r1=1.59&r2=1.60 http://cvs.lms.org.pl/viewvc/Development/lms/templates/tariffinfo.html.diff?&r1=1.62&r2=1.63 http://cvs.lms.org.pl/viewvc/Development/lms/templates/trafficdbcompact.html.diff?&r1=1.16&r2=1.17 http://cvs.lms.org.pl/viewvc/Development/lms/templates/useradd.html.diff?&r1=1.73&r2=1.74 http://cvs.lms.org.pl/viewvc/Development/lms/templates/useredit.html.diff?&r1=1.25&r2=1.26 http://cvs.lms.org.pl/viewvc/Development/lms/templates/voipaccountaddbox.html.diff?&r1=1.5&r2=1.6 http://cvs.lms.org.pl/viewvc/Development/lms/templates/voipaccounteditbox.html.diff?&r1=1.4&r2=1.5 http://cvs.lms.org.pl/viewvc/Development/lms/templates/voipaccountsearch.html.diff?&r1=1.2&r2=1.3 Index: lms/templates/accountadd.html diff -u lms/templates/accountadd.html:1.44 lms/templates/accountadd.html:1.45 --- lms/templates/accountadd.html:1.44 Wed Mar 10 14:08:32 2010 +++ lms/templates/accountadd.html Thu Nov 10 07:41:00 2011 @@ -1,15 +1,13 @@ {include file="header.html"} - + {include file="calendar_js.html"} -{literal}

{$layout.pagetitle}

Index: lms/templates/accountedit.html diff -u lms/templates/accountedit.html:1.37 lms/templates/accountedit.html:1.38 --- lms/templates/accountedit.html:1.37 Wed Mar 10 14:08:32 2010 +++ lms/templates/accountedit.html Thu Nov 10 07:41:00 2011 @@ -1,15 +1,13 @@ {include file="header.html"} - + {include file="calendar_js.html"} -{literal}

{$layout.pagetitle}

Index: lms/templates/aliasadd.html diff -u lms/templates/aliasadd.html:1.18 lms/templates/aliasadd.html:1.19 --- lms/templates/aliasadd.html:1.18 Wed Mar 10 14:08:32 2010 +++ lms/templates/aliasadd.html Thu Nov 10 07:41:00 2011 @@ -1,7 +1,7 @@ {include file="header.html"} - -{literal} + -{/literal}

{$layout.pagetitle}

Index: lms/templates/aliasedit.html diff -u lms/templates/aliasedit.html:1.6 lms/templates/aliasedit.html:1.7 --- lms/templates/aliasedit.html:1.6 Wed Mar 10 14:08:32 2010 +++ lms/templates/aliasedit.html Thu Nov 10 07:41:00 2011 @@ -1,7 +1,7 @@ {include file="header.html"} - -{literal} + -{/literal}

{$layout.pagetitle}

Index: lms/templates/balancelist.html diff -u lms/templates/balancelist.html:1.95 lms/templates/balancelist.html:1.96 --- lms/templates/balancelist.html:1.95 Fri Oct 14 18:09:03 2011 +++ lms/templates/balancelist.html Thu Nov 10 07:41:00 2011 @@ -1,8 +1,7 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} -{literal} -{/literal}
Index: lms/templates/balancenew.html diff -u lms/templates/balancenew.html:1.68 lms/templates/balancenew.html:1.69 --- lms/templates/balancenew.html:1.68 Sat Jun 6 19:40:57 2009 +++ lms/templates/balancenew.html Thu Nov 10 07:41:00 2011 @@ -1,8 +1,7 @@ {include file="header.html"} - + {include file="calendar_js.html"}

{$layout.pagetitle}

Index: lms/templates/cashimport.html diff -u lms/templates/cashimport.html:1.24 lms/templates/cashimport.html:1.25 --- lms/templates/cashimport.html:1.24 Fri Oct 14 18:09:03 2011 +++ lms/templates/cashimport.html Thu Nov 10 07:41:00 2011 @@ -1,7 +1,6 @@ {include file="header.html"} - +

{$layout.pagetitle}

-{literal} -{/literal}

Index: lms/templates/choosegpscoords.html diff -u lms/templates/choosegpscoords.html:1.1 lms/templates/choosegpscoords.html:1.2 --- lms/templates/choosegpscoords.html:1.1 Thu Nov 10 04:10:42 2011 +++ lms/templates/choosegpscoords.html Thu Nov 10 07:41:00 2011 @@ -1,5 +1,5 @@ - + @@ -16,6 +16,7 @@ {/if} Index: lms/templates/chooselocation.html diff -u lms/templates/chooselocation.html:1.2 lms/templates/chooselocation.html:1.3 --- lms/templates/chooselocation.html:1.2 Fri Oct 21 15:37:07 2011 +++ lms/templates/chooselocation.html Thu Nov 10 07:41:00 2011 @@ -1,5 +1,5 @@ - + @@ -107,161 +107,159 @@ {/if}
-{literal} -{/literal} Index: lms/templates/choosenode.html diff -u lms/templates/choosenode.html:1.2 lms/templates/choosenode.html:1.3 --- lms/templates/choosenode.html:1.2 Mon May 24 09:43:17 2010 +++ lms/templates/choosenode.html Thu Nov 10 07:41:00 2011 @@ -1,5 +1,5 @@ - + @@ -9,42 +9,41 @@ -{literal} Index: lms/templates/configadd.html diff -u lms/templates/configadd.html:1.21 lms/templates/configadd.html:1.22 --- lms/templates/configadd.html:1.21 Mon Mar 15 15:34:44 2010 +++ lms/templates/configadd.html Thu Nov 10 07:41:00 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -71,13 +71,11 @@ {include file="footer.html"} Index: lms/templates/configedit.html diff -u lms/templates/configedit.html:1.20 lms/templates/configedit.html:1.21 --- lms/templates/configedit.html:1.20 Fri Oct 14 18:09:03 2011 +++ lms/templates/configedit.html Thu Nov 10 07:41:00 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -67,7 +67,6 @@

-{literal} -{/literal} {include file="footer.html"} Index: lms/templates/customeractions.html diff -u lms/templates/customeractions.html:1.4 lms/templates/customeractions.html:1.5 --- lms/templates/customeractions.html:1.4 Sun Jun 7 10:28:16 2009 +++ lms/templates/customeractions.html Thu Nov 10 07:41:00 2011 @@ -1,4 +1,4 @@ - +
@@ -60,13 +60,13 @@
-{literal} -{/literal} Index: lms/templates/customeradd.html diff -u lms/templates/customeradd.html:1.46 lms/templates/customeradd.html:1.47 --- lms/templates/customeradd.html:1.46 Fri Apr 22 15:15:23 2011 +++ lms/templates/customeradd.html Thu Nov 10 07:41:00 2011 @@ -1,23 +1,24 @@ {include file="header.html"} - +

{$layout.pagetitle}

-{literal} -{/literal}

@@ -435,10 +436,10 @@

-{literal} -{/literal} {include file="footer.html"} Index: lms/templates/customerassignmentinfoshort.html diff -u lms/templates/customerassignmentinfoshort.html:1.3 lms/templates/customerassignmentinfoshort.html:1.4 --- lms/templates/customerassignmentinfoshort.html:1.3 Thu Mar 31 20:19:17 2011 +++ lms/templates/customerassignmentinfoshort.html Thu Nov 10 07:41:00 2011 @@ -1,5 +1,5 @@ - + @@ -41,8 +41,10 @@
Index: lms/templates/customerassignments.html diff -u lms/templates/customerassignments.html:1.44 lms/templates/customerassignments.html:1.45 --- lms/templates/customerassignments.html:1.44 Fri Oct 14 18:09:03 2011 +++ lms/templates/customerassignments.html Thu Nov 10 07:41:00 2011 @@ -1,4 +1,4 @@ - + {assign var=today value=$smarty.now|date_format:"%x 00:00:00"}{assign var=today value=$today|date_format:"%s"} @@ -98,11 +98,11 @@
-{literal} -{/literal} Index: lms/templates/customerassignmentsedit.html diff -u lms/templates/customerassignmentsedit.html:1.23 lms/templates/customerassignmentsedit.html:1.24 --- lms/templates/customerassignmentsedit.html:1.23 Thu Mar 31 13:11:21 2011 +++ lms/templates/customerassignmentsedit.html Thu Nov 10 07:41:00 2011 @@ -1,66 +1,70 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} -{literal} -{/literal}
@@ -300,17 +304,17 @@
{include file="customerassignments.html"} {include file="footer.html"} Index: lms/templates/customerbalancebox.html diff -u lms/templates/customerbalancebox.html:1.50 lms/templates/customerbalancebox.html:1.51 --- lms/templates/customerbalancebox.html:1.50 Fri Oct 14 18:09:03 2011 +++ lms/templates/customerbalancebox.html Thu Nov 10 07:41:00 2011 @@ -1,5 +1,4 @@ - -{literal} + @@ -242,11 +242,11 @@ Index: lms/templates/customerdocuments.html diff -u lms/templates/customerdocuments.html:1.22 lms/templates/customerdocuments.html:1.23 --- lms/templates/customerdocuments.html:1.22 Fri Oct 14 18:09:03 2011 +++ lms/templates/customerdocuments.html Thu Nov 10 07:41:00 2011 @@ -1,4 +1,4 @@ - +
@@ -62,11 +62,11 @@
-{literal}{/literal} + Index: lms/templates/customereditbox.html diff -u lms/templates/customereditbox.html:1.42 lms/templates/customereditbox.html:1.43 --- lms/templates/customereditbox.html:1.42 Thu Mar 31 13:11:22 2011 +++ lms/templates/customereditbox.html Thu Nov 10 07:41:00 2011 @@ -1,10 +1,10 @@ - -{literal} + -{/literal} @@ -461,6 +461,8 @@
Index: lms/templates/customerevents.html diff -u lms/templates/customerevents.html:1.4 lms/templates/customerevents.html:1.5 --- lms/templates/customerevents.html:1.4 Fri Oct 14 18:09:03 2011 +++ lms/templates/customerevents.html Thu Nov 10 07:41:00 2011 @@ -1,4 +1,4 @@ - +
@@ -62,11 +62,11 @@
-{literal}{/literal} + Index: lms/templates/customergroupassignments.html diff -u lms/templates/customergroupassignments.html:1.8 lms/templates/customergroupassignments.html:1.9 --- lms/templates/customergroupassignments.html:1.8 Thu Sep 18 13:15:33 2008 +++ lms/templates/customergroupassignments.html Thu Nov 10 07:41:00 2011 @@ -1,5 +1,4 @@ - -{literal} +

Index: lms/templates/customergroups.html diff -u lms/templates/customergroups.html:1.10 lms/templates/customergroups.html:1.11 --- lms/templates/customergroups.html:1.10 Tue Mar 9 10:23:00 2010 +++ lms/templates/customergroups.html Thu Nov 10 07:41:00 2011 @@ -1,4 +1,4 @@ - +
@@ -53,11 +53,11 @@
-{literal}{/literal} + Index: lms/templates/customerinfobox.html diff -u lms/templates/customerinfobox.html:1.50 lms/templates/customerinfobox.html:1.51 --- lms/templates/customerinfobox.html:1.50 Fri Oct 14 18:09:03 2011 +++ lms/templates/customerinfobox.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -382,12 +382,12 @@
{if $customerpanel} -{literal}{/literal} + {/if} Index: lms/templates/customermessages.html diff -u lms/templates/customermessages.html:1.4 lms/templates/customermessages.html:1.5 --- lms/templates/customermessages.html:1.4 Fri Oct 14 18:09:03 2011 +++ lms/templates/customermessages.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -57,11 +57,11 @@
-{literal}{/literal} + Index: lms/templates/customernodesbox.html diff -u lms/templates/customernodesbox.html:1.30 lms/templates/customernodesbox.html:1.31 --- lms/templates/customernodesbox.html:1.30 Fri Oct 14 18:09:03 2011 +++ lms/templates/customernodesbox.html Thu Nov 10 07:41:01 2011 @@ -1,5 +1,6 @@ - -{literal}{/literal} +//--> + {if $_config.phpui.ewx_support|chkconfig}{assign var=ewx value=1}{else}{assign var=ewx value=0}{/if} @@ -165,8 +169,10 @@
Index: lms/templates/customersearch.html diff -u lms/templates/customersearch.html:1.24 lms/templates/customersearch.html:1.25 --- lms/templates/customersearch.html:1.24 Thu Apr 7 12:28:17 2011 +++ lms/templates/customersearch.html Thu Nov 10 07:41:01 2011 @@ -1,9 +1,8 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"}

Index: lms/templates/customersearchresults.html diff -u lms/templates/customersearchresults.html:1.16 lms/templates/customersearchresults.html:1.17 --- lms/templates/customersearchresults.html:1.16 Fri Oct 14 18:09:03 2011 +++ lms/templates/customersearchresults.html Thu Nov 10 07:41:01 2011 @@ -1,7 +1,6 @@ {include file="header.html"} - +

{$layout.pagetitle}

-{literal} -{/literal}

Index: lms/templates/customervoipaccountsbox.html diff -u lms/templates/customervoipaccountsbox.html:1.6 lms/templates/customervoipaccountsbox.html:1.7 --- lms/templates/customervoipaccountsbox.html:1.6 Fri Oct 14 18:09:03 2011 +++ lms/templates/customervoipaccountsbox.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -49,11 +49,11 @@
-{literal}{/literal} + Index: lms/templates/customerwarnings.html diff -u lms/templates/customerwarnings.html:1.12 lms/templates/customerwarnings.html:1.13 --- lms/templates/customerwarnings.html:1.12 Sun Mar 15 11:41:32 2009 +++ lms/templates/customerwarnings.html Thu Nov 10 07:41:01 2011 @@ -1,11 +1,10 @@ {include file="header.html"} - -{literal} + -{/literal}

{$layout.pagetitle}

Index: lms/templates/daemonconfigadd.html diff -u lms/templates/daemonconfigadd.html:1.11 lms/templates/daemonconfigadd.html:1.12 --- lms/templates/daemonconfigadd.html:1.11 Tue Aug 4 13:06:35 2009 +++ lms/templates/daemonconfigadd.html Thu Nov 10 07:41:01 2011 @@ -1,77 +1,76 @@ {include file="header.html"} - +

{$layout.pagetitle}

-{literal} -{/literal}

Index: lms/templates/daemonconfigedit.html diff -u lms/templates/daemonconfigedit.html:1.11 lms/templates/daemonconfigedit.html:1.12 --- lms/templates/daemonconfigedit.html:1.11 Tue Aug 4 13:06:35 2009 +++ lms/templates/daemonconfigedit.html Thu Nov 10 07:41:01 2011 @@ -1,77 +1,76 @@ {include file="header.html"} - +

{$layout.pagetitle}

-{literal} -{/literal}

Index: lms/templates/dblist.html diff -u lms/templates/dblist.html:1.32 lms/templates/dblist.html:1.33 --- lms/templates/dblist.html:1.32 Fri Oct 14 18:09:04 2011 +++ lms/templates/dblist.html Thu Nov 10 07:41:01 2011 @@ -1,9 +1,8 @@ {include file="header.html"} - +

{$layout.pagetitle}

Index: lms/templates/documentadd.html diff -u lms/templates/documentadd.html:1.30 lms/templates/documentadd.html:1.31 --- lms/templates/documentadd.html:1.30 Thu Mar 31 13:11:22 2011 +++ lms/templates/documentadd.html Thu Nov 10 07:41:01 2011 @@ -1,9 +1,8 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} {$xajax} -{literal} -{/literal}
Index: lms/templates/documentedit.html diff -u lms/templates/documentedit.html:1.8 lms/templates/documentedit.html:1.9 --- lms/templates/documentedit.html:1.8 Thu Mar 31 13:11:22 2011 +++ lms/templates/documentedit.html Thu Nov 10 07:41:01 2011 @@ -1,16 +1,15 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} -{literal} -{/literal}

Index: lms/templates/documentgen.html diff -u lms/templates/documentgen.html:1.11 lms/templates/documentgen.html:1.12 --- lms/templates/documentgen.html:1.11 Tue Mar 8 13:03:43 2011 +++ lms/templates/documentgen.html Thu Nov 10 07:41:01 2011 @@ -1,15 +1,14 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} {$xajax} -{literal} -{/literal}
Index: lms/templates/documentlist.html diff -u lms/templates/documentlist.html:1.27 lms/templates/documentlist.html:1.28 --- lms/templates/documentlist.html:1.27 Wed Aug 11 09:28:39 2010 +++ lms/templates/documentlist.html Thu Nov 10 07:41:01 2011 @@ -1,67 +1,65 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $docid}{/if} -{literal} -{/literal} {include file="calendar_js.html"} Index: lms/templates/domainadd.html diff -u lms/templates/domainadd.html:1.20 lms/templates/domainadd.html:1.21 --- lms/templates/domainadd.html:1.20 Wed Dec 15 13:10:15 2010 +++ lms/templates/domainadd.html Thu Nov 10 07:41:01 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -88,23 +88,24 @@

-{literal} -{/literal} {include file="footer.html"} Index: lms/templates/eventadd.html diff -u lms/templates/eventadd.html:1.21 lms/templates/eventadd.html:1.22 --- lms/templates/eventadd.html:1.21 Fri Oct 16 10:45:55 2009 +++ lms/templates/eventadd.html Thu Nov 10 07:41:01 2011 @@ -1,8 +1,8 @@ {include file="header.html"} - + {include file="calendar_js.html"}

{$layout.pagetitle}

Index: lms/templates/eventedit.html diff -u lms/templates/eventedit.html:1.18 lms/templates/eventedit.html:1.19 --- lms/templates/eventedit.html:1.18 Fri Oct 14 18:09:04 2011 +++ lms/templates/eventedit.html Thu Nov 10 07:41:01 2011 @@ -1,8 +1,8 @@ {include file="header.html"} - + {include file="calendar_js.html"} -{literal} -{/literal}

{$layout.pagetitle}

Index: lms/templates/header.html diff -u lms/templates/header.html:1.135 lms/templates/header.html:1.136 --- lms/templates/header.html:1.135 Fri Oct 14 18:09:04 2011 +++ lms/templates/header.html Thu Nov 10 07:41:01 2011 @@ -1,5 +1,5 @@ - + ::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle|striphtml} :{/if}:: @@ -49,7 +49,7 @@ {/foreach}
-
+
*{t}Logout{/t} {$layout.logname|truncate:10:"..."}
{include file="footer.html"} Index: lms/templates/invoicelist.html diff -u lms/templates/invoicelist.html:1.84 lms/templates/invoicelist.html:1.85 --- lms/templates/invoicelist.html:1.84 Fri Oct 14 18:09:04 2011 +++ lms/templates/invoicelist.html Thu Nov 10 07:41:01 2011 @@ -1,26 +1,24 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $invoice.invoice} {/if} -{literal} -{/literal}
Index: lms/templates/invoicenew.html diff -u lms/templates/invoicenew.html:1.70 lms/templates/invoicenew.html:1.71 --- lms/templates/invoicenew.html:1.70 Thu Mar 31 20:19:17 2011 +++ lms/templates/invoicenew.html Thu Nov 10 07:41:01 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $newinvoice} @@ -437,12 +438,12 @@
{include file="footer.html"} - Index: lms/templates/invoicenote.html diff -u lms/templates/invoicenote.html:1.28 lms/templates/invoicenote.html:1.29 --- lms/templates/invoicenote.html:1.28 Mon Apr 4 13:52:03 2011 +++ lms/templates/invoicenote.html Thu Nov 10 07:41:01 2011 @@ -1,42 +1,45 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"}
@@ -283,12 +286,12 @@
{include file="footer.html"} Index: lms/templates/messageadd.html diff -u lms/templates/messageadd.html:1.4 lms/templates/messageadd.html:1.5 --- lms/templates/messageadd.html:1.4 Thu Mar 19 13:25:49 2009 +++ lms/templates/messageadd.html Thu Nov 10 07:41:01 2011 @@ -1,9 +1,8 @@ {include file="header.html"} - +

{$layout.pagetitle}

-{literal} -{/literal} {if $message.customerid} Index: lms/templates/multiselect.html diff -u lms/templates/multiselect.html:1.2 lms/templates/multiselect.html:1.3 --- lms/templates/multiselect.html:1.2 Tue Aug 21 13:52:45 2007 +++ lms/templates/multiselect.html Thu Nov 10 07:41:01 2011 @@ -1,66 +1,66 @@ - +
Index: lms/templates/netdevconnbox.html diff -u lms/templates/netdevconnbox.html:1.31 lms/templates/netdevconnbox.html:1.32 --- lms/templates/netdevconnbox.html:1.31 Fri Oct 14 18:09:04 2011 +++ lms/templates/netdevconnbox.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -100,11 +100,12 @@
-{literal} {/literal} Index: lms/templates/netdevinfobox.html diff -u lms/templates/netdevinfobox.html:1.30 lms/templates/netdevinfobox.html:1.31 --- lms/templates/netdevinfobox.html:1.30 Wed Nov 9 10:51:56 2011 +++ lms/templates/netdevinfobox.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -281,12 +281,12 @@
{if $devicepanel} -{literal}{/literal} + {/if} Index: lms/templates/netdevipaddbox.html diff -u lms/templates/netdevipaddbox.html:1.31 lms/templates/netdevipaddbox.html:1.32 --- lms/templates/netdevipaddbox.html:1.31 Fri May 7 14:22:31 2010 +++ lms/templates/netdevipaddbox.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - + @@ -131,7 +131,6 @@
-{literal} -{/literal} - \ No newline at end of file Index: lms/templates/netdevipeditbox.html diff -u lms/templates/netdevipeditbox.html:1.30 lms/templates/netdevipeditbox.html:1.31 --- lms/templates/netdevipeditbox.html:1.30 Fri May 7 14:22:31 2010 +++ lms/templates/netdevipeditbox.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -162,16 +162,16 @@
-{literal} -{/literal} Index: lms/templates/netdevipinfobox.html diff -u lms/templates/netdevipinfobox.html:1.21 lms/templates/netdevipinfobox.html:1.22 --- lms/templates/netdevipinfobox.html:1.21 Fri Oct 14 18:09:04 2011 +++ lms/templates/netdevipinfobox.html Thu Nov 10 07:41:01 2011 @@ -1,38 +1,41 @@ - + Index: lms/templates/netdevmap.html diff -u lms/templates/netdevmap.html:1.25 lms/templates/netdevmap.html:1.26 --- lms/templates/netdevmap.html:1.25 Thu Nov 10 04:10:42 2011 +++ lms/templates/netdevmap.html Thu Nov 10 07:41:01 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $emptydb}
@@ -25,6 +25,7 @@
{elseif $gd} {* default if $type is not set or not 'flash' *}

Index: lms/templates/netdevnodes.html diff -u lms/templates/netdevnodes.html:1.27 lms/templates/netdevnodes.html:1.28 --- lms/templates/netdevnodes.html:1.27 Fri Oct 14 18:09:04 2011 +++ lms/templates/netdevnodes.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -94,11 +94,11 @@
-{literal} -{/literal} Index: lms/templates/netdevsearch.html diff -u lms/templates/netdevsearch.html:1.3 lms/templates/netdevsearch.html:1.4 --- lms/templates/netdevsearch.html:1.3 Thu Nov 6 15:02:59 2008 +++ lms/templates/netdevsearch.html Thu Nov 10 07:41:01 2011 @@ -1,16 +1,13 @@ {include file="header.html"} - +

{$layout.pagetitle}

Index: lms/templates/netinfo.html diff -u lms/templates/netinfo.html:1.69 lms/templates/netinfo.html:1.70 --- lms/templates/netinfo.html:1.69 Fri Oct 14 18:09:04 2011 +++ lms/templates/netinfo.html Thu Nov 10 07:41:01 2011 @@ -1,15 +1,18 @@ {include file="header.html"} - -{if $unlockedit}{/if} + +{if $unlockedit} + +{/if}

{$layout.pagetitle}

{if $unlockedit}{/if} Index: lms/templates/nodeaddbox.html diff -u lms/templates/nodeaddbox.html:1.88 lms/templates/nodeaddbox.html:1.89 --- lms/templates/nodeaddbox.html:1.88 Thu Nov 10 04:10:42 2011 +++ lms/templates/nodeaddbox.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -202,7 +202,6 @@
-{literal} -{/literal} Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.92 lms/templates/nodeeditbox.html:1.93 --- lms/templates/nodeeditbox.html:1.92 Thu Nov 10 04:10:42 2011 +++ lms/templates/nodeeditbox.html Thu Nov 10 07:41:01 2011 @@ -1,4 +1,4 @@ - +
@@ -210,22 +210,21 @@
-{literal} -{/literal} Index: lms/templates/nodegroupassignments.html diff -u lms/templates/nodegroupassignments.html:1.2 lms/templates/nodegroupassignments.html:1.3 --- lms/templates/nodegroupassignments.html:1.2 Thu Sep 18 13:15:33 2008 +++ lms/templates/nodegroupassignments.html Thu Nov 10 07:41:02 2011 @@ -1,7 +1,6 @@ - -{literal} +

Index: lms/templates/nodegroups.html diff -u lms/templates/nodegroups.html:1.2 lms/templates/nodegroups.html:1.3 --- lms/templates/nodegroups.html:1.2 Thu Sep 18 13:15:33 2008 +++ lms/templates/nodegroups.html Thu Nov 10 07:41:02 2011 @@ -1,4 +1,4 @@ - +
@@ -54,11 +54,11 @@
-{literal}{/literal} + Index: lms/templates/nodeinfobox.html diff -u lms/templates/nodeinfobox.html:1.78 lms/templates/nodeinfobox.html:1.79 --- lms/templates/nodeinfobox.html:1.78 Wed Nov 9 10:42:35 2011 +++ lms/templates/nodeinfobox.html Thu Nov 10 07:41:02 2011 @@ -1,23 +1,20 @@ - + Index: lms/templates/nodesearch.html diff -u lms/templates/nodesearch.html:1.30 lms/templates/nodesearch.html:1.31 --- lms/templates/nodesearch.html:1.30 Fri Jan 14 08:50:35 2011 +++ lms/templates/nodesearch.html Thu Nov 10 07:41:02 2011 @@ -1,7 +1,6 @@ {include file="header.html"} - +

{$layout.pagetitle}

Index: lms/templates/nodewarnings.html diff -u lms/templates/nodewarnings.html:1.23 lms/templates/nodewarnings.html:1.24 --- lms/templates/nodewarnings.html:1.23 Sun Mar 15 11:41:33 2009 +++ lms/templates/nodewarnings.html Thu Nov 10 07:41:02 2011 @@ -1,11 +1,10 @@ {include file="header.html"} - -{literal} + {/if} {include file="calendar_js.html"} Index: lms/templates/noteedit.html diff -u lms/templates/noteedit.html:1.3 lms/templates/noteedit.html:1.4 --- lms/templates/noteedit.html:1.3 Fri Nov 13 14:34:33 2009 +++ lms/templates/noteedit.html Thu Nov 10 07:41:02 2011 @@ -1,33 +1,31 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} +//--> + Index: lms/templates/notelist.html diff -u lms/templates/notelist.html:1.5 lms/templates/notelist.html:1.6 --- lms/templates/notelist.html:1.5 Fri Oct 14 18:09:04 2011 +++ lms/templates/notelist.html Thu Nov 10 07:41:02 2011 @@ -1,23 +1,23 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $note} {/if} -{literal} -{/literal}
Index: lms/templates/printindex.html diff -u lms/templates/printindex.html:1.100 lms/templates/printindex.html:1.101 --- lms/templates/printindex.html:1.100 Thu Apr 7 12:28:17 2011 +++ lms/templates/printindex.html Thu Nov 10 07:41:02 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} {if $printmenu=="customer"} @@ -638,22 +638,21 @@ {if $printmenu=="finances"}

-{literal} -{/literal}

Index: lms/templates/promotionschemaadd.html diff -u lms/templates/promotionschemaadd.html:1.3 lms/templates/promotionschemaadd.html:1.4 --- lms/templates/promotionschemaadd.html:1.3 Mon Mar 7 14:53:34 2011 +++ lms/templates/promotionschemaadd.html Thu Nov 10 07:41:02 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -89,34 +89,33 @@

{include file="footer.html"} Index: lms/templates/promotionschemadata.html diff -u lms/templates/promotionschemadata.html:1.2 lms/templates/promotionschemadata.html:1.3 --- lms/templates/promotionschemadata.html:1.2 Fri Oct 14 18:09:05 2011 +++ lms/templates/promotionschemadata.html Thu Nov 10 07:41:02 2011 @@ -1,4 +1,4 @@ - +
@@ -105,113 +105,117 @@
-{literal} Index: lms/templates/promotionschemaedit.html diff -u lms/templates/promotionschemaedit.html:1.3 lms/templates/promotionschemaedit.html:1.4 --- lms/templates/promotionschemaedit.html:1.3 Mon Mar 7 14:53:34 2011 +++ lms/templates/promotionschemaedit.html Thu Nov 10 07:41:02 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -88,34 +88,33 @@

{include file="footer.html"} Index: lms/templates/promotionschemas.html diff -u lms/templates/promotionschemas.html:1.2 lms/templates/promotionschemas.html:1.3 --- lms/templates/promotionschemas.html:1.2 Fri Oct 14 18:09:05 2011 +++ lms/templates/promotionschemas.html Thu Nov 10 07:41:02 2011 @@ -1,4 +1,4 @@ - +
@@ -47,8 +47,10 @@
Index: lms/templates/promotiontariffs.html diff -u lms/templates/promotiontariffs.html:1.2 lms/templates/promotiontariffs.html:1.3 --- lms/templates/promotiontariffs.html:1.2 Fri Oct 14 18:09:05 2011 +++ lms/templates/promotiontariffs.html Thu Nov 10 07:41:02 2011 @@ -1,4 +1,4 @@ - +
@@ -52,11 +52,11 @@
-{literal} -{/literal} Index: lms/templates/receiptadd.html diff -u lms/templates/receiptadd.html:1.55 lms/templates/receiptadd.html:1.56 --- lms/templates/receiptadd.html:1.55 Fri Oct 16 10:45:55 2009 +++ lms/templates/receiptadd.html Thu Nov 10 07:41:02 2011 @@ -1,8 +1,7 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} -{literal} -{/literal} +//--> +
Index: lms/templates/receiptadv.html diff -u lms/templates/receiptadv.html:1.3 lms/templates/receiptadv.html:1.4 --- lms/templates/receiptadv.html:1.3 Sun Dec 28 20:03:28 2008 +++ lms/templates/receiptadv.html Thu Nov 10 07:41:02 2011 @@ -1,13 +1,13 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} -{literal} -{/literal} Index: lms/templates/receiptedit.html diff -u lms/templates/receiptedit.html:1.39 lms/templates/receiptedit.html:1.40 --- lms/templates/receiptedit.html:1.39 Fri Oct 16 10:45:55 2009 +++ lms/templates/receiptedit.html Thu Nov 10 07:41:02 2011 @@ -1,23 +1,22 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} -{literal} -{/literal} +//--> + Index: lms/templates/receiptlist.html diff -u lms/templates/receiptlist.html:1.26 lms/templates/receiptlist.html:1.27 --- lms/templates/receiptlist.html:1.26 Fri Oct 14 18:09:05 2011 +++ lms/templates/receiptlist.html Thu Nov 10 07:41:02 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $receipt.receipt} @@ -8,16 +8,15 @@ {/if} {include file="calendar_js.html"} -{literal} -{/literal} Index: lms/templates/recordedit.html diff -u lms/templates/recordedit.html:1.9 lms/templates/recordedit.html:1.10 --- lms/templates/recordedit.html:1.9 Mon Apr 12 09:17:01 2010 +++ lms/templates/recordedit.html Thu Nov 10 07:41:02 2011 @@ -171,9 +171,8 @@
-{literal} -{/literal} {include file="footer.html"} Index: lms/templates/reload.html diff -u lms/templates/reload.html:1.10 lms/templates/reload.html:1.11 --- lms/templates/reload.html:1.10 Sun Dec 28 20:03:28 2008 +++ lms/templates/reload.html Thu Nov 10 07:41:02 2011 @@ -1,9 +1,7 @@ - +

{$layout.pagetitle}

-{literal} -{/literal}

Index: lms/templates/rtmessageadd.html diff -u lms/templates/rtmessageadd.html:1.27 lms/templates/rtmessageadd.html:1.28 --- lms/templates/rtmessageadd.html:1.27 Fri Oct 14 18:09:05 2011 +++ lms/templates/rtmessageadd.html Thu Nov 10 07:41:02 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -97,17 +97,13 @@

{include file="footer.html"} -{literal} -{/literal} Index: lms/templates/rtticketadd.html diff -u lms/templates/rtticketadd.html:1.31 lms/templates/rtticketadd.html:1.32 --- lms/templates/rtticketadd.html:1.31 Fri Oct 14 18:09:05 2011 +++ lms/templates/rtticketadd.html Thu Nov 10 07:41:02 2011 @@ -1,13 +1,13 @@ {include file="header.html"} - +

{$layout.pagetitle}

Index: lms/templates/rtticketeditbox.html diff -u lms/templates/rtticketeditbox.html:1.25 lms/templates/rtticketeditbox.html:1.26 --- lms/templates/rtticketeditbox.html:1.25 Fri Oct 14 18:09:05 2011 +++ lms/templates/rtticketeditbox.html Thu Nov 10 07:41:02 2011 @@ -1,12 +1,12 @@ - +

Index: lms/templates/tariffadd.html diff -u lms/templates/tariffadd.html:1.55 lms/templates/tariffadd.html:1.56 --- lms/templates/tariffadd.html:1.55 Thu Feb 17 13:08:44 2011 +++ lms/templates/tariffadd.html Thu Nov 10 07:41:02 2011 @@ -1,25 +1,26 @@ {include file="header.html"} - +

{$layout.pagetitle}

Index: lms/templates/tariffedit.html diff -u lms/templates/tariffedit.html:1.59 lms/templates/tariffedit.html:1.60 --- lms/templates/tariffedit.html:1.59 Thu Feb 17 13:08:44 2011 +++ lms/templates/tariffedit.html Thu Nov 10 07:41:02 2011 @@ -1,25 +1,25 @@ {include file="header.html"} - +

{$layout.pagetitle}

Index: lms/templates/tariffinfo.html diff -u lms/templates/tariffinfo.html:1.62 lms/templates/tariffinfo.html:1.63 --- lms/templates/tariffinfo.html:1.62 Wed Mar 2 11:31:06 2011 +++ lms/templates/tariffinfo.html Thu Nov 10 07:41:02 2011 @@ -1,22 +1,20 @@ {include file="header.html"} - +

{$layout.pagetitle}

Index: lms/templates/trafficdbcompact.html diff -u lms/templates/trafficdbcompact.html:1.16 lms/templates/trafficdbcompact.html:1.17 --- lms/templates/trafficdbcompact.html:1.16 Wed Mar 25 10:46:59 2009 +++ lms/templates/trafficdbcompact.html Thu Nov 10 07:41:02 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -44,12 +44,10 @@ {include file="footer.html"} Index: lms/templates/useradd.html diff -u lms/templates/useradd.html:1.73 lms/templates/useradd.html:1.74 --- lms/templates/useradd.html:1.73 Thu Mar 10 12:36:39 2011 +++ lms/templates/useradd.html Thu Nov 10 07:41:02 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -119,12 +119,10 @@ {include file="footer.html"} Index: lms/templates/useredit.html diff -u lms/templates/useredit.html:1.25 lms/templates/useredit.html:1.26 --- lms/templates/useredit.html:1.25 Thu Mar 10 12:36:39 2011 +++ lms/templates/useredit.html Thu Nov 10 07:41:02 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -122,12 +122,10 @@ Index: lms/templates/voipaccountaddbox.html diff -u lms/templates/voipaccountaddbox.html:1.5 lms/templates/voipaccountaddbox.html:1.6 --- lms/templates/voipaccountaddbox.html:1.5 Thu Sep 15 18:26:10 2011 +++ lms/templates/voipaccountaddbox.html Thu Nov 10 07:41:02 2011 @@ -1,4 +1,4 @@ - +
@@ -72,10 +72,8 @@
-{literal} -{/literal} Index: lms/templates/voipaccounteditbox.html diff -u lms/templates/voipaccounteditbox.html:1.4 lms/templates/voipaccounteditbox.html:1.5 --- lms/templates/voipaccounteditbox.html:1.4 Thu Sep 15 18:26:10 2011 +++ lms/templates/voipaccounteditbox.html Thu Nov 10 07:41:02 2011 @@ -1,4 +1,4 @@ - +
@@ -87,10 +87,8 @@
-{literal} -{/literal} Index: lms/templates/voipaccountsearch.html diff -u lms/templates/voipaccountsearch.html:1.2 lms/templates/voipaccountsearch.html:1.3 --- lms/templates/voipaccountsearch.html:1.2 Fri Nov 21 14:22:53 2008 +++ lms/templates/voipaccountsearch.html Thu Nov 10 07:41:02 2011 @@ -1,7 +1,6 @@ {include file="header.html"} - +

{$layout.pagetitle}

From cvs w lms.org.pl Thu Nov 10 08:06:30 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 08:06:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (3 files) Message-ID: <20111110070630.C2E3A302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 08:06:30 Author: chilek Path: /cvsroot/lms/templates Modified: netdevconnbox.html netdevipaddbox.html nodewarnings.html - javascript smarty literal cleanup (missed files) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevconnbox.html.diff?&r1=1.32&r2=1.33 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevipaddbox.html.diff?&r1=1.32&r2=1.33 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodewarnings.html.diff?&r1=1.24&r2=1.25 Index: lms/templates/netdevconnbox.html diff -u lms/templates/netdevconnbox.html:1.32 lms/templates/netdevconnbox.html:1.33 --- lms/templates/netdevconnbox.html:1.32 Thu Nov 10 07:41:01 2011 +++ lms/templates/netdevconnbox.html Thu Nov 10 08:06:30 2011 @@ -1,4 +1,4 @@ - +
@@ -108,4 +108,3 @@ } //--> -{/literal} Index: lms/templates/netdevipaddbox.html diff -u lms/templates/netdevipaddbox.html:1.32 lms/templates/netdevipaddbox.html:1.33 --- lms/templates/netdevipaddbox.html:1.32 Thu Nov 10 07:41:01 2011 +++ lms/templates/netdevipaddbox.html Thu Nov 10 08:06:30 2011 @@ -1,4 +1,4 @@ - +
@@ -158,4 +158,3 @@ } //--> -{/literal} Index: lms/templates/nodewarnings.html diff -u lms/templates/nodewarnings.html:1.24 lms/templates/nodewarnings.html:1.25 --- lms/templates/nodewarnings.html:1.24 Thu Nov 10 07:41:02 2011 +++ lms/templates/nodewarnings.html Thu Nov 10 08:06:30 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - + -{/literal}

{$layout.pagetitle}

From cvs w lms.org.pl Thu Nov 10 09:44:28 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 09:44:28 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (choosegpscoords.php, netdevmap.php) Message-ID: <20111110084428.2A64B302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 09:44:28 Author: chilek Path: /cvsroot/lms/modules Modified: choosegpscoords.php netdevmap.php - open local area in gps selection popup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/choosegpscoords.php.diff?&r1=1.1&r2=1.2 http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevmap.php.diff?&r1=1.69&r2=1.70 Index: lms/modules/choosegpscoords.php diff -u lms/modules/choosegpscoords.php:1.1 lms/modules/choosegpscoords.php:1.2 --- lms/modules/choosegpscoords.php:1.1 Thu Nov 10 04:10:41 2011 +++ lms/modules/choosegpscoords.php Thu Nov 10 09:44:28 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: choosegpscoords.php,v 1.1 2011/11/10 03:10:41 chilek Exp $ + * $Id: choosegpscoords.php,v 1.2 2011/11/10 08:44:28 chilek Exp $ */ $layout['pagetitle'] = trans('Select gps coordinates'); @@ -38,6 +38,40 @@ { $js = 'var targetfield1 = window.parent.targetfield1;'; $js .= 'var targetfield2 = window.parent.targetfield2;'; + + $devices = $DB->GetAllByKey('SELECT n.id, n.name, n.location, MAX(lastonline) AS lastonline, n.latitude, n.longitude + FROM netdevices n + LEFT JOIN nodes ON (n.id = netdev) + WHERE n.latitude IS NOT NULL AND n.longitude IS NOT NULL + GROUP BY n.id, n.name, n.location, n.latitude, n.longitude', 'id'); + + if ($devices) + { + foreach ($devices as $devidx => $device) + if ($device['lastonline']) + if (time() - $device['lastonline'] > $CONFIG['phpui']['lastonline_limit']) + $devices[$devidx]['img'] = 'img/netdev_off.png'; + else + $devices[$devidx]['img'] = 'img/netdev_on.png'; + else + $devices[$devidx]['img'] = 'img/netdev_unk.png'; + + $devids = implode(',', array_keys($devices)); + + $links = $DB->GetAll('SELECT src, dst, type FROM netlinks WHERE src IN ('.$devids.') AND dst IN ('.$devids.')'); + } + + if ($links) + foreach ($links as $linkidx => $link) + { + $links[$linkidx]['srclat'] = $devices[$link['src']]['latitude']; + $links[$linkidx]['srclon'] = $devices[$link['src']]['longitude']; + $links[$linkidx]['dstlat'] = $devices[$link['dst']]['latitude']; + $links[$linkidx]['dstlon'] = $devices[$link['dst']]['longitude']; + } + + $SMARTY->assign('devices', $devices); + $SMARTY->assign('links', $links); } $SMARTY->assign('part', $p); Index: lms/modules/netdevmap.php diff -u lms/modules/netdevmap.php:1.69 lms/modules/netdevmap.php:1.70 --- lms/modules/netdevmap.php:1.69 Thu Nov 10 04:10:41 2011 +++ lms/modules/netdevmap.php Thu Nov 10 09:44:28 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: netdevmap.php,v 1.69 2011/11/10 03:10:41 chilek Exp $ + * $Id: netdevmap.php,v 1.70 2011/11/10 08:44:28 chilek Exp $ */ function drawtext($x, $y, $text, $r, $g, $b) @@ -326,18 +326,21 @@ WHERE n.latitude IS NOT NULL AND n.longitude IS NOT NULL GROUP BY n.id, n.name, n.location, n.latitude, n.longitude', 'id'); - foreach ($devices as $devidx => $device) - if ($device['lastonline']) - if (time() - $device['lastonline'] > $CONFIG['phpui']['lastonline_limit']) - $devices[$devidx]['img'] = 'img/netdev_off.png'; + if ($devices) + { + foreach ($devices as $devidx => $device) + if ($device['lastonline']) + if (time() - $device['lastonline'] > $CONFIG['phpui']['lastonline_limit']) + $devices[$devidx]['img'] = 'img/netdev_off.png'; + else + $devices[$devidx]['img'] = 'img/netdev_on.png'; else - $devices[$devidx]['img'] = 'img/netdev_on.png'; - else - $devices[$devidx]['img'] = 'img/netdev_unk.png'; + $devices[$devidx]['img'] = 'img/netdev_unk.png'; - $devids = implode(',', array_keys($devices)); + $devids = implode(',', array_keys($devices)); - $links = $DB->GetAll('SELECT src, dst, type FROM netlinks WHERE src IN ('.$devids.') AND dst IN ('.$devids.')'); + $links = $DB->GetAll('SELECT src, dst, type FROM netlinks WHERE src IN ('.$devids.') AND dst IN ('.$devids.')'); + } if ($links) foreach ($links as $linkidx => $link) From cvs w lms.org.pl Thu Nov 10 09:44:28 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 09:44:28 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (choosegpscoords.html, netdevmap.html) Message-ID: <20111110084428.52577302A041@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 09:44:28 Author: chilek Path: /cvsroot/lms/templates Modified: choosegpscoords.html netdevmap.html - open local area in gps selection popup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/choosegpscoords.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevmap.html.diff?&r1=1.26&r2=1.27 Index: lms/templates/choosegpscoords.html diff -u lms/templates/choosegpscoords.html:1.2 lms/templates/choosegpscoords.html:1.3 --- lms/templates/choosegpscoords.html:1.2 Thu Nov 10 07:41:00 2011 +++ lms/templates/choosegpscoords.html Thu Nov 10 09:44:28 2011 @@ -1,5 +1,5 @@ - + @@ -17,7 +17,7 @@ Index: lms/templates/netdevmap.html diff -u lms/templates/netdevmap.html:1.26 lms/templates/netdevmap.html:1.27 --- lms/templates/netdevmap.html:1.26 Thu Nov 10 07:41:01 2011 +++ lms/templates/netdevmap.html Thu Nov 10 09:44:28 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $emptydb}
@@ -127,7 +127,11 @@ map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition({ displayProjection: new OpenLayers.Projection("EPSG:4326") })); - map.zoomToExtent(area); + {if $devices} + map.zoomToExtent(area); + {else} + map.zoomToMaxExtent(); + {/if} //--> {elseif $gd} {* default if $type is not set or not 'flash' *} From cvs w lms.org.pl Thu Nov 10 10:02:43 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 10:02:43 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (accesstable.php) Message-ID: <20111110090243.BEC86302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 10:02:43 Author: chilek Path: /cvsroot/lms/lib Modified: accesstable.php - added choosegpscoords to access table Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/accesstable.php.diff?&r1=1.143&r2=1.144 Index: lms/lib/accesstable.php diff -u lms/lib/accesstable.php:1.143 lms/lib/accesstable.php:1.144 --- lms/lib/accesstable.php:1.143 Fri Sep 16 22:48:16 2011 +++ lms/lib/accesstable.php Thu Nov 10 10:02:43 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: accesstable.php,v 1.143 2011/09/16 20:48:16 chilek Exp $ + * $Id: accesstable.php,v 1.144 2011/11/10 09:02:43 chilek Exp $ */ unset($access); @@ -68,7 +68,7 @@ $access['table'][12]['allow_reg'] = '^(((host|config|numberplan|taxrate|state|division|cashsource)(list|edit|add|del|load))|((promotion|promotionschema)(list|edit|add|del|set|info)))$'; $access['table'][13]['name'] = trans('networks and devices management'); -$access['table'][13]['allow_reg'] = '^((net|netdev|ewxch)(info|list|edit|add|del|cmp|map|remap|search)|choose(mac|ip)|ewxnodelist|ewxdevlist|chooselocation)$'; +$access['table'][13]['allow_reg'] = '^((net|netdev|ewxch)(info|list|edit|add|del|cmp|map|remap|search)|choose(mac|ip|gpscoords)|ewxnodelist|ewxdevlist|chooselocation)$'; $access['table'][14]['name'] = trans('timetable management'); $access['table'][14]['allow_reg'] = '^(event(list|edit|add|del|info|print|search)|choosecustomer)$'; From cvs w lms.org.pl Thu Nov 10 16:07:20 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 16:07:20 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111110150720.6507D302A040@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 16:07:20 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - network maps show nodes and node links & switched map creation from markers to features Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1601&r2=1.1602 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1601 lms/doc/ChangeLog:1.1602 --- lms/doc/ChangeLog:1.1601 Thu Nov 10 07:40:59 2011 +++ lms/doc/ChangeLog Thu Nov 10 16:07:20 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1601 2011/11/10 06:40:59 chilek Exp $ +$Id: ChangeLog,v 1.1602 2011/11/10 15:07:20 chilek Exp $ version ? (????-??-??): @@ -44,6 +44,7 @@ - netdevmap: show info about netdevices for OpenStreetMap map type [chilan] - selection of gps coordinates from popup map [chilan] - javascript smarty literal cleanup [chilan] + - network maps show nodes and node links & switched map creation from markers to features [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Thu Nov 10 16:07:20 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 10 Nov 2011 16:07:20 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (choosegpscoords.html, netdevmap.html) Message-ID: <20111110150720.EB6FF302A042@eftep.altec.pl> Date: Thursday, November 10, 2011 @ 16:07:20 Author: chilek Path: /cvsroot/lms/templates Modified: choosegpscoords.html netdevmap.html - network maps show nodes and node links & switched map creation from markers to features Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/choosegpscoords.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevmap.html.diff?&r1=1.27&r2=1.28 Index: lms/templates/choosegpscoords.html diff -u lms/templates/choosegpscoords.html:1.3 lms/templates/choosegpscoords.html:1.4 --- lms/templates/choosegpscoords.html:1.3 Thu Nov 10 09:44:28 2011 +++ lms/templates/choosegpscoords.html Thu Nov 10 16:07:20 2011 @@ -1,12 +1,12 @@ - + ::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle} :{/if}:: - + {if $js} + Index: lms/templates/netdevmap.html diff -u lms/templates/netdevmap.html:1.32 lms/templates/netdevmap.html:1.33 --- lms/templates/netdevmap.html:1.32 Thu Nov 10 21:03:06 2011 +++ lms/templates/netdevmap.html Fri Nov 11 12:23:17 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $emptydb}
@@ -24,334 +24,68 @@
+ {elseif $gd} {* default if $type is not set or not 'flash' *} From cvs w lms.org.pl Fri Nov 11 17:07:28 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 11 Nov 2011 17:07:28 +0100 (CET) Subject: [lms-commits] CVS update of lmsweb (index.php) Message-ID: <20111111160728.63EBF302A040@eftep.altec.pl> Date: Friday, November 11, 2011 @ 17:07:28 Author: alec Path: /cvsroot/lmsweb Modified: index.php - Fixed extracting news' date and author Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lmsweb/index.php.diff?&r1=1.27&r2=1.28 Index: lmsweb/index.php diff -u lmsweb/index.php:1.27 lmsweb/index.php:1.28 --- lmsweb/index.php:1.27 Wed Dec 22 13:03:10 2010 +++ lmsweb/index.php Fri Nov 11 17:07:28 2011 @@ -18,13 +18,18 @@ $cvsid = $news[0]; $newsid = sprintf('%d',preg_replace('/^([0-9]{4})_.*$/','\1',$file)); $title = preg_replace('/^[0-9]{4}_/','',$file); - $date = preg_replace('/^.Id: .*,v .* ([0-9]{4}\/[0-9]{2}\/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}).*$/','\1',$cvsid); - $author = preg_replace('/^.Id: .*,v .* '.$date.' (.*) Exp.*/','\1',$cvsid); - $newstab[$newsid][date] = $date; - $newstab[$newsid][author] = $author; - $newstab[$newsid][body] = $news; - $newstab[$newsid][file] = $title; - $newstab[$newsid][title] = str_replace('_',' ',$title); + $date = ''; + $author = ''; + if (preg_match('/([0-9]{4}\/[0-9]{2}\/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}) ([^ ]+) Exp/', $cvsid, $m)) + { + $date = $m[1]; + $author = $m[2]; + } + $newstab[$newsid]['date'] = $date; + $newstab[$newsid]['author'] = $author; + $newstab[$newsid]['body'] = $news; + $newstab[$newsid]['file'] = $title; + $newstab[$newsid]['title'] = str_replace('_',' ',$title); if($newsmax < $newsid) $newsmax = $newsid; } From cvs w lms.org.pl Sat Nov 12 21:04:31 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 12 Nov 2011 21:04:31 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (map.inc.php, netdevmaprefresh.php, ping.php) Message-ID: <20111112200431.12FA2302A044@eftep.altec.pl> Date: Saturday, November 12, 2011 @ 21:04:31 Author: chilek Path: /cvsroot/lms/modules Added: netdevmaprefresh.php ping.php Modified: map.inc.php - livemap(tm) in LMS ;-) network state is updated asynchronously in real time in phpui->lastonline_limit time periods - we can ping nodes and devices watching results in popups - 5 default base layers for maps Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/map.inc.php.diff?&r1=1.1&r2=1.2 http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevmaprefresh.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php?rev=1.1 Index: lms/modules/map.inc.php diff -u lms/modules/map.inc.php:1.1 lms/modules/map.inc.php:1.2 --- lms/modules/map.inc.php:1.1 Fri Nov 11 12:23:17 2011 +++ lms/modules/map.inc.php Sat Nov 12 21:04:30 2011 @@ -21,11 +21,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: map.inc.php,v 1.1 2011/11/11 11:23:17 chilek Exp $ + * $Id: map.inc.php,v 1.2 2011/11/12 20:04:30 chilek Exp $ */ -$devices = $DB->GetAllByKey('SELECT n.id, n.name, n.location, '.$DB->GroupConcat('INET_NTOA(nodes.ipaddr)') - .' AS ipaddr, MAX(lastonline) AS lastonline, n.latitude, n.longitude +$devices = $DB->GetAllByKey('SELECT n.id, n.name, n.location, '.$DB->GroupConcat('INET_NTOA(CASE WHEN nodes.ownerid = 0 THEN nodes.ipaddr ELSE NULL END)') + .' AS ipaddr, '.$DB->GroupConcat('CASE WHEN nodes.ownerid = 0 THEN nodes.id ELSE NULL END').' AS nodeid, + MAX(lastonline) AS lastonline, n.latitude AS lat, n.longitude AS lon FROM netdevices n LEFT JOIN nodes ON (n.id = netdev) WHERE n.latitude IS NOT NULL AND n.longitude IS NOT NULL @@ -57,14 +58,14 @@ if ($devlinks) foreach ($devlinks as $devlinkidx => $devlink) { - $devlinks[$devlinkidx]['srclat'] = $devices[$devlink['src']]['latitude']; - $devlinks[$devlinkidx]['srclon'] = $devices[$devlink['src']]['longitude']; - $devlinks[$devlinkidx]['dstlat'] = $devices[$devlink['dst']]['latitude']; - $devlinks[$devlinkidx]['dstlon'] = $devices[$devlink['dst']]['longitude']; + $devlinks[$devlinkidx]['srclat'] = $devices[$devlink['src']]['lat']; + $devlinks[$devlinkidx]['srclon'] = $devices[$devlink['src']]['lon']; + $devlinks[$devlinkidx]['dstlat'] = $devices[$devlink['dst']]['lat']; + $devlinks[$devlinkidx]['dstlon'] = $devices[$devlink['dst']]['lon']; } } -$nodes = $DB->GetAllByKey('SELECT n.id, n.name, INET_NTOA(n.ipaddr) AS ipaddr, n.location, n.lastonline, n.latitude, n.longitude +$nodes = $DB->GetAllByKey('SELECT n.id, n.name, INET_NTOA(n.ipaddr) AS ipaddr, n.location, n.lastonline, n.latitude AS lat, n.longitude AS lon FROM nodes n WHERE n.latitude IS NOT NULL AND n.longitude IS NOT NULL', 'id'); @@ -95,10 +96,10 @@ if ($nodelinks) foreach ($nodelinks as $nodelinkidx => $nodelink) { - $nodelinks[$nodelinkidx]['nodelat'] = $nodes[$nodelink['nodeid']]['latitude']; - $nodelinks[$nodelinkidx]['nodelon'] = $nodes[$nodelink['nodeid']]['longitude']; - $nodelinks[$nodelinkidx]['netdevlat'] = $devices[$nodelink['netdev']]['latitude']; - $nodelinks[$nodelinkidx]['netdevlon'] = $devices[$nodelink['netdev']]['longitude']; + $nodelinks[$nodelinkidx]['nodelat'] = $nodes[$nodelink['nodeid']]['lat']; + $nodelinks[$nodelinkidx]['nodelon'] = $nodes[$nodelink['nodeid']]['lon']; + $nodelinks[$nodelinkidx]['netdevlat'] = $devices[$nodelink['netdev']]['lat']; + $nodelinks[$nodelinkidx]['netdevlon'] = $devices[$nodelink['netdev']]['lon']; } } Index: lms/modules/netdevmaprefresh.php diff -u /dev/null lms/modules/netdevmaprefresh.php:1.1 --- /dev/null Sat Nov 12 21:04:31 2011 +++ lms/modules/netdevmaprefresh.php Sat Nov 12 21:04:30 2011 @@ -0,0 +1,37 @@ + $node) +// if ($node['id'] == '2534') +// $nodes[$nodeidx]['state'] = 2; + +echo '{"devices":'.json_encode($devices).',"nodes":'.json_encode($nodes).'}'; + +?> Index: lms/modules/ping.php diff -u /dev/null lms/modules/ping.php:1.1 --- /dev/null Sat Nov 12 21:04:31 2011 +++ lms/modules/ping.php Sat Nov 12 21:04:30 2011 @@ -0,0 +1,81 @@ +addAppend('data', 'innerHTML', $output.'
'); + $objResponse->addAssign('transmitted', 'value', $transmitted); + $objResponse->addAssign('received', 'value', $received); + $objResponse->addAssign('summary', 'innerHTML', ''.trans('Total: $a% ($b/$c)', + round(($received / $transmitted) * 100), $received, $transmitted).''); + return $objResponse; +} + +$layout['pagetitle'] = trans('Ping'); + +if (!isset($_GET['id']) || !$DB->GetOne('SELECT id FROM nodes WHERE id=?', array(intval($_GET['id'])))) + $SESSION->redirect('?m=nodelist'); + +$nodeid = $_GET['id']; + +if (isset($_GET['p']) && $_GET['p'] == 'main') +{ + /* Using AJAX for template plugins */ + require(LIB_DIR.'/xajax/xajax.inc.php'); + + $xajax = new xajax(); + $xajax->errorHandlerOn(); + $xajax->registerFunction("refresh"); + $xajax->processRequests(); + + $SMARTY->assign('xajax', $xajax->getJavascript('img/', 'xajax.js')); + $SMARTY->assign('part', $_GET['p']); +} + +$SMARTY->assign('ipaddr', $LMS->GetNodeIpByID($nodeid)); +$SMARTY->assign('nodeid', $nodeid); +$SMARTY->display('ping.html'); + +?> From cvs w lms.org.pl Sat Nov 12 21:04:30 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 12 Nov 2011 21:04:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111112200430.7859A302A040@eftep.altec.pl> Date: Saturday, November 12, 2011 @ 21:04:30 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - livemap(tm) in LMS ;-) network state is updated asynchronously in real time in phpui->lastonline_limit time periods - we can ping nodes and devices watching results in popups - 5 default base layers for maps Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1603&r2=1.1604 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1603 lms/doc/ChangeLog:1.1604 --- lms/doc/ChangeLog:1.1603 Fri Nov 11 12:23:16 2011 +++ lms/doc/ChangeLog Sat Nov 12 21:04:29 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1603 2011/11/11 11:23:16 chilek Exp $ +$Id: ChangeLog,v 1.1604 2011/11/12 20:04:29 chilek Exp $ version ? (????-??-??): @@ -46,6 +46,10 @@ - javascript smarty literal cleanup [chilan] - network maps show nodes and node links & switched map creation from markers to features [chilan] - separated js and php files created for map support [chilan] + - livemap(tm) in LMS ;-) network state is updated asynchronously in real time + in phpui->lastonline_limit time periods [chilan] + - we can ping nodes and devices watching results in popups [chilan] + - 5 default base layers for maps [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Sat Nov 12 21:04:30 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 12 Nov 2011 21:04:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (accesstable.php) Message-ID: <20111112200430.AFB21302A042@eftep.altec.pl> Date: Saturday, November 12, 2011 @ 21:04:30 Author: chilek Path: /cvsroot/lms/lib Modified: accesstable.php - livemap(tm) in LMS ;-) network state is updated asynchronously in real time in phpui->lastonline_limit time periods - we can ping nodes and devices watching results in popups - 5 default base layers for maps Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/accesstable.php.diff?&r1=1.144&r2=1.145 Index: lms/lib/accesstable.php diff -u lms/lib/accesstable.php:1.144 lms/lib/accesstable.php:1.145 --- lms/lib/accesstable.php:1.144 Thu Nov 10 10:02:43 2011 +++ lms/lib/accesstable.php Sat Nov 12 21:04:30 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: accesstable.php,v 1.144 2011/11/10 09:02:43 chilek Exp $ + * $Id: accesstable.php,v 1.145 2011/11/12 20:04:30 chilek Exp $ */ unset($access); @@ -68,7 +68,7 @@ $access['table'][12]['allow_reg'] = '^(((host|config|numberplan|taxrate|state|division|cashsource)(list|edit|add|del|load))|((promotion|promotionschema)(list|edit|add|del|set|info)))$'; $access['table'][13]['name'] = trans('networks and devices management'); -$access['table'][13]['allow_reg'] = '^((net|netdev|ewxch)(info|list|edit|add|del|cmp|map|remap|search)|choose(mac|ip|gpscoords)|ewxnodelist|ewxdevlist|chooselocation)$'; +$access['table'][13]['allow_reg'] = '^((net|netdev|ewxch)(info|list|edit|add|del|cmp|map(refresh|)|remap|search)|choose(mac|ip|gpscoords)|ewxnodelist|ewxdevlist|chooselocation|ping)$'; $access['table'][14]['name'] = trans('timetable management'); $access['table'][14]['allow_reg'] = '^(event(list|edit|add|del|info|print|search)|choosecustomer)$'; From cvs w lms.org.pl Sat Nov 12 21:04:30 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 12 Nov 2011 21:04:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (common.js, map.js) Message-ID: <20111112200430.80B15302A041@eftep.altec.pl> Date: Saturday, November 12, 2011 @ 21:04:30 Author: chilek Path: /cvsroot/lms/img Modified: common.js map.js - livemap(tm) in LMS ;-) network state is updated asynchronously in real time in phpui->lastonline_limit time periods - we can ping nodes and devices watching results in popups - 5 default base layers for maps Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/common.js.diff?&r1=1.36&r2=1.37 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.1&r2=1.2 Index: lms/img/common.js diff -u lms/img/common.js:1.36 lms/img/common.js:1.37 --- lms/img/common.js:1.36 Thu Nov 10 04:10:41 2011 +++ lms/img/common.js Sat Nov 12 21:04:30 2011 @@ -32,26 +32,26 @@ } // LMS: function to autoresize iframe and parent div container (overlib) -function autoiframe_setsize(width, height) +function autoiframe_setsize(id, width, height) { - var doc = window.parent ? parent.document : document, - frame = doc.getElementById('autoiframe'); + var doc = window.parent ? parent.document : document, + frame = doc.getElementById(id); - if (width) { - frame.style.width = width + 'px'; - frame.parentNode.style.width = width + 'px'; - } - if (height) { - frame.style.height = height + 'px'; - frame.parentNode.style.height = height + 'px'; - } + if (width) { + frame.style.width = width + 'px'; + frame.parentNode.style.width = width + 'px'; + } + if (height) { + frame.style.height = height + 'px'; + frame.parentNode.style.height = height + 'px'; + } } function openSelectWindow(theURL, winName, myWidth, myHeight, isCenter, formfield) { targetfield = formfield; popup(theURL, 1, 1, 30, 15); - autoiframe_setsize(myWidth, myHeight); + autoiframe_setsize('autoiframe', myWidth, myHeight); return false; } @@ -61,7 +61,7 @@ targetfield1 = formfield1; targetfield2 = formfield2; popup(theURL, 1, 1, 30, 15); - autoiframe_setsize(myWidth, myHeight); + autoiframe_setsize('autoiframe', myWidth, myHeight); return false; } @@ -389,4 +389,10 @@ } return checked; -} \ No newline at end of file +} + +function ping_popup(id) +{ + popup('?m=ping&id=' + id, 1, 1, 30, 30); + autoiframe_setsize('autoiframe', 400, 300); +} Index: lms/img/map.js diff -u lms/img/map.js:1.1 lms/img/map.js:1.2 --- lms/img/map.js:1.1 Fri Nov 11 12:23:17 2011 +++ lms/img/map.js Sat Nov 12 21:04:30 2011 @@ -1,5 +1,70 @@ +var map = null; +var maprequest = null; +var mappopup = null; +var featurepopup = null; +var lastonline_limit; -var popup = null; +function set_lastonline_limit(sec) +{ + lastonline_limit = sec; +} + +function netdevmap_updater() +{ + if (maprequest.status = 200) + { + data = eval('(' + maprequest.responseText + ')'); + devices = data.devices; + nodes = data.nodes; + + devicelayer = map.getLayersByName('Devices')[0]; + for (i in devices) + { + var features = devicelayer.getFeaturesByAttribute('id', parseInt(devices[i].id)); + if (features.length && features[0].attributes.state != devices[i].state) + { + var newfeature = new OpenLayers.Feature.Vector( + features[0].geometry.clone(), + devices[i]); + devicelayer.removeFeatures([features[0]]); + devicelayer.addFeatures([newfeature]); + } + } + + nodelayer = map.getLayersByName('Nodes')[0]; + for (i in nodes) + { + var features = nodelayer.getFeaturesByAttribute('id', parseInt(nodes[i].id)); + if (features.length && features[0].attributes.state != nodes[i].state) + { + var newfeature = new OpenLayers.Feature.Vector( + features[0].geometry.clone(), + nodes[i]); + nodelayer.removeFeatures([features[0]]); + nodelayer.addFeatures([newfeature]); + } + } + + } +} + +function netdevmap_refresh() +{ + maprequest = OpenLayers.Request.issue({ + url: '?m=netdevmaprefresh', + callback: netdevmap_updater + }); + setTimeout("netdevmap_refresh()", lastonline_limit * 1000); +} + +function ping_from_map(id) +{ + featurepopup.setContentHTML( + '' + ); + autoiframe_setsize('autoiframe' + id, 400, 300); + featurepopup.updateSize(); +} function createMap(deviceArray, devlinkArray, nodeArray, nodelinkArray, selection) { @@ -10,12 +75,18 @@ ]; var map = new OpenLayers.Map("map"); - var osmap = new OpenLayers.Layer.OSM(); - var gmap = new OpenLayers.Layer.Google("Google Maps"); - map.addLayer(gmap); - map.addLayer(osmap); + var gsat = new OpenLayers.Layer.Google("Google Satellite", + {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22, visibility: false}); + var gphy = new OpenLayers.Layer.Google("Google Physical", + {type: google.maps.MapTypeId.TERRAIN, visibility: false}); + var gmap = new OpenLayers.Layer.Google("Google Streets", // the default + {numZoomLevels: 20, visibility: false}); + var ghyb = new OpenLayers.Layer.Google("Google Hybrid", + {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 22, visibility: true}); + var osm = new OpenLayers.Layer.OSM(); -// var renderer = OpenLayers.Layer.Vector.prototype.renderers; + map.addLayers([gsat, gphy, gmap, ghyb, osm]); + map.setBaseLayer(gmap); var devicestyle = new OpenLayers.Style( { @@ -214,22 +285,25 @@ multiple: false, eventListeners: { "featurehighlighted": function(e) { - popup = new OpenLayers.Popup(null, - new OpenLayers.LonLat(e.feature.data.lon, e.feature.data.lat) - .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), - new OpenLayers.Size(150, 50), - '' + e.feature.data.name + '
' + (e.feature.data.ipaddr).split(",")[0]); - popup.setOpacity(0.8); - popup.closeOnMove = true; - map.addPopup(popup); + if (mappopup == null) + { + mappopup = new OpenLayers.Popup.Anchored(null, + new OpenLayers.LonLat(e.feature.data.lon, e.feature.data.lat) + .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), + new OpenLayers.Size(600, 400), + '' + e.feature.data.name + '' + (e.feature.data.ipaddr.length ? '
' + e.feature.data.ipaddr.replace(/,/g, "
") : '')); + mappopup.setOpacity(0.8); + mappopup.closeOnMove = true; + map.addPopup(mappopup); + mappopup.updateSize(); + } OpenLayers.Event.stop(e); }, "featureunhighlighted": function(e) { - if (popup != null) + if (mappopup) { - map.removePopup(popup); - popup.destroy(); - popup = null; + map.removePopup(mappopup); + mappopup = null; } OpenLayers.Event.stop(e); } @@ -242,12 +316,51 @@ { var selectlayer = new OpenLayers.Control.SelectFeature([devicelayer, nodelayer], { clickout: true, toggle: false, - multiple: false, hover: false, + multiple: true, hover: false, toggleKey: "ctrlKey", // ctrl key removes from selection multipleKey: "shiftKey", // shift key adds to selection - onSelect: function(e) { - document.location = "?m=" + e.data.type + "&id=" + e.data.id; - OpenLayers.Event.stop(e); + onSelect: function(feature) { + if (mappopup) + { + map.removePopup(mappopup); + mappopup = null; + } + selectedFeature = feature; + featurepopup = new OpenLayers.Popup(null, + new OpenLayers.LonLat(feature.data.lon, feature.data.lat) + .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), + new OpenLayers.Size(600, 400), + null, + null, + false, + function(e) { + selectlayer.unselect(selectedFeature); + }); + var content = '' + feature.data.name + '
'; + if (feature.data.type == 'netdevinfo') + { + if (feature.data.ipaddr.length) { + var ips = feature.data.ipaddr.split(','); + var nodeids = feature.data.nodeid.split(','); + for (i in nodeids) + content += ' ' + + ips[i] + '
'; + } + } else + content += ' ' + + feature.data.ipaddr + '
'; + content += ' Info '; + featurepopup.setContentHTML(content); + featurepopup.setOpacity(0.8); + map.addPopup(featurepopup); + featurepopup.updateSize(); + cursize = featurepopup.size; + featurepopup.setSize(new OpenLayers.Size(cursize.w + 20, cursize + 20)); + feature.popup = featurepopup; + }, + onUnselect: function(feature) { + map.removePopup(feature.popup); + feature.popup = null; } }); map.addControl(selectlayer); From cvs w lms.org.pl Sat Nov 12 21:04:31 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 12 Nov 2011 21:04:31 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (14 files) Message-ID: <20111112200431.9E39F302A040@eftep.altec.pl> Date: Saturday, November 12, 2011 @ 21:04:31 Author: chilek Path: /cvsroot/lms/templates Added: ping.html Modified: calendar.html choosegpscoords.html chooselocation.html customerassignmentinfoshort.html customerinfoshort.html dynpopup.html netdevlistshort.html netdevmap.html nodegrouplistshort.html nodeinfobox.html nodelistshort.html rtticketinfoshort.html trafficgraph.html - livemap(tm) in LMS ;-) network state is updated asynchronously in real time in phpui->lastonline_limit time periods - we can ping nodes and devices watching results in popups - 5 default base layers for maps Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/calendar.html.diff?&r1=1.13&r2=1.14 http://cvs.lms.org.pl/viewvc/Development/lms/templates/choosegpscoords.html.diff?&r1=1.8&r2=1.9 http://cvs.lms.org.pl/viewvc/Development/lms/templates/chooselocation.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerassignmentinfoshort.html.diff?&r1=1.4&r2=1.5 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfoshort.html.diff?&r1=1.27&r2=1.28 http://cvs.lms.org.pl/viewvc/Development/lms/templates/dynpopup.html.diff?&r1=1.9&r2=1.10 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevlistshort.html.diff?&r1=1.5&r2=1.6 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevmap.html.diff?&r1=1.33&r2=1.34 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodegrouplistshort.html.diff?&r1=1.6&r2=1.7 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.79&r2=1.80 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodelistshort.html.diff?&r1=1.22&r2=1.23 http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/templates/rtticketinfoshort.html.diff?&r1=1.6&r2=1.7 http://cvs.lms.org.pl/viewvc/Development/lms/templates/trafficgraph.html.diff?&r1=1.7&r2=1.8 Index: lms/templates/calendar.html diff -u lms/templates/calendar.html:1.13 lms/templates/calendar.html:1.14 --- lms/templates/calendar.html:1.13 Thu Mar 31 20:19:16 2011 +++ lms/templates/calendar.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -168,7 +168,7 @@
Index: lms/templates/choosegpscoords.html diff -u lms/templates/choosegpscoords.html:1.8 lms/templates/choosegpscoords.html:1.9 --- lms/templates/choosegpscoords.html:1.8 Fri Nov 11 12:23:17 2011 +++ lms/templates/choosegpscoords.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -18,19 +18,18 @@ Index: lms/templates/chooselocation.html diff -u lms/templates/chooselocation.html:1.3 lms/templates/chooselocation.html:1.4 --- lms/templates/chooselocation.html:1.3 Thu Nov 10 07:41:00 2011 +++ lms/templates/chooselocation.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -247,7 +247,7 @@ lt = document.getElementById('locationtable'), h = (st ? st.offsetHeight : 0) + lt.offsetHeight; - autoiframe_setsize(350, Math.max(h, 160)); + autoiframe_setsize('autoiframe', 350, Math.max(h, 160)); } var win = window.parent, varname = '{$data.varname}', formname = '{$data.formname}', Index: lms/templates/customerassignmentinfoshort.html diff -u lms/templates/customerassignmentinfoshort.html:1.4 lms/templates/customerassignmentinfoshort.html:1.5 --- lms/templates/customerassignmentinfoshort.html:1.4 Thu Nov 10 07:41:00 2011 +++ lms/templates/customerassignmentinfoshort.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -43,7 +43,7 @@ Index: lms/templates/customerinfoshort.html diff -u lms/templates/customerinfoshort.html:1.27 lms/templates/customerinfoshort.html:1.28 --- lms/templates/customerinfoshort.html:1.27 Thu Apr 28 09:49:04 2011 +++ lms/templates/customerinfoshort.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -175,7 +175,7 @@ Index: lms/templates/dynpopup.html diff -u lms/templates/dynpopup.html:1.9 lms/templates/dynpopup.html:1.10 --- lms/templates/dynpopup.html:1.9 Thu Mar 31 20:19:17 2011 +++ lms/templates/dynpopup.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -15,7 +15,7 @@ Index: lms/templates/netdevlistshort.html diff -u lms/templates/netdevlistshort.html:1.5 lms/templates/netdevlistshort.html:1.6 --- lms/templates/netdevlistshort.html:1.5 Fri Oct 14 18:09:04 2011 +++ lms/templates/netdevlistshort.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -48,7 +48,7 @@ Index: lms/templates/netdevmap.html diff -u lms/templates/netdevmap.html:1.33 lms/templates/netdevmap.html:1.34 --- lms/templates/netdevmap.html:1.33 Fri Nov 11 12:23:17 2011 +++ lms/templates/netdevmap.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $emptydb} @@ -100,11 +100,11 @@ {if $_config.phpui.radius|chkconfig} Index: lms/templates/netdeveditbox.html diff -u lms/templates/netdeveditbox.html:1.36 lms/templates/netdeveditbox.html:1.37 --- lms/templates/netdeveditbox.html:1.36 Thu Nov 10 04:10:42 2011 +++ lms/templates/netdeveditbox.html Sun Nov 13 00:37:21 2011 @@ -1,4 +1,4 @@ - + {include file="calendar_js.html"}
@@ -27,17 +27,16 @@ {elseif $gd} {* default if $type is not set or not 'flash' *} Index: lms/templates/nodegrouplistshort.html diff -u lms/templates/nodegrouplistshort.html:1.6 lms/templates/nodegrouplistshort.html:1.7 --- lms/templates/nodegrouplistshort.html:1.6 Fri Oct 14 18:09:04 2011 +++ lms/templates/nodegrouplistshort.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -40,7 +40,7 @@ Index: lms/templates/nodeinfobox.html diff -u lms/templates/nodeinfobox.html:1.79 lms/templates/nodeinfobox.html:1.80 --- lms/templates/nodeinfobox.html:1.79 Thu Nov 10 07:41:02 2011 +++ lms/templates/nodeinfobox.html Sat Nov 12 21:04:31 2011 @@ -1,4 +1,4 @@ - + Index: lms/templates/ping.html diff -u /dev/null lms/templates/ping.html:1.1 --- /dev/null Sat Nov 12 21:04:31 2011 +++ lms/templates/ping.html Sat Nov 12 21:04:31 2011 @@ -0,0 +1,48 @@ + + + + + + +::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle} :{/if}:: + +{$xajax} + +{if !$part} + + + +{else} + + + +
+
+
{t a="0" b="0" c="0"}Total: $a% ($b/$c){/t}
+
+ + + + + + + {t}Auto Scroll{/t} + +
+
+ +{/if} + Index: lms/templates/rtticketinfoshort.html diff -u lms/templates/rtticketinfoshort.html:1.6 lms/templates/rtticketinfoshort.html:1.7 --- lms/templates/rtticketinfoshort.html:1.6 Fri Oct 14 18:09:05 2011 +++ lms/templates/rtticketinfoshort.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -69,7 +69,7 @@ Index: lms/templates/trafficgraph.html diff -u lms/templates/trafficgraph.html:1.7 lms/templates/trafficgraph.html:1.8 --- lms/templates/trafficgraph.html:1.7 Thu Mar 31 20:19:17 2011 +++ lms/templates/trafficgraph.html Sat Nov 12 21:04:31 2011 @@ -1,5 +1,5 @@ - + @@ -30,7 +30,7 @@ From cvs w lms.org.pl Sat Nov 12 21:04:30 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 12 Nov 2011 21:04:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20111112200430.D926F302A043@eftep.altec.pl> Date: Saturday, November 12, 2011 @ 21:04:30 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - livemap(tm) in LMS ;-) network state is updated asynchronously in real time in phpui->lastonline_limit time periods - we can ping nodes and devices watching results in popups - 5 default base layers for maps Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.396&r2=1.397 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.396 lms/lib/locale/pl/strings.php:1.397 --- lms/lib/locale/pl/strings.php:1.396 Thu Nov 10 04:22:30 2011 +++ lms/lib/locale/pl/strings.php Sat Nov 12 21:04:30 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.396 2011/11/10 03:22:30 chilek Exp $ + * $Id: strings.php,v 1.397 2011/11/12 20:04:30 chilek Exp $ */ $_LANG['$a ($b addresses)'] = '$a ($b adresów)'; @@ -2513,4 +2513,9 @@ $_LANG['Select gps coordinates'] = 'Wybierz współrzędne geograficzne'; $_LANG['Select gps coordinates:'] = 'Wybierz współprzędne geograficzne:'; +$_LANG['$a bytes from $b: icmp_req=$c ttl=$d time=$e ms'] = '$a bajtów od $b: icmp_req=$c ttl=$d czas=$e ms'; +$_LANG['Destination Host Unreachable'] = 'Urządzenie docelowe jest nieosiągalne'; +$_LANG['Total: $a% ($b/$c)'] = 'Razem: $a% ($b/$c)'; +$_LANG['Auto Scroll'] = 'Automatyczne przewijanie'; + ?> From cvs w lms.org.pl Sun Nov 13 00:37:22 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 13 Nov 2011 00:37:22 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (6 files) Message-ID: <20111112233722.2D433302A040@eftep.altec.pl> Date: Sunday, November 13, 2011 @ 00:37:22 Author: chilek Path: /cvsroot/lms/templates Modified: netdevadd.html netdeveditbox.html netdevinfobox.html nodeaddbox.html nodeeditbox.html nodeinfobox.html - fixed gps coordinates popup handler Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevadd.html.diff?&r1=1.33&r2=1.34 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdeveditbox.html.diff?&r1=1.36&r2=1.37 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevinfobox.html.diff?&r1=1.31&r2=1.32 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeaddbox.html.diff?&r1=1.89&r2=1.90 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.93&r2=1.94 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.80&r2=1.81 Index: lms/templates/netdevadd.html diff -u lms/templates/netdevadd.html:1.33 lms/templates/netdevadd.html:1.34 --- lms/templates/netdevadd.html:1.33 Thu Nov 10 04:10:42 2011 +++ lms/templates/netdevadd.html Sun Nov 13 00:37:21 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - + {include file="calendar_js.html"}

{$layout.pagetitle}

@@ -88,11 +88,11 @@
- {t}GPS latitude:{/t} + {t}GPS longitude:{/t} - - »»» + + »»»
- {t}GPS longitude:{/t} + {t}GPS latitude:{/t} - - »»» + + »»»
@@ -87,11 +87,11 @@ @@ -99,11 +99,11 @@ {if $_config.phpui.radius|chkconfig} Index: lms/templates/netdevinfobox.html diff -u lms/templates/netdevinfobox.html:1.31 lms/templates/netdevinfobox.html:1.32 --- lms/templates/netdevinfobox.html:1.31 Thu Nov 10 07:41:01 2011 +++ lms/templates/netdevinfobox.html Sun Nov 13 00:37:21 2011 @@ -1,4 +1,4 @@ - +
- {t}GPS latitude:{/t} + {t}GPS longitude:{/t} - - »»» + + »»»
- {t}GPS longitude:{/t} + {t}GPS latitude:{/t} - - »»» + + »»»
{/if} - {if $netdevinfo.latitude || $netdevinfo.longitude} + {if $netdevinfo.longitude || $netdevinfo.latitude} @@ -106,11 +106,11 @@ {/if} Index: lms/templates/nodeaddbox.html diff -u lms/templates/nodeaddbox.html:1.89 lms/templates/nodeaddbox.html:1.90 --- lms/templates/nodeaddbox.html:1.89 Thu Nov 10 07:41:01 2011 +++ lms/templates/nodeaddbox.html Sun Nov 13 00:37:21 2011 @@ -1,4 +1,4 @@ - +
@@ -88,17 +88,17 @@
- {t}GPS latitude:{/t} + {t}GPS longitude:{/t} - - {$netdevinfo.latitude} + + {$netdevinfo.longitude}
- {t}GPS longitude:{/t} + {t}GPS latitude:{/t} - - {$netdevinfo.longitude} + + {$netdevinfo.latitude}
@@ -138,11 +138,11 @@ {t}Location:{/t} @@ -150,11 +150,11 @@ {t}Location:{/t} Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.93 lms/templates/nodeeditbox.html:1.94 --- lms/templates/nodeeditbox.html:1.93 Thu Nov 10 07:41:01 2011 +++ lms/templates/nodeeditbox.html Sun Nov 13 00:37:21 2011 @@ -1,4 +1,4 @@ - + @@ -134,11 +134,11 @@ {t}GPS coordinates:{/t} @@ -146,11 +146,11 @@ {t}GPS coordinates:{/t} Index: lms/templates/nodeinfobox.html diff -u lms/templates/nodeinfobox.html:1.80 lms/templates/nodeinfobox.html:1.81 --- lms/templates/nodeinfobox.html:1.80 Sat Nov 12 21:04:31 2011 +++ lms/templates/nodeinfobox.html Sun Nov 13 00:37:22 2011 @@ -1,4 +1,4 @@ - +\n"; + } + + $aStyles = $this->_getSections('style'); + if (0 < count($aStyles)) + { +// echo ""; + + $sHash = md5(implode($aStyles)); + $sQuery = $sQueryBase . "xjxGenerateStyle=" . $sHash; + + echo "\n\n"; + } + + $this->bWorking = false; + } + } + + /* + Function: canProcessRequest + + Called by the to determine if this plugin can + process the current request. This will return true when the + requestURI contains an appropriate hash code. + */ + function canProcessRequest() + { + return ('' != $this->sRequest); + } + + function &_getSections($sType) + { + $objPluginManager =& xajaxPluginManager::getInstance(); + + $objPluginManager->configure('deferScriptGeneration', 'deferred'); + + $aSections = array(); + + // buffer output + + ob_start(); + $objPluginManager->generateClientScript(); + $sScript = ob_get_clean(); + + // parse out blocks + + $aParts = explode('', $sScript); + foreach ($aParts as $sPart) + { + $aValues = explode('<' . $sType, $sPart, 2); + if (2 == count($aValues)) + { + list($sJunk, $sPart) = $aValues; + + $aValues = explode('>', $sPart, 2); + if (2 == count($aValues)) + { + list($sJunk, $sPart) = $aValues; + + if (0 < strlen($sPart)) + $aSections[] = $sPart; + } + } + } + + $objPluginManager->configure('deferScriptGeneration', $this->bDeferScriptGeneration); + + return $aSections; + } + + /* + Function: processRequest + + Called by the when the current request should be + processed. This plugin will generate the javascript or style sheet information + that would normally be output by the other xajax plugin objects, when script + deferral is in effect. If script deferral is disabled, this function returns + without performing any functions. + */ + function processRequest() + { + if ($this->canProcessRequest()) + { + $aSections =& $this->_getSections($this->sRequest); + +// echo ""; + + // validate the hash + $sHash = md5(implode($aSections)); + if (false == $this->bValidateHash || $sHash == $this->sHash) + { + $sType = 'text/javascript'; + if ('style' == $this->sRequest) + $sType = 'text/css'; + + $objResponse = new xajaxCustomResponse($sType); + + foreach ($aSections as $sSection) + $objResponse->append($sSection . "\n"); + + $objResponseManager =& xajaxResponseManager::getInstance(); + $objResponseManager->append($objResponse); + + header ('Expires: ' . gmdate('D, d M Y H:i:s', time() + (60*60*24)) . ' GMT'); + + return true; + } + + return 'Invalid script or style request.'; + trigger_error('Hash mismatch: ' . $this->sRequest . ': ' . $sHash . ' <==> ' . $this->sHash, E_USER_ERROR); + } + } +} + +/* + Register the plugin with the xajax plugin manager. +*/ +$objPluginManager =& xajaxPluginManager::getInstance(); +$objPluginManager->registerPlugin(new xajaxScriptPlugin(), 9999); From cvs w lms.org.pl Mon Nov 14 08:51:07 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 14 Nov 2011 08:51:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/xajax/xajax_core (14 files) Message-ID: <20111114075107.CF52C302A040@eftep.altec.pl> Date: Monday, November 14, 2011 @ 08:51:07 Author: chilek Path: /cvsroot/lms/lib/xajax/xajax_core Added: legacy.inc.php xajax.inc.php xajaxArgumentManager.inc.php xajaxCall.inc.php xajaxCompress.inc.php xajaxControl.inc.php xajaxLanguageManager.inc.php xajaxPlugin.inc.php xajaxPluginManager.inc.php xajaxRequest.inc.php xajaxResponse.inc.php xajaxResponseManager.inc.php xajax_lang_de.inc.php xajax_lang_nl.inc.php - ported to xajax 0.5 Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/legacy.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajax.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxArgumentManager.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxCall.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxCompress.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxControl.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxLanguageManager.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxPlugin.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxPluginManager.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxRequest.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxResponse.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajaxResponseManager.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajax_lang_de.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/xajax_lang_nl.inc.php?rev=1.1 Index: lms/lib/xajax/xajax_core/legacy.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/legacy.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/legacy.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,73 @@ +setOutputEntities(true); } + function outputEntitiesOff() { $this->setOutputEntities(false); } + function addConfirmCommands() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'confirmCommands'), $temp); } + function addAssign() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'assign'), $temp); } + function addAppend() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'append'), $temp); } + function addPrepend() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'prepend'), $temp); } + function addReplace() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'replace'), $temp); } + function addClear() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'clear'), $temp); } + function addAlert() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'alert'), $temp); } + function addRedirect() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'redirect'), $temp); } + function addScript() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'script'), $temp); } + function addScriptCall() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'call'), $temp); } + function addRemove() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'remove'), $temp); } + function addCreate() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'create'), $temp); } + function addInsert() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'insert'), $temp); } + function addInsertAfter() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'insertAfter'), $temp); } + function addCreateInput() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'createInput'), $temp); } + function addInsertInput() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'insertInput'), $temp); } + function addInsertInputAfter() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'insertInputAfter'), $temp); } + function addRemoveHandler() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'removeHandler'), $temp); } + function addIncludeScript() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'includeScript'), $temp); } + function addIncludeCSS() { $temp=func_get_args(); return call_user_func_array(array(&$this, 'includeCSS'), $temp); } + function &getXML() { return $this; } +} + +class legacyXajax extends xajax { + function legacyXajax($sRequestURI='', $sWrapperPrefix='xajax_', $sEncoding=XAJAX_DEFAULT_CHAR_ENCODING, $bDebug=false) + { + parent::xajax(); + $this->configure('requestURI', $sRequestURI); + $this->configure('wrapperPrefix', $sWrapperPrefix); + $this->configure('characterEncoding', $sEncoding); + $this->configure('debug', $bDebug); + } + function registerExternalFunction($mFunction, $sInclude) + { + $xuf =& new xajaxUserFunction($mFunction, $sInclude); + $this->register(XAJAX_FUNCTION, $xuf); + } + function registerCatchAllFunction($mFunction) + { + if (is_array($mFunction)) array_shift($mFunction); + $this->register(XAJAX_PROCESSING_EVENT, XAJAX_PROCESSING_EVENT_INVALID, $mFunction); + } + function registerPreFunction($mFunction) + { + if (is_array($mFunction)) array_shift($mFunction); + $this->register(XAJAX_PROCESSING_EVENT, XAJAX_PROCESSING_EVENT_BEFORE, $mFunction); + } + function canProcessRequests() { return $this->canProcessRequest(); } + function processRequests() { return $this->processRequest(); } + function setCallableObject(&$oObject) { return $this->register(XAJAX_CALLABLE_OBJECT, $oObject); } + function debugOn() { return $this->configure('debug',true); } + function debugOff() { return $this->configure('debug',false); } + function statusMessagesOn() { return $this->configure('statusMessages',true); } + function statusMessagesOff() { return $this->configure('statusMessages',false); } + function waitCursorOn() { return $this->configure('waitCursor',true); } + function waitCursorOff() { return $this->configure('waitCursor',false); } + function exitAllowedOn() { return $this->configure('exitAllowed',true); } + function exitAllowedOff() { return $this->configure('exitAllowed',false); } + function errorHandlerOn() { return $this->configure('errorHandler',true); } + function errorHandlerOff() { return $this->configure('errorHandler',false); } + function cleanBufferOn() { return $this->configure('cleanBuffer',true); } + function cleanBufferOff() { return $this->configure('cleanBuffer',false); } + function decodeUTF8InputOn() { return $this->configure('decodeUTF8Input',true); } + function decodeUTF8InputOff() { return $this->configure('decodeUTF8Input',false); } + function outputEntitiesOn() { return $this->configure('outputEntities',true); } + function outputEntitiesOff() { return $this->configure('outputEntities',false); } + function allowBlankResponseOn() { return $this->configure('allowBlankResponse',true); } + function allowBlankResponseOff() { return $this->configure('allowBlankResponse',false); } +} Index: lms/lib/xajax/xajax_core/xajax.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajax.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajax.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,1423 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajax.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Section: Standard Definitions +*/ + +/* + String: XAJAX_DEFAULT_CHAR_ENCODING + + Default character encoding used by both the and + classes. +*/ +if (!defined ('XAJAX_DEFAULT_CHAR_ENCODING')) define ('XAJAX_DEFAULT_CHAR_ENCODING', 'utf-8'); + +/* + String: XAJAX_PROCESSING_EVENT + String: XAJAX_PROCESSING_EVENT_BEFORE + String: XAJAX_PROCESSING_EVENT_AFTER + String: XAJAX_PROCESSING_EVENT_INVALID + + Identifiers used to register processing events. Processing events are essentially + hooks into the xajax core that can be used to add functionality into the request + processing sequence. +*/ +if (!defined ('XAJAX_PROCESSING_EVENT')) define ('XAJAX_PROCESSING_EVENT', 'xajax processing event'); +if (!defined ('XAJAX_PROCESSING_EVENT_BEFORE')) define ('XAJAX_PROCESSING_EVENT_BEFORE', 'beforeProcessing'); +if (!defined ('XAJAX_PROCESSING_EVENT_AFTER')) define ('XAJAX_PROCESSING_EVENT_AFTER', 'afterProcessing'); +if (!defined ('XAJAX_PROCESSING_EVENT_INVALID')) define ('XAJAX_PROCESSING_EVENT_INVALID', 'invalidRequest'); + +/* + Class: xajax + + The xajax class uses a modular plug-in system to facilitate the processing + of special Ajax requests made by a PHP page. It generates Javascript that + the page must include in order to make requests. It handles the output + of response commands (see ). Many flags and settings can be + adjusted to effect the behavior of the xajax class as well as the client-side + javascript. +*/ +class xajax +{ + /**#@+ + * @access protected + */ + + /* + Array: aSettings + + This array is used to store all the configuration settings that are set during + the run of the script. This provides a single data store for the settings + in case we need to return the value of a configuration option for some reason. + + It is advised that individual plugins store a local copy of the settings they + wish to track, however, settings are available via a reference to the + object using getConfiguration>. + */ + var $aSettings; + + /* + Boolean: bErrorHandler + + This is a configuration setting that the main xajax object tracks. It is used + to enable an error handler function which will trap php errors and return them + to the client as part of the response. The client can then display the errors + to the user if so desired. + */ + var $bErrorHandler; + + /* + Array: aProcessingEvents + + Stores the processing event handlers that have been assigned during this run + of the script. + */ + var $aProcessingEvents; + + /* + Boolean: bExitAllowed + + A configuration option that is tracked by the main object. Setting this + to true allows to exit immediatly after processing a xajax request. If + this is set to false, xajax will allow the remaining code and HTML to be sent + as part of the response. Typically this would result in an error, however, + a response processor on the client side could be designed to handle this condition. + */ + var $bExitAllowed; + + /* + Boolean: bCleanBuffer + + A configuration option that is tracked by the main object. Setting this + to true allows to clear out any pending output buffers so that the + is (virtually) the only output when handling a request. + */ + var $bCleanBuffer; + + /* + String: sLogFile + + A configuration setting tracked by the main object. Set the name of the + file on the server that you wish to have php error messages written to during + the processing of requests. + */ + var $sLogFile; + + /* + String: sCoreIncludeOutput + + This is populated with any errors or warnings produced while including the xajax + core components. This is useful for debugging core updates. + */ + var $sCoreIncludeOutput; + + /* + Object: objPluginManager + + This stores a reference to the global + */ + var $objPluginManager; + + /* + Object: objArgumentManager + + Stores a reference to the global + */ + var $objArgumentManager; + + /* + Object: objResponseManager + + Stores a reference to the global + */ + var $objResponseManager; + + /* + Object: objLanguageManager + + Stores a reference to the global + */ + var $objLanguageManager; + + /**#@-*/ + + /* + Constructor: xajax + + Constructs a xajax instance and initializes the plugin system. + + Parameters: + + sRequestURI - (optional): The sRequestURI> to be used + for calls back to the server. If empty, xajax fills in the current + URI that initiated this request. + */ + function xajax($sRequestURI=null, $sLanguage=null) + { + $this->bErrorHandler = false; + $this->aProcessingEvents = array(); + $this->bExitAllowed = true; + $this->bCleanBuffer = true; + $this->sLogFile = ''; + + $this->__wakeup(); + + // The default configuration settings. + $this->configureMany( + array( + 'characterEncoding' => XAJAX_DEFAULT_CHAR_ENCODING, + 'decodeUTF8Input' => false, + 'outputEntities' => false, + 'defaultMode' => 'asynchronous', + 'defaultMethod' => 'POST', // W3C: Method is case sensitive + 'wrapperPrefix' => 'xajax_', + 'debug' => false, + 'verbose' => false, + 'useUncompressedScripts' => false, + 'statusMessages' => false, + 'waitCursor' => true, + 'scriptDeferral' => false, + 'exitAllowed' => true, + 'errorHandler' => false, + 'cleanBuffer' => false, + 'allowBlankResponse' => false, + 'allowAllResponseTypes' => false, + 'generateStubs' => true, + 'logFile' => '', + 'timeout' => 6000, + 'version' => $this->getVersion() + ) + ); + + if (null !== $sRequestURI) + $this->configure('requestURI', $sRequestURI); + else + $this->configure('requestURI', $this->_detectURI()); + + if (null !== $sLanguage) + $this->configure('language', $sLanguage); + + if ('utf-8' != XAJAX_DEFAULT_CHAR_ENCODING) $this->configure("decodeUTF8Input", true); + + } + + /* + Function: __sleep + */ + function __sleep() + { + $aMembers = get_class_vars(get_class($this)); + + if (isset($aMembers['objLanguageManager'])) + unset($aMembers['objLanguageManager']); + + if (isset($aMembers['objPluginManager'])) + unset($aMembers['objPluginManager']); + + if (isset($aMembers['objArgumentManager'])) + unset($aMembers['objArgumentManager']); + + if (isset($aMembers['objResponseManager'])) + unset($aMembers['objResponseManager']); + + if (isset($aMembers['sCoreIncludeOutput'])) + unset($aMembers['sCoreIncludeOutput']); + + return array_keys($aMembers); + } + + /* + Function: __wakeup + */ + function __wakeup() + { + ob_start(); + + $sLocalFolder = dirname(__FILE__); + +//SkipAIO + require $sLocalFolder . '/xajaxPluginManager.inc.php'; + require $sLocalFolder . '/xajaxLanguageManager.inc.php'; + require $sLocalFolder . '/xajaxArgumentManager.inc.php'; + require $sLocalFolder . '/xajaxResponseManager.inc.php'; + require $sLocalFolder . '/xajaxRequest.inc.php'; + require $sLocalFolder . '/xajaxResponse.inc.php'; +//EndSkipAIO + + // this is the list of folders where xajax will look for plugins + // that will be automatically included at startup. + $aPluginFolders = array(); + $aPluginFolders[] = dirname($sLocalFolder) . '/xajax_plugins'; + +//SkipAIO + $aPluginFolders[] = $sLocalFolder . '/plugin_layer'; +//EndSkipAIO + + // Setup plugin manager + $this->objPluginManager =& xajaxPluginManager::getInstance(); + $this->objPluginManager->loadPlugins($aPluginFolders); + + $this->objLanguageManager =& xajaxLanguageManager::getInstance(); + $this->objArgumentManager =& xajaxArgumentManager::getInstance(); + $this->objResponseManager =& xajaxResponseManager::getInstance(); + + $this->sCoreIncludeOutput = ob_get_clean(); + } + + /* + Function: getGlobalResponse + + Returns the object preconfigured with the encoding + and entity settings from this instance of . This is used + for singleton-pattern response development. + + Returns: + + : A object which can be used to return + response commands. See also the class. + */ + function &getGlobalResponse() + { + static $obj; + if (!$obj) { + $obj = new xajaxResponse(); + } + return $obj; + } + + /* + Function: getVersion + + Returns: + + string : The current xajax version. + */ + function getVersion() + { + return 'xajax 0.5'; + } + + /* + Function: register + + Call this function to register request handlers, including functions, + callable objects and events. New plugins can be added that support + additional registration methods and request processors. + + + Parameters: + + $sType - (string): Type of request handler being registered; standard + options include: + XAJAX_FUNCTION: a function declared at global scope. + XAJAX_CALLABLE_OBJECT: an object who's methods are to be registered. + XAJAX_EVENT: an event which will cause zero or more event handlers + to be called. + XAJAX_EVENT_HANDLER: register an event handler function. + + $sFunction || $objObject || $sEvent - (mixed): + when registering a function, this is the name of the function + when registering a callable object, this is the object being registered + when registering an event or event handler, this is the name of the event + + $sIncludeFile || $aCallOptions || $sEventHandler + when registering a function, this is the (optional) include file. + when registering a callable object, this is an (optional) array + of call options for the functions being registered. + when registering an event handler, this is the name of the function. + */ + function register($sType, $mArg) + { + $aArgs = func_get_args(); + $nArgs = func_num_args(); + + if (2 < $nArgs) + { + if (XAJAX_PROCESSING_EVENT == $aArgs[0]) + { + $sEvent = $aArgs[1]; + $xuf =& $aArgs[2]; + + if (false == is_a($xuf, 'xajaxUserFunction')) + $xuf = new xajaxUserFunction($xuf); + + $this->aProcessingEvents[$sEvent] =& $xuf; + + return true; + } + } + + if (1 < $nArgs) + { + // for php4 + $aArgs[1] =& $mArg; + } + + return $this->objPluginManager->register($aArgs); + } + + /* + Function: configure + + Call this function to set options that will effect the processing of + xajax requests. Configuration settings can be specific to the xajax + core, request processor plugins and response plugins. + + + Parameters: + + Options include: + javascript URI - (string): The path to the folder that contains the + xajax javascript files. + errorHandler - (boolean): true to enable the xajax error handler, see + bErrorHandler> + exitAllowed - (boolean): true to allow xajax to exit after processing + a request. See bExitAllowed> for more information. + */ + function configure($sName, $mValue) + { + if ('errorHandler' == $sName) { + if (true === $mValue || false === $mValue) + $this->bErrorHandler = $mValue; + } else if ('exitAllowed' == $sName) { + if (true === $mValue || false === $mValue) + $this->bExitAllowed = $mValue; + } else if ('cleanBuffer' == $sName) { + if (true === $mValue || false === $mValue) + $this->bCleanBuffer = $mValue; + } else if ('logFile' == $sName) { + $this->sLogFile = $mValue; + } + + $this->objLanguageManager->configure($sName, $mValue); + $this->objArgumentManager->configure($sName, $mValue); + $this->objPluginManager->configure($sName, $mValue); + $this->objResponseManager->configure($sName, $mValue); + + $this->aSettings[$sName] = $mValue; + } + + /* + Function: configureMany + + Set an array of configuration options. + + Parameters: + + $aOptions - (array): Associative array of configuration settings + */ + function configureMany($aOptions) + { + foreach ($aOptions as $sName => $mValue) + $this->configure($sName, $mValue); + } + + /* + Function: getConfiguration + + Get the current value of a configuration setting that was previously set + via configure> or configureMany> + + Parameters: + + $sName - (string): The name of the configuration setting + + Returns: + + $mValue : (mixed): The value of the setting if set, null otherwise. + */ + function getConfiguration($sName) + { + if (isset($this->aSettings[$sName])) + return $this->aSettings[$sName]; + return NULL; + } + + /* + Function: canProcessRequest + + Determines if a call is a xajax request or a page load request. + + Return: + + boolean - True if this is a xajax request, false otherwise. + */ + function canProcessRequest() + { + return $this->objPluginManager->canProcessRequest(); + } + + /* + Function: processRequest + + If this is a xajax request (see canProcessRequest>), call the + requested PHP function, build the response and send it back to the + browser. + + This is the main server side engine for xajax. It handles all the + incoming requests, including the firing of events and handling of the + response. If your RequestURI is the same as your web page, then this + function should be called before ANY headers or HTML is output from + your script. + + This function may exit, if a request is processed. See bAllowExit> + */ + function processRequest() + { +//SkipDebug + // Check to see if headers have already been sent out, in which case we can't do our job + if (headers_sent($filename, $linenumber)) { + echo "Output has already been sent to the browser at {$filename}:{$linenumber}.\n"; + echo 'Please make sure the command $xajax->processRequest() is placed before this.'; + exit(); + } +//EndSkipDebug + + if ($this->canProcessRequest()) + { + // Use xajax error handler if necessary + if ($this->bErrorHandler) { + $GLOBALS['xajaxErrorHandlerText'] = ""; + set_error_handler("xajaxErrorHandler"); + } + + $mResult = true; + + // handle beforeProcessing event + if (isset($this->aProcessingEvents[XAJAX_PROCESSING_EVENT_BEFORE])) + { + $bEndRequest = false; + $this->aProcessingEvents[XAJAX_PROCESSING_EVENT_BEFORE]->call(array(&$bEndRequest)); + $mResult = (false === $bEndRequest); + } + + if (true === $mResult) + $mResult = $this->objPluginManager->processRequest(); + + if (true === $mResult) + { + if ($this->bCleanBuffer) { + $er = error_reporting(0); + while (ob_get_level() > 0) ob_end_clean(); + error_reporting($er); + } + + // handle afterProcessing event + if (isset($this->aProcessingEvents[XAJAX_PROCESSING_EVENT_AFTER])) + { + $bEndRequest = false; + $this->aProcessingEvents[XAJAX_PROCESSING_EVENT_AFTER]->call(array(&$bEndRequest)); + if (true === $bEndRequest) + { + $this->objResponseManager->clear(); + $this->objResponseManager->append($aResult[1]); + } + } + } + else if (is_string($mResult)) + { + if ($this->bCleanBuffer) { + $er = error_reporting(0); + while (ob_get_level() > 0) ob_end_clean(); + error_reporting($er); + } + + // $mResult contains an error message + // the request was missing the cooresponding handler function + // or an error occurred while attempting to execute the + // handler. replace the response, if one has been started + // and send a debug message. + + $this->objResponseManager->clear(); + $this->objResponseManager->append(new xajaxResponse()); + + // handle invalidRequest event + if (isset($this->aProcessingEvents[XAJAX_PROCESSING_EVENT_INVALID])) + $this->aProcessingEvents[XAJAX_PROCESSING_EVENT_INVALID]->call(); + else + $this->objResponseManager->debug($mResult); + } + + if ($this->bErrorHandler) { + $sErrorMessage = $GLOBALS['xajaxErrorHandlerText']; + if (!empty($sErrorMessage)) { + if (0 < strlen($this->sLogFile)) { + $fH = @fopen($this->sLogFile, "a"); + if (NULL != $fH) { + fwrite( + $fH, + $this->objLanguageManager->getText('LOGHDR:01') + . strftime("%b %e %Y %I:%M:%S %p") + . $this->objLanguageManager->getText('LOGHDR:02') + . $sErrorMessage + . $this->objLanguageManager->getText('LOGHDR:03') + ); + fclose($fH); + } else { + $this->objResponseManager->debug( + $this->objLanguageManager->getText('LOGERR:01') + . $this->sLogFile + ); + } + } + $this->objResponseManager->debug( + $this->objLanguageManager->getText('LOGMSG:01') + . $sErrorMessage + ); + } + } + + $this->objResponseManager->send(); + + if ($this->bErrorHandler) restore_error_handler(); + + if ($this->bExitAllowed) exit(); + } + } + + /* + Function: printJavascript + + Prints the xajax Javascript header and wrapper code into your page. + This should be used to print the javascript code between the HEAD + and /HEAD tags at the top of the page. + + The javascript code output by this function is dependent on the plugins + that are included and the functions that are registered. + + Parameters: + + $sJsURI - (string, optional, deprecated): the path to the xajax javascript file(s) + + This option is deprecated and will be removed in future versions; instead + please use configure> with the option name 'javascript URI' + $aJsFiles - (array, optional, deprecated): an array of xajax javascript files + that will be loaded via SCRIPT tags. This option is deprecated and will + be removed in future versions; please use configure> with the + option name 'javascript files' instead. + */ + function printJavascript($sJsURI="", $aJsFiles=array()) + { + if (0 < strlen($sJsURI)) + $this->configure("javascript URI", $sJsURI); + + if (0 < count($aJsFiles)) + $this->configure("javascript files", $aJsFiles); + + $this->objPluginManager->generateClientScript(); + } + + /* + Function: getJavascript + + See printJavascript> for more information. + */ + function getJavascript($sJsURI='', $aJsFiles=array()) + { + ob_start(); + $this->printJavascript($sJsURI, $aJsFiles); + return ob_get_clean(); + } + + /* + Function: autoCompressJavascript + + Creates a new xajax_core, xajax_debug, etc... file out of the + _uncompressed file with a similar name. This strips out the + comments and extraneous whitespace so the file is as small as + possible without modifying the function of the code. + + Parameters: + + sJsFullFilename - (string): The relative path and name of the file + to be compressed. + bAlways - (boolean): Compress the file, even if it already exists. + */ + function autoCompressJavascript($sJsFullFilename=NULL, $bAlways=false) + { + $sJsFile = 'xajax_js/xajax_core.js'; + + if ($sJsFullFilename) { + $realJsFile = $sJsFullFilename; + } + else { + $realPath = realpath(dirname(dirname(__FILE__))); + $realJsFile = $realPath . '/'. $sJsFile; + } + + // Create a compressed file if necessary + if (!file_exists($realJsFile) || true == $bAlways) { + $srcFile = str_replace('.js', '_uncompressed.js', $realJsFile); + if (!file_exists($srcFile)) { + trigger_error( + $this->objLanguageManager->getText('CMPRSJS:RDERR:01') + . dirname($realJsFile) + . $this->objLanguageManager->getText('CMPRSJS:RDERR:02') + , E_USER_ERROR + ); + } + require_once(dirname(__FILE__) . '/xajaxCompress.inc.php'); + $javaScript = implode('', file($srcFile)); + $compressedScript = xajaxCompressFile($javaScript); + $fH = @fopen($realJsFile, 'w'); + if (!$fH) { + trigger_error( + $this->objLanguageManager->getText('CMPRSJS:WTERR:01') + . dirname($realJsFile) + . $this->objLanguageManager->getText('CMPRSJS:WTERR:02') + , E_USER_ERROR + ); + } + else { + fwrite($fH, $compressedScript); + fclose($fH); + } + } + } + + function _compressSelf($sFolder=null) + { + if (null == $sFolder) + $sFolder = dirname(dirname(__FILE__)); + + require_once(dirname(__FILE__) . '/xajaxCompress.inc.php'); + + if ($handle = opendir($sFolder)) { + while (!(false === ($sName = readdir($handle)))) { + if ('.' != $sName && '..' != $sName && is_dir($sFolder . '/' . $sName)) { + $this->_compressSelf($sFolder . '/' . $sName); + } else if (8 < strlen($sName) && 0 == strpos($sName, '.compressed')) { + if ('.inc.php' == substr($sName, strlen($sName) - 8, 8)) { + $sName = substr($sName, 0, strlen($sName) - 8); + $sPath = $sFolder . '/' . $sName . '.inc.php'; + if (file_exists($sPath)) { + + $aParsed = array(); + $aFile = file($sPath); + $nSkip = 0; + foreach (array_keys($aFile) as $sKey) + if ('//SkipDebug' == $aFile[$sKey]) + ++$nSkip; + else if ('//EndSkipDebug' == $aFile[$sKey]) + --$nSkip; + else if (0 == $nSkip) + $aParsed[] = $aFile[$sKey]; + unset($aFile); + + $compressedScript = xajaxCompressFile(implode('', $aParsed)); + + $sNewPath = $sPath; + $fH = @fopen($sNewPath, 'w'); + if (!$fH) { + trigger_error( + $this->objLanguageManager->getText('CMPRSPHP:WTERR:01') + . $sNewPath + . $this->objLanguageManager->getText('CMPRSPHP:WTERR:02') + , E_USER_ERROR + ); + } + else { + fwrite($fH, $compressedScript); + fclose($fH); + } + } + } + } + } + + closedir($handle); + } + } + + function _compile($sFolder=null, $bWriteFile=true) + { + if (null == $sFolder) + $sFolder = dirname(__FILE__); + + require_once(dirname(__FILE__) . '/xajaxCompress.inc.php'); + + $aOutput = array(); + + if ($handle = opendir($sFolder)) { + while (!(false === ($sName = readdir($handle)))) { + if ('.' != $sName && '..' != $sName && is_dir($sFolder . '/' . $sName)) { + $aOutput[] = $this->_compile($sFolder . '/' . $sName, false); + } else if (8 < strlen($sName)) { + if ('.inc.php' == substr($sName, strlen($sName) - 8, 8)) { + $sName = substr($sName, 0, strlen($sName) - 8); + $sPath = $sFolder . '/' . $sName . '.inc.php'; + if ( + 'xajaxAIO' != $sName && + 'legacy' != $sName && + 'xajaxCompress' != $sName + ) { + if (file_exists($sPath)) { + + $aParsed = array(); + $aFile = file($sPath); + $nSkip = 0; + foreach (array_keys($aFile) as $sKey) + if ('//SkipDebug' == substr($aFile[$sKey], 0, 11)) + ++$nSkip; + else if ('//EndSkipDebug' == substr($aFile[$sKey], 0, 14)) + --$nSkip; + else if ('//SkipAIO' == substr($aFile[$sKey], 0, 9)) + ++$nSkip; + else if ('//EndSkipAIO' == substr($aFile[$sKey], 0, 12)) + --$nSkip; + else if ('<'.'?php' == substr($aFile[$sKey], 0, 5)) {} + else if ('?'.'>' == substr($aFile[$sKey], 0, 2)) {} + else if (0 == $nSkip) + $aParsed[] = $aFile[$sKey]; + unset($aFile); + + $aOutput[] = xajaxCompressFile(implode('', $aParsed)); + } + } + } + } + } + + closedir($handle); + } + + if ($bWriteFile) + { + $fH = @fopen($sFolder . '/xajaxAIO.inc.php', 'w'); + if (!$fH) { + trigger_error( + $this->objLanguageManager->getText('CMPRSAIO:WTERR:01') + . $sFolder + . $this->objLanguageManager->getText('CMPRSAIO:WTERR:02') + , E_USER_ERROR + ); + } + else { + fwrite($fH, '<'.'?php '); + fwrite($fH, implode('', $aOutput)); + fclose($fH); + } + } + + return implode('', $aOutput); + } + + /* + Function: _detectURI + + Returns the current requests URL based upon the SERVER vars. + + Returns: + + string : The URL of the current request. + */ + function _detectURI() { + $aURL = array(); + + // Try to get the request URL + if (!empty($_SERVER['REQUEST_URI'])) { + + $_SERVER['REQUEST_URI'] = str_replace( + array('"',"'",'<','>'), + array('%22','%27','%3C','%3E'), + $_SERVER['REQUEST_URI'] + ); + + $aURL = parse_url($_SERVER['REQUEST_URI']); + } + + // Fill in the empty values + if (empty($aURL['scheme'])) { + if (!empty($_SERVER['HTTP_SCHEME'])) { + $aURL['scheme'] = $_SERVER['HTTP_SCHEME']; + } else { + $aURL['scheme'] = + (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') + ? 'https' + : 'http'; + } + } + + if (empty($aURL['host'])) { + if (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) { + if (strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ':') > 0) { + list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_X_FORWARDED_HOST']); + } else { + $aURL['host'] = $_SERVER['HTTP_X_FORWARDED_HOST']; + } + } else if (!empty($_SERVER['HTTP_HOST'])) { + if (strpos($_SERVER['HTTP_HOST'], ':') > 0) { + list($aURL['host'], $aURL['port']) = explode(':', $_SERVER['HTTP_HOST']); + } else { + $aURL['host'] = $_SERVER['HTTP_HOST']; + } + } else if (!empty($_SERVER['SERVER_NAME'])) { + $aURL['host'] = $_SERVER['SERVER_NAME']; + } else { + echo $this->objLanguageManager->getText('DTCTURI:01'); + echo $this->objLanguageManager->getText('DTCTURI:02'); + exit(); + } + } + + if (empty($aURL['port']) && !empty($_SERVER['SERVER_PORT'])) { + $aURL['port'] = $_SERVER['SERVER_PORT']; + } + + if (!empty($aURL['path'])) + if (0 == strlen(basename($aURL['path']))) + unset($aURL['path']); + + if (empty($aURL['path'])) { + $sPath = array(); + if (!empty($_SERVER['PATH_INFO'])) { + $sPath = parse_url($_SERVER['PATH_INFO']); + } else { + $sPath = parse_url($_SERVER['PHP_SELF']); + } + if (isset($sPath['path'])) + $aURL['path'] = str_replace(array('"',"'",'<','>'), array('%22','%27','%3C','%3E'), $sPath['path']); + unset($sPath); + } + + if (empty($aURL['query']) && !empty($_SERVER['QUERY_STRING'])) { + $aURL['query'] = $_SERVER['QUERY_STRING']; + } + + if (!empty($aURL['query'])) { + $aURL['query'] = '?'.$aURL['query']; + } + + // Build the URL: Start with scheme, user and pass + $sURL = $aURL['scheme'].'://'; + if (!empty($aURL['user'])) { + $sURL.= $aURL['user']; + if (!empty($aURL['pass'])) { + $sURL.= ':'.$aURL['pass']; + } + $sURL.= '@'; + } + + // Add the host + $sURL.= $aURL['host']; + + // Add the port if needed + if (!empty($aURL['port']) + && (($aURL['scheme'] == 'http' && $aURL['port'] != 80) + || ($aURL['scheme'] == 'https' && $aURL['port'] != 443))) { + $sURL.= ':'.$aURL['port']; + } + + // Add the path and the query string + $sURL.= $aURL['path'].@$aURL['query']; + + // Clean up + unset($aURL); + + $aURL = explode("?", $sURL); + + if (1 < count($aURL)) + { + $aQueries = explode("&", $aURL[1]); + + foreach ($aQueries as $sKey => $sQuery) + { + if ("xjxGenerate" == substr($sQuery, 0, 11)) + unset($aQueries[$sKey]); + } + + $sQueries = implode("&", $aQueries); + + $aURL[1] = $sQueries; + + $sURL = implode("?", $aURL); + } + + return $sURL; + } + + + /* + Deprecated functions + */ + + /* + Function: setCharEncoding + + Sets the character encoding that will be used for the HTTP output. + Typically, you will not need to use this method since the default + character encoding can be configured using the constant + . + + Parameters: + + sEncoding - (string): The encoding to use. + - examples include (UTF-8, ISO-8859-1) + + Note: + deprecated : This function will be removed in future versions. Please + use configure> instead. + */ + function setCharEncoding($sEncoding) + { + $this->configure('characterEncoding', $sEncoding); + } + + /* + Function: getCharEncoding + + Returns the current character encoding. See also setCharEncoding> + and + + Returns: + + string : The character encoding. + + Note: + deprecated : This function will be removed in future versions. Please + use getConfiguration> instead. + */ + function getCharEncoding() + { + return $this->getConfiguration('characterEncoding'); + } + + /* + Function: setFlags + + Sets a series of flags. See also, setFlag>. + + Parameters: + + flags - (array): An associative array containing the name of the flag + and the value to set. + + Note: + deprecated : This function will be removed in future versions. Please + use configureMany> instead. + */ + function setFlags($flags) + { + foreach ($flags as $name => $value) { + $this->configure($name, $value); + } + } + + /* + Function: setFlag + + Sets a single flag (boolean true or false). + + Available flags are as follows (flag, default value): + - debug, false + - verbose, false + - statusMessages, false + - waitCursor, true + - scriptDeferral, false + - exitAllowed, true + - errorHandler, false + - cleanBuffer, false + - decodeUTF8Input, false + - outputEntities, false + - allowBlankResponse, false + - allowAllResponseTypes, false + - generateStubs, true + + Parameters: + + name - (string): The name of the flag to set. + value - (boolean): The value to set. + + Note: + + deprecated : This function will be removed in future versions. Please + use configure> instead. + */ + function setFlag($name, $value) + { + $this->configure($name, $value); + + } + + /* + Function: getFlag + + Returns the current value of the flag. See also setFlag>. + + Parameters: + + name - (string): The name of the flag. + + Returns: + + boolean : The value currently associated with the flag. + + Note: + deprecated : This function will be removed in future versions. Instead, + use getConfiguration>. + */ + function getFlag($name) + { + return $this->getConfiguration($name); + } + + /* + Function: setRequestURI + + Sets the URI to which requests will be sent. + + Parameters: + + sRequestURI - (string): The URI + + Note: + + $xajax->setRequestURI("http://www.xajaxproject.org"); + + deprecated : This function will be removed in future versions. Please + use configure> instead. + */ + function setRequestURI($sRequestURI) + { + $this->configure('requestURI', $sRequestURI); + } + + /* + Function: getRequestURI + + Returns: + + string : The current request URI that will be configured on the client + side. This is the default URI for all requests made from the current + page. See setRequestURI>. + + Note: + deprecated : This function will be removed in future versions. Please + use getConfiguration> instead. + */ + function getRequestURI() + { + return $this->getConfiguration('requestURI'); + } + + /* + Function: setDefaultMode + + Sets the default mode for requests from the browser. + + Parameters: + + sDefaultMode - (string): The mode to set as the default. + + - 'synchronous' + - 'asynchronous' + + Note: + deprecated : This function will be removed in future versions. Please + use configure> instead. + */ + function setDefaultMode($sDefaultMode) + { + $this->configure('defaultMode', $sDefaultMode); + } + + /* + Function: getDefaultMode + + Get the default request mode that will be used by the browser + for submitting requests to the server. See also setDefaultMode> + + Returns: + + string - The default mode to be used by the browser for each + request. + + Note: + deprecated : This function will be removed in future versions. Please + use getConfiguration> instead. + */ + function getDefaultMode() + { + return $this->getConfiguration('defaultMode'); + } + + /* + Function: setDefaultMethod + + Sets the default method for making xajax requests. + + Parameters: + + sMethod - (string): The name of the method. + + - 'GET' + - 'POST' + Note: + deprecated : This function will be removed in future versions. Please + use configure> instead. + */ + function setDefaultMethod($sMethod) + { + $this->configure('defaultMethod', $sMethod); + } + + /* + Function: getDefaultMethod + + Gets the default method for making xajax requests. + + Returns: + + string - The current method configured. + + Note: + deprecated : This function will be removed in future versions. Please + use getConfiguration> instead. + */ + function getDefaultMethod() + { + return $this->getConfiguration('defaultMethod'); + } + + /* + Function: setWrapperPrefix + + Sets the prefix that will be prepended to the javascript wrapper + functions. This allows a little flexibility in setting the naming + for the wrapper functions. + + Parameters: + + sPrefix - (string): The prefix to be used. + - default is 'xajax_' + + Note: + deprecated : This function will be removed in future versions. Please + use configure> instead. + */ + function setWrapperPrefix($sPrefix) + { + $this->configure('wrapperPrefix', $sPrefix); + } + + /* + Function: getWrapperPrefix + + Gets the current javascript wrapper prefix. See also, setWrapperPrefix> + + Returns: + + string - The current wrapper prefix. + + Note: + deprecated : This function will be removed in future versions. Please + use getConfiguration> instead. + */ + function getWrapperPrefix() + { + return $this->getConfiguration('wrapperPrefix'); + } + + /* + Function: setLogFile + + Specifies a log file that will be written to by xajax during a + request. This is only used by the error handling system at this + point. If you do not invoke this method or you pass in an empty + string, then no log file will be written to. + + Parameters: + + sFilename - (string): The full or reletive path to the log file. + + Note: + deprecated : This function will be removed in future versions. Please + use configure> instead. + */ + function setLogFile($sFilename) + { + $this->configure('logFile', $sFilename); + } + + /* + Function: getLogFile + + Returns the current log file path. See also setLogFile>. + + Returns: + + string : The log file path. + + Note: + deprecated : This function will be removed in future versions. Please + use getConfiguration> instead. + */ + function getLogFile() + { + return $this->getConfiguration('logFile'); + } + + /* + Function: registerFunction + + Registers a PHP function or method with the xajax request processor. This + makes the function available to the browser via an asynchronous + (or synchronous) javascript call. + + Parameters: + + mFunction - (string or array): The string containing the function name + or an array containing the following: + - (string) The function name as it will be called from javascript. + - (object, by reference) A reference to an instance of a class + containing the specified function. + - (string) The function as it is found in the class passed in the second + parameter. + sIncludeFile - (string, optional): The server path to the PHP file to + include when calling this function. This will enable xajax to load + only the include file that is needed for this function call, thus + reducing server load. + + Note: + deprecated : This function will be removed in future versions. Please + use register> instead. + */ + function registerFunction($mFunction, $sIncludeFile=null) + { + $xuf = new xajaxUserFunction($mFunction, $sIncludeFile); + return $this->register(XAJAX_FUNCTION, $xuf); + } + + /* + Function: registerCallableObject + + Registers an object whose methods will be searched for a match to the + incoming request. If more than one callable object is registered, the + first on that contains the requested method will be used. + + Parameters: + + oObject - (object, by reference): The object whose methods will be + registered. + + Note: + deprecated : This function will be removed in future versions. Please + use register> instead. + */ + function registerCallableObject(&$oObject) + { + $mResult = false; + + if (0 > version_compare(PHP_VERSION, '5.0')) + // for PHP4; using eval because PHP5 will complain it is deprecated + eval('$mResult = $this->register(XAJAX_CALLABLE_OBJECT, &$oObject);'); + else + // for PHP5 + $mResult = $this->register(XAJAX_CALLABLE_OBJECT, $oObject); + + return $mResult; + } + + /* + Function: registerEvent + + Assigns a callback function with the specified xajax event. Events + are triggered during the processing of a request. + + List: Available events: + - beforeProcessing: triggered before the request is processed. + - afterProcessing: triggered after the request is processed. + - invalidRequest: triggered if no matching function/method is found. + + Parameters: + + mCallback - (function): The function or object callback to be assigned. + sEventName - (string): The name of the event. + + Note: + deprecated : This function will be removed in future versions. Please + use register> instead. + */ + function registerEvent($sEventName, $mCallback) + { + $this->register(XAJAX_PROCESSING_EVENT, $sEventName, $mCallback); + } + +} + +/* + Section: Global functions +*/ + +/* + Function xajaxErrorHandler + + This function is registered with PHP's set_error_handler if the xajax + error handling system is enabled. + + See bUserErrorHandler> +*/ +function xajaxErrorHandler($errno, $errstr, $errfile, $errline) +{ + $errorReporting = error_reporting(); + if (($errno & $errorReporting) == 0) return; + + if ($errno == E_NOTICE) { + $errTypeStr = 'NOTICE'; + } + else if ($errno == E_WARNING) { + $errTypeStr = 'WARNING'; + } + else if ($errno == E_USER_NOTICE) { + $errTypeStr = 'USER NOTICE'; + } + else if ($errno == E_USER_WARNING) { + $errTypeStr = 'USER WARNING'; + } + else if ($errno == E_USER_ERROR) { + $errTypeStr = 'USER FATAL ERROR'; + } + else if (defined('E_STRICT') && $errno == E_STRICT) { + return; + } + else { + $errTypeStr = 'UNKNOWN: ' . $errno; + } + + $sCrLf = "\n"; + + ob_start(); + echo $GLOBALS['xajaxErrorHandlerText']; + echo $sCrLf; + echo '----'; + echo $sCrLf; + echo '['; + echo $errTypeStr; + echo '] '; + echo $errstr; + echo $sCrLf; + echo 'Error on line '; + echo $errline; + echo ' of file '; + echo $errfile; + $GLOBALS['xajaxErrorHandlerText'] = ob_get_clean(); +} + Index: lms/lib/xajax/xajax_core/xajaxArgumentManager.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxArgumentManager.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxArgumentManager.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,466 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxArgumentManager.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +if (!defined('XAJAX_METHOD_UNKNOWN')) define('XAJAX_METHOD_UNKNOWN', 0); +if (!defined('XAJAX_METHOD_GET')) define('XAJAX_METHOD_GET', 1); +if (!defined('XAJAX_METHOD_POST')) define('XAJAX_METHOD_POST', 2); + +/* + Class: xajaxArgumentManager + + This class processes the input arguments from the GET or POST data of + the request. If this is a request for the initial page load, no arguments + will be processed. During a xajax request, any arguments found in the + GET or POST will be converted to a PHP array. +*/ +class xajaxArgumentManager +{ + /* + Array: aArgs + + An array of arguments received via the GET or POST parameter + xjxargs. + */ + var $aArgs; + + /* + Boolean: bDecodeUTF8Input + + A configuration option used to indicate whether input data should be + UTF8 decoded automatically. + */ + var $bDecodeUTF8Input; + + /* + String: sCharacterEncoding + + The character encoding in which the input data will be received. + */ + var $sCharacterEncoding; + + /* + Integer: nMethod + + Stores the method that was used to send the arguments from the client. Will + be one of: XAJAX_METHOD_UNKNOWN, XAJAX_METHOD_GET, XAJAX_METHOD_POST + */ + var $nMethod; + + /* + Array: aSequence + + Stores the decoding sequence table. + */ + var $aSequence; + + /* + Function: convertStringToBool + + Converts a string to a bool var. + + Parameters: + $sValue - (string): + + Returns: + (bool) : true / false + + */ + + function convertStringToBool($sValue) + { + if (0 == strcasecmp($sValue, 'true')) + return true; + if (0 == strcasecmp($sValue, 'false')) + return false; + if (is_numeric($sValue)) + { + if (0 == $sValue) + return false; + return true; + } + return false; + } + + function argumentStripSlashes(&$sArg) + { + if (false == is_string($sArg)) + return; + + $sArg = stripslashes($sArg); + } + + function argumentDecodeXML(&$sArg) + { + if (false == is_string($sArg)) + return; + + if (0 == strlen($sArg)) + return; + + $nStackDepth = 0; + $aStack = array(); + $aArg = array(); + + $nCurrent = 0; + $nLast = 0; + $aExpecting = array(); + $nFound = 0; + list($aExpecting, $nFound) = $this->aSequence['start']; + + $nLength = strlen($sArg); + + $sKey = ''; + $mValue = ''; + + while ($nCurrent < $nLength) + { + $bFound = false; + + foreach ($aExpecting as $sExpecting => $nExpectedLength) + { + if ($sArg[$nCurrent] == $sExpecting[0]) + { + if ($sExpecting == substr($sArg, $nCurrent, $nExpectedLength)) + { + list($aExpecting, $nFound) = $this->aSequence[$sExpecting]; + + switch ($nFound) + { + case 3: // k + $sKey = ''; + break; + case 4: // /k + $sKey = str_replace( + array('<'.'![CDATA[', ']]>'), + '', + substr($sArg, $nLast, $nCurrent - $nLast) + ); + break; + case 5: // v + $mValue = ''; + break; + case 6: // /v + if ($nLast < $nCurrent) + { + $mValue = str_replace( + array('<'.'![CDATA[', ']]>'), + '', + substr($sArg, $nLast, $nCurrent - $nLast) + ); + + $cType = substr($mValue, 0, 1); + $sValue = substr($mValue, 1); + switch ($cType) { + case 'S': $mValue = false === $sValue ? '' : $sValue; break; + case 'B': $mValue = $this->convertStringToBool($sValue); break; + case 'N': $mValue = floatval($sValue); break; + case '*': $mValue = null; break; + } + } + break; + case 7: // /e + $aArg[$sKey] = $mValue; + break; + case 1: // xjxobj + ++$nStackDepth; + array_push($aStack, $aArg); + $aArg = array(); + array_push($aStack, $sKey); + $sKey = ''; + break; + case 8: // /xjxobj + if (1 < $nStackDepth) { + $mValue = $aArg; + $sKey = array_pop($aStack); + $aArg = array_pop($aStack); + --$nStackDepth; + } else { + $sArg = $aArg; + return; + } + break; + } + $nCurrent += $nExpectedLength; + $nLast = $nCurrent; + $bFound = true; + break; + } + } + } + + if (false == $bFound) + { + if (0 == $nCurrent) + { + $sArg = str_replace( + array('<'.'![CDATA[', ']]>'), + '', + $sArg + ); + + $cType = substr($sArg, 0, 1); + $sValue = substr($sArg, 1); + switch ($cType) { + case 'S': $sArg = false === $sValue ? '' : $sValue; break; + case 'B': $sArg = $this->convertStringToBool($sValue); break; + case 'N': $sArg = floatval($sValue); break; + case '*': $sArg = null; break; + } + + return; + } + +// for larger arg data, performance may suffer using concatenation +// $sText .= $sArg[$nCurrent]; + $nCurrent++; + } + } + + $objLanguageManager =& xajaxLanguageManager::getInstance(); + + trigger_error( + $objLanguageManager->getText('ARGMGR:ERR:01') + . $sExpecting + . $objLanguageManager->getText('ARGMGR:ERR:02') + . $sArg + , E_USER_ERROR + ); + } + + function argumentDecodeUTF8_iconv(&$mArg) + { + if (is_array($mArg)) + { + foreach (array_keys($mArg) as $sKey) + { + $sNewKey = $sKey; + $this->argumentDecodeUTF8_iconv($sNewKey); + + if ($sNewKey != $sKey) + { + $mArg[$sNewKey] = $mArg[$sKey]; + unset($mArg[$sKey]); + $sKey = $sNewKey; + } + + $this->argumentDecodeUTF8_iconv($mArg[$sKey]); + } + } + else if (is_string($mArg)) + $mArg = iconv("UTF-8", $this->sCharacterEncoding.'//TRANSLIT', $mArg); + } + + function argumentDecodeUTF8_mb_convert_encoding(&$mArg) + { + if (is_array($mArg)) + { + foreach (array_keys($mArg) as $sKey) + { + $sNewKey = $sKey; + $this->argumentDecodeUTF8_mb_convert_encoding($sNewKey); + + if ($sNewKey != $sKey) + { + $mArg[$sNewKey] = $mArg[$sKey]; + unset($mArg[$sKey]); + $sKey = $sNewKey; + } + + $this->argumentDecodeUTF8_mb_convert_encoding($mArg[$sKey]); + } + } + else if (is_string($mArg)) + $mArg = mb_convert_encoding($mArg, $this->sCharacterEncoding, "UTF-8"); + } + + function argumentDecodeUTF8_utf8_decode(&$mArg) + { + if (is_array($mArg)) + { + foreach (array_keys($mArg) as $sKey) + { + $sNewKey = $sKey; + $this->argumentDecodeUTF8_utf8_decode($sNewKey); + + if ($sNewKey != $sKey) + { + $mArg[$sNewKey] = $mArg[$sKey]; + unset($mArg[$sKey]); + $sKey = $sNewKey; + } + + $this->argumentDecodeUTF8_utf8_decode($mArg[$sKey]); + } + } + else if (is_string($mArg)) + $mArg = utf8_decode($mArg); + } + + /* + Constructor: xajaxArgumentManager + + Initializes configuration settings to their default values and reads + the argument data from the GET or POST data. + */ + function xajaxArgumentManager() + { + $this->aArgs = array(); + + $this->bDecodeUTF8Input = false; + $this->sCharacterEncoding = 'UTF-8'; + $this->nMethod = XAJAX_METHOD_UNKNOWN; + + $this->aSequence = array( + '<'.'k'.'>' => array(array( + '<'.'/k'.'>' => 4 + ), 3), + '<'.'/k'.'>' => array(array( + '<'.'v'.'>' => 3, + '<'.'/e'.'>' => 4 + ), 4), + '<'.'v'.'>' => array(array( + '<'.'xjxobj'.'>' => 8, + '<'.'/v'.'>' => 4 + ), 5), + '<'.'/v'.'>' => array(array( + '<'.'/e'.'>' => 4, + '<'.'k'.'>' => 3 + ), 6), + '<'.'e'.'>' => array(array( + '<'.'k'.'>' => 3, + '<'.'v'.'>' => 3, + '<'.'/e'.'>' => 4 + ), 2), + '<'.'/e'.'>' => array(array( + '<'.'e'.'>' => 3, + '<'.'/xjxobj'.'>' => 9 + ), 7), + '<'.'xjxobj'.'>' => array(array( + '<'.'e'.'>' => 3, + '<'.'/xjxobj'.'>' => 9 + ), 1), + '<'.'/xjxobj'.'>' => array(array( + '<'.'/v'.'>' => 4 + ), 8), + 'start' => array(array( + '<'.'xjxobj'.'>' => 8 + ), 9) + ); + + if (isset($_POST['xjxargs'])) { + $this->nMethod = XAJAX_METHOD_POST; + $this->aArgs = $_POST['xjxargs']; + } else if (isset($_GET['xjxargs'])) { + $this->nMethod = XAJAX_METHOD_GET; + $this->aArgs = $_GET['xjxargs']; + } + + if (1 == get_magic_quotes_gpc()) + array_walk($this->aArgs, array(&$this, 'argumentStripSlashes')); + + array_walk($this->aArgs, array(&$this, 'argumentDecodeXML')); + } + + /* + Function: getInstance + + Returns: + + object - A reference to an instance of this class. This function is + used to implement the singleton pattern. + */ + function &getInstance() + { + static $obj; + if (!$obj) { + $obj = new xajaxArgumentManager(); + } + return $obj; + } + + /* + Function: configure + + Accepts configuration settings from the main object. + + Parameters: + + + The tracks the following configuration settings: + + - (boolean): See bDecodeUTF8Input> + - (string): See sCharacterEncoding> + */ + function configure($sName, $mValue) + { + if ('decodeUTF8Input' == $sName) { + if (true === $mValue || false === $mValue) + $this->bDecodeUTF8Input = $mValue; + } else if ('characterEncoding' == $sName) { + $this->sCharacterEncoding = $mValue; + } + } + + /* + Function: getRequestMethod + + Returns the method that was used to send the arguments from the client. + */ + function getRequestMethod() + { + return $this->nMethod; + } + + /* + Function: process + + Returns the array of arguments that were extracted and parsed from + the GET or POST data. + */ + function process() + { + if ($this->bDecodeUTF8Input) + { + $sFunction = ''; + + if (function_exists('iconv')) + $sFunction = "iconv"; + else if (function_exists('mb_convert_encoding')) + $sFunction = "mb_convert_encoding"; + else if ($this->sCharacterEncoding == "ISO-8859-1") + $sFunction = "utf8_decode"; + else { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('ARGMGR:ERR:03') + , E_USER_NOTICE + ); + } + + $mFunction = array(&$this, 'argumentDecodeUTF8_' . $sFunction); + + array_walk($this->aArgs, $mFunction); + + $this->bDecodeUTF8Input = false; + } + + return $this->aArgs; + } +} Index: lms/lib/xajax/xajax_core/xajaxCall.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxCall.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxCall.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,389 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxCall.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Class: xajaxCall + + Create a piece of javascript code that will invoke the + function. + + This class is deprecated and will be removed in future versions; please use + instead. +*/ +class xajaxCall { + + /**#@+ + * @access protected + */ + + /* + String: sFunction + + Required: The name of the xajax enabled function to call + */ + var $sFunction; + + /* + String: sReturnValue + + Required: The value to return once the has + returned. (for asynchronous calls, this is immediate) + */ + var $sReturnValue; + + /* + Array: aParameters + + The associative array that will be used to store the parameters for this + call. + - key: The textual representation of the parameter. + - value: A boolean value indicating whether or not to use quotes around + this parameter. + */ + var $aParameters; + + /* + String: sMode + + The mode to use for the call + - 'synchronous' + - 'asynchronous' + */ + var $sMode; + + /* + String: sRequestType + + The request type that will be used for the call + - 'GET' + - 'POST' + */ + var $sRequestType; + + /* + String: sResponseProcessor + + The name of the javascript function that will be invoked + to handle the response. + */ + var $sResponseProcessor; + + /* + String: sRequestURI + + The URI for where this request will be sent. + */ + var $sRequestURI; + + /* + String: sContentType + + The content type to use for the request. + */ + var $sContentType; + + /* + Constructor: xajaxCall + + Initializes the xajaxCall object. + + Parameters: + + sFunction - (string): The name of the xajax enabled function + that will be invoked when this javascript code is executed + on the browser. This function name should match a PHP + function from your script. + */ + function xajaxCall($sFunction = '') { + $this->sFunction = $sFunction; + $this->aParameters = array(); + $this->sMode = ''; + $this->sRequestType = ''; + $this->sResponseProcessor = ''; + $this->sRequestURI = ''; + $this->sContentType = ''; + } + + /* + Function: setFunction + + Override the function name set in the constructor. + + Parameters: + + sFunction - (string): The name of the xajax enabled function + that will be invoked when this javascript code is executed + on the browser. This function name should match a PHP + function from your script. + + Returns: + + object : The object. + */ + function setFunction($sFunction) { + $this->sFunction = $sFunction; + return $this; + } + + /* + Function: clearParameters + + Clear the list of parameters being accumulated for this + call. + + Returns: + + object : The object. + */ + function clearParameters() { + $this->aParameters = array(); + } + + /* + Function: addParameter + + Adds a parameter to the list that will be specified for the + request generated by this object. + + Parameters: + + sParameter - (string): The parameter value or name. + bUseQuotes - (boolean): Whether or not to put quotes around this value. + + If you specify the name of a javascript variable, or provide a javascript + function call as a parameter, do not use quotes around the value. + + Returns: + + object : The object. + */ + function addParameter($sParameter, $bUseQuotes = true) { + $this->aParameters[] = array($sParameter, $bUseQuotes); + return $this; + } + + /* + Function: addFormValuesParameter + + Add a parameter value that is the result of calling + for the specified form. + + Parameters: + + sFormID - (string): The id of the form for which you wish to return + the input values. + + Returns: + + object : The object. + */ + function addFormValuesParameter($sFormID) { + $this->aParameters[] = array('xajax.getFormValues("'.$sFormID.'")'); + return $this; + } + + /* + Function: setMode + + Sets the mode that will be specified for this + + Parameters: + + $sMode - (string): The mode to be set. + - 'synchronous' + - 'asynchronous' + + Returns: + + object : The object. + */ + function setMode($sMode) { + $this->sMode = $sMode; + return $this; + } + + /* + Function: setRequestType + + Sets the request type which will be specified for the + generated . + + Parameters: + + - 'GET' + - 'POST' + + Returns: + + object : The object. + */ + function setRequestType($sRequestType) { + $this->sRequestType = $sRequestType; + return $this; + } + + /* + Function: setResponseProcessor + + Sets the name of the javascript function that will be used + to process this response. This is an advanced function, use + with caution. + + Parameters: + + Returns: + + object : The object. + */ + function setResponseProcessor($sResponseProcessor) { + $this->sResponseProcessor = $sResponseProcessor; + return $this; + } + + /* + Function: setRequestURI + + Override the default URI with the specified one. + + Parameters: + + sRequestURI - (string): The URI that the generated request will be sent + to. + + Returns: + + object : The object. + */ + function setRequestURI($sRequestURI) { + $this->sRequestURI = $sRequestURI; + return $this; + } + + /* + Function: setContentType + + Sets the content type that will be used by the generated request. + + Parameters: + + Returns: + + object : The object. + */ + function setContentType($sContentType) { + $this->sContentType = $sContentType; + } + + /* + Function: setReturnValue + + Sets the value that will be returned after the generated call. + Set to an empty string if no return value is desired. + + Parameters: + + Returns: + + object : The object. + */ + function setReturnValue($sReturnValue) { + $this->sReturnValue = $sReturnValue; + } + + /* + Function: generate + + Construct a statement in javascript that can be used + to make a xajax request with the parameters and settings previously + configured for this object. + + The output from this function can be used as an event handler in your + javascript code. + + Returns: + + string - The javascript statement that will invoked the + function on the browser, causing a xajax request to be sent to + the server. + */ + function generate() { + $output = 'xajax.call("'; + $output .= $this->sFunction; + $output .= '", {'; + $separator = ''; + if (0 < count($this->aParameters)) { + $output .= 'parameters: ['; + foreach ($this->aParameters as $aParameter) { + $output .= $separator; + $bUseQuotes = $aParameter[1]; + if ($bUseQuotes) + $output .= '"'; + $output .= $aParameter[0]; + if ($bUseQuotes) + $output .= '"'; + $separator = ','; + } + $output .= ']'; + } + if (0 < strlen($this->sMode)) { + $output .= $separator; + $output .= 'mode:"'; + $output .= $this->sMode; + $output .= '"'; + $separator = ','; + } + if (0 < strlen($this->sRequestType)) { + $output .= $separator; + $output .= 'requestType:"'; + $output .= $this->sRequestType; + $output .= '"'; + $separator = ','; + } + if (0 < strlen($this->sResponseProcessor)) { + $output .= $separator; + $output .= 'responseProcessor:'; + $output .= $this->sResponseProcessor; + $separator = ','; + } + if (0 < strlen($this->sRequestURI)) { + $output .= $separator; + $output .= 'requestURI:"'; + $output .= $this->sRequestURI; + $output .= '"'; + $separator = ','; + } + if (0 < strlen($this->sContentType)) { + $output .= $separator; + $output .= 'contentType:"'; + $output .= $this->sContentType; + $output .= '"'; + $separator = ','; + } + $output .= '}); '; + if (0 < strlen($this->sReturnValue)) { + $output .= 'return '; + $output .= $this->sReturnValue; + } else { + $output .= 'return false;'; + } + + return $output; + } +} Index: lms/lib/xajax/xajax_core/xajaxCompress.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxCompress.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxCompress.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,148 @@ + will call this function internally to compress the javascript code for + more efficient delivery. + + Parameters: + + $sFile - (stirng): The file to be compressed. +*/ +function xajaxCompressFile($sFile) +{ + //remove windows cariage returns + $sFile = str_replace("\r",'',$sFile); + + //array to store replaced literal strings + $literal_strings = array(); + + //explode the string into lines + $lines = explode("\n",$sFile); + //loop through all the lines, building a new string at the same time as removing literal strings + $clean = ''; + $inComment = false; + $literal = ''; + $inQuote = false; + $escaped = false; + $quoteChar = ''; + + $iLen = count($lines); + for($i=0; $i<$iLen; ++$i) + { + $line = $lines[$i]; + $inNormalComment = false; + + //loop through line's characters and take out any literal strings, replace them with ___i___ where i is the index of this string + $jLen = strlen($line); + for($j=0; $j<$jLen; ++$j) + { + $c = substr($line,$j,1); + $d = substr($line,$j,2); + + //look for start of quote + if(!$inQuote && !$inComment) + { + //is this character a quote or a comment + if(($c=='"' || $c=="'") && !$inComment && !$inNormalComment) + { + $inQuote = true; + $inComment = false; + $escaped = false; + $quoteChar = $c; + $literal = $c; + } + else if($d=="/*" && !$inNormalComment) + { + $inQuote = false; + $inComment = true; + $escaped = false; + $quoteChar = $d; + $literal = $d; + $j++; + } + else if($d=="//") //ignore string markers that are found inside comments + { + $inNormalComment = true; + } + else + { + if (!$inNormalComment) + $clean .= $c; + } + } + else //allready in a string so find end quote + { + if($c == $quoteChar && !$escaped && !$inComment) + { + $inQuote = false; + $literal .= $c; + + //subsitute in a marker for the string + $clean .= "___" . count($literal_strings) . "___"; + + //push the string onto our array + array_push($literal_strings,$literal); + + } + else if($inComment && $d=="*/") + { + $inComment = false; + $literal .= $d; + ++$j; + } + else if($c == "\\" && !$escaped) + $escaped = true; + else + $escaped = false; + + $literal .= $c; + } + } + if($inComment) $literal .= "\n"; + $clean .= "\n"; + } + //explode the clean string into lines again + $lines = explode("\n",$clean); + + //now process each line at a time + $iLen = count($lines); + for($i=0; $i<$iLen; ++$i) + { + $line = $lines[$i]; + + //remove comments + $line = preg_replace("/\/\/(.*)/","",$line); + + //strip leading and trailing whitespace + $line = trim($line); + + //remove all whitespace with a single space + $line = preg_replace("/\s+/"," ",$line); + + //remove any whitespace that occurs after/before an operator + $line = preg_replace("/\s*([!\}\{;,&=\|\-\+\*\/\)\(:])\s*/","\\1",$line); + + $lines[$i] = $line; + } + + //implode the lines + $sFile = implode("\n",$lines); + + //make sure there is a max of 1 \n after each line + $sFile = preg_replace("/[\n]+/","\n",$sFile); + + //strip out line breaks that immediately follow a semi-colon + $sFile = preg_replace("/;\n/",";",$sFile); + + //curly brackets aren't on their own + $sFile = preg_replace("/[\n]*\{[\n]*/","{",$sFile); + + //finally loop through and replace all the literal strings: + $iLen = count($literal_strings); + for($i=0; $i<$iLen; ++$i) + $sFile = str_replace('___'.$i.'___',$literal_strings[$i],$sFile); + + return $sFile; +} Index: lms/lib/xajax/xajax_core/xajaxControl.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxControl.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxControl.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,682 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxControl.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Constant: XAJAX_HTML_CONTROL_DOCTYPE_FORMAT + + Defines the doctype of the current document; this will effect how the HTML is formatted + when the html control library is used to construct html documents and fragments. This can + be one of the following values: + + 'XHTML' - (default) Typical effects are that certain elements are closed with '/>' + 'HTML' - Typical differences are that closing tags for certain elements cannot be '/>' +*/ +if (false == defined('XAJAX_HTML_CONTROL_DOCTYPE_FORMAT')) define('XAJAX_HTML_CONTROL_DOCTYPE_FORMAT', 'XHTML'); + +/* + Constant: XAJAX_HTML_CONTROL_DOCTYPE_VERSION +*/ +if (false == defined('XAJAX_HTML_CONTROL_DOCTYPE_VERSION')) define('XAJAX_HTML_CONTROL_DOCTYPE_VERSION', '1.0'); + +/* + Constant: XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION +*/ +if (false == defined('XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION')) define('XAJAX_HTML_CONTROL_DOCTYPE_VALIDATION', 'TRANSITIONAL'); + +/* + Class: xajaxControl + + The base class for all xajax enabled controls. Derived classes will generate the + HTML and javascript code that will be sent to the browser via printHTML> + or sent to the browser in a via getHTML>. +*/ +class xajaxControl +{ + /* + String: sTag + */ + var $sTag; + + /* + Boolean: sEndTag + + 'required' - (default) Indicates the control must have a full end tag + 'optional' - The control may have an abbr. begin tag or a full end tag + 'forbidden' - The control must have an abbr. begin tag and no end tag + */ + var $sEndTag; + + /* + Array: aAttributes + + An associative array of attributes that will be used in the generation + of the HMTL code for this control. + */ + var $aAttributes; + + /* + Array: aEvents + + An associative array of events that will be assigned to this control. Each + event declaration will include a reference to a object; it's + script will be extracted using printScript> or + getScript>. + */ + var $aEvents; + + /* + String: sClass + + Contains a declaration of the class of this control. %inline controls do not + need to be indented, %block controls should be indented. + */ + var $sClass; + + /* + Function: xajaxControl + + Parameters: + + $aConfiguration - (array): An associative array that contains a variety + of configuration options for this object. + + Note: + This array may contain the following entries: + + 'attributes' - (array): An associative array containing attributes + that will be passed to the setAttribute> function. + + 'children' - (array): An array of derived objects that + will be the children of this control. + */ + function xajaxControl($sTag, $aConfiguration=array()) + { + $this->sTag = $sTag; + + $this->clearAttributes(); + + if (isset($aConfiguration['attributes'])) + if (is_array($aConfiguration['attributes'])) + foreach ($aConfiguration['attributes'] as $sKey => $sValue) + $this->setAttribute($sKey, $sValue); + + $this->clearEvents(); + + if (isset($aConfiguration['event'])) + call_user_func_array(array(&$this, 'setEvent'), $aConfiguration['event']); + + else if (isset($aConfiguration['events'])) + if (is_array($aConfiguration['events'])) + foreach ($aConfiguration['events'] as $aEvent) + call_user_func_array(array(&$this, 'setEvent'), $aEvent); + + $this->sClass = '%block'; + $this->sEndTag = 'forbidden'; + } + + /* + Function: getClass + + Returns the *adjusted* class of the element + */ + function getClass() + { + return $this->sClass; + } + + /* + Function: clearAttributes + + Removes all attributes assigned to this control. + */ + function clearAttributes() + { + $this->aAttributes = array(); + } + + /* + Function: setAttribute + + Call to set various control specific attributes to be included in the HTML + script that is returned when printHTML> or getHTML> + is called. + + Parameters: + $sName - (string): The attribute name to set the value. + $sValue - (string): The value to be set. + */ + function setAttribute($sName, $sValue) + { +//SkipDebug + if (class_exists('clsValidator')) + { + $objValidator =& clsValidator::getInstance(); + if (false == $objValidator->attributeValid($this->sTag, $sName)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:IAERR:01') + . $sName + . $objLanguageManager->getText('XJXCTL:IAERR:02') + . $this->sTag + . $objLanguageManager->getText('XJXCTL:IAERR:03') + , E_USER_ERROR + ); + } + } +//EndSkipDebug + + $this->aAttributes[$sName] = $sValue; + } + + /* + Function: getAttribute + + Call to obtain the value currently associated with the specified attribute + if set. + + Parameters: + + sName - (string): The name of the attribute to be returned. + + Returns: + + mixed : The value associated with the attribute, or null. + */ + function getAttribute($sName) + { + if (false == isset($this->aAttributes[$sName])) + return null; + + return $this->aAttributes[$sName]; + } + + /* + Function: clearEvents + + Clear the events that have been associated with this object. + */ + function clearEvents() + { + $this->aEvents = array(); + } + + /* + Function: setEvent + + Call this function to assign a object as the handler for + the specific DOM event. The printScript> function will + be called to generate the javascript for this request. + + Parameters: + + sEvent - (string): A string containing the name of the event to be assigned. + objRequest - (xajaxRequest object): The object to be associated + with the specified event. + aParameters - (array, optional): An array containing parameter declarations + that will be passed to this object just before the javascript + is generated. + sBeforeRequest - (string, optional): a string containing a snippet of javascript code + to execute prior to calling the xajaxRequest function + sAfterRequest - (string, optional): a string containing a snippet of javascript code + to execute after calling the xajaxRequest function + */ + function setEvent($sEvent, &$objRequest, $aParameters=array(), $sBeforeRequest='', $sAfterRequest='; return false;') + { +//SkipDebug + if (false == is_a($objRequest, 'xajaxRequest')) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:IRERR:01') + . $this->backtrace() + , E_USER_ERROR + ); + } + + if (class_exists('clsValidator')) { + $objValidator =& clsValidator::getInstance(); + if (false == $objValidator->attributeValid($this->sTag, $sEvent)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:IEERR:01') + . $sEvent + . $objLanguageManager->getText('XJXCTL:IEERR:02') + . $this->sTag + . $objLanguageManager->getText('XJXCTL:IEERR:03') + , E_USER_ERROR + ); + } + } +//EndSkipDebug + + $this->aEvents[$sEvent] = array( + &$objRequest, + $aParameters, + $sBeforeRequest, + $sAfterRequest + ); + } + + /* + Function: getHTML + + Generates and returns the HTML representation of this control and + it's children. + + Returns: + + string : The HTML representation of this control. + */ + function getHTML($bFormat=false) + { + ob_start(); + if ($bFormat) + $this->printHTML(); + else + $this->printHTML(false); + return ob_get_clean(); + } + + /* + Function: printHTML + + Generates and prints the HTML representation of this control and + it's children. + + Returns: + + string : The HTML representation of this control. + */ + function printHTML($sIndent='') + { +//SkipDebug + if (class_exists('clsValidator')) + { + $objValidator =& clsValidator::getInstance(); + $sMissing = ''; + if (false == $objValidator->checkRequiredAttributes($this->sTag, $this->aAttributes, $sMissing)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:MAERR:01') + . $sMissing + . $objLanguageManager->getText('XJXCTL:MAERR:02') + . $this->sTag + . $objLanguageManager->getText('XJXCTL:MAERR:03') + , E_USER_ERROR + ); + } + } +//EndSkipDebug + + $sClass = $this->getClass(); + + if ('%inline' != $sClass) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + echo $sIndent; + + echo '<'; + echo $this->sTag; + echo ' '; + $this->_printAttributes(); + $this->_printEvents(); + + if ('forbidden' == $this->sEndTag) + { + if ('HTML' == XAJAX_HTML_CONTROL_DOCTYPE_FORMAT) + echo '>'; + else if ('XHTML' == XAJAX_HTML_CONTROL_DOCTYPE_FORMAT) + echo '/>'; + + if ('%inline' != $sClass) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + echo "\n"; + + return; + } + else if ('optional' == $this->sEndTag) + { + echo '/>'; + + if ('%inline' == $sClass) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + echo "\n"; + + return; + } +//SkipDebug + else + { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:IETERR:01') + . $this->backtrace() + , E_USER_ERROR + ); + } +//EndSkipDebug + } + + function _printAttributes() + { + // NOTE: Special case here: disabled='false' does not work in HTML; does work in javascript + foreach ($this->aAttributes as $sKey => $sValue) + if ('disabled' != $sKey || 'false' != $sValue) + echo "{$sKey}='{$sValue}' "; + } + + function _printEvents() + { + foreach (array_keys($this->aEvents) as $sKey) + { + $aEvent =& $this->aEvents[$sKey]; + $objRequest =& $aEvent[0]; + $aParameters = $aEvent[1]; + $sBeforeRequest = $aEvent[2]; + $sAfterRequest = $aEvent[3]; + + foreach ($aParameters as $aParameter) + { + $nParameter = $aParameter[0]; + $sType = $aParameter[1]; + $sValue = $aParameter[2]; + $objRequest->setParameter($nParameter, $sType, $sValue); + } + + $objRequest->useDoubleQuote(); + + echo "{$sKey}='{$sBeforeRequest}"; + + $objRequest->printScript(); + + echo "{$sAfterRequest}' "; + } + } + + function backtrace() + { + // debug_backtrace was added to php in version 4.3.0 + // version_compare was added to php in version 4.0.7 + if (0 <= version_compare(PHP_VERSION, '4.3.0')) + return '
Backtrace:
' 
+				. print_r(debug_backtrace(), true) 
+				. '
'; + return ''; + } +} + +/* + Class: xajaxControlContainer + + This class is used as the base class for controls that will contain + other child controls. +*/ +class xajaxControlContainer extends xajaxControl +{ + /* + Array: aChildren + + An array of child controls. + */ + var $aChildren; + + /* + Boolean: sChildClass + + Will contain '%inline' if all children are class = '%inline', '%block' if all children are '%block' or + '%flow' if both '%inline' and '%block' elements are detected. + */ + var $sChildClass; + + /* + Function: xajaxControlContainer + + Called to construct and configure this control. + + Parameters: + + aConfiguration - (array): See xajaxControl> for more + information. + */ + function xajaxControlContainer($sTag, $aConfiguration=array()) + { + xajaxControl::xajaxControl($sTag, $aConfiguration); + + $this->clearChildren(); + + if (isset($aConfiguration['child'])) + $this->addChild($aConfiguration['child']); + + else if (isset($aConfiguration['children'])) + $this->addChildren($aConfiguration['children']); + + $this->sEndTag = 'required'; + } + + /* + Function: getClass + + Returns the *adjusted* class of the element + */ + function getClass() + { + $sClass = xajaxControl::getClass(); + + if (0 < count($this->aChildren) && '%flow' == $sClass) + return $this->getContentClass(); + else if (0 == count($this->aChildren) || '%inline' == $sClass || '%block' == $sClass) + return $sClass; + + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:ICERR:01') + . $this->backtrace() + , E_USER_ERROR + ); + } + + /* + Function: getContentClass + + Returns the *adjusted* class of the content (children) of this element + */ + function getContentClass() + { + $sClass = ''; + + foreach (array_keys($this->aChildren) as $sKey) + { + if ('' == $sClass) + $sClass = $this->aChildren[$sKey]->getClass(); + else if ($sClass != $this->aChildren[$sKey]->getClass()) + return '%flow'; + } + + if ('' == $sClass) + return '%inline'; + + return $sClass; + } + + /* + Function: clearChildren + + Clears the list of child controls associated with this control. + */ + function clearChildren() + { + $this->sChildClass = '%inline'; + $this->aChildren = array(); + } + + /* + Function: addChild + + Adds a control to the array of child controls. Child controls + must be derived from . + */ + function addChild(&$objControl) + { +//SkipDebug + if (false == is_a($objControl, 'xajaxControl')) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:ICLERR:01') + . $this->backtrace() + , E_USER_ERROR + ); + } + + if (class_exists('clsValidator')) + { + $objValidator =& clsValidator::getInstance(); + if (false == $objValidator->childValid($this->sTag, $objControl->sTag)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:ICLERR:02') + . $objControl->sTag + . $objLanguageManager->getText('XJXCTL:ICLERR:03') + . $this->sTag + . $objLanguageManager->getText('XJXCTL:ICLERR:04') + . $this->backtrace() + , E_USER_ERROR + ); + } + } +//EndSkipDebug + + $this->aChildren[] =& $objControl; + } + + function addChildren(&$aChildren) + { +//SkipDebug + if (false == is_array($aChildren)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:ICHERR:01') + . $this->backtrace() + , E_USER_ERROR + ); + } +//EndSkipDebug + + foreach (array_keys($aChildren) as $sKey) + $this->addChild($aChildren[$sKey]); + } + + function printHTML($sIndent='') + { +//SkipDebug + if (class_exists('clsValidator')) + { + $objValidator =& clsValidator::getInstance(); + $sMissing = ''; + if (false == $objValidator->checkRequiredAttributes($this->sTag, $this->aAttributes, $sMissing)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXCTL:MRAERR:01') + . $sMissing + . $objLanguageManager->getText('XJXCTL:MRAERR:02') + . $this->sTag + . $objLanguageManager->getText('XJXCTL:MRAERR:03') + , E_USER_ERROR + ); + } + } +//EndSkipDebug + + $sClass = $this->getClass(); + + if ('%inline' != $sClass) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + echo $sIndent; + + echo '<'; + echo $this->sTag; + echo ' '; + $this->_printAttributes(); + $this->_printEvents(); + + if (0 == count($this->aChildren)) + { + if ('optional' == $this->sEndTag) + { + echo '/>'; + + if ('%inline' != $sClass) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + echo "\n"; + + return; + } +//SkipDebug + else if ('required' != $this->sEndTag) + trigger_error("Invalid end tag designation; should be optional or required.\n" + . $this->backtrace(), + E_USER_ERROR + ); +//EndSkipDebug + } + + echo '>'; + + $sContentClass = $this->getContentClass(); + + if ('%inline' != $sContentClass) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + echo "\n"; + + $this->_printChildren($sIndent); + + if ('%inline' != $sContentClass) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + echo $sIndent; + + echo '<' . '/'; + echo $this->sTag; + echo '>'; + + if ('%inline' != $sClass) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + echo "\n"; + } + + function _printChildren($sIndent='') + { + if (false == is_a($this, 'clsDocument')) + // this odd syntax is necessary to detect request for no formatting + if (false === (false === $sIndent)) + $sIndent .= "\t"; + + // children + foreach (array_keys($this->aChildren) as $sKey) + { + $objChild =& $this->aChildren[$sKey]; + $objChild->printHTML($sIndent); + } + } +} Index: lms/lib/xajax/xajax_core/xajaxLanguageManager.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxLanguageManager.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxLanguageManager.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,188 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxLanguageManager.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Class: xajaxLanguageManager + + This class contains the default language (english) and the code used to supply + debug and error messages upon request; as well as the code used to load alternate + language text as requested via the function. +*/ +class xajaxLanguageManager +{ + /* + Array: aMessages + + An array of the currently registered languages. + */ + var $aMessages; + + /* + String: sLanguage + + The currently configured language. + */ + var $sLanguage; + + /* + Function: xajaxLanguageManager + + Construct and initialize the one and only xajax language manager object. + */ + function xajaxLanguageManager() + { + $this->aMessages = array(); + + $this->aMessages['en'] = array( + 'LOGHDR:01' => '** xajax Error Log - ', + 'LOGHDR:02' => " **\n", + 'LOGHDR:03' => "\n\n\n", + 'LOGERR:01' => "** Logging Error **\n\nxajax was unable to write to the error log file:\n", + 'LOGMSG:01' => "** PHP Error Messages: **", + 'CMPRSJS:RDERR:01' => 'The xajax uncompressed Javascript file could not be found in the ', + 'CMPRSJS:RDERR:02' => ' folder. Error ', + 'CMPRSJS:WTERR:01' => 'The xajax compressed javascript file could not be written in the ', + 'CMPRSJS:WTERR:02' => ' folder. Error ', + 'CMPRSPHP:WTERR:01' => 'The xajax compressed file ', + 'CMPRSPHP:WTERR:02' => ' could not be written to. Error ', + 'CMPRSAIO:WTERR:01' => 'The xajax compressed file ', + 'CMPRSAIO:WTERR:02' => '/xajaxAIO.inc.php could not be written to. Error ', + 'DTCTURI:01' => 'xajax Error: xajax failed to automatically identify your Request URI.', + 'DTCTURI:02' => 'Please set the Request URI explicitly when you instantiate the xajax object.', + 'ARGMGR:ERR:01' => 'Malformed object argument received: ', + 'ARGMGR:ERR:02' => ' <==> ', + 'ARGMGR:ERR:03' => 'The incoming xajax data could not be converted from UTF-8', + 'XJXCTL:IAERR:01' => 'Invalid attribute [', + 'XJXCTL:IAERR:02' => '] for element [', + 'XJXCTL:IAERR:03' => '].', + 'XJXCTL:IRERR:01' => 'Invalid request object passed to xajaxControl::setEvent', + 'XJXCTL:IEERR:01' => 'Invalid attribute (event name) [', + 'XJXCTL:IEERR:02' => '] for element [', + 'XJXCTL:IEERR:03' => '].', + 'XJXCTL:MAERR:01' => 'Missing required attribute [', + 'XJXCTL:MAERR:02' => '] for element [', + 'XJXCTL:MAERR:03' => '].', + 'XJXCTL:IETERR:01' => "Invalid end tag designation; should be forbidden or optional.\n", + 'XJXCTL:ICERR:01' => "Invalid class specified for html control; should be %inline, %block or %flow.\n", + 'XJXCTL:ICLERR:01' => 'Invalid control passed to addChild; should be derived from xajaxControl.', + 'XJXCTL:ICLERR:02' => 'Invalid control passed to addChild [', + 'XJXCTL:ICLERR:03' => '] for element [', + 'XJXCTL:ICLERR:04' => "].\n", + 'XJXCTL:ICHERR:01' => 'Invalid parameter passed to xajaxControl::addChildren; should be array of xajaxControl objects', + 'XJXCTL:MRAERR:01' => 'Missing required attribute [', + 'XJXCTL:MRAERR:02' => '] for element [', + 'XJXCTL:MRAERR:03' => '].', + 'XJXPLG:GNERR:01' => 'Response plugin should override the getName function.', + 'XJXPLG:PERR:01' => 'Response plugin should override the process function.', + 'XJXPM:IPLGERR:01' => 'Attempt to register invalid plugin: ', + 'XJXPM:IPLGERR:02' => ' should be derived from xajaxRequestPlugin or xajaxResponsePlugin.', + 'XJXPM:MRMERR:01' => 'Failed to locate registration method for the following: ', + 'XJXRSP:EDERR:01' => 'Passing character encoding to the xajaxResponse constructor is deprecated, instead use $xajax->configure("characterEncoding", ...);', + 'XJXRSP:MPERR:01' => 'Invalid or missing plugin name detected in call to xajaxResponse::plugin', + 'XJXRSP:CPERR:01' => "The \$sType parameter of addCreate has been deprecated. Use the addCreateInput() method instead.", + 'XJXRSP:LCERR:01' => "The xajax response object could not load commands as the data provided was not a valid array.", + 'XJXRSP:AKERR:01' => 'Invalid tag name encoded in array.', + 'XJXRSP:IEAERR:01' => 'Improperly encoded array.', + 'XJXRSP:NEAERR:01' => 'Non-encoded array detected.', + 'XJXRSP:MBEERR:01' => 'The xajax response output could not be converted to HTML entities because the mb_convert_encoding function is not available', + 'XJXRSP:MXRTERR' => 'Error: Cannot mix types in a single response.', + 'XJXRSP:MXCTERR' => 'Error: Cannot mix content types in a single response.', + 'XJXRSP:MXCEERR' => 'Error: Cannot mix character encodings in a single response.', + 'XJXRSP:MXOEERR' => 'Error: Cannot mix output entities (true/false) in a single response.', + 'XJXRM:IRERR' => 'An invalid response was returned while processing this request.', + 'XJXRM:MXRTERR' => 'Error: You cannot mix response types while processing a single request: ' + ); + + $this->sLanguage = 'en'; + } + + /* + Function: getInstance + + Implements the singleton pattern: provides a single instance of the xajax + language manager object to all object which request it. + */ + function &getInstance() + { + static $obj; + if (!$obj) { + $obj = new xajaxLanguageManager(); + } + return $obj; + } + + /* + Function: configure + + Called by the main xajax object as configuration options are set. See also: + . The tracks the following configuration + options. + Parameters: + + - language (string, default 'en'): The currently selected language. + */ + function configure($sName, $mValue) + { + if ('language' == $sName) { + if ($mValue !== $this->sLanguage) { + $sFolder = dirname(__FILE__); + @include $sFolder . '/xajax_lang_' . $mValue . '.inc.php'; + // require $sFolder . '/xajax_lang_' . $mValue . '.inc.php'; + $this->sLanguage = $mValue; + } + } + } + + /* + Function: register + + Called to register an array of alternate language messages. + + Parameters: + + sLanguage - (string): the character code which represents the language being registered. + aMessages - (array): the array of translated debug and error messages + */ + function register($sLanguage, $aMessages) { + $this->aMessages[$sLanguage] = $aMessages; + } + + /* + Function: getText + + Called by the main xajax object and other objects during the initial page generation + or request processing phase to obtain language specific debug and error messages. + + sMessage - (string): A code indicating the message text being requested. + */ + function getText($sMessage) + { + if (isset($this->aMessages[$this->sLanguage])) + if (isset($this->aMessages[$this->sLanguage][$sMessage])) + return $this->aMessages[$this->sLanguage][$sMessage]; + + return '(Unknown language or message identifier)' + . $this->sLanguage + . '::' + . $sMessage; + } +} Index: lms/lib/xajax/xajax_core/xajaxPlugin.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxPlugin.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxPlugin.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,191 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxPlugin.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Class: xajaxPlugin + + The base class for all xajax plugins. +*/ +class xajaxPlugin +{ +} + +/* + Class: xajaxRequestPlugin + + The base class for all xajax request plugins. + + Request plugins handle the registration, client script generation and processing of + xajax enabled requests. Each plugin should have a unique signature for both + the registration and processing of requests. During registration, the user will + specify a type which will allow the plugin to detect and handle it. During client + script generation, the plugin will generate a stub with the + prescribed call options and request signature. During request processing, the + plugin will detect the signature generated previously and process the request + accordingly. +*/ +class xajaxRequestPlugin extends xajaxPlugin +{ + /* + Function: configure + + Called by the when a configuration setting is changing. + Plugins should store a local copy of the settings they wish to use during + registration, client script generation or request processing. + */ + function configure($sName, $mValue) + { + } + + /* + Function: register + + Called by the when a user script when a function, event + or callable object is to be registered. Additional plugins may support other + registration types. + */ + function register($aArgs) + { + return false; + } + + /* + Function: generateClientScript + + Called by when the page's HTML is being sent to the browser. + This allows each plugin to inject some script / style or other appropriate tags + into the HEAD of the document. Each block must be appropriately enclosed, meaning + javascript code must be enclosed in SCRIPT and /SCRIPT tags. + */ + function generateClientScript() + { + } + + /* + Function: canProcessRequest + + Called by the when a request has been received to determine + if the request is for a xajax enabled function or for the initial page load. + */ + function canProcessRequest() + { + return false; + } + + /* + Function: processRequest + + Called by the when a request is being processed. This + will only occur when has determined that the current request is a valid + (registered) xajax enabled function via canProcessRequest>. + + Returns: + false + */ + function processRequest() + { + return false; + } +} + +/* + Class: xajaxResponsePlugin + + Base class for all xajax response plugins. + + A response plugin provides additional services not already provided by the + class with regard to sending response commands to the + client. In addition, a response command may send javascript to the browser + at page load to aid in the processing of it's response commands. +*/ +class xajaxResponsePlugin extends xajaxPlugin +{ + /* + Object: objResponse + + A reference to the current object that is being used + to build the response that will be sent to the client browser. + */ + var $objResponse; + + /* + Function: setResponse + + Called by the object that is currently being used + to build the response that will be sent to the client browser. + + Parameters: + + objResponse - (object): A reference to the object + */ + function setResponse(&$objResponse) + { + $this->objResponse =& $objResponse; + } + + /* + Function: addCommand + + Used internally to add a command to the response command list. This + will call addPluginCommand> using the reference provided + in setResponse>. + */ + function addCommand($aAttributes, $sData) + { + $this->objResponse->addPluginCommand($this, $aAttributes, $sData); + } + + /* + Function: getName + + Called by the when the user script requests a plugin. + This name must match the plugin name requested in the called to + plugin>. + */ + function getName() + { +//SkipDebug + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXPLG:GNERR:01') + , E_USER_ERROR + ); +//EndSkipDebug + } + + /* + Function: process + + Called by when a user script requests the service of a + response plugin. The parameters provided by the user will be used to + determine which response command and parameters will be sent to the + client upon completion of the xajax request process. + */ + function process() + { +//SkipDebug + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXPLG:PERR:01') + , E_USER_ERROR + ); +//EndSkipDebug + } +} Index: lms/lib/xajax/xajax_core/xajaxPluginManager.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxPluginManager.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxPluginManager.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,344 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxPluginManager.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +//SkipAIO +require(dirname(__FILE__) . '/xajaxPlugin.inc.php'); +//EndSkipAIO + +/* + Class: xajaxPluginManager +*/ +class xajaxPluginManager +{ + /* + Array: aRequestPlugins + */ + var $aRequestPlugins; + + /* + Array: aResponsePlugins + */ + var $aResponsePlugins; + + /* + Array: aConfigurable + */ + var $aConfigurable; + + /* + Array: aRegistrars + */ + var $aRegistrars; + + /* + Array: aProcessors + */ + var $aProcessors; + + /* + Array: aClientScriptGenerators + */ + var $aClientScriptGenerators; + + /* + Function: xajaxPluginManager + + Construct and initialize the one and only xajax plugin manager. + */ + function xajaxPluginManager() + { + $this->aRequestPlugins = array(); + $this->aResponsePlugins = array(); + + $this->aConfigurable = array(); + $this->aRegistrars = array(); + $this->aProcessors = array(); + $this->aClientScriptGenerators = array(); + } + + /* + Function: getInstance + + Implementation of the singleton pattern: returns the one and only instance of the + xajax plugin manager. + + Returns: + + object : a reference to the one and only instance of the + plugin manager. + */ + function &getInstance() + { + static $obj; + if (!$obj) { + $obj = new xajaxPluginManager(); + } + return $obj; + } + + /* + Function: loadPlugins + + Loads plugins from the folders specified. + + Parameters: + $aFolders - (array): Array of folders to check for plugins + */ + function loadPlugins($aFolders) + { + foreach ($aFolders as $sFolder) { + if (is_dir($sFolder)) + if ($handle = opendir($sFolder)) { + while (!(false === ($sName = readdir($handle)))) { + $nLength = strlen($sName); + if (8 < $nLength) { + $sFileName = substr($sName, 0, $nLength - 8); + $sExtension = substr($sName, $nLength - 8, 8); + if ('.inc.php' == $sExtension) { + require $sFolder . '/' . $sFileName . $sExtension; + } + } + } + + closedir($handle); + } + } + } + + /* + Function: _insertIntoArray + + Inserts an entry into an array given the specified priority number. + If a plugin already exists with the given priority, the priority is + automatically incremented until a free spot is found. The plugin + is then inserted into the empty spot in the array. + + Parameters: + + $aPlugins - (array): Plugins array + $objPlugin - (object): A reference to an instance of a plugin. + $nPriority - (number): The desired priority, used to order + the plugins. + + */ + function _insertIntoArray(&$aPlugins, &$objPlugin, $nPriority) + { + while (isset($aPlugins[$nPriority])) + $nPriority++; + + $aPlugins[$nPriority] =& $objPlugin; + } + + /* + Function: registerPlugin + + Registers a plugin. + + Parameters: + + objPlugin - (object): A reference to an instance of a plugin. + + Note: + Below is a table for priorities and their description: + 0 thru 999: Plugins that are part of or extensions to the xajax core + 1000 thru 8999: User created plugins, typically, these plugins don't care about order + 9000 thru 9999: Plugins that generally need to be last or near the end of the plugin list + */ + function registerPlugin(&$objPlugin, $nPriority=1000) + { + if (is_a($objPlugin, 'xajaxRequestPlugin')) + { + $this->_insertIntoArray($this->aRequestPlugins, $objPlugin, $nPriority); + + if (method_exists($objPlugin, 'register')) + $this->_insertIntoArray($this->aRegistrars, $objPlugin, $nPriority); + + if (method_exists($objPlugin, 'canProcessRequest')) + if (method_exists($objPlugin, 'processRequest')) + $this->_insertIntoArray($this->aProcessors, $objPlugin, $nPriority); + } + else if (is_a($objPlugin, 'xajaxResponsePlugin')) + { + $this->aResponsePlugins[] =& $objPlugin; + } + else + { +//SkipDebug + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXPM:IPLGERR:01') + . get_class($objPlugin) + . $objLanguageManager->getText('XJXPM:IPLGERR:02') + , E_USER_ERROR + ); +//EndSkipDebug + } + + if (method_exists($objPlugin, 'configure')) + $this->_insertIntoArray($this->aConfigurable, $objPlugin, $nPriority); + + if (method_exists($objPlugin, 'generateClientScript')) + $this->_insertIntoArray($this->aClientScriptGenerators, $objPlugin, $nPriority); + } + + /* + Function: canProcessRequest + + Calls each of the request plugins and determines if the + current request can be processed by one of them. If no processor identifies + the current request, then the request must be for the initial page load. + + See canProcessRequest> for more information. + */ + function canProcessRequest() + { + $bHandled = false; + + $aKeys = array_keys($this->aProcessors); + sort($aKeys); + foreach ($aKeys as $sKey) { + $mResult = $this->aProcessors[$sKey]->canProcessRequest(); + if (true === $mResult) + $bHandled = true; + else if (is_string($mResult)) + return $mResult; + } + + return $bHandled; + } + + /* + Function: processRequest + + Calls each of the request plugins to request that they process the + current request. If the plugin processes the request, it will + return true. + */ + function processRequest() + { + $bHandled = false; + + $aKeys = array_keys($this->aProcessors); + sort($aKeys); + foreach ($aKeys as $sKey) { + $mResult = $this->aProcessors[$sKey]->processRequest(); + if (true === $mResult) + $bHandled = true; + else if (is_string($mResult)) + return $mResult; + } + + return $bHandled; + } + + /* + Function: configure + + Call each of the request plugins passing along the configuration + setting specified. + + Parameters: + + sName - (string): The name of the configuration setting to set. + mValue - (mixed): The value to be set. + */ + function configure($sName, $mValue) + { + $aKeys = array_keys($this->aConfigurable); + sort($aKeys); + foreach ($aKeys as $sKey) + $this->aConfigurable[$sKey]->configure($sName, $mValue); + } + + /* + Function: register + + Call each of the request plugins and give them the opportunity to + handle the registration of the specified function, event or callable object. + + Parameters: + $aArgs - (array) : + */ + function register($aArgs) + { + $aKeys = array_keys($this->aRegistrars); + sort($aKeys); + foreach ($aKeys as $sKey) + { + $objPlugin =& $this->aRegistrars[$sKey]; + $mResult =& $objPlugin->register($aArgs); + if (is_a($mResult, 'xajaxRequest')) + return $mResult; + if (is_array($mResult)) + return $mResult; + if (is_bool($mResult)) + if (true === $mResult) + return true; + } +//SkipDebug + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXPM:MRMERR:01') + . print_r($aArgs, true) + , E_USER_ERROR + ); +//EndSkipDebug + } + + /* + Function: generateClientScript + + Call each of the request and response plugins giving them the + opportunity to output some javascript to the page being generated. This + is called only when the page is being loaded initially. This is not + called when processing a request. + */ + function generateClientScript() + { + $aKeys = array_keys($this->aClientScriptGenerators); + sort($aKeys); + foreach ($aKeys as $sKey) + $this->aClientScriptGenerators[$sKey]->generateClientScript(); + } + + /* + Function: getPlugin + + Locate the specified response plugin by name and return + a reference to it if one exists. + + Parameters: + $sName - (string): Name of the plugin. + + Returns: + mixed : Returns plugin or false if not found. + */ + function &getPlugin($sName) + { + $aKeys = array_keys($this->aResponsePlugins); + sort($aKeys); + foreach ($aKeys as $sKey) + if (is_a($this->aResponsePlugins[$sKey], $sName)) + return $this->aResponsePlugins[$sKey]; + + $bFailure = false; + return $bFailure; + } +} Index: lms/lib/xajax/xajax_core/xajaxRequest.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxRequest.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxRequest.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,359 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxRequest.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Constant: XAJAX_FORM_VALUES + Specifies that the parameter will consist of an array of form values. +*/ +if (!defined ('XAJAX_FORM_VALUES')) define ('XAJAX_FORM_VALUES', 'get form values'); +/* + Constant: XAJAX_INPUT_VALUE + Specifies that the parameter will contain the value of an input control. +*/ +if (!defined ('XAJAX_INPUT_VALUE')) define ('XAJAX_INPUT_VALUE', 'get input value'); +/* + Constant: XAJAX_CHECKED_VALUE + Specifies that the parameter will consist of a boolean value of a checkbox. +*/ +if (!defined ('XAJAX_CHECKED_VALUE')) define ('XAJAX_CHECKED_VALUE', 'get checked value'); +/* + Constant: XAJAX_ELEMENT_INNERHTML + Specifies that the parameter value will be the innerHTML value of the element. +*/ +if (!defined ('XAJAX_ELEMENT_INNERHTML')) define ('XAJAX_ELEMENT_INNERHTML', 'get element innerHTML'); +/* + Constant: XAJAX_QUOTED_VALUE + Specifies that the parameter will be a quoted value (string). +*/ +if (!defined ('XAJAX_QUOTED_VALUE')) define ('XAJAX_QUOTED_VALUE', 'quoted value'); +/* + Constant: XAJAX_JS_VALUE + Specifies that the parameter will be a non-quoted value (evaluated by the + browsers javascript engine at run time. +*/ +if (!defined ('XAJAX_JS_VALUE')) define ('XAJAX_JS_VALUE', 'unquoted value'); + +/* + Class: xajaxRequest + + Used to store and generate the client script necessary to invoke + a xajax request from the browser to the server script. + + This object is typically generated by the register> method + and can be used to quickly generate the javascript that is used + to initiate a xajax request to the registered function, object, event + or other xajax call. +*/ +class xajaxRequest +{ + /* + String: sName + + The name of the function. + */ + var $sName; + + /* + String: sQuoteCharacter + + A string containing either a single or a double quote character + that will be used during the generation of the javascript for + this function. This can be set prior to calling printScript> + */ + var $sQuoteCharacter; + + /* + Array: aParameters + + An array of parameters that will be used to populate the argument list + for this function when the javascript is output in printScript> + */ + var $aParameters; + + /* + Function: xajaxRequest + + Construct and initialize this request. + + sName - (string): The name of this request. + */ + function xajaxRequest($sName) + { + $this->aParameters = array(); + $this->sQuoteCharacter = '"'; + $this->sName = $sName; + } + + /* + Function: useSingleQuote + + Call this to instruct the request to use single quotes when generating + the javascript. + */ + function useSingleQuote() + { + $this->sQuoteCharacter = "'"; + } + + /* + Function: useDoubleQuote + + Call this to instruct the request to use double quotes while generating + the javascript. + */ + function useDoubleQuote() + { + $this->sQuoteCharacter = '"'; + } + + /* + Function: clearParameters + + Clears the parameter list associated with this request. + */ + function clearParameters() + { + $this->aParameters = array(); + } + + /* + Function: addParameter + + Adds a parameter value to the parameter list for this request. + + sType - (string): The type of the value to be used. + sValue - (string: The value to be used. + + See Also: + See setParameter> for details. + */ + function addParameter() + { + $aArgs = func_get_args(); + + if (1 < count($aArgs)) + $this->setParameter( + count($this->aParameters), + $aArgs[0], + $aArgs[1]); + } + + /* + Function: setParameter + + Sets a specific parameter value. + + Parameters: + + nParameter - (number): The index of the parameter to set + sType - (string): The type of value + sValue - (string): The value as it relates to the specified type + + Note: + + Types should be one of the following , , + , , . + The value should be as follows: + - Use the ID of the form you want to process. + - The string data to be passed. + - A string containing valid javascript (either a javascript + variable name that will be in scope at the time of the call or a + javascript function call whose return value will become the parameter. + + */ + function setParameter() + { + $aArgs = func_get_args(); + + if (2 < count($aArgs)) + { + $nParameter = $aArgs[0]; + $sType = $aArgs[1]; + + if (XAJAX_FORM_VALUES == $sType) + { + $sFormID = $aArgs[2]; + $this->aParameters[$nParameter] = + "xajax.getFormValues(" + . $this->sQuoteCharacter + . $sFormID + . $this->sQuoteCharacter + . ")"; + } + else if (XAJAX_INPUT_VALUE == $sType) + { + $sInputID = $aArgs[2]; + $this->aParameters[$nParameter] = + "xajax.$(" + . $this->sQuoteCharacter + . $sInputID + . $this->sQuoteCharacter + . ").value"; + } + else if (XAJAX_CHECKED_VALUE == $sType) + { + $sCheckedID = $aArgs[2]; + $this->aParameters[$nParameter] = + "xajax.$(" + . $this->sQuoteCharacter + . $sCheckedID + . $this->sQuoteCharacter + . ").checked"; + } + else if (XAJAX_ELEMENT_INNERHTML == $sType) + { + $sElementID = $aArgs[2]; + $this->aParameters[$nParameter] = + "xajax.$(" + . $this->sQuoteCharacter + . $sElementID + . $this->sQuoteCharacter + . ").innerHTML"; + } + else if (XAJAX_QUOTED_VALUE == $sType) + { + $sValue = $aArgs[2]; + $this->aParameters[$nParameter] = + $this->sQuoteCharacter + . $sValue + . $this->sQuoteCharacter; + } + else if (XAJAX_JS_VALUE == $sType) + { + $sValue = $aArgs[2]; + $this->aParameters[$nParameter] = $sValue; + } + } + } + + /* + Function: getScript + + Returns a string representation of the script output (javascript) from + this request object. See also: + */ + function getScript() + { + ob_start(); + $this->printScript(); + return ob_get_clean(); + } + + /* + Function: printScript + + Generates a block of javascript code that can be used to invoke + the specified xajax request. + */ + function printScript() + { + echo $this->sName; + echo '('; + + $sSeparator = ''; + + foreach ($this->aParameters as $sParameter) + { + echo $sSeparator; + echo $sParameter; + $sSeparator = ', '; + } + + echo ')'; + } +} + +/* + Class: xajaxCustomRequest + + This class extends the class such that simple javascript + can be put in place of a xajax request to the server. The primary purpose + of this class is to provide simple scripting services to the + based objects, like , and . +*/ +class xajaxCustomRequest extends xajaxRequest +{ + /* + Array: aVariables; + */ + var $aVariables; + + /* + String: sScript; + */ + var $sScript; + + /* + Function: xajaxCustomRequest + + Constructs and initializes an instance of the object. + + Parameters: + + sScript - (string): The javascript (template) that will be printed + upon request. + aVariables - (associative array, optional): An array of variable name, + value pairs that will be passed to setVariable> + */ + function xajaxCustomRequest($sScript) + { + $this->aVariables = array(); + $this->sScript = $sScript; + } + + /* + Function: clearVariables + + Clears the array of variables that will be used to modify the script before + it is printed and sent to the client. + */ + function clearVariables() + { + $this->aVariables = array(); + } + + /* + Function: setVariable + + Sets a value that will be used to modify the script before it is sent to + the browser. The object will perform a string + replace operation on each of the values set with this function. + + Parameters: + $sName - (string): Variable name + $sValue - (string): Value + + */ + function setVariable($sName, $sValue) + { + $this->aVariables[$sName] = $sValue; + } + + /* + Function: printScript + */ + function printScript() + { + $sScript = $this->sScript; + foreach ($this->aVariables as $sKey => $sValue) + $sScript = str_replace($sKey, $sValue, $sScript); + echo $sScript; + } +} Index: lms/lib/xajax/xajax_core/xajaxResponse.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxResponse.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxResponse.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,1908 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxResponse.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Class: xajaxResponse + + Collect commands to be sent back to the browser in response to a xajax + request. Commands are encoded and packaged in a format that is acceptable + to the response handler from the javascript library running on the client + side. + + Common commands include: + - assign>: Assign a value to an elements property. + - append>: Append a value on to an elements property. + - script>: Execute a portion of javascript code. + - call>: Execute an existing javascript function. + - alert>: Display an alert dialog to the user. + + Elements are identified by the value of the HTML id attribute. If you do + not see your updates occuring on the browser side, ensure that you are + using the correct id in your response. +*/ +class xajaxResponse +{ + /**#@+ + * @access protected + */ + + /* + Array: aCommands + + Stores the commands that will be sent to the browser in the response. + */ + var $aCommands; + + /* + String: sCharacterEncoding + + The name of the encoding method you wish to use when dealing with + special characters. See setEncoding> for more information. + */ + var $sCharacterEncoding; + + /* + Boolean: bOutputEntities + + Convert special characters to the HTML equivellent. See also + bOutputEntities> and setFlag>. + */ + var $bOutputEntities; + + /* + Mixed: returnValue + + A string, array or integer value to be returned to the caller when + using 'synchronous' mode requests. See setMode> for details. + */ + var $returnValue; + + /* + Object: objPluginManager + + A reference to the global plugin manager. + */ + var $objPluginManager; + + /**#@-*/ + + /* + Constructor: xajaxResponse + + Create and initialize a xajaxResponse object. + */ + function xajaxResponse() + { + //SkipDebug + if (0 < func_num_args()) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:EDERR:01') + , E_USER_ERROR + ); + } + //EndSkipDebug + + $this->aCommands = array(); + + $objResponseManager =& xajaxResponseManager::getInstance(); + + $this->sCharacterEncoding = $objResponseManager->getCharacterEncoding(); + $this->bOutputEntities = $objResponseManager->getOutputEntities(); + + $this->objPluginManager =& xajaxPluginManager::getInstance(); + } + + /* + Function: setCharacterEncoding + + Overrides the default character encoding (or the one specified in the + constructor) to the specified character encoding. + + Parameters: + + sCharacterEncoding - (string): The encoding method to use for this response. + + See also, xajaxResponse>() + + Returns: + + object - The xajaxResponse object. + */ + function setCharacterEncoding($sCharacterEncoding) + { + $this->sCharacterEncoding = $sCharacterEncoding; + return $this; + } + + /* + Function: setOutputEntities + + Convert special characters to their HTML equivellent automatically + (only works if the mb_string extension is available). + + Parameters: + + bOption - (boolean): Convert special characters + + Returns: + + object - The xajaxResponse object. + */ + function setOutputEntities($bOutputEntities) + { + $this->bOutputEntities = (boolean)$bOutputEntities; + return $this; + } + + /* + Function: plugin + + Provides access to registered response plugins. If you are using PHP + 4 or 5, pass the plugin name as the first argument, the plugin method + name as the second argument and subsequent arguments (if any) to be + passed along to the plugin. + + Optionally, if you use PHP 5, you can pass just the plugin name as the + first argument and the plugin object will be returned. You can then + access the methods of the plugin directly. + + Parameters: + + sName - (string): Name of the plugin. + sFunction - (string, optional): The name of the method to call. + arg1...argn - (mixed, optional): Additional arguments to pass on to + the plugin function. + + Returns: + + object - The plugin specified by sName. + */ + function &plugin() + { + $aArgs = func_get_args(); + $nArgs = func_num_args(); + + //SkipDebug + if (false == (0 < $nArgs)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:MPERR:01') + , E_USER_ERROR + ); + } + //EndSkipDebug + + $sName = array_shift($aArgs); + + $objPlugin =& $this->objPluginManager->getPlugin($sName); + + if (false === $objPlugin) + { + $bReturn = false; + return $bReturn; + } + + $objPlugin->setResponse($this); + + if (0 < count($aArgs)) + { + $sMethod = array_shift($aArgs); + + $aFunction = array(&$objPlugin, $sMethod); + call_user_func_array($aFunction, $aArgs); + } + + return $objPlugin; + } + + /* + Function: __get + + Magic function for PHP 5. Used to permit plugins to be called as if they + where native members of the xajaxResponse instance. + + Parameters: + + sPluginName - (string): The name of the plugin. + + Returns: + + object - The plugin specified by sPluginName. + */ + function &__get($sPluginName) + { + $objPlugin =& $this->plugin($sPluginName); + return $objPlugin; + } + + /* + Function: confirmCommands + + Response command that prompts user with [ok] [cancel] style + message box. If the user clicks cancel, the specified + number of response commands following this one, will be + skipped. + + Parameters: + + iCmdNumber - (integer): The number of commands to skip upon cancel. + sMessage - (string): The message to display to the user. + + Returns: + + object : The xajaxResponse object. + */ + function confirmCommands($iCmdNumber, $sMessage) + { + return $this->addCommand( + array( + 'cmd'=>'cc', + 'id'=>$iCmdNumber + ), + $sMessage + ); + } + + /* + Function: assign + + Response command indicating that the specified value should be + assigned to the given element's attribute. + + Parameters: + + sTarget - (string): The id of the html element on the browser. + sAttribute - (string): The property to be assigned. + sData - (string): The value to be assigned to the property. + + Returns: + + object : The object. + + */ + function assign($sTarget,$sAttribute,$sData) + { + return $this->addCommand( + array( + 'cmd'=>'as', + 'id'=>$sTarget, + 'prop'=>$sAttribute + ), + $sData + ); + } + + /* + Function: append + + Response command that indicates the specified data should be appended + to the given element's property. + + Parameters: + + sTarget - (string): The id of the element to be updated. + sAttribute - (string): The name of the property to be appended to. + sData - (string): The data to be appended to the property. + + Returns: + + object : The object. + */ + function append($sTarget,$sAttribute,$sData) + { + return $this->addCommand( + array( + 'cmd'=>'ap', + 'id'=>$sTarget, + 'prop'=>$sAttribute + ), + $sData + ); + } + + /* + Function: prepend + + Response command to prepend the specified value onto the given + element's property. + + Parameters: + + sTarget - (string): The id of the element to be updated. + sAttribute - (string): The property to be updated. + sData - (string): The value to be prepended. + + Returns: + + object : The object. + */ + function prepend($sTarget,$sAttribute,$sData) + { + return $this->addCommand( + array( + 'cmd'=>'pp', + 'id'=>$sTarget, + 'prop'=>$sAttribute + ), + $sData + ); + } + + /* + Function: replace + + Replace a specified value with another value within the given + element's property. + + Parameters: + + sTarget - (string): The id of the element to update. + sAttribute - (string): The property to be updated. + sSearch - (string): The needle to search for. + sData - (string): The data to use in place of the needle. + */ + function replace($sTarget,$sAttribute,$sSearch,$sData) + { + return $this->addCommand( + array( + 'cmd'=>'rp', + 'id'=>$sTarget, + 'prop'=>$sAttribute + ), + array( + 's' => $sSearch, + 'r' => $sData + ) + ); + } + + /* + Function: clear + + Response command used to clear the specified property of the + given element. + + Parameters: + + sTarget - (string): The id of the element to be updated. + sAttribute - (string): The property to be clared. + + Returns: + + object - The object. + */ + function clear($sTarget,$sAttribute) + { + return $this->assign( + $sTarget, + $sAttribute, + '' + ); + } + + /* + Function: contextAssign + + Response command used to assign a value to a member of a + javascript object (or element) that is specified by the context + member of the request. The object is referenced using the 'this' keyword + in the sAttribute parameter. + + Parameters: + + sAttribute - (string): The property to be updated. + sData - (string): The value to assign. + + Returns: + + object : The object. + */ + function contextAssign($sAttribute, $sData) + { + return $this->addCommand( + array( + 'cmd'=>'c:as', + 'prop'=>$sAttribute + ), + $sData + ); + } + + /* + Function: contextAppend + + Response command used to append a value onto the specified member + of the javascript context object (or element) specified by the context + member of the request. The object is referenced using the 'this' keyword + in the sAttribute parameter. + + Parameters: + + sAttribute - (string): The member to be appended to. + sData - (string): The value to append. + + Returns: + + object : The object. + */ + function contextAppend($sAttribute, $sData) + { + return $this->addCommand( + array( + 'cmd'=>'c:ap', + 'prop'=>$sAttribute + ), + $sData + ); + } + + /* + Function: contextPrepend + + Response command used to prepend the speicified data to the given + member of the current javascript object specified by context in the + current request. The object is access via the 'this' keyword in the + sAttribute parameter. + + Parameters: + + sAttribute - (string): The member to be updated. + sData - (string): The value to be prepended. + + Returns: + + object : The object. + */ + function contextPrepend($sAttribute, $sData) + { + return $this->addCommand( + array( + 'cmd'=>'c:pp', + 'prop'=>$sAttribute + ), + $sData + ); + } + + /* + Function: contextClear + + Response command used to clear the value of the property specified + in the sAttribute parameter. The member is access via the 'this' + keyword and can be used to update a javascript object specified + by context in the request parameters. + + Parameters: + + sAttribute - (string): The member to be cleared. + + Returns: + + object : The object. + */ + function contextClear($sAttribute) + { + return $this->contextAssign( + $sAttribute, + '' + ); + } + + /* + Function: alert + + Response command that is used to display an alert message to the user. + + Parameters: + + sMsg - (string): The message to be displayed. + + Returns: + + object : The object. + */ + function alert($sMsg) + { + return $this->addCommand( + array( + 'cmd'=>'al' + ), + $sMsg + ); + } + + function debug($sMessage) + { + return $this->addCommand( + array( + 'cmd'=>'dbg' + ), + $sMessage + ); + } + + /* + Function: redirect + + Response command that causes the browser to navigate to the specified + URL. + + Parameters: + + sURL - (string): The relative or fully qualified URL. + iDelay - (integer, optional): Number of seconds to delay before + the redirect occurs. + + Returns: + + object : The object. + */ + function redirect($sURL, $iDelay=0) + { + //we need to parse the query part so that the values are rawurlencode()'ed + //can't just use parse_url() cos we could be dealing with a relative URL which + // parse_url() can't deal with. + $queryStart = strpos($sURL, '?', strrpos($sURL, '/')); + if ($queryStart !== FALSE) + { + $queryStart++; + $queryEnd = strpos($sURL, '#', $queryStart); + if ($queryEnd === FALSE) + $queryEnd = strlen($sURL); + $queryPart = substr($sURL, $queryStart, $queryEnd-$queryStart); + parse_str($queryPart, $queryParts); + $newQueryPart = ""; + if ($queryParts) + { + $first = true; + foreach($queryParts as $key => $value) + { + if ($first) + $first = false; + else + $newQueryPart .= '&'; + $newQueryPart .= rawurlencode($key).'='.rawurlencode($value); + } + } else if ($_SERVER['QUERY_STRING']) { + //couldn't break up the query, but there's one there + //possibly "http://url/page.html?query1234" type of query? + //just encode it and hope it works + $newQueryPart = rawurlencode($_SERVER['QUERY_STRING']); + } + $sURL = str_replace($queryPart, $newQueryPart, $sURL); + } + if ($iDelay) + $this->script( + 'window.setTimeout("window.location = \'' + . $sURL + . '\';",' + . ($iDelay*1000) + . ');' + ); + else + $this->script( + 'window.location = "' + . $sURL + . '";' + ); + return $this; + } + + /* + Function: script + + Response command that is used to execute a portion of javascript on + the browser. The script runs in it's own context, so variables declared + locally, using the 'var' keyword, will no longer be available after the + call. To construct a variable that will be accessable globally, even + after the script has executed, leave off the 'var' keyword. + + Parameters: + + sJS - (string): The script to execute. + + Returns: + + object : The object. + */ + function script($sJS) + { + return $this->addCommand( + array( + 'cmd'=>'js' + ), + $sJS + ); + } + + /* + Function: call + + Response command that indicates that the specified javascript + function should be called with the given (optional) parameters. + + Parameters: + + arg1 - (string): The name of the function to call. + arg2 .. argn : arguments to be passed to the function. + + Returns: + + object : The object. + */ + function call() { + $aArgs = func_get_args(); + $sFunc = array_shift($aArgs); + return $this->addCommand( + array( + 'cmd'=>'jc', + 'func'=>$sFunc + ), + $aArgs + ); + } + + /* + Function: remove + + Response command used to remove an element from the document. + + Parameters: + + sTarget - (string): The id of the element to be removed. + + Returns: + + object : The object. + */ + function remove($sTarget) + { + return $this->addCommand( + array( + 'cmd'=>'rm', + 'id'=>$sTarget), + '' + ); + } + + /* + Function: create + + Response command used to create a new element on the browser. + + Parameters: + + sParent - (string): The id of the parent element. + sTag - (string): The tag name to be used for the new element. + sId - (string): The id to assign to the new element. + sType - (string, optional): The type of tag, deprecated, use + createInput> instead. + + Returns: + + object : The object. + */ + function create($sParent, $sTag, $sId, $sType=null) + { + //SkipDebug + if (false === (null === $sType)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:CPERR:01') + , E_USER_WARNING + ); + } + //EndSkipDebug + + return $this->addCommand( + array( + 'cmd'=>'ce', + 'id'=>$sParent, + 'prop'=>$sId + ), + $sTag + ); + } + + /* + Function: insert + + Response command used to insert a new element just prior to the specified + element. + + Parameters: + + sBefore - (string): The element used as a reference point for the + insertion. + sTag - (string): The tag to be used for the new element. + sId - (string): The id to be used for the new element. + + Returns: + + object : The object. + */ + function insert($sBefore, $sTag, $sId) + { + return $this->addCommand( + array( + 'cmd'=>'ie', + 'id'=>$sBefore, + 'prop'=>$sId + ), + $sTag + ); + } + + /* + Function: insertAfter + + Response command used to insert a new element after the specified + one. + + Parameters: + + sAfter - (string): The id of the element that will be used as a reference + for the insertion. + sTag - (string): The tag name to be used for the new element. + sId - (string): The id to be used for the new element. + + Returns: + + object : The object. + */ + function insertAfter($sAfter, $sTag, $sId) + { + return $this->addCommand( + array( + 'cmd'=>'ia', + 'id'=>$sAfter, + 'prop'=>$sId + ), + $sTag + ); + } + + /* + Function: createInput + + Response command used to create an input element on the browser. + + Parameters: + + sParent - (string): The id of the parent element. + sType - (string): The type of the new input element. + sName - (string): The name of the new input element. + sId - (string): The id of the new element. + + Returns: + + object : The object. + */ + function createInput($sParent, $sType, $sName, $sId) + { + return $this->addCommand( + array( + 'cmd'=>'ci', + 'id'=>$sParent, + 'prop'=>$sId, + 'type'=>$sType + ), + $sName + ); + } + + /* + Function: insertInput + + Response command used to insert a new input element preceeding the + specified element. + + Parameters: + + sBefore - (string): The id of the element to be used as the reference + point for the insertion. + sType - (string): The type of the new input element. + sName - (string): The name of the new input element. + sId - (string): The id of the new input element. + + Returns: + + object : The object. + */ + function insertInput($sBefore, $sType, $sName, $sId) + { + return $this->addCommand( + array( + 'cmd'=>'ii', + 'id'=>$sBefore, + 'prop'=>$sId, + 'type'=>$sType + ), + $sName + ); + } + + /* + Function: insertInputAfter + + Response command used to insert a new input element after the + specified element. + + Parameters: + + sAfter - (string): The id of the element that is to be used + as the insertion point for the new element. + sType - (string): The type of the new input element. + sName - (string): The name of the new input element. + sId - (string): The id of the new input element. + + Returns: + + object : The object. + */ + function insertInputAfter($sAfter, $sType, $sName, $sId) + { + return $this->addCommand( + array( + 'cmd'=>'iia', + 'id'=>$sAfter, + 'prop'=>$sId, + 'type'=>$sType + ), + $sName + ); + } + + /* + Function: setEvent + + Response command used to set an event handler on the browser. + + Parameters: + + sTarget - (string): The id of the element that contains the event. + sEvent - (string): The name of the event. + sScript - (string): The javascript to execute when the event is fired. + + Returns: + + object : The object. + */ + function setEvent($sTarget,$sEvent,$sScript) + { + return $this->addCommand( + array( + 'cmd'=>'ev', + 'id'=>$sTarget, + 'prop'=>$sEvent + ), + $sScript + ); + } + + + /* + Function: addEvent + + Response command used to set an event handler on the browser. + + Parameters: + + sTarget - (string): The id of the element that contains the event. + sEvent - (string): The name of the event. + sScript - (string): The javascript to execute when the event is fired. + + Returns: + + object : The object. + + Note: + + This function is depreciated and will be removed in a future version. + Use instead. + */ + function addEvent($sTarget,$sEvent,$sScript) + { + return $this->setEvent( + $sTarget, + $sEvent, + $sScript + ); + } + + /* + Function: addHandler + + Response command used to install an event handler on the specified element. + + Parameters: + + sTarget - (string): The id of the element. + sEvent - (string): The name of the event to add the handler to. + sHandler - (string): The javascript function to call when the event is fired. + + You can add more than one event handler to an element's event using this method. + + Returns: + + object - The object. + */ + function addHandler($sTarget,$sEvent,$sHandler) + { + return $this->addCommand( + array( + 'cmd'=>'ah', + 'id'=>$sTarget, + 'prop'=>$sEvent + ), + $sHandler + ); + } + + /* + Function: removeHandler + + Response command used to remove an event handler from an element. + + Parameters: + + sTarget - (string): The id of the element. + sEvent - (string): The name of the event. + sHandler - (string): The javascript function that is called when the + event is fired. + + Returns: + + object : The object. + */ + function removeHandler($sTarget,$sEvent,$sHandler) + { + return $this->addCommand( + array( + 'cmd'=>'rh', + 'id'=>$sTarget, + 'prop'=>$sEvent + ), + $sHandler); + } + + /* + Function: setFunction + + Response command used to construct a javascript function on the browser. + + Parameters: + + sFunction - (string): The name of the function to construct. + sArgs - (string): Comma separated list of parameter names. + sScript - (string): The javascript code that will become the body of the + function. + + Returns: + + object : The object. + */ + function setFunction($sFunction, $sArgs, $sScript) + { + return $this->addCommand( + array( + 'cmd'=>'sf', + 'func'=>$sFunction, + 'prop'=>$sArgs + ), + $sScript + ); + } + + /* + Function: wrapFunction + + Response command used to construct a wrapper function around + and existing javascript function on the browser. + + Parameters: + + sFunction - (string): The name of the existing function to wrap. + sArgs - (string): The comma separated list of parameters for the function. + aScripts - (array): An array of javascript code snippets that will + be used to build the body of the function. The first piece of code + specified in the array will occur before the call to the original + function, the second will occur after the original function is called. + sReturnValueVariable - (string): The name of the variable that will + retain the return value from the call to the original function. + + Returns: + + object : The object. + */ + function wrapFunction($sFunction, $sArgs, $aScripts, $sReturnValueVariable) + { + return $this->addCommand( + array( + 'cmd'=>'wpf', + 'func'=>$sFunction, + 'prop'=>$sArgs, + 'type'=>$sReturnValueVariable + ), + $aScripts + ); + } + + /* + Function: includeScript + + Response command used to load a javascript file on the browser. + + Parameters: + + sFileName - (string): The relative or fully qualified URI of the + javascript file. + + sType - (string): Determines the script type . Defaults to 'text/javascript'. + + + Returns: + + object : The object. + */ + function includeScript($sFileName, $sType = null, $sId = null) + { + $command = array('cmd' => 'in'); + + if (false === (null === $sType)) + $command['type'] = $sType; + + if (false === (null === $sId)) + $command['elm_id'] = $sId; + + return $this->addCommand( + $command, + $sFileName + ); + } + + /* + Function: includeScriptOnce + + Response command used to include a javascript file on the browser + if it has not already been loaded. + + Parameters: + + sFileName - (string): The relative for fully qualified URI of the + javascript file. + + sType - (string): Determines the script type . Defaults to 'text/javascript'. + + Returns: + + object : The object. + */ + function includeScriptOnce($sFileName, $sType = null, $sId = null) + { + $command = array('cmd' => 'ino'); + + if (false === (null === $sType)) + $command['type'] = $sType; + + if (false === (null === $sId)) + $command['elm_id'] = $sId; + + return $this->addCommand( + $command, + $sFileName + ); + } + + /* + Function: removeScript + + Response command used to remove a SCRIPT reference to a javascript + file on the browser. Optionally, you can call a javascript function + just prior to the file being unloaded (for cleanup). + + Parameters: + + sFileName - (string): The relative or fully qualified URI of the + javascript file. + sUnload - (string): Name of a javascript function to call prior + to unlaoding the file. + + Returns: + + object : The object. + */ + function removeScript($sFileName, $sUnload = '') { + $this->addCommand( + array( + 'cmd'=>'rjs', + 'unld'=>$sUnload + ), + $sFileName + ); + return $this; + } + + /* + Function: includeCSS + + Response command used to include a LINK reference to + the specified CSS file on the browser. This will cause the + browser to load and apply the style sheet. + + Parameters: + + sFileName - (string): The relative or fully qualified URI of + the css file. + + sMedia - (string): Determines the media type of the CSS file. Defaults to 'screen'. + + Returns: + + object : The object. + */ + function includeCSS($sFileName, $sMedia = null) + { + $command = array('cmd' => 'css'); + + if (false === (null === $sMedia)) + $command['media'] = $sMedia; + + return $this->addCommand( + $command, + $sFileName + ); + } + + /* + Function: removeCSS + + Response command used to remove a LINK reference to + a CSS file on the browser. This causes the browser to + unload the style sheet, effectively removing the style + changes it caused. + + Parameters: + + sFileName - (string): The relative or fully qualified URI + of the css file. + + Returns: + + object : The object. + */ + function removeCSS($sFileName, $sMedia = null) + { + $command = array('cmd'=>'rcss'); + + if (false === (null === $sMedia)) + $command['media'] = $sMedia; + + return $this->addCommand( + $command, + $sFileName + ); + } + + /* + Function: waitForCSS + + Response command instructing xajax to pause while the CSS + files are loaded. The browser is not typically a multi-threading + application, with regards to javascript code. Therefore, the + CSS files included or removed with includeCSS> and + removeCSS> respectively, will not be loaded or + removed until the browser regains control from the script. This + command returns control back to the browser and pauses the execution + of the response until the CSS files, included previously, are + loaded. + + Parameters: + + iTimeout - (integer): The number of 1/10ths of a second to pause + before timing out and continuing with the execution of the + response commands. + + Returns: + + object : The object. + */ + function waitForCSS($iTimeout = 600) { + $sData = ""; + $this->addCommand( + array( + 'cmd'=>'wcss', + 'prop'=>$iTimeout + ), + $sData + ); + return $this; + } + + /* + Function: waitFor + + Response command instructing xajax to delay execution of the response + commands until a specified condition is met. Note, this returns control + to the browser, so that other script operations can execute. xajax + will continue to monitor the specified condition and, when it evaulates + to true, will continue processing response commands. + + Parameters: + + script - (string): A piece of javascript code that evaulates to true + or false. + tenths - (integer): The number of 1/10ths of a second to wait before + timing out and continuing with the execution of the response + commands. + + Returns: + + object : The object. + */ + function waitFor($script, $tenths) { + return $this->addCommand( + array( + 'cmd'=>'wf', + 'prop'=>$tenths + ), + $script + ); + } + + /* + Function: sleep + + Response command which instructs xajax to pause execution + of the response commands, returning control to the browser + so it can perform other commands asynchronously. After + the specified delay, xajax will continue execution of the + response commands. + + Parameters: + + tenths - (integer): The number of 1/10ths of a second to + sleep. + + Returns: + + object : The object. + */ + function sleep($tenths) { + $this->addCommand( + array( + 'cmd'=>'s', + 'prop'=>$tenths + ), + '' + ); + return $this; + } + + /* + Function: setReturnValue + + Stores a value that will be passed back as part of the response. + When making synchronous requests, the calling javascript can + obtain this value immediately as the return value of the + function. + + Parameters: + + value - (mixed): Any value. + + Returns: + + object : The object. + */ + function setReturnValue($value) { + $this->returnValue = $this->_encodeArray($value); + return $this; + } + + /* + Function: getContentType + + Returns the current content type that will be used for the + response packet. (typically: "text/xml") + + Returns: + + string : The content type. + */ + function getContentType() + { + return 'text/xml'; + } + + /* + Function: getOutput + */ + function getOutput() + { + ob_start(); + $this->_printHeader_XML(); + $this->_printResponse_XML(); + return ob_get_clean(); + } + + /* + Function: printOutput + + Prints the output, generated from the commands added to the response, + that will be sent to the browser. + + Returns: + + string : The textual representation of the response commands. + */ + function printOutput() + { + $this->_sendHeaders(); + $this->_printHeader_XML(); + $this->_printResponse_XML(); + } + + /* + Function: _sendHeaders + + Used internally to generate the response headers. + */ + function _sendHeaders() + { + $objArgumentManager =& xajaxArgumentManager::getInstance(); + if (XAJAX_METHOD_GET == $objArgumentManager->getRequestMethod()) + { + header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header ("Cache-Control: no-cache, must-revalidate"); + header ("Pragma: no-cache"); + } + + $sCharacterSet = ''; + if ($this->sCharacterEncoding && 0 < strlen(trim($this->sCharacterEncoding))) { + $sCharacterSet = '; charset="' . trim($this->sCharacterEncoding) . '"'; + } + + $sContentType = $this->getContentType(); + + header('content-type: ' . $sContentType . ' ' . $sCharacterSet); + } + + /* + Function: getCommandCount + + Returns: + + integer : The number of commands in the response. + */ + function getCommandCount() + { + return count($this->aCommands); + } + + /* + Function: loadCommands + + Merges the response commands from the specified + object with the response commands in this object. + + Parameters: + + mCommands - (object): object. + bBefore - (boolean): Add the new commands to the beginning + of the list. + + */ + function loadCommands($mCommands, $bBefore=false) + { + if (is_a($mCommands, 'xajaxResponse')) { + $this->returnValue = $mCommands->returnValue; + + if ($bBefore) { + $this->aCommands = array_merge($mCommands->aCommands, $this->aCommands); + } + else { + $this->aCommands = array_merge($this->aCommands, $mCommands->aCommands); + } + } + else if (is_array($mCommands)) { + if ($bBefore) { + $this->aCommands = array_merge($mCommands, $this->aCommands); + } + else { + $this->aCommands = array_merge($this->aCommands, $mCommands); + } + } + else { + //SkipDebug + if (!empty($mCommands)) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:LCERR:01') + , E_USER_ERROR + ); + } + //EndSkipDebug + } + } + + function absorb($objResponse) + { + $this->loadCommands($objResponse); + } + + /* + Function: addPluginCommand + + Adds a response command that is generated by a plugin. + + Parameters: + + objPlugin - (object): A reference to a plugin object. + aAttributes - (array): Array containing the attributes for this + response command. + mData - (mixed): The data to be sent with this command. + + Returns: + + object : The object. + */ + function addPluginCommand($objPlugin, $aAttributes, $mData) + { + $aAttributes['plg'] = $objPlugin->getName(); + return $this->addCommand($aAttributes, $mData); + } + + /* + Function: addCommand + + Add a response command to the array of commands that will + be sent to the browser. + + Parameters: + + aAttributes - (array): Associative array of attributes that + will describe the command. + mData - (mixed): The data to be associated with this command. + + Returns: + + object : The command. + */ + function addCommand($aAttributes, $mData) + { + $aAttributes['data'] = $this->_encodeArray($mData); + $this->aCommands[] = $aAttributes; + return $this; + } + + /* + Function: _printHeader_XML + + Used internally to print XML start tag. + */ + function _printHeader_XML() + { + echo '<'; + echo '?'; + echo 'xml version="1.0"'; + + $sEncoding = trim($this->sCharacterEncoding); + if ($this->sCharacterEncoding && 0 < strlen($sEncoding)) { + echo ' encoding="'; + echo $sEncoding; + echo '"'; + } + + echo ' ?'; + echo '>'; + } + + /* + Function: _printResponse_XML + + Used internally to generate the command output. + */ + function _printResponse_XML() + { + echo '<'; + echo 'xjx>'; + + if (null !== $this->returnValue) + { + echo '<'; + echo 'xjxrv>'; + + $this->_printArray_XML($this->returnValue); + + echo '<'; + echo '/xjxrv>'; + } + + foreach(array_keys($this->aCommands) as $sKey) + $this->_printCommand_XML($this->aCommands[$sKey]); + + echo '<'; + echo '/xjx>'; + } + + /* + Function: _printCommand_XML + + Prints an XML representation of the command. + + Parameters: + + aAttributes - (array): Associative array of attributes for this + command. + */ + function _printCommand_XML(&$aAttributes) + { + echo '<'; + echo 'cmd'; + + $mData = ''; + + foreach (array_keys($aAttributes) as $sKey) { + if ($sKey) { + if ('data' != $sKey) { + echo ' '; + echo $sKey; + echo '="'; + echo $aAttributes[$sKey]; + echo '"'; + } else + $mData =& $aAttributes[$sKey]; + } + } + + echo '>'; + + $this->_printArray_XML($mData); + + echo '<'; + echo '/cmd>'; + } + + /* + Function: _printArray_XML + + Prints an XML representation of a php array suitable + for inclusion in the response to the browser. Arrays + sent via this method will be converted into a javascript + array on the browser. + + Parameters: + + mArray - (array): Array to be converted. + */ + function _printArray_XML(&$mArray) { + if ('object' == gettype($mArray)) + $mArray = get_object_vars($mArray); + + if (false == is_array($mArray)) { + $this->_printEscapedString_XML($mArray); + return; + } + + echo '<'; + echo 'xjxobj>'; + + foreach (array_keys($mArray) as $sKey) { + if (is_array($mArray[$sKey])) { + echo '<'; + echo 'e>'; + + foreach (array_keys($mArray[$sKey]) as $sInnerKey) { + //SkipDebug + if (htmlspecialchars($sInnerKey, ENT_COMPAT, 'UTF-8') != $sInnerKey) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:AKERR:01') + , E_USER_ERROR + ); + } + //EndSkipDebug + + if ('k' == $sInnerKey || 'v' == $sInnerKey) { + echo '<'; + echo $sInnerKey; + echo '>'; + $this->_printArray_XML($mArray[$sKey][$sInnerKey]); + echo '<'; + echo '/'; + echo $sInnerKey; + echo '>'; + } else { + //SkipDebug + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:IEAERR:01') + , E_USER_ERROR + ); + //EndSkipDebug + } + } + + echo '<'; + echo '/e>'; + } else { + //SkipDebug + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:NEAERR:01') + , E_USER_ERROR + ); + //EndSkipDebug + } + } + + echo '<'; + echo '/xjxobj>'; + } + + /* + Function: _printEscapedString_XML + + Escape the specified data if necessary, so special characters in the + command data does not interfere with the structure of the response. + + This could be overridden to allow for transport encodings other than + XML. + + Parameters: + + sData - (string): The data to be escaped. + + Returns: + + string : The escaped data. + */ + function _printEscapedString_XML(&$sData) + { + if (is_null($sData) || false == isset($sData)) { + echo '*'; + return; + } + + if ($this->bOutputEntities) { + //SkipDebug + if (false === function_exists('mb_convert_encoding')) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:MBEERR:01') + , E_USER_NOTICE + ); + } + //EndSkipDebug + + echo call_user_func_array('mb_convert_encoding', array(&$sData, 'HTML-ENTITIES', $this->sCharacterEncoding)); + return; + } + + $nCDATA = 0; + + $bNoOpenCDATA = (false === strpos($sData, '<'.'![CDATA[')); + if ($bNoOpenCDATA) { + $bNoCloseCDATA = (false === strpos($sData, ']]>')); + if ($bNoCloseCDATA) { + $bSpecialChars = (htmlspecialchars($sData, ENT_COMPAT, 'UTF-8') != $sData); + if ($bSpecialChars) + $nCDATA = 1; + } else + $nCDATA = 2; + } else + $nCDATA = 2; + + if (0 < $nCDATA) { + echo '<'; + echo '![CDATA['; + + // PHP defines numeric values as integer or float (double and real are aliases of float) + if (is_string($sData)) { + echo 'S'; + } else if (is_int($sData) || is_float($sData)) { + echo 'N'; + } else if (is_bool($sData)) { + echo 'B'; + } + + if (1 < $nCDATA) { + $aSegments = explode('<'.'![CDATA[', $sData); + $aOutput = array(); + $nOutput = 0; + foreach (array_keys($aSegments) as $keySegment) { + $aFragments = explode(']]>', $aSegments[$keySegment]); + $aStack = array(); + $nStack = 0; + foreach (array_keys($aFragments) as $keyFragment) { + if (0 < $nStack) + array_push($aStack, ']]]]><', '![CDATA[>', $aFragments[$keyFragment]); + else + $aStack[] = $aFragments[$keyFragment]; + ++$nStack; + } + if (0 < $nOutput) + array_push($aOutput, '<', '![]]><', '![CDATA[CDATA[', implode('', $aStack)); + else + $aOutput[] = implode('', $aStack); + ++$nOutput; + } + echo implode('', $aOutput); + } else + echo $sData; + + echo ']]>'; + } else { + if (is_string($sData)) { + echo 'S'; + } else if (is_int($sData) || is_float($sData)) { + echo 'N'; + } else if (is_bool($sData)) { + echo 'B'; + } + echo $sData; + } + } + + /* + Function: _encodeArray + + Recursively serializes a data structure in an array so that it can + be sent to the browser. This can be thought of as the opposite of + _parseObjXml>. + + Parameters: + + mData - (mixed): The data to be evaluated. + + Returns: + + mixed : The object constructed from the data. + */ + function _encodeArray(&$mData) { + if ('object' === gettype($mData)) + $mData = get_object_vars($mData); + + if (false === is_array($mData)) + return $mData; + + $aData = array(); + foreach (array_keys($mData) as $sKey) + $aData[] = array( + // key does not need to be encoded + 'k'=>$sKey, + 'v'=>$this->_encodeArray($mData[$sKey]) + ); + return $aData; + } + +}// end class xajaxResponse + +class xajaxCustomResponse +{ + var $sOutput; + var $sContentType; + + var $sCharacterEncoding; + var $bOutputEntities; + + function xajaxCustomResponse($sContentType) + { + $this->sOutput = ''; + $this->sContentType = $sContentType; + + $objResponseManager =& xajaxResponseManager::getInstance(); + + $this->sCharacterEncoding = $objResponseManager->getCharacterEncoding(); + $this->bOutputEntities = $objResponseManager->getOutputEntities(); + } + + function setCharacterEncoding($sCharacterEncoding) + { + $this->sCharacterEncoding = $sCharacterEncoding; + } + + function setOutputEntities($bOutputEntities) + { + $this->bOutputEntities = $bOutputEntities; + } + + function clear() + { + $this->sOutput = ''; + } + + function append($sOutput) + { + $this->sOutput .= $sOutput; + } + + function absorb($objResponse) + { + //SkipDebug + if (false == is_a($objResponse, 'xajaxCustomResponse')) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:MXRTERR') + , E_USER_ERROR + ); + } + + if ($objResponse->getContentType() != $this->getContentType()) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:MXCTERR') + , E_USER_ERROR + ); + } + + if ($objResponse->getCharacterEncoding() != $this->getCharacterEncoding()) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:MXCEERR') + , E_USER_ERROR + ); + } + + if ($objResponse->getOutputEntities() != $this->getOutputEntities()) { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + trigger_error( + $objLanguageManager->getText('XJXRSP:MXOEERR') + , E_USER_ERROR + ); + } + //EndSkipDebug + + $this->sOutput .= $objResponse->getOutput(); + } + + function getContentType() + { + return $this->sContentType; + } + + function getCharacterEncoding() + { + return $this->sCharacterEncoding; + } + + function getOutputEntities() + { + return $this->bOutputEntities; + } + + function getOutput() + { + return $this->sOutput; + } + + function printOutput() + { + $sContentType = $this->sContentType; + $sCharacterSet = $this->sCharacterEncoding; + + header("content-type: {$sContentType}; charset={$sCharacterSet}"); + + echo $this->sOutput; + } +} Index: lms/lib/xajax/xajax_core/xajaxResponseManager.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajaxResponseManager.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajaxResponseManager.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,231 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxResponseManager.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Class: xajaxResponseManager + + This class stores and tracks the response that will be returned after + processing a request. The response manager represents a single point + of contact for working with objects as well as + objects. +*/ +class xajaxResponseManager +{ + /* + Object: objResponse + + The current response object that will be sent back to the browser + once the request processing phase is complete. + */ + var $objResponse; + + /* + String: sCharacterEncoding + */ + var $sCharacterEncoding; + + /* + Boolean: bOutputEntities + */ + var $bOutputEntities; + + /* + Array: aDebugMessages + */ + var $aDebugMessages; + + /* + Function: xajaxResponseManager + + Construct and initialize the one and only xajaxResponseManager object. + */ + function xajaxResponseManager() + { + $this->objResponse = NULL; + $this->aDebugMessages = array(); + } + + /* + Function: getInstance + + Implementation of the singleton pattern: provide a single instance of the + to all who request it. + */ + function &getInstance() + { + static $obj; + if (!$obj) { + $obj = new xajaxResponseManager(); + } + return $obj; + } + + /* + Function: configure + + Called by the xajax object when configuration options are set in the main script. Option + values are passed to each of the main xajax components and stored locally as needed. The + will track the characterEncoding and outputEntities settings. + + Parameters: + $sName - (string): Setting name + $mValue - (mixed): Value + */ + function configure($sName, $mValue) + { + if ('characterEncoding' == $sName) + { + $this->sCharacterEncoding = $mValue; + + if (isset($this->objResponse)) + $this->objResponse->setCharacterEncoding($this->sCharacterEncoding); + } + else if ('outputEntities' == $sName) + { + if (true === $mValue || false === $mValue) + { + $this->bOutputEntities = $mValue; + + if (isset($this->objResponse)) + $this->objResponse->setOutputEntities($this->bOutputEntities); + } + } + } + + /* + Function: clear + + Clear the current response. A new response will need to be appended + before the request processing is complete. + */ + function clear() + { + $this->objResponse = NULL; + } + + /* + Function: append + + Used, primarily internally, to append one response object onto the end of another. You can + append one xajaxResponse to the end of another, or append a xajaxCustomResponse onto the end of + another xajaxCustomResponse. However, you cannot append a standard response object onto the end + of a custom response and likewise, you cannot append a custom response onto the end of a standard + response. + + Parameters: + + $mResponse - (object): The new response object to be added to the current response object. + + If no prior response has been appended, this response becomes the main response object to which other + response objects will be appended. + */ + function append($mResponse) + { + if (is_a($mResponse, 'xajaxResponse')) { + if (NULL == $this->objResponse) { + $this->objResponse = $mResponse; + } else if (is_a($this->objResponse, 'xajaxResponse')) { + if ($this->objResponse != $mResponse) + $this->objResponse->absorb($mResponse); + } else { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + $this->debug( + $objLanguageManager->getText('XJXRM:MXRTERR') + . get_class($this->objResponse) + . ')' + ); + } + } else if (is_a($mResponse, 'xajaxCustomResponse')) { + if (NULL == $this->objResponse) { + $this->objResponse = $mResponse; + } else if (is_a($this->objResponse, 'xajaxCustomResponse')) { + if ($this->objResponse != $mResponse) + $this->objResponse->absorb($mResponse); + } else { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + $this->debug( + $objLanguageManager->getText('XJXRM:MXRTERR') + . get_class($this->objResponse) + . ')' + ); + } + } else { + $objLanguageManager =& xajaxLanguageManager::getInstance(); + $this->debug($objLanguageManager->getText('XJXRM:IRERR')); + } + } + + /* + Function: debug + + Appends a debug message on the end of the debug message queue. Debug messages + will be sent to the client with the normal response (if the response object supports + the sending of debug messages, see: ) + + Parameters: + + $sMessage - (string): The text of the debug message to be sent. + */ + function debug($sMessage) + { + $this->aDebugMessages[] = $sMessage; + } + + /* + Function: send + + Prints the response object to the output stream, thus sending the response to the client. + */ + function send() + { + if (NULL != $this->objResponse) { + foreach ($this->aDebugMessages as $sMessage) + $this->objResponse->debug($sMessage); + $this->aDebugMessages = array(); + $this->objResponse->printOutput(); + } + } + + /* + Function: getCharacterEncoding + + Called automatically by new response objects as they are constructed to obtain the + current character encoding setting. As the character encoding is changed, the + will automatically notify the current response object since it would have been constructed + prior to the setting change, see . + */ + function getCharacterEncoding() + { + return $this->sCharacterEncoding; + } + + /* + Function: getOutputEntities + + Called automatically by new response objects as they are constructed to obtain the + current output entities setting. As the output entities setting is changed, the + will automatically notify the current response object since it would + have been constructed prior to the setting change, see . + */ + function getOutputEntities() + { + return $this->bOutputEntities; + } +} \ No newline at end of file Index: lms/lib/xajax/xajax_core/xajax_lang_de.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajax_lang_de.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajax_lang_de.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,88 @@ + for a detailed description, copyright + and license information. + + Translations provided by: (Thank you!) + - mic + - q_no +*/ + +/* + @package xajax + @version $Id: xajax_lang_de.inc.php,v 1.1 2011/11/14 07:51:07 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +//SkipAIO + +$objLanguageManager =& xajaxLanguageManager::getInstance(); +$objLanguageManager->register('de', array( + 'LOGHDR:01' => '** xajax Fehler Protokoll - ', + 'LOGHDR:02' => " **\n", + 'LOGHDR:03' => "\n\n\n", + 'LOGERR:01' => "** Protokolliere Fehler **\n\nxajax konnte den Fehler nicht in die Protokolldatei schreiben:\n", + 'LOGMSG:01' => "** PHP Fehlermeldungen: **", + 'CMPRSJS:RDERR:01' => 'Die unkomprimierte JavaScript-Datei konnte nicht gefunden werden im Verzeichnis: ', + 'CMPRSJS:RDERR:02' => '. Fehler ', + 'CMPRSJS:WTERR:01' => 'Die komprimierte xajax JavaScript-Datei konnte nicht in das Verzeichnis ', + 'CMPRSJS:WTERR:02' => ' geschrieben werden. Fehler ', + 'CMPRSPHP:WTERR:01' => 'Die komprimierte xajax Datei ', + 'CMPRSPHP:WTERR:02' => ' konnte nicht geschrieben werden. Fehler ', + 'CMPRSAIO:WTERR:01' => 'Die komprimierte xajax Datei ', + 'CMPRSAIO:WTERR:02' => '/xajaxAIO.inc.php konnte nicht geschrieben werden. Fehler ', + 'DTCTURI:01' => 'xajax Fehler: xajax konnte die Request URI nicht automatisch identifizieren.', + 'DTCTURI:02' => 'Bitte setzen sie die Request URI explizit wenn sie die xajax Klasse instanziieren.', + 'ARGMGR:ERR:01' => 'Fehlerhaftes Objekt erhalten: ', + 'ARGMGR:ERR:02' => ' <==> ', + 'ARGMGR:ERR:03' => 'Die erhaltenen xajax Daten konnte nicht aus UTF8 konvertiert werden.', + 'XJXCTL:IAERR:01' => 'Ungültiges Attribut [', + 'XJXCTL:IAERR:02' => '] für Element [', + 'XJXCTL:IAERR:03' => '].', + 'XJXCTL:IRERR:01' => 'Ungültiges Request-Objekt übergeben an xajaxControl::setEvent', + 'XJXCTL:IEERR:01' => 'Ungültiges Attribut (event name) [', + 'XJXCTL:IEERR:02' => '] für Element [', + 'XJXCTL:IEERR:03' => '].', + 'XJXCTL:MAERR:01' => 'Erforderliches Attribut fehlt [', + 'XJXCTL:MAERR:02' => '] für Element [', + 'XJXCTL:MAERR:03' => '].', + 'XJXCTL:IETERR:01' => "Ungültiges End-Tag; Sollte 'forbidden' oder 'optional' sein.\n", + 'XJXCTL:ICERR:01' => "Ungültige Klasse für html control angegeben.; Sollte %inline, %block oder %flow sein.\n", + 'XJXCTL:ICLERR:01' => 'Ungültige Klasse (control) an addChild übergeben; Sollte abgeleitet sein von xajaxControl.', + 'XJXCTL:ICLERR:02' => 'Ungültige Klasse (control) an addChild übergeben [', + 'XJXCTL:ICLERR:03' => '] für Element [', + 'XJXCTL:ICLERR:04' => "].\n", + 'XJXCTL:ICHERR:01' => 'Ungültiger Parameter übergeben für xajaxControl::addChildren; Array aus xajaxControl Objekten erwartet.', + 'XJXCTL:MRAERR:01' => 'Erforderliches Attribut fehlt [', + 'XJXCTL:MRAERR:02' => '] für Element [', + 'XJXCTL:MRAERR:03' => '].', + 'XJXPLG:GNERR:01' => 'Response plugin sollte die Funktion getName überschreiben.', + 'XJXPLG:PERR:01' => 'Response plugin sollte die process Funktion überschreiben.', + 'XJXPM:IPLGERR:01' => 'Versuch ungültiges Plugin zu registrieren: : ', + 'XJXPM:IPLGERR:02' => ' Ableitung von xajaxRequestPlugin oder xajaxResponsePlugin erwartet.', + 'XJXPM:MRMERR:01' => 'Konnte die Registrierungsmethode nicht finden für: : ', + 'XJXRSP:EDERR:01' => 'Die Angabe der Zeichensatzkodierung in der xajaxResponse ist veraltet. Die neue Funktion lautet: $xajax->configure("characterEncoding", ...);', + 'XJXRSP:MPERR:01' => 'Ungültiger oder fehlender Pluginname festgestellt im Aufruf von xajaxResponse::plugin', + 'XJXRSP:CPERR:01' => "Der Parameter \$sType in addCreate ist veraltet. Die neue Funktion lautet addCreateInput()", + 'XJXRSP:LCERR:01' => "Das xajax response Objeckt konnte die Befehler nich verarbeiten, da kein gültiges Array übergeben wurde.", + 'XJXRSP:AKERR:01' => 'Ungültiger Tag-Name im Array.', + 'XJXRSP:IEAERR:01' => 'Ungeeignet kodiertes Array.', + 'XJXRSP:NEAERR:01' => 'Nicht kodiertes Array festgestellt.', + 'XJXRSP:MBEERR:01' => 'Die Ausgabe vonn xajax response konnte nicht in htmlentities umgewandelt werden, da die Funktion mb_convert_encoding nicht verfügbar ist.', + 'XJXRSP:MXRTERR' => 'Fehler: Kann keine verschiedenen Typen in einer einzelnen Antwort verarbeiten.', + 'XJXRSP:MXCTERR' => 'Fehler: Kann keine verschiedenen Content-Types in einer einzelnen Antwort verarbeiten.', + 'XJXRSP:MXCEERR' => 'Fehler: Kann keine verschiedenen Zeichensatzkodierungen in einer einzelnen Antwort verarbeiten.', + 'XJXRSP:MXOEERR' => 'Fehler: Kann keine output entities (true/false) in ener einzelnen Antwort verarbeiten.', + 'XJXRM:IRERR' => 'Ungültige Antwort erhalten während der Ausführung der Anfrage.', + 'XJXRM:MXRTERR' => 'Fehler: Kann kkeine verschiedenen reponse types benutzen während der Ausführung einer Anfrage: ' + )); + +//EndSkipAIO \ No newline at end of file Index: lms/lib/xajax/xajax_core/xajax_lang_nl.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/xajax_lang_nl.inc.php:1.1 --- /dev/null Mon Nov 14 08:51:07 2011 +++ lms/lib/xajax/xajax_core/xajax_lang_nl.inc.php Mon Nov 14 08:51:07 2011 @@ -0,0 +1,79 @@ + for a detailed description, copyright + and license information. + + Translations provided by: (Thank you!) + - Jeffrey +*/ + +//SkipAIO + +$objLanguageManager =& xajaxLanguageManager::getInstance(); +$objLanguageManager->register('nl', array( + 'LOGHDR:01' => '** xajax Foutmelding logboek - ', + 'LOGHDR:02' => " **\n", + 'LOGHDR:03' => "\n\n\n", + 'LOGERR:01' => "** Logboek fouten **\n\nxajax was niet in staat om te schrijven naar het logboek:\n", + 'LOGMSG:01' => "** PHP Foutmeldingen: **", + 'CMPRSJS:RDERR:01' => 'Het xajax ongecomprimeerde Javascript bestand kon niet worden gevonden in de: ', + 'CMPRSJS:RDERR:02' => '. map. ', + 'CMPRSJS:WTERR:01' => 'Het xajax gecomprimeerde Javascript bestand kon niet worden geschreven in de: ', + 'CMPRSJS:WTERR:02' => ' map. Fout ', + 'CMPRSPHP:WTERR:01' => 'Naar het xajax gecomprimeerde bestand ', + 'CMPRSPHP:WTERR:02' => ' kon niet worden geschreven. Fout ', + 'CMPRSAIO:WTERR:01' => 'Naar het xajax gecomprimeerde bestand ', + 'CMPRSAIO:WTERR:02' => '/xajaxAIO.inc.php kon niet worden geschreven. Fout ', + 'DTCTURI:01' => 'xajax Fout: xajax kon de Request URI niet automatisch identificeren.', + 'DTCTURI:02' => 'Alstublieft, specificeer de Request URI expliciet bij het initiëren van het xajax object.', + 'ARGMGR:ERR:01' => 'Misvormd object argument ontvangen: ', + 'ARGMGR:ERR:02' => ' <==> ', + 'ARGMGR:ERR:03' => 'De binnenkomende xajax data kon niet wordt geconverteerd van UTF-8.', + 'XJXCTL:IAERR:01' => 'Ongeldig attribuut [', + 'XJXCTL:IAERR:02' => '] voor element [', + 'XJXCTL:IAERR:03' => '].', + 'XJXCTL:IRERR:01' => 'Ongeldige object aanvraag doorgegeven aan xajaxControl::setEvent', + 'XJXCTL:IEERR:01' => 'Ongeldig attribuut (event name) [', + 'XJXCTL:IEERR:02' => '] voor element [', + 'XJXCTL:IEERR:03' => '].', + 'XJXCTL:MAERR:01' => 'Ontbrekend attribuut [', + 'XJXCTL:MAERR:02' => '] voor element [', + 'XJXCTL:MAERR:03' => '].', + 'XJXCTL:IETERR:01' => "Ongeldige eind-tag; zou 'forbidden' of 'optional' moeten zijn..\n", + 'XJXCTL:ICERR:01' => "Ongeldige klasse gespecificeerd voor html control.; zou %inline, %block of %flow moeten zijn.\n", + 'XJXCTL:ICLERR:01' => 'Ongeldige (control) doorgegeven aan addChild; Zou moeten worden afgeleid van xajaxControl.', + 'XJXCTL:ICLERR:02' => 'Ongeldige (control) doorgegeven aan addChild [', + 'XJXCTL:ICLERR:03' => '] voor element [', + 'XJXCTL:ICLERR:04' => "].\n", + 'XJXCTL:ICHERR:01' => 'Ongeldige parameter doorgegeven aan xajaxControl::addChildren; Array moet bestaan uit xajaxControl objecten.', + 'XJXCTL:MRAERR:01' => 'Ontbrekend attribuut [', + 'XJXCTL:MRAERR:02' => '] voor element [', + 'XJXCTL:MRAERR:03' => '].', + 'XJXPLG:GNERR:01' => 'Retourneer plugin zou de getName functie moeten overschrijven.', + 'XJXPLG:PERR:01' => 'Retourneer plugin zou de proces functie moeten overschrijven.', + 'XJXPM:IPLGERR:01' => 'Poging om ongeldige plugin te registreren: : ', + 'XJXPM:IPLGERR:02' => ' afleiding moet komen van xajaxRequestPlugin of xajaxResponsePlugin.', + 'XJXPM:MRMERR:01' => 'Localisatie van registratie methode faalde voor het volgende: : ', + 'XJXRSP:EDERR:01' => 'Doorgeven van karakter decodering naar de xajaxResponse constructie is verouderd. De nieuwe functie luidt: $xajax->configure("characterEncoding", ...);', + 'XJXRSP:MPERR:01' => 'Ongeldige of ontbrekende plugin naam gedetecteerd in een aanvraag naar xajaxResponse::plugin', + 'XJXRSP:CPERR:01' => "De parameter \$sType in addCreate is verouderd.. De nieuwe functie luidt addCreateInput()", + 'XJXRSP:LCERR:01' => "Het xajax antwoord object kon de commando's niet laden, gezien de meegegeven data geen geldige array is.", + 'XJXRSP:AKERR:01' => 'Ongeldige ge-encodeerde tag naam in array', + 'XJXRSP:IEAERR:01' => 'Ungeeignet kodiertes Array.', + 'XJXRSP:NEAERR:01' => 'Niet gecodeerde array gedetecteerd.', + 'XJXRSP:MBEERR:01' => 'De xajax output kon niet worden geconverteerd naar HTML entities, gezien mb_convert_encoding niet beschikbaar is.', + 'XJXRSP:MXRTERR' => 'Fout: Kann keine verschiedenen Typen in einer einzelnen Antwort verarbeiten.', + 'XJXRSP:MXCTERR' => 'Fout: Kan geen meerdere typen verwisselen in een enkele teruggave.', + 'XJXRSP:MXCEERR' => 'Fout: Kan geen meerdere karakter decoderingen verwerken in een enkele teruggave.', + 'XJXRSP:MXOEERR' => 'Fout: kan geen output entities (true/false) in een enkele teruggave verwerken.', + 'XJXRM:IRERR' => 'Een ongeldig antwoord is geretourneerd tijdens het verwerken van deze aanvraag.', + 'XJXRM:MXRTERR' => 'Fout: Kan geen meerdere typen verwisselen tijdens het verwerken van een enkele aanvraag: ' + )); + +//EndSkipAIO \ No newline at end of file From cvs w lms.org.pl Mon Nov 14 08:56:03 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 14 Nov 2011 08:56:03 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/xajax/xajax_core/plugin_layer/support (3 files) Message-ID: <20111114075603.BBF4B302A040@eftep.altec.pl> Date: Monday, November 14, 2011 @ 08:56:03 Author: chilek Path: /cvsroot/lms/lib/xajax/xajax_core/plugin_layer/support Added: xajaxCallableObject.inc.php xajaxEvent.inc.php xajaxUserFunction.inc.php - ported to xajax 0.5 Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/plugin_layer/support/xajaxCallableObject.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/plugin_layer/support/xajaxEvent.inc.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/xajax/xajax_core/plugin_layer/support/xajaxUserFunction.inc.php?rev=1.1 Index: lms/lib/xajax/xajax_core/plugin_layer/support/xajaxCallableObject.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/plugin_layer/support/xajaxCallableObject.inc.php:1.1 --- /dev/null Mon Nov 14 08:56:03 2011 +++ lms/lib/xajax/xajax_core/plugin_layer/support/xajaxCallableObject.inc.php Mon Nov 14 08:56:03 2011 @@ -0,0 +1,228 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxCallableObject.inc.php,v 1.1 2011/11/14 07:56:03 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Class: xajaxCallableObject + + A class that stores a reference to an object whose methods can be called from + the client via a xajax request. will call + generateClientScript> so that stub functions can be + generated and sent to the browser. +*/ +class xajaxCallableObject +{ + /* + Object: obj + + A reference to the callable object. + */ + var $obj; + + /* + Array: aConfiguration + + An associative array that will contain configuration options for zero + or more of the objects methods. These configuration options will + define the call options for each request. The call options will be + passed to the client browser when the function stubs are generated. + */ + var $aConfiguration; + + /* + Function: xajaxCallableObject + + Constructs and initializes the + + obj - (object): The object to reference. + */ + function xajaxCallableObject(&$obj) + { + $this->obj =& $obj; + $this->aConfiguration = array(); + } + + /* + Function: getName + + Returns the name of this callable object. This is typically the + class name of the object. + */ + function getName() + { + return get_class($this->obj); + } + + /* + Function: configure + + Used to set configuration options / call options for each method. + + sMethod - (string): The name of the method. + sName - (string): The name of the configuration option. + sValue - (string): The value to be set. + */ + function configure($sMethod, $sName, $sValue) + { + $sMethod = strtolower($sMethod); + + if (false == isset($this->aConfiguration[$sMethod])) + $this->aConfiguration[$sMethod] = array(); + + $this->aConfiguration[$sMethod][$sName] = $sValue; + } + + /* + Function: generateRequests + + Produces an array of objects, one for each method + exposed by this callable object. + + sXajaxPrefix - (string): The prefix to be prepended to the + javascript function names; this will correspond to the name + used for the function stubs that are generated by the + generateClientScript> call. + */ + function generateRequests($sXajaxPrefix) + { + $aRequests = array(); + + $sClass = get_class($this->obj); + + foreach (get_class_methods($this->obj) as $sMethodName) + { + $bInclude = true; + // exclude magic __call method + if ("__call" == $sMethodName) + $bInclude = false; + // exclude constructor + if ($sClass == $sMethodName) + $bInclude = false; + if ($bInclude) + $aRequests[strtolower($sMethodName)] = + new xajaxRequest("{$sXajaxPrefix}{$sClass}.{$sMethodName}"); + } + + return $aRequests; + } + + /* + Function: generateClientScript + + Called by generateClientScript> while is + generating the javascript to be sent to the browser. + + sXajaxPrefix - (string): The prefix to be prepended to the + javascript function names. + */ + function generateClientScript($sXajaxPrefix) + { + $sClass = get_class($this->obj); + + echo "{$sXajaxPrefix}{$sClass} = {};\n"; + + foreach (get_class_methods($this->obj) as $sMethodName) + { + $bInclude = true; + // exclude magic __call, __construct, __destruct methods + if (2 < strlen($sMethodName)) + if ("__" == substr($sMethodName, 0, 2)) + $bInclude = false; + // exclude constructor + if ($sClass == $sMethodName) + $bInclude = false; + if ($bInclude) + { + echo "{$sXajaxPrefix}{$sClass}.{$sMethodName} = function() { "; + echo "return xajax.request( "; + echo "{ xjxcls: '{$sClass}', xjxmthd: '{$sMethodName}' }, "; + echo "{ parameters: arguments"; + + $sSeparator = ", "; + if (isset($this->aConfiguration['*'])) + foreach ($this->aConfiguration['*'] as $sKey => $sValue) + echo "{$sSeparator}{$sKey}: {$sValue}"; + if (isset($this->aConfiguration[strtolower($sMethodName)])) + foreach ($this->aConfiguration[strtolower($sMethodName)] as $sKey => $sValue) + echo "{$sSeparator}{$sKey}: {$sValue}"; + + echo " } ); "; + echo "};\n"; + } + } + } + + /* + Function: isClass + + Determins if the specified class name matches the class name of the + object referenced by obj>. + + sClass - (string): The name of the class to check. + + Returns: + + boolean - True of the specified class name matches the class of + the object being referenced; false otherwise. + */ + function isClass($sClass) + { + if(get_class($this->obj) === $sClass) + return true; + return false; + } + + /* + Function: hasMethod + + Determines if the specified method name is one of the methods of the + object referenced by obj>. + + sMethod - (object): The name of the method to check. + + Returns: + + boolean - True of the referenced object contains the specified method, + false otherwise. + */ + function hasMethod($sMethod) + { + return method_exists($this->obj, $sMethod) || method_exists($this->obj, "__call"); + } + + /* + Function: call + + Call the specified method of the object being referenced using the specified + array of arguments. + + sMethod - (string): The name of the method to call. + aArgs - (array): The arguments to pass to the method. + */ + function call($sMethod, $aArgs) + { + $objResponseManager =& xajaxResponseManager::getInstance(); + $objResponseManager->append( + call_user_func_array( + array(&$this->obj, $sMethod), + $aArgs + ) + ); + } +} Index: lms/lib/xajax/xajax_core/plugin_layer/support/xajaxEvent.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/plugin_layer/support/xajaxEvent.inc.php:1.1 --- /dev/null Mon Nov 14 08:56:03 2011 +++ lms/lib/xajax/xajax_core/plugin_layer/support/xajaxEvent.inc.php Mon Nov 14 08:56:03 2011 @@ -0,0 +1,162 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxEvent.inc.php,v 1.1 2011/11/14 07:56:03 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +// require_once is necessary here as the function plugin also includes this +//SkipAIO +require_once dirname(__FILE__) . '/xajaxUserFunction.inc.php'; +//EndSkipAIO + +/* + Class: xajaxEvent + + A container class which holds a reference to handler functions and configuration + options associated with a registered event. +*/ +class xajaxEvent +{ + /* + String: sName + + The name of the event. + */ + var $sName; + + /* + Array: aConfiguration + + Configuration / call options to be used when initiating a xajax request + to trigger this event. + */ + var $aConfiguration; + + /* + Array: aHandlers + + A list of objects associated with this registered + event. Each of these functions will be called when the event is triggered. + */ + var $aHandlers; + + /* + Function: xajaxEvent + + Construct and initialize this object. + */ + function xajaxEvent($sName) + { + $this->sName = $sName; + $this->aConfiguration = array(); + $this->aHandlers = array(); + } + + /* + Function: getName + + Returns the name of the event. + + Returns: + + string - the name of the event. + */ + function getName() + { + return $this->sName; + } + + /* + Function: configure + + Sets/stores configuration options that will be used when generating + the client script that is sent to the browser. + */ + function configure($sName, $mValue) + { + $this->aConfiguration[$sName] = $mValue; + } + + /* + Function: addHandler + + Adds a object to the list of handlers that will + be fired when the event is triggered. + */ + function addHandler(&$xuf) + { + $this->aHandlers[] =& $xuf; + } + + /* + Function: generateRequest + + Generates a object that corresponds to the + event so that the client script can easily invoke this event. + + sXajaxPrefix - (string): The prefix that will be prepended to + the client script stub function associated with this event. + + sEventPrefix - (string): The prefix prepended to the client script + function stub and script. + */ + function generateRequest($sXajaxPrefix, $sEventPrefix) + { + $sEvent = $this->sName; + return new xajaxRequest("{$sXajaxPrefix}{$sEventPrefix}{$sEvent}"); + } + + /* + Function: generateClientScript + + Generates a block of javascript code that declares a stub function + that can be used to easily trigger the event from the browser. + */ + function generateClientScript($sXajaxPrefix, $sEventPrefix) + { + $sMode = ''; + $sMethod = ''; + + if (isset($this->aConfiguration['mode'])) + $sMode = $this->aConfiguration['mode']; + + if (isset($this->aConfiguration['method'])) + $sMethod = $this->aConfiguration['method']; + + if (0 < strlen($sMode)) + $sMode = ", mode: '{$sMode}'"; + + if (0 < strlen($sMethod)) + $sMethod = ", method: '{$sMethod}'"; + + $sEvent = $this->sName; + echo "{$sXajaxPrefix}{$sEventPrefix}{$sEvent} = function() { return xajax.request( { xjxevt: '{$sEvent}' }, { parameters: arguments{$sMode}{$sMethod} } ); };\n"; + } + + /* + Function: fire + + Called by the when the event has been triggered. + */ + function fire($aArgs) + { + $objResponseManager =& xajaxResponseManager::getInstance(); + + foreach (array_keys($this->aHandlers) as $sKey) + $this->aHandlers[$sKey]->call($aArgs); + } +} Index: lms/lib/xajax/xajax_core/plugin_layer/support/xajaxUserFunction.inc.php diff -u /dev/null lms/lib/xajax/xajax_core/plugin_layer/support/xajaxUserFunction.inc.php:1.1 --- /dev/null Mon Nov 14 08:56:03 2011 +++ lms/lib/xajax/xajax_core/plugin_layer/support/xajaxUserFunction.inc.php Mon Nov 14 08:56:03 2011 @@ -0,0 +1,233 @@ + for a detailed description, copyright + and license information. +*/ + +/* + @package xajax + @version $Id: xajaxUserFunction.inc.php,v 1.1 2011/11/14 07:56:03 chilek Exp $ + @copyright Copyright (c) 2005-2007 by Jared White & J. Max Wilson + @copyright Copyright (c) 2008-2009 by Joseph Woolley, Steffen Konerow, Jared White & J. Max Wilson + @license http://www.xajaxproject.org/bsd_license.txt BSD License +*/ + +/* + Class: xajaxUserFunction + + Construct instances of this class to define functions that will be registered + with the request processor. This class defines the parameters that + are needed for the definition of a xajax enabled function. While you can + still specify functions by name during registration, it is advised that you + convert to using this class when you wish to register external functions or + to specify call options as well. +*/ +class xajaxUserFunction +{ + /* + String: sAlias + + An alias to use for this function. This is useful when you want + to call the same xajax enabled function with a different set of + call options from what was already registered. + */ + var $sAlias; + + /* + Object: uf + + A string or array which defines the function to be registered. + */ + var $uf; + + /* + String: sInclude + + The path and file name of the include file that contains the function. + */ + var $sInclude; + + /* + Array: aConfiguration + + An associative array containing call options that will be sent to the + browser curing client script generation. + */ + var $aConfiguration; + + /* + Function: xajaxUserFunction + + Constructs and initializes the object. + + $uf - (mixed): A function specification in one of the following formats: + + - a three element array: + (string) Alternate function name: when a method of a class has the same + name as another function in the system, you can provide an alias to + help avoid collisions. + (object or class name) Class: the name of the class or an instance of + the object which contains the function to be called. + (string) Method: the name of the method that will be called. + - a two element array: + (object or class name) Class: the name of the class or an instance of + the object which contains the function to be called. + (string) Method: the name of the method that will be called. + - a string: + the name of the function that is available at global scope (not in a + class. + $sInclude - (string, optional): The path and file name of the include file + that contains the class or function to be called. + + $aConfiguration - (array, optional): An associative array of call options + that will be used when sending the request from the client. + + Examples: + + $myFunction = array('alias', 'myClass', 'myMethod'); + $myFunction = array('alias', &$myObject, 'myMethod'); + $myFunction = array('myClass', 'myMethod'); + $myFunction = array(&$myObject, 'myMethod'); + $myFunction = 'myFunction'; + + $myUserFunction = new xajaxUserFunction($myFunction, 'myFile.inc.php', array( + 'method' => 'get', + 'mode' => 'synchronous' + )); + + $xajax->register(XAJAX_FUNCTION, $myUserFunction); + */ + function xajaxUserFunction($uf, $sInclude=NULL, $aConfiguration=array()) + { + $this->sAlias = ''; + $this->uf =& $uf; + $this->sInclude = $sInclude; + $this->aConfiguration = array(); + foreach ($aConfiguration as $sKey => $sValue) + $this->configure($sKey, $sValue); + + if (is_array($this->uf) && 2 < count($this->uf)) + { + $this->sAlias = $this->uf[0]; + $this->uf = array_slice($this->uf, 1); + } + +//SkipDebug + if (is_array($this->uf) && 2 != count($this->uf)) + trigger_error( + 'Invalid function declaration for xajaxUserFunction.', + E_USER_ERROR + ); +//EndSkipDebug + } + + /* + Function: getName + + Get the name of the function being referenced. + + Returns: + + string - the name of the function contained within this object. + */ + function getName() + { + // Do not use sAlias here! + if (is_array($this->uf)) + return $this->uf[1]; + return $this->uf; + } + + /* + Function: configure + + Call this to set call options for this instance. + */ + function configure($sName, $sValue) + { + if ('alias' == $sName) + $this->sAlias = $sValue; + else + $this->aConfiguration[$sName] = $sValue; + } + + /* + Function: generateRequest + + Constructs and returns a object which is capable + of generating the javascript call to invoke this xajax enabled + function. + */ + function generateRequest($sXajaxPrefix) + { + $sAlias = $this->getName(); + if (0 < strlen($this->sAlias)) + $sAlias = $this->sAlias; + return new xajaxRequest("{$sXajaxPrefix}{$sAlias}"); + } + + /* + Function: generateClientScript + + Called by the that is referencing this function + reference during the client script generation phase. This function + will generate the javascript function stub that is sent to the + browser on initial page load. + */ + function generateClientScript($sXajaxPrefix) + { + $sFunction = $this->getName(); + $sAlias = $sFunction; + if (0 < strlen($this->sAlias)) + $sAlias = $this->sAlias; + echo "{$sXajaxPrefix}{$sAlias} = function() { "; + echo "return xajax.request( "; + echo "{ xjxfun: '{$sFunction}' }, "; + echo "{ parameters: arguments"; + + $sSeparator = ", "; + foreach ($this->aConfiguration as $sKey => $sValue) + echo "{$sSeparator}{$sKey}: {$sValue}"; + + echo " } ); "; + echo "};\n"; + } + + /* + Function: call + + Called by the that references this function during the + request processing phase. This function will call the specified + function, including an external file if needed and passing along + the specified arguments. + */ + function call($aArgs=array()) + { + $objResponseManager =& xajaxResponseManager::getInstance(); + + if (NULL != $this->sInclude) + { + ob_start(); + require_once $this->sInclude; + $sOutput = ob_get_clean(); + +//SkipDebug + if (0 < strlen($sOutput)) + { + $sOutput = 'From include file: ' . $this->sInclude . ' => ' . $sOutput; + $objResponseManager->debug($sOutput); + } +//EndSkipDebug + } + + $mFunction = $this->uf; + $objResponseManager->append(call_user_func_array($mFunction, $aArgs)); + } +} +?> From cvs w lms.org.pl Mon Nov 14 10:19:22 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 14 Nov 2011 10:19:22 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (ping.php) Message-ID: <20111114091922.95EEA302A041@eftep.altec.pl> Date: Monday, November 14, 2011 @ 10:19:22 Author: chilek Path: /cvsroot/lms/modules Modified: ping.php - small fix Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.1&r2=1.2 Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.1 lms/modules/ping.php:1.2 --- lms/modules/ping.php:1.1 Sat Nov 12 21:04:30 2011 +++ lms/modules/ping.php Mon Nov 14 10:19:22 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.1 2011/11/12 20:04:30 chilek Exp $ + * $Id: ping.php,v 1.2 2011/11/14 09:19:22 chilek Exp $ */ function refresh($params) @@ -38,17 +38,18 @@ if (count($reply)) { $received++; - $output = preg_replace('/^([0-9]+).+ttl=([0-9]+).+time=([0-9\.]+.+)$/', - trans('\1 bytes from $a: icmp_req=$b ttl=\2 time=\3', $ipaddr, $transmitted), current($reply)); + if (preg_match('/^([0-9]+).+ttl=([0-9]+).+time=([0-9\.]+.+)$/', current($reply), $matches)) + $output = trans('$a bytes from $b: icmp_req=$c ttl=$d time=$e', + $matches[1], $ipaddr, $transmitted, $matches[2], $matches[3]); } else $output = trans('Destination Host Unreachable'); if (empty($received)) $received = '0'; - $objResponse->addAppend('data', 'innerHTML', $output.'
'); - $objResponse->addAssign('transmitted', 'value', $transmitted); - $objResponse->addAssign('received', 'value', $received); - $objResponse->addAssign('summary', 'innerHTML', ''.trans('Total: $a% ($b/$c)', + $objResponse->append('data', 'innerHTML', $output.'
'); + $objResponse->assign('transmitted', 'value', $transmitted); + $objResponse->assign('received', 'value', $received); + $objResponse->assign('summary', 'innerHTML', ''.trans('Total: $a% ($b/$c)', round(($received / $transmitted) * 100), $received, $transmitted).''); return $objResponse; } @@ -63,14 +64,15 @@ if (isset($_GET['p']) && $_GET['p'] == 'main') { /* Using AJAX for template plugins */ - require(LIB_DIR.'/xajax/xajax.inc.php'); + require(LIB_DIR.'/xajax/xajax_core/xajax.inc.php'); $xajax = new xajax(); - $xajax->errorHandlerOn(); - $xajax->registerFunction("refresh"); - $xajax->processRequests(); + $xajax->configure('errorHandler', true); + $xajax->configure('javascript URI', 'img'); + $xajax->register(XAJAX_FUNCTION, 'refresh'); + $xajax->processRequest(); - $SMARTY->assign('xajax', $xajax->getJavascript('img/', 'xajax.js')); + $SMARTY->assign('xajax', $xajax->getJavascript()); $SMARTY->assign('part', $_GET['p']); } From cvs w lms.org.pl Mon Nov 14 10:19:22 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 14 Nov 2011 10:19:22 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20111114091922.78082302A040@eftep.altec.pl> Date: Monday, November 14, 2011 @ 10:19:22 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - small fix Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.397&r2=1.398 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.397 lms/lib/locale/pl/strings.php:1.398 --- lms/lib/locale/pl/strings.php:1.397 Sat Nov 12 21:04:30 2011 +++ lms/lib/locale/pl/strings.php Mon Nov 14 10:19:22 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.397 2011/11/12 20:04:30 chilek Exp $ + * $Id: strings.php,v 1.398 2011/11/14 09:19:22 chilek Exp $ */ $_LANG['$a ($b addresses)'] = '$a ($b adresów)'; @@ -2513,7 +2513,7 @@ $_LANG['Select gps coordinates'] = 'Wybierz współrzędne geograficzne'; $_LANG['Select gps coordinates:'] = 'Wybierz współprzędne geograficzne:'; -$_LANG['$a bytes from $b: icmp_req=$c ttl=$d time=$e ms'] = '$a bajtów od $b: icmp_req=$c ttl=$d czas=$e ms'; +$_LANG['$a bytes from $b: icmp_req=$c ttl=$d time=$e'] = '$a bajtów od $b: icmp_req=$c ttl=$d czas=$e'; $_LANG['Destination Host Unreachable'] = 'Urządzenie docelowe jest nieosiągalne'; $_LANG['Total: $a% ($b/$c)'] = 'Razem: $a% ($b/$c)'; $_LANG['Auto Scroll'] = 'Automatyczne przewijanie'; From cvs w lms.org.pl Mon Nov 14 20:21:54 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 14 Nov 2011 20:21:54 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (ping.php) Message-ID: <20111114192154.E3B2A302A042@eftep.altec.pl> Date: Monday, November 14, 2011 @ 20:21:54 Author: chilek Path: /cvsroot/lms/modules Modified: ping.php - toolbar on netdevmap and possibility to ping any host (event not included in database) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.2&r2=1.3 Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.2 lms/modules/ping.php:1.3 --- lms/modules/ping.php:1.2 Mon Nov 14 10:19:22 2011 +++ lms/modules/ping.php Mon Nov 14 20:21:54 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.2 2011/11/14 09:19:22 chilek Exp $ + * $Id: ping.php,v 1.3 2011/11/14 19:21:54 chilek Exp $ */ function refresh($params) @@ -56,8 +56,31 @@ $layout['pagetitle'] = trans('Ping'); -if (!isset($_GET['id']) || !$DB->GetOne('SELECT id FROM nodes WHERE id=?', array(intval($_GET['id'])))) - $SESSION->redirect('?m=nodelist'); +if (!isset($_GET['id'])) +{ + if (isset($_GET['p']) && $_GET['p'] == 'main') + { + /* Using AJAX for template plugins */ + require(LIB_DIR.'/xajax/xajax_core/xajax.inc.php'); + + $xajax = new xajax(); + $xajax->configure('errorHandler', true); + $xajax->configure('javascript URI', 'img'); + $xajax->register(XAJAX_FUNCTION, 'refresh'); + $xajax->processRequest(); + + $SMARTY->assign('xajax', $xajax->getJavascript()); + $SMARTY->assign('part', $_GET['p']); + } + + if (isset($_GET['ip'])) + $SMARTY->assign('ipaddr', $_GET['ip']); + $SMARTY->display('ping.html'); + die; +} +else + if (!$DB->GetOne('SELECT id FROM nodes WHERE id=?', array(intval($_GET['id'])))) + $SESSION->redirect('?m=nodelist'); $nodeid = $_GET['id']; From cvs w lms.org.pl Mon Nov 14 20:21:54 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 14 Nov 2011 20:21:54 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.css, map.js) Message-ID: <20111114192154.C49B0302A041@eftep.altec.pl> Date: Monday, November 14, 2011 @ 20:21:54 Author: chilek Path: /cvsroot/lms/img Added: map.css Modified: map.js - toolbar on netdevmap and possibility to ping any host (event not included in database) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.2&r2=1.3 Index: lms/img/map.css diff -u /dev/null lms/img/map.css:1.1 --- /dev/null Mon Nov 14 20:21:54 2011 +++ lms/img/map.css Mon Nov 14 20:21:54 2011 @@ -0,0 +1,33 @@ +div.olControlPanel { + position: absolute; + top: 5px; + left: 60px; +} + +.olControlPanel div { + display: block; + float: left; + width: 18px; + height: 18px; + border: thin solid black; + margin: 1px; + background-color: white; + background-position: center center; + background-repeat: no-repeat; +} + +.olPingButtonItemActive { + background-image: url("ip.gif"); +} + +.olPingButtonItemInactive { + background-image: url("ip.gif"); +} + +.olping2buttonItemActive { + background-image: url("ip.gif"); +} + +.olping2buttonItemInactive { + background-image: url("ip.gif"); +} Index: lms/img/map.js diff -u lms/img/map.js:1.2 lms/img/map.js:1.3 --- lms/img/map.js:1.2 Sat Nov 12 21:04:30 2011 +++ lms/img/map.js Mon Nov 14 20:21:54 2011 @@ -2,8 +2,18 @@ var maprequest = null; var mappopup = null; var featurepopup = null; +var pingpopup = null; var lastonline_limit; +function removeInvisiblePopups() +{ + // OpenLayers doesn't destroy closed popups, so + // we search for them here and destroy if there are ... + for (var i in map.popups) + if (!map.popups[i].visible()) + map.removePopup(map.popups[i]); +} + function set_lastonline_limit(sec) { lastonline_limit = sec; @@ -60,12 +70,28 @@ function ping_from_map(id) { featurepopup.setContentHTML( - '' + '' ); autoiframe_setsize('autoiframe' + id, 400, 300); featurepopup.updateSize(); } +function ping_from_popup() +{ + var ip = document.forms['ipform'].ip.value; + if (!ip.match(/^([0-9]{1,3}\.){3}[0-9]{1,3}$/)) + return false; + pingpopup.setContentHTML( + '' + ); + + removeInvisiblePopups(); + + autoiframe_setsize('autoiframe' + ip.replace('.', '_'), 400, 300); + pingpopup.updateSize(); + return false; +} + function createMap(deviceArray, devlinkArray, nodeArray, nodelinkArray, selection) { var linkstyles = [ @@ -330,12 +356,12 @@ new OpenLayers.LonLat(feature.data.lon, feature.data.lat) .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), new OpenLayers.Size(600, 400), - null, - null, - false, + null, null, false, function(e) { selectlayer.unselect(selectedFeature); }); + featurepopup.keepInMap = true; + featurepopup.panMapIfOutOfView = true; var content = '' + feature.data.name + '
'; if (feature.data.type == 'netdevinfo') { @@ -367,6 +393,46 @@ selectlayer.activate(); } + var pingbutton = new OpenLayers.Control.Button({ + displayClass: "olPingButton", + title: "Ping a host ...", + command: 'ping'}); + +// var ping2button = new OpenLayers.Control.Button({ +// displayClass: "olPing2Button", +// title: "Ping2 a host ...", +// command: "ping2"}); + + var panel = new OpenLayers.Control.Panel({ + type: OpenLayers.Control.TYPE_BUTTON, + title: "Toolbar", + activateControl: function(control) { + if (control.command == 'ping') { + pingpopup = new OpenLayers.Popup(null, + map.getLonLatFromPixel(new OpenLayers.Pixel(60, 23)).clone(), + new OpenLayers.Size(600, 400), + '' + + '
- {t}GPS latitude:{/t} + {t}GPS longitude:{/t} - - »»» + + »»»
- {t}GPS longitude:{/t} + {t}GPS latitude:{/t} - - »»» + + »»»
- {t}GPS latitude:{/t} + {t}GPS longitude:{/t} - - »»» + + »»»
- {t}GPS longitude:{/t} + {t}GPS latitude:{/t} - - »»» + + »»»
Enter IP address:
', + null, + function() { + alert('close') + }); + pingpopup.setOpacity(0.8); + pingpopup.closeOnMove = true; + pingpopup.autoSize = true; + //pingpopup.keepInMap = true; + //pingpopup.panMapIfOutOfView = true; + map.addPopup(pingpopup); + pingpopup.updateSize(); + document.forms['ipform'].ip.focus(); + } else { + } + } + }); +// panel.addControls([pingbutton, ping2button]); + panel.addControls([pingbutton]); + map.addControl(panel); + map.addControl(new OpenLayers.Control.ScaleLine()); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition({ displayProjection: new OpenLayers.Projection("EPSG:4326") })); @@ -376,5 +442,9 @@ else map.zoomToMaxExtent(); + map.events.register('mousemove', map, function(e) { + removeInvisiblePopups(); + }); + return map; } From cvs w lms.org.pl Mon Nov 14 20:21:54 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 14 Nov 2011 20:21:54 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111114192154.AD8B0302A040@eftep.altec.pl> Date: Monday, November 14, 2011 @ 20:21:54 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - toolbar on netdevmap and possibility to ping any host (event not included in database) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1605&r2=1.1606 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1605 lms/doc/ChangeLog:1.1606 --- lms/doc/ChangeLog:1.1605 Mon Nov 14 08:51:06 2011 +++ lms/doc/ChangeLog Mon Nov 14 20:21:54 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1605 2011/11/14 07:51:06 chilek Exp $ +$Id: ChangeLog,v 1.1606 2011/11/14 19:21:54 chilek Exp $ version ? (????-??-??): @@ -51,6 +51,7 @@ - we can ping nodes and devices watching results in popups [chilan] - 5 default base layers for maps [chilan] - ported to xajax 0.5 [chilan] + - toolbar on netdevmap and possibility to ping any host (event not included in database) [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Mon Nov 14 20:21:55 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 14 Nov 2011 20:21:55 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (header.html, ping.html) Message-ID: <20111114192155.1D814302A043@eftep.altec.pl> Date: Monday, November 14, 2011 @ 20:21:55 Author: chilek Path: /cvsroot/lms/templates Modified: header.html ping.html - toolbar on netdevmap and possibility to ping any host (event not included in database) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/header.html.diff?&r1=1.136&r2=1.137 http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.1&r2=1.2 Index: lms/templates/header.html diff -u lms/templates/header.html:1.136 lms/templates/header.html:1.137 --- lms/templates/header.html:1.136 Thu Nov 10 07:41:01 2011 +++ lms/templates/header.html Mon Nov 14 20:21:54 2011 @@ -1,5 +1,5 @@ - + ::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle|striphtml} :{/if}:: @@ -7,6 +7,7 @@ + Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.1 lms/templates/ping.html:1.2 --- lms/templates/ping.html:1.1 Sat Nov 12 21:04:31 2011 +++ lms/templates/ping.html Mon Nov 14 20:21:54 2011 @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ {if !$part} - + {else} @@ -22,6 +22,7 @@ if (elem && document.getElementById('autoscroll').checked) elem.scrollTop += 1000; xajax_refresh(xajax.getFormValues('params')); + setTimeout("ping_refresh()", 1000); } From cvs w lms.org.pl Tue Nov 15 08:42:56 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 08:42:56 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.js) Message-ID: <20111115074256.A2E28302A040@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 08:42:56 Author: chilek Path: /cvsroot/lms/img Modified: map.js - netdevmap: borders for popups Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.3&r2=1.4 Index: lms/img/map.js diff -u lms/img/map.js:1.3 lms/img/map.js:1.4 --- lms/img/map.js:1.3 Mon Nov 14 20:21:54 2011 +++ lms/img/map.js Tue Nov 15 08:42:56 2011 @@ -2,7 +2,6 @@ var maprequest = null; var mappopup = null; var featurepopup = null; -var pingpopup = null; var lastonline_limit; function removeInvisiblePopups() @@ -67,28 +66,33 @@ setTimeout("netdevmap_refresh()", lastonline_limit * 1000); } -function ping_from_map(id) +function ping_from_map(id, nodeid) { - featurepopup.setContentHTML( - '' - ); - autoiframe_setsize('autoiframe' + id, 400, 300); - featurepopup.updateSize(); + var i; + for (i = 0; i < map.popups.length, map.popups[i].id != id; i++); + map.popups[i].setContentHTML( + ''); + + removeInvisiblePopups(); + + autoiframe_setsize('autoiframe_' + id.replace('.', '_'), 400, 300); + map.popups[i].updateSize(); } -function ping_from_popup() +function ping_from_popup(id) { var ip = document.forms['ipform'].ip.value; if (!ip.match(/^([0-9]{1,3}\.){3}[0-9]{1,3}$/)) return false; - pingpopup.setContentHTML( - '' - ); + var i; + for (i = 0; i < map.popups.length, map.popups[i].id != id; i++); + map.popups[i].setContentHTML( + ''); removeInvisiblePopups(); - autoiframe_setsize('autoiframe' + ip.replace('.', '_'), 400, 300); - pingpopup.updateSize(); + autoiframe_setsize('autoiframe_' + id.replace('.', '_'), 400, 300); + map.popups[i].updateSize(); return false; } @@ -317,7 +321,9 @@ new OpenLayers.LonLat(e.feature.data.lon, e.feature.data.lat) .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), new OpenLayers.Size(600, 400), - '' + e.feature.data.name + '' + (e.feature.data.ipaddr.length ? '
' + e.feature.data.ipaddr.replace(/,/g, "
") : '')); + '
' + e.feature.data.name + + "" + (e.feature.data.ipaddr.length ? '
' + e.feature.data.ipaddr.replace(/,/g, "
") : '') + + '
'); mappopup.setOpacity(0.8); mappopup.closeOnMove = true; map.addPopup(mappopup); @@ -352,36 +358,38 @@ mappopup = null; } selectedFeature = feature; - featurepopup = new OpenLayers.Popup(null, + var featurepopup = new OpenLayers.Popup(null, new OpenLayers.LonLat(feature.data.lon, feature.data.lat) .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), - new OpenLayers.Size(600, 400), - null, null, false, - function(e) { - selectlayer.unselect(selectedFeature); - }); + new OpenLayers.Size(600, 400)); + featurepopup.setOpacity(0.8); + featurepopup.closeOnMove = true; + featurepopup.autoSize = true; featurepopup.keepInMap = true; featurepopup.panMapIfOutOfView = true; - var content = '' + feature.data.name + '
'; + var content = ''; if (feature.data.type == 'netdevinfo') { if (feature.data.ipaddr.length) { var ips = feature.data.ipaddr.split(','); var nodeids = feature.data.nodeid.split(','); for (i in nodeids) - content += ' ' - + ips[i] + '
'; + content += ''; } } else - content += ' ' - + feature.data.ipaddr + '
'; - content += ' Info '; + content += ''; + content += '
' + feature.data.name + '
 ' + + ips[i] + '
 ' + + feature.data.ipaddr + '
' + + ' Info' + + '
'; featurepopup.setContentHTML(content); - featurepopup.setOpacity(0.8); map.addPopup(featurepopup); featurepopup.updateSize(); cursize = featurepopup.size; - featurepopup.setSize(new OpenLayers.Size(cursize.w + 20, cursize + 20)); + featurepopup.setSize(new OpenLayers.Size(cursize.w + 20, cursize.h + 20)); feature.popup = featurepopup; }, onUnselect: function(feature) { @@ -408,18 +416,19 @@ title: "Toolbar", activateControl: function(control) { if (control.command == 'ping') { - pingpopup = new OpenLayers.Popup(null, - map.getLonLatFromPixel(new OpenLayers.Pixel(60, 23)).clone(), - new OpenLayers.Size(600, 400), - '
' - + '
Enter IP address:
', - null, - function() { - alert('close') - }); + var pingpopup = new OpenLayers.Popup(null, + map.getLonLatFromPixel(new OpenLayers.Pixel(60, 27)).clone(), + new OpenLayers.Size(600, 400)); pingpopup.setOpacity(0.8); pingpopup.closeOnMove = true; pingpopup.autoSize = true; + pingpopup.keepInMap = true; + pingpopup.panMapIfOutOfView = true; + pingpopup.setContentHTML('
' + + '' + + '
Enter IP address:
' + + '
'); //pingpopup.keepInMap = true; //pingpopup.panMapIfOutOfView = true; map.addPopup(pingpopup); From cvs w lms.org.pl Tue Nov 15 08:58:23 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 08:58:23 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111115075823.9CE6D302A041@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 08:58:23 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - netdevmap: borders for popups Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.2&r2=1.3 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.2 lms/templates/ping.html:1.3 --- lms/templates/ping.html:1.2 Mon Nov 14 20:21:54 2011 +++ lms/templates/ping.html Tue Nov 15 08:58:23 2011 @@ -1,5 +1,5 @@ - + @@ -29,19 +29,21 @@ setTimeout("ping_refresh()", 1000); //--> - -
+ +
-
{t a="0" b="0" c="0"}Total: $a% ($b/$c){/t}
-
-
- - - - - - {t}Auto Scroll{/t} -
+
+ {t a="0" b="0" c="0"}Total: $a% ($b/$c){/t} +
+
+
+ + + + + + {t}Auto Scroll{/t} +
From cvs w lms.org.pl Tue Nov 15 08:58:23 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 08:58:23 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.css) Message-ID: <20111115075823.7AD20302A040@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 08:58:23 Author: chilek Path: /cvsroot/lms/img Modified: map.css - netdevmap: borders for popups Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.1&r2=1.2 Index: lms/img/map.css diff -u lms/img/map.css:1.1 lms/img/map.css:1.2 --- lms/img/map.css:1.1 Mon Nov 14 20:21:54 2011 +++ lms/img/map.css Tue Nov 15 08:58:23 2011 @@ -16,6 +16,10 @@ background-repeat: no-repeat; } +div.olPopupContent { + padding: 0px; +} + .olPingButtonItemActive { background-image: url("ip.gif"); } From cvs w lms.org.pl Tue Nov 15 10:50:25 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 10:50:25 +0100 (CET) Subject: [lms-commits] CVS update of lms/img/OpenLayers/theme/default (7 files) Message-ID: <20111115095025.57526302A040@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 10:50:25 Author: chilek Path: /cvsroot/lms/img/OpenLayers/theme/default Added: framedCloud.css google.css google.tidy.css ie6-style.css ie6-style.tidy.css style.css style.tidy.css - openlayers missed default css style files Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/OpenLayers/theme/default/framedCloud.css?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/img/OpenLayers/theme/default/google.css?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/img/OpenLayers/theme/default/google.tidy.css?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/img/OpenLayers/theme/default/ie6-style.css?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/img/OpenLayers/theme/default/ie6-style.tidy.css?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/img/OpenLayers/theme/default/style.css?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/img/OpenLayers/theme/default/style.tidy.css?rev=1.1 Index: lms/img/OpenLayers/theme/default/google.css diff -u /dev/null lms/img/OpenLayers/theme/default/google.css:1.1 --- /dev/null Tue Nov 15 10:50:25 2011 +++ lms/img/OpenLayers/theme/default/google.css Tue Nov 15 10:50:25 2011 @@ -0,0 +1,17 @@ +.olLayerGoogleCopyright { + right: 3px; + bottom: 2px; + left: auto; +} +.olLayerGoogleV3.olLayerGoogleCopyright { + bottom: 0px; + right: 0px !important; +} +.olLayerGooglePoweredBy { + left: 2px; + bottom: 2px; +} +.olLayerGoogleV3.olLayerGooglePoweredBy { + bottom: 0px !important; +} + Index: lms/img/OpenLayers/theme/default/google.tidy.css diff -u /dev/null lms/img/OpenLayers/theme/default/google.tidy.css:1.1 --- /dev/null Tue Nov 15 10:50:25 2011 +++ lms/img/OpenLayers/theme/default/google.tidy.css Tue Nov 15 10:50:25 2011 @@ -0,0 +1 @@ +.olLayerGoogleCopyright{right:3px;bottom:2px;left:auto;}.olLayerGoogleV3.olLayerGoogleCopyright{bottom:0;right:0!important;}.olLayerGooglePoweredBy{left:2px;bottom:2px;}.olLayerGoogleV3.olLayerGooglePoweredBy{bottom:0!important;} \ No newline at end of file Index: lms/img/OpenLayers/theme/default/ie6-style.css diff -u /dev/null lms/img/OpenLayers/theme/default/ie6-style.css:1.1 --- /dev/null Tue Nov 15 10:50:25 2011 +++ lms/img/OpenLayers/theme/default/ie6-style.css Tue Nov 15 10:50:25 2011 @@ -0,0 +1,10 @@ +.olControlZoomPanel div { + background-image: url(img/zoom-panel-NOALPHA.png); +} +.olControlPanPanel div { + background-image: url(img/pan-panel-NOALPHA.png); +} +.olControlEditingToolbar { + width: 200px; +} + Index: lms/img/OpenLayers/theme/default/ie6-style.tidy.css diff -u /dev/null lms/img/OpenLayers/theme/default/ie6-style.tidy.css:1.1 --- /dev/null Tue Nov 15 10:50:25 2011 +++ lms/img/OpenLayers/theme/default/ie6-style.tidy.css Tue Nov 15 10:50:25 2011 @@ -0,0 +1 @@ +.olControlZoomPanel div{background-image:url(img/zoom-panel-NOALPHA.png);}.olControlPanPanel div{background-image:url(img/pan-panel-NOALPHA.png);}.olControlEditingToolbar{width:200px;} \ No newline at end of file Index: lms/img/OpenLayers/theme/default/style.css diff -u /dev/null lms/img/OpenLayers/theme/default/style.css:1.1 --- /dev/null Tue Nov 15 10:50:25 2011 +++ lms/img/OpenLayers/theme/default/style.css Tue Nov 15 10:50:25 2011 @@ -0,0 +1,433 @@ +div.olMap { + z-index: 0; + padding: 0 !important; + margin: 0 !important; + cursor: default; +} + +div.olMapViewport { + text-align: left; +} + +div.olLayerDiv { + -moz-user-select: none; + -khtml-user-select: none; +} + +.olLayerGoogleCopyright { + left: 2px; + bottom: 2px; +} +.olLayerGoogleV3.olLayerGoogleCopyright { + right: auto !important; +} +.olLayerGooglePoweredBy { + left: 2px; + bottom: 15px; +} +.olLayerGoogleV3.olLayerGooglePoweredBy { + bottom: 15px !important; +} +.olControlAttribution { + font-size: smaller; + right: 3px; + bottom: 4.5em; + position: absolute; + display: block; +} +.olControlScale { + right: 3px; + bottom: 3em; + display: block; + position: absolute; + font-size: smaller; +} +.olControlScaleLine { + display: block; + position: absolute; + left: 10px; + bottom: 15px; + font-size: xx-small; +} +.olControlScaleLineBottom { + border: solid 2px black; + border-bottom: none; + margin-top:-2px; + text-align: center; +} +.olControlScaleLineTop { + border: solid 2px black; + border-top: none; + text-align: center; +} + +.olControlPermalink { + right: 3px; + bottom: 1.5em; + display: block; + position: absolute; + font-size: smaller; +} + +div.olControlMousePosition { + bottom: 0em; + right: 3px; + display: block; + position: absolute; + font-family: Arial; + font-size: smaller; +} + +.olControlOverviewMapContainer { + position: absolute; + bottom: 0; + right: 0; +} + +.olControlOverviewMapElement { + padding: 10px 18px 10px 10px; + background-color: #00008B; + -moz-border-radius: 1em 0 0 0; +} + +.olControlOverviewMapMinimizeButton { + right: 0; + bottom: 80px; + cursor: pointer; +} + +.olControlOverviewMapMaximizeButton { + right: 0; + bottom: 80px; + cursor: pointer; +} + +.olControlOverviewMapExtentRectangle { + overflow: hidden; + background-image: url("img/blank.gif"); + cursor: move; + border: 2px dotted red; +} +.olControlOverviewMapRectReplacement { + overflow: hidden; + cursor: move; + background-image: url("img/overview_replacement.gif"); + background-repeat: no-repeat; + background-position: center; +} + +.olLayerGeoRSSDescription { + float:left; + width:100%; + overflow:auto; + font-size:1.0em; +} +.olLayerGeoRSSClose { + float:right; + color:gray; + font-size:1.2em; + margin-right:6px; + font-family:sans-serif; +} +.olLayerGeoRSSTitle { + float:left;font-size:1.2em; +} + +.olPopupContent { + padding:5px; + overflow: auto; +} + +.olControlNavigationHistory { + background-image: url("img/navigation_history.png"); + background-repeat: no-repeat; + width: 24px; + height: 24px; + +} +.olControlNavigationHistoryPreviousItemActive { + background-position: 0 0; +} +.olControlNavigationHistoryPreviousItemInactive { + background-position: 0 -24px; +} +.olControlNavigationHistoryNextItemActive { + background-position: -24px 0; +} +.olControlNavigationHistoryNextItemInactive { + background-position: -24px -24px; +} + +div.olControlSaveFeaturesItemActive { + background-image: url(img/save_features_on.png); + background-repeat: no-repeat; + background-position: 0 1px; +} +div.olControlSaveFeaturesItemInactive { + background-image: url(img/save_features_off.png); + background-repeat: no-repeat; + background-position: 0 1px; +} + +.olHandlerBoxZoomBox { + border: 2px solid red; + position: absolute; + background-color: white; + opacity: 0.50; + font-size: 1px; + filter: alpha(opacity=50); +} +.olHandlerBoxSelectFeature { + border: 2px solid blue; + position: absolute; + background-color: white; + opacity: 0.50; + font-size: 1px; + filter: alpha(opacity=50); +} + +.olControlPanPanel { + top: 10px; + left: 5px; +} + +.olControlPanPanel div { + background-image: url(img/pan-panel.png); + height: 18px; + width: 18px; + cursor: pointer; + position: absolute; +} + +.olControlPanPanel .olControlPanNorthItemInactive { + top: 0; + left: 9px; + background-position: 0 0; +} +.olControlPanPanel .olControlPanSouthItemInactive { + top: 36px; + left: 9px; + background-position: 18px 0; +} +.olControlPanPanel .olControlPanWestItemInactive { + position: absolute; + top: 18px; + left: 0; + background-position: 0 18px; +} +.olControlPanPanel .olControlPanEastItemInactive { + top: 18px; + left: 18px; + background-position: 18px 18px; +} + +.olControlZoomPanel { + top: 71px; + left: 14px; +} + +.olControlZoomPanel div { + background-image: url(img/zoom-panel.png); + position: absolute; + height: 18px; + width: 18px; + cursor: pointer; +} + +.olControlZoomPanel .olControlZoomInItemInactive { + top: 0; + left: 0; + background-position: 0 0; +} + +.olControlZoomPanel .olControlZoomToMaxExtentItemInactive { + top: 18px; + left: 0; + background-position: 0 -18px; +} + +.olControlZoomPanel .olControlZoomOutItemInactive { + top: 36px; + left: 0; + background-position: 0 18px; +} + +/* + * When a potential text is bigger than the image it move the image + * with some headers (closes #3154) + */ +.olControlPanZoomBar div { + font-size: 1px; +} + +.olPopupCloseBox { + background: url("img/close.gif") no-repeat; + cursor: pointer; +} + +.olFramedCloudPopupContent { + padding: 5px; + overflow: auto; +} + +.olControlNoSelect { + -moz-user-select: none; + -khtml-user-select: none; +} + +.olImageLoadError { + background-color: pink; + opacity: 0.5; + filter: alpha(opacity=50); /* IE */ +} + +/** + * Cursor styles + */ + +.olCursorWait { + cursor: wait; +} +.olDragDown { + cursor: move; +} +.olDrawBox { + cursor: crosshair; +} +.olControlDragFeatureOver { + cursor: move; +} +.olControlDragFeatureActive.olControlDragFeatureOver.olDragDown { + cursor: -moz-grabbing; +} + +/** + * Layer switcher + */ +.olControlLayerSwitcher { + position: absolute; + top: 25px; + right: 0; + width: 20em; + font-family: sans-serif; + font-weight: bold; + margin-top: 3px; + margin-left: 3px; + margin-bottom: 3px; + font-size: smaller; + color: white; + background-color: transparent; +} + +.olControlLayerSwitcher .layersDiv { + padding-top: 5px; + padding-left: 10px; + padding-bottom: 5px; + padding-right: 75px; + background-color: darkblue; + width: 100%; + height: 100%; +} + +.olControlLayerSwitcher .layersDiv .baseLbl, +.olControlLayerSwitcher .layersDiv .dataLbl { + margin-top: 3px; + margin-left: 3px; + margin-bottom: 3px; +} + +.olControlLayerSwitcher .layersDiv .baseLayersDiv, +.olControlLayerSwitcher .layersDiv .dataLayersDiv { + padding-left: 10px; +} + +.olControlLayerSwitcher .maximizeDiv, +.olControlLayerSwitcher .minimizeDiv { + top: 5px; + right: 0; + cursor: pointer; +} + +.olBingAttribution { + color: #DDD; +} +.olBingAttribution.road { + color: #333; +} + +.olGoogleAttribution.hybrid, .olGoogleAttribution.satellite { + color: #EEE; +} +.olGoogleAttribution { + color: #333; +} +span.olGoogleAttribution a { + color: #77C; +} +span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a { + color: #EEE; +} + +/** + * Editing and navigation icons. + * (using the editing_tool_bar.png sprint image) + */ +.olControlNavToolbar , +.olControlEditingToolbar { + margin: 5px 5px 0 0; +} +.olControlNavToolbar div, +.olControlEditingToolbar div { + background-image: url("img/editing_tool_bar.png"); + background-repeat: no-repeat; + margin: 0 0 5px 5px; + width: 24px; + height: 22px; + cursor: pointer +} +/* positions */ +.olControlEditingToolbar { + right: 0; + top: 0; +} +.olControlNavToolbar { + top: 295px; + left: 9px; +} +/* layouts */ +.olControlEditingToolbar div { + float: right; +} +/* individual controls */ +.olControlNavToolbar .olControlNavigationItemInactive, +.olControlEditingToolbar .olControlNavigationItemInactive { + background-position: -103px -1px; +} +.olControlNavToolbar .olControlNavigationItemActive , +.olControlEditingToolbar .olControlNavigationItemActive { + background-position: -103px -24px; +} +.olControlNavToolbar .olControlZoomBoxItemInactive { + background-position: -128px -1px; +} +.olControlNavToolbar .olControlZoomBoxItemActive { + background-position: -128px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePointItemInactive { + background-position: -77px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePointItemActive { + background-position: -77px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePathItemInactive { + background-position: -51px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePathItemActive { + background-position: -51px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{ + background-position: -26px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive { + background-position: -26px -24px; +} Index: lms/img/OpenLayers/theme/default/style.tidy.css diff -u /dev/null lms/img/OpenLayers/theme/default/style.tidy.css:1.1 --- /dev/null Tue Nov 15 10:50:25 2011 +++ lms/img/OpenLayers/theme/default/style.tidy.css Tue Nov 15 10:50:25 2011 @@ -0,0 +1 @@ +div.olMap{z-index:0;cursor:default;margin:0!important;padding:0!important;}div.olMapViewport{text-align:left;}.olLayerGoogleCopyright{left:2px;bottom:2px;}.olLayerGoogleV3.olLayerGoogleCopyright{right:auto!important;}.olLayerGooglePoweredBy{left:2px;bottom:15px;}.olLayerGoogleV3.olLayerGooglePoweredBy{bottom:15px!important;}.olControlAttribution{font-size:smaller;right:3px;bottom:4.5em;position:absolute;display:block;}.olControlScale{right:3px;bottom:3em;display:block;position:absolute;font-size:smaller;}.olControlScaleLine{display:block;position:absolute;left:10px;bottom:15px;font-size:xx-small;}.olControlScaleLineBottom{border:solid 2px #000;border-bottom:none;margin-top:-2px;text-align:center;}.olControlScaleLineTop{border:solid 2px #000;border-top:none;text-align:center;}.olControlPermalink{right:3px;bottom:1.5em;display:block;position:absolute;font-size:smaller;}div.olControlMousePosition{bottom:0;right:3px;display:block;position:absolute;font-family:Arial;font-size:sma ller;}.olControlOverviewMapContainer{position:absolute;bottom:0;right:0;}.olControlOverviewMapElement{background-color:#00008B;-moz-border-radius:1em 0 0;padding:10px 18px 10px 10px;}.olControlOverviewMapExtentRectangle{overflow:hidden;background-image:url(img/blank.gif);cursor:move;border:2px dotted red;}.olControlOverviewMapRectReplacement{overflow:hidden;cursor:move;background-image:url(img/overview_replacement.gif);background-repeat:no-repeat;background-position:center;}.olLayerGeoRSSDescription{float:left;width:100%;overflow:auto;font-size:1em;}.olLayerGeoRSSClose{float:right;color:gray;font-size:1.2em;margin-right:6px;font-family:sans-serif;}.olLayerGeoRSSTitle{float:left;font-size:1.2em;}.olControlNavigationHistory{background-image:url(img/navigation_history.png);background-repeat:no-repeat;width:24px;height:24px;}.olControlNavigationHistoryPreviousItemActive{background-position:0 0;}.olControlNavigationHistoryPreviousItemInactive{background-position:0 -24px;}.olContr olNavigationHistoryNextItemActive{background-position:-24px 0;}.olControlNavigationHistoryNextItemInactive{background-position:-24px -24px;}div.olControlSaveFeaturesItemActive{background-image:url(img/save_features_on.png);background-repeat:no-repeat;background-position:0 1px;}div.olControlSaveFeaturesItemInactive{background-image:url(img/save_features_off.png);background-repeat:no-repeat;background-position:0 1px;}.olHandlerBoxZoomBox{border:2px solid red;position:absolute;background-color:#FFF;opacity:.5;font-size:1px;filter:alpha(opacity=50);}.olHandlerBoxSelectFeature{border:2px solid blue;position:absolute;background-color:#FFF;opacity:.5;font-size:1px;filter:alpha(opacity=50);}.olControlPanPanel{top:10px;left:5px;}.olControlPanPanel div{background-image:url(img/pan-panel.png);height:18px;width:18px;cursor:pointer;position:absolute;}.olControlPanPanel .olControlPanNorthItemInactive{top:0;left:9px;background-position:0 0;}.olControlPanPanel .olControlPanSouthItemInactive {top:36px;left:9px;background-position:18px 0;}.olControlPanPanel .olControlPanWestItemInactive{position:absolute;top:18px;left:0;background-position:0 18px;}.olControlPanPanel .olControlPanEastItemInactive{top:18px;left:18px;background-position:18px 18px;}.olControlZoomPanel{top:71px;left:14px;}.olControlZoomPanel div{background-image:url(img/zoom-panel.png);position:absolute;height:18px;width:18px;cursor:pointer;}.olControlZoomPanel .olControlZoomInItemInactive{top:0;left:0;background-position:0 0;}.olControlZoomPanel .olControlZoomToMaxExtentItemInactive{top:18px;left:0;background-position:0 -18px;}.olControlZoomPanel .olControlZoomOutItemInactive{top:36px;left:0;background-position:0 18px;}.olControlPanZoomBar div{font-size:1px;}.olPopupCloseBox{background:url(img/close.gif) no-repeat;cursor:pointer;}.olImageLoadError{background-color:#FFC0CB;opacity:.5;filter:alpha(opacity=50);}.olCursorWait{cursor:wait;}.olDrawBox{cursor:crosshair;}.olControlDragFeatureActive.olControl DragFeatureOver.olDragDown{cursor:0;}.olControlLayerSwitcher{position:absolute;top:25px;right:0;width:20em;font-family:sans-serif;font-weight:700;margin-top:3px;margin-left:3px;margin-bottom:3px;font-size:smaller;color:#FFF;background-color:transparent;}.olControlLayerSwitcher .layersDiv{background-color:#00008B;width:100%;height:100%;padding:5px 75px 5px 10px;}.olControlLayerSwitcher .layersDiv .baseLbl,.olControlLayerSwitcher .layersDiv .dataLbl{margin-top:3px;margin-left:3px;margin-bottom:3px;}.olControlLayerSwitcher .layersDiv .baseLayersDiv,.olControlLayerSwitcher .layersDiv .dataLayersDiv{padding-left:10px;}.olControlLayerSwitcher .maximizeDiv,.olControlLayerSwitcher .minimizeDiv{top:5px;right:0;cursor:pointer;}.olBingAttribution{color:#DDD;}span.olGoogleAttribution a{color:#77C;}.olControlNavToolbar,.olControlEditingToolbar{margin:5px 5px 0 0;}.olControlNavToolbar div,.olControlEditingToolbar div{background-image:url(img/editing_tool_bar.png);background-repeat:no-repe at;width:24px;height:22px;cursor:pointer;margin:0 0 5px 5px;}.olControlEditingToolbar{right:0;top:0;}.olControlNavToolbar{top:295px;left:9px;}.olControlEditingToolbar div{float:right;}.olControlNavToolbar .olControlNavigationItemInactive,.olControlEditingToolbar .olControlNavigationItemInactive{background-position:-103px -1px;}.olControlNavToolbar .olControlNavigationItemActive,.olControlEditingToolbar .olControlNavigationItemActive{background-position:-103px -24px;}.olControlNavToolbar .olControlZoomBoxItemInactive{background-position:-128px -1px;}.olControlNavToolbar .olControlZoomBoxItemActive{background-position:-128px -24px;}.olControlEditingToolbar .olControlDrawFeaturePointItemInactive{background-position:-77px -1px;}.olControlEditingToolbar .olControlDrawFeaturePointItemActive{background-position:-77px -24px;}.olControlEditingToolbar .olControlDrawFeaturePathItemInactive{background-position:-51px -1px;}.olControlEditingToolbar .olControlDrawFeaturePathItemActive{back ground-position:-51px -24px;}.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{background-position:-26px -1px;}.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive{background-position:-26px -24px;}div.olLayerDiv,.olControlNoSelect{-khtml-user-select:none;-moz-user-select:none;}.olControlOverviewMapMinimizeButton,.olControlOverviewMapMaximizeButton{bottom:80px;cursor:pointer;right:0;}.olPopupContent,.olFramedCloudPopupContent{overflow:auto;padding:5px;}.olDragDown,.olControlDragFeatureOver{cursor:move;}.olBingAttribution.road,.olGoogleAttribution{color:#333;}.olGoogleAttribution.hybrid,.olGoogleAttribution.satellite,span.olGoogleAttribution.hybrid a,span.olGoogleAttribution.satellite a{color:#EEE;} \ No newline at end of file From cvs w lms.org.pl Tue Nov 15 19:08:54 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 19:08:54 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (LMS.class.php) Message-ID: <20111115180854.93F92302A041@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 19:08:54 Author: chilek Path: /cvsroot/lms/lib Modified: LMS.class.php - fixed popup autosize on netdevmap Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMS.class.php.diff?&r1=1.1083&r2=1.1084 Index: lms/lib/LMS.class.php diff -u lms/lib/LMS.class.php:1.1083 lms/lib/LMS.class.php:1.1084 --- lms/lib/LMS.class.php:1.1083 Wed Nov 9 13:56:09 2011 +++ lms/lib/LMS.class.php Tue Nov 15 19:08:54 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMS.class.php,v 1.1083 2011/11/09 12:56:09 chilek Exp $ + * $Id: LMS.class.php,v 1.1084 2011/11/15 18:08:54 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.1083 $'; + var $_revision = '$Revision: 1.1084 $'; function LMS(&$DB, &$AUTH, &$CONFIG) // class variables setting { @@ -1302,8 +1302,8 @@ isset($nodedata['linktype']) ? 1 : 0, isset($nodedata['port']) && $nodedata['netdev'] ? intval($nodedata['port']) : 0, isset($nodedata['nas']) ? $nodedata['nas'] : 0, - !empty($nodedata['latitude']) ? $nodedata['latitude'] : null, !empty($nodedata['longitude']) ? $nodedata['longitude'] : null, + !empty($nodedata['latitude']) ? $nodedata['latitude'] : null, $nodedata['id'] )); @@ -1569,7 +1569,7 @@ if($this->DB->Execute('INSERT INTO nodes (name, ipaddr, ipaddr_pub, ownerid, passwd, creatorid, creationdate, access, warning, info, netdev, location, location_city, location_street, location_house, location_flat, - linktype, port, chkmac, halfduplex, nas, latitude, longitude) + linktype, port, chkmac, halfduplex, nas, longitude, latitude) VALUES (?, inet_aton(?), inet_aton(?), ?, ?, ?, ?NOW?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array(strtoupper($nodedata['name']), @@ -1592,8 +1592,8 @@ $nodedata['chkmac'], $nodedata['halfduplex'], isset($nodedata['nas']) ? $nodedata['nas'] : 0, - !empty($nodedata['latitude']) ? $nodedata['latitude'] : null, - !empty($nodedata['longitude']) ? $nodedata['longitude'] : null + !empty($nodedata['longitude']) ? $nodedata['longitude'] : null, + !empty($nodedata['latitude']) ? $nodedata['latitude'] : null ))) { $id = $this->DB->GetLastInsertID('nodes'); @@ -3353,7 +3353,7 @@ description, producer, model, serialnumber, ports, purchasetime, guaranteeperiod, shortname, nastype, clients, secret, community, channelid, - latitude, longitude) + longitude, latitude) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($data['name'], $data['location'], @@ -3374,8 +3374,8 @@ $data['secret'], $data['community'], !empty($data['channelid']) ? $data['channelid'] : NULL, - !empty($data['latitude']) ? $data['latitude'] : NULL, - !empty($data['longitude']) ? $data['longitude'] : NULL + !empty($data['longitude']) ? $data['longitude'] : NULL, + !empty($data['latitude']) ? $data['latitude'] : NULL ))) { $id = $this->DB->GetLastInsertID('netdevices'); @@ -3410,7 +3410,7 @@ $this->DB->Execute('UPDATE netdevices SET name=?, description=?, producer=?, location=?, location_city=?, location_street=?, location_house=?, location_flat=?, model=?, serialnumber=?, ports=?, purchasetime=?, guaranteeperiod=?, shortname=?, - nastype=?, clients=?, secret=?, community=?, channelid=?, latitude=?, longitude=? + nastype=?, clients=?, secret=?, community=?, channelid=?, longitude=? latitude=? WHERE id=?', array($data['name'], $data['description'], @@ -3431,8 +3431,8 @@ $data['secret'], $data['community'], !empty($data['channelid']) ? $data['channelid'] : NULL, - !empty($data['latitude']) ? $data['latitude'] : null, !empty($data['longitude']) ? $data['longitude'] : null, + !empty($data['latitude']) ? $data['latitude'] : null, $data['id'] )); } From cvs w lms.org.pl Tue Nov 15 19:08:54 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 19:08:54 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.css, map.js) Message-ID: <20111115180854.0CCC2302A040@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 19:08:53 Author: chilek Path: /cvsroot/lms/img Modified: map.css map.js - fixed popup autosize on netdevmap Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.4&r2=1.5 Index: lms/img/map.css diff -u lms/img/map.css:1.2 lms/img/map.css:1.3 --- lms/img/map.css:1.2 Tue Nov 15 08:58:23 2011 +++ lms/img/map.css Tue Nov 15 19:08:53 2011 @@ -16,10 +16,84 @@ background-repeat: no-repeat; } +div.olPopup { + overflow: visible; +} + div.olPopupContent { + overflow: visible; padding: 0px; } +div.infoPopupTable { + border: thin solid black; + background-color: #DFD5BD; + width: auto; + height: auto; + white-space: nowrap; + overflow: visible; +} + +div.infoPopupName { + padding: 2px; + font-weight: bold; + width: auto; + height: auto; + white-space: nowrap; +} + +div.infoPopupPing { + padding: 2px; + width: auto; + height: auto; + white-space: nowrap; +} + +div.infoPopupInfo { + padding: 2px; + width: auto; + height: auto; + white-space: nowrap; +} + +div.mapPopupTable { + border: thin solid black; + background-color: #DFD5BD; + width: auto; + height: auto; + white-space: nowrap; + overflow: visible; +} + +div.mapPopupName { + padding: 2px; + font-weight: bold; + width: auto; + height: auto; + white-space: nowrap; +} + +div.mapPopupIp { + padding: 2px; + width: auto; + height: auto; + white-space: nowrap; +} + +div.ipPopupTable { + border: thin solid black; + background-color: #DFD5BD; + width: auto; + height: auto; + padding: 2px; + white-space: nowrap; + overflow: visible; +} + +div.ipPopupLabel { + font-weight: bold; +} + .olPingButtonItemActive { background-image: url("ip.gif"); } Index: lms/img/map.js diff -u lms/img/map.js:1.4 lms/img/map.js:1.5 --- lms/img/map.js:1.4 Tue Nov 15 08:42:56 2011 +++ lms/img/map.js Tue Nov 15 19:08:53 2011 @@ -320,14 +320,24 @@ mappopup = new OpenLayers.Popup.Anchored(null, new OpenLayers.LonLat(e.feature.data.lon, e.feature.data.lat) .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), - new OpenLayers.Size(600, 400), - '
' + e.feature.data.name - + "" + (e.feature.data.ipaddr.length ? '
' + e.feature.data.ipaddr.replace(/,/g, "
") : '') - + '
'); + new OpenLayers.Size(10, 10), + '
' + e.feature.data.name + '
' + + (e.feature.data.ipaddr.length ? + '
' + e.feature.data.ipaddr.replace(/,/g, '
') + '
' + : '') + + '
'); mappopup.setOpacity(0.8); mappopup.closeOnMove = true; map.addPopup(mappopup); - mappopup.updateSize(); + mappopup.div.style.overflow = 'visible'; + mappopup.div.style.width = 'auto'; + mappopup.div.style.height = 'auto'; + mappopup.groupDiv.style.overflow = 'visible'; + mappopup.groupDiv.style.width = 'auto'; + mappopup.groupDiv.style.height = 'auto'; + mappopup.contentDiv.style.width = 'auto'; + mappopup.contentDiv.style.heigh = 'auto'; + //mappopup.updateSize(); } OpenLayers.Event.stop(e); }, @@ -361,35 +371,39 @@ var featurepopup = new OpenLayers.Popup(null, new OpenLayers.LonLat(feature.data.lon, feature.data.lat) .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), - new OpenLayers.Size(600, 400)); + new OpenLayers.Size(10, 10)); featurepopup.setOpacity(0.8); featurepopup.closeOnMove = true; - featurepopup.autoSize = true; - featurepopup.keepInMap = true; - featurepopup.panMapIfOutOfView = true; - var content = ''; + //featurepopup.keepInMap = true; + //featurepopup.panMapIfOutOfView = true; + var content = '
' + feature.data.name + '
'; if (feature.data.type == 'netdevinfo') { if (feature.data.ipaddr.length) { var ips = feature.data.ipaddr.split(','); var nodeids = feature.data.nodeid.split(','); for (i in nodeids) - content += '
'; + + ips[i] + ''; } } else - content += ''; - content += '
' + feature.data.name + '
 ' - + ips[i] + '
 ' - + feature.data.ipaddr + '
' - + ' Info' - + '
'; + + feature.data.ipaddr + '
'; + content += '
'; featurepopup.setContentHTML(content); map.addPopup(featurepopup); - featurepopup.updateSize(); - cursize = featurepopup.size; - featurepopup.setSize(new OpenLayers.Size(cursize.w + 20, cursize.h + 20)); + featurepopup.div.style.overflow = 'visible'; + featurepopup.div.style.width = 'auto'; + featurepopup.div.style.height = 'auto'; + featurepopup.groupDiv.style.overflow = 'visible'; + featurepopup.groupDiv.style.width = 'auto'; + featurepopup.groupDiv.style.height = 'auto'; + featurepopup.contentDiv.style.width = 'auto'; + featurepopup.contentDiv.style.heigh = 'auto'; + //featurepopup.updateSize(); feature.popup = featurepopup; }, onUnselect: function(feature) { @@ -424,13 +438,11 @@ pingpopup.autoSize = true; pingpopup.keepInMap = true; pingpopup.panMapIfOutOfView = true; - pingpopup.setContentHTML('
' - + '' - + '
Enter IP address:
' - + '
'); - //pingpopup.keepInMap = true; - //pingpopup.panMapIfOutOfView = true; + pingpopup.setContentHTML('
Enter IP address:
' + + '
' + + '
' + + '' + + '
'); map.addPopup(pingpopup); pingpopup.updateSize(); document.forms['ipform'].ip.focus(); From cvs w lms.org.pl Tue Nov 15 23:33:29 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 23:33:29 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (DragPopup.js, map.css, map.js) Message-ID: <20111115223329.E0897302A041@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 23:33:29 Author: chilek Path: /cvsroot/lms/img Added: DragPopup.js Modified: map.css map.js - netmap popups are draggable thanks to DragPopup class written by Matt Walker Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/DragPopup.js?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.5&r2=1.6 Index: lms/img/DragPopup.js diff -u /dev/null lms/img/DragPopup.js:1.1 --- /dev/null Tue Nov 15 23:33:29 2011 +++ lms/img/DragPopup.js Tue Nov 15 23:33:29 2011 @@ -0,0 +1,98 @@ +/* + * Move a popup with a drag. + * + * @author Matt Walker + * @class + */ +OpenLayers.Control.DragPopup = OpenLayers.Class(OpenLayers.Control, { + + down: false, + + popPnt: null, + + mapPnt: null, + + popup: null, + + docMouseUpProxy: null, + + /** + * Constructor: OpenLayers.Control.DragPopup + * Create a new control to drag a popup. + * + * Parameters: + * @param {OpenLayers.Popup} popup + * @param {Object} options + */ + initialize: function(popup, options) { + OpenLayers.Control.prototype.initialize.apply(this, [options]); + this.popup = popup; + this.popup.events.register('mousedown', this, this.mouseDown); + this.popup.events.register('mouseup', this, this.mouseUp); + this.popup.events.register('mousemove', this, this.mouseMove); + // Define a function bound to this used to listen for + // document mouseout events + this.docMouseUpProxy = OpenLayers.Function.bind(this.mouseUp, this); + }, + + /** + * Method: setMap + * Set the map property for the control. + * + * Parameters: + * map - {} The controls map. + */ + setMap: function(map) { + OpenLayers.Control.prototype.setMap.apply(this, [map]); + this.map.events.register('mousemove', this, this.mouseMove); + }, + + mouseDown: function(evt) { + //console.log('mouseDown'); + this.down = true; + this.popPnt = this.popup.events.getMousePosition(evt); + OpenLayers.Event.observe(document, 'mouseup', this.docMouseUpProxy); + OpenLayers.Event.stop(evt); + }, + + mouseUp: function(evt) { + //console.log('mouseUp'); + this.down = false; + OpenLayers.Event.stopObserving(document, 'mouseup', this.docMouseUpProxy); + OpenLayers.Event.stop(evt); + }, + + mouseOut: function(evt) { + //console.log('map.mouseOut'); + this.down = false; + OpenLayers.Event.stop(evt); + }, + + mouseMove: function(evt) { + //console.log('mouseMove'); + if (this.down) { + var mapPntPx = this.map.events.getMousePosition(evt); + mapPntPx = mapPntPx.add((this.popPnt.x*-1), (this.popPnt.y*-1)); + this.popup.lonlat = this.map.getLonLatFromViewPortPx(mapPntPx); + this.popup.updatePosition(); + } + OpenLayers.Event.stop(evt); + }, + + destroy: function() { + // Remove listeners + this.popup.events.unregister('mousedown', this, this.mouseDown); + this.popup.events.unregister('mouseup', this, this.mouseUp); + this.popup.events.unregister('mousemove', this, this.mouseMove); + this.map.events.unregister('mousemove', this, this.mouseMove); + // Clear object references + this.popup = null; + this.popPnt = null; + // allow our superclass to tidy up + OpenLayers.Control.prototype.destroy.apply(this, []); + }, + + /** @final @type String */ + CLASS_NAME: "OpenLayers.Control.DragPopup" +}); + Index: lms/img/map.css diff -u lms/img/map.css:1.3 lms/img/map.css:1.4 --- lms/img/map.css:1.3 Tue Nov 15 19:08:53 2011 +++ lms/img/map.css Tue Nov 15 23:33:29 2011 @@ -28,8 +28,7 @@ div.infoPopupTable { border: thin solid black; background-color: #DFD5BD; - width: auto; - height: auto; + width: auto; height: auto; white-space: nowrap; overflow: visible; } @@ -37,30 +36,26 @@ div.infoPopupName { padding: 2px; font-weight: bold; - width: auto; - height: auto; + width: auto; height: auto; white-space: nowrap; } div.infoPopupPing { padding: 2px; - width: auto; - height: auto; + width: auto; height: auto; white-space: nowrap; } div.infoPopupInfo { padding: 2px; - width: auto; - height: auto; + width: auto; height: auto; white-space: nowrap; } div.mapPopupTable { border: thin solid black; background-color: #DFD5BD; - width: auto; - height: auto; + width: auto; height: auto; white-space: nowrap; overflow: visible; } @@ -68,23 +63,20 @@ div.mapPopupName { padding: 2px; font-weight: bold; - width: auto; - height: auto; + width: auto; height: auto; white-space: nowrap; } div.mapPopupIp { padding: 2px; - width: auto; - height: auto; + width: auto; height: auto; white-space: nowrap; } div.ipPopupTable { border: thin solid black; background-color: #DFD5BD; - width: auto; - height: auto; + width: auto; height: auto; padding: 2px; white-space: nowrap; overflow: visible; @@ -94,6 +86,15 @@ font-weight: bold; } +div.popupTitleBar { + border: thin solid black; + background-color: #CEBD9B; + border-top-width: 1pt; border-top-style: solid; border-left-width: 1pt; border-left-style: solid; border-right-width: 1pt; border-right-style: solid; + font-weight: bold; + white-space: nowrap; + overflow: hidden; +} + .olPingButtonItemActive { background-image: url("ip.gif"); } Index: lms/img/map.js diff -u lms/img/map.js:1.5 lms/img/map.js:1.6 --- lms/img/map.js:1.5 Tue Nov 15 19:08:53 2011 +++ lms/img/map.js Tue Nov 15 23:33:29 2011 @@ -1,7 +1,6 @@ var map = null; var maprequest = null; var mappopup = null; -var featurepopup = null; var lastonline_limit; function removeInvisiblePopups() @@ -66,12 +65,11 @@ setTimeout("netdevmap_refresh()", lastonline_limit * 1000); } -function ping_from_map(id, nodeid) +function ping_host(id, ip) { - var i; - for (i = 0; i < map.popups.length, map.popups[i].id != id; i++); - map.popups[i].setContentHTML( - ''); + for (var i = 0; i < map.popups.length, map.popups[i].id != id; i++); + map.popups[i].setContentHTML('
Ping to ' + ip + '
' + + ''); removeInvisiblePopups(); @@ -79,20 +77,14 @@ map.popups[i].updateSize(); } -function ping_from_popup(id) +function ping_any_host(id) { var ip = document.forms['ipform'].ip.value; if (!ip.match(/^([0-9]{1,3}\.){3}[0-9]{1,3}$/)) return false; - var i; - for (i = 0; i < map.popups.length, map.popups[i].id != id; i++); - map.popups[i].setContentHTML( - ''); - removeInvisiblePopups(); + ping_host(id, ip); - autoiframe_setsize('autoiframe_' + id.replace('.', '_'), 400, 300); - map.popups[i].updateSize(); return false; } @@ -383,18 +375,23 @@ var ips = feature.data.ipaddr.split(','); var nodeids = feature.data.nodeid.split(','); for (i in nodeids) - content += ''; featurepopup.setContentHTML(content); + map.addPopup(featurepopup); + + var dragpopup = new OpenLayers.Control.DragPopup(featurepopup); + map.addControl(dragpopup); + featurepopup.div.style.overflow = 'visible'; featurepopup.div.style.width = 'auto'; featurepopup.div.style.height = 'auto'; @@ -413,51 +410,64 @@ }); map.addControl(selectlayer); selectlayer.activate(); - } - var pingbutton = new OpenLayers.Control.Button({ - displayClass: "olPingButton", - title: "Ping a host ...", - command: 'ping'}); - -// var ping2button = new OpenLayers.Control.Button({ -// displayClass: "olPing2Button", -// title: "Ping2 a host ...", -// command: "ping2"}); - - var panel = new OpenLayers.Control.Panel({ - type: OpenLayers.Control.TYPE_BUTTON, - title: "Toolbar", - activateControl: function(control) { - if (control.command == 'ping') { - var pingpopup = new OpenLayers.Popup(null, - map.getLonLatFromPixel(new OpenLayers.Pixel(60, 27)).clone(), - new OpenLayers.Size(600, 400)); - pingpopup.setOpacity(0.8); - pingpopup.closeOnMove = true; - pingpopup.autoSize = true; - pingpopup.keepInMap = true; - pingpopup.panMapIfOutOfView = true; - pingpopup.setContentHTML('
Enter IP address:
' - + '
' - + '
' - + '' - + '
'); - map.addPopup(pingpopup); - pingpopup.updateSize(); - document.forms['ipform'].ip.focus(); - } else { + var pingbutton = new OpenLayers.Control.Button({ + displayClass: "olPingButton", + title: "Ping a host ...", + command: 'ping'}); + +// var ping2button = new OpenLayers.Control.Button({ +// displayClass: "olPing2Button", +// title: "Ping2 a host ...", +// command: "ping2"}); + + var panel = new OpenLayers.Control.Panel({ + type: OpenLayers.Control.TYPE_BUTTON, + title: "Toolbar", + activateControl: function(control) { + if (control.command == 'ping') { + var pingpopup = new OpenLayers.Popup(null, + map.getLonLatFromPixel(new OpenLayers.Pixel(60, 27)).clone(), + new OpenLayers.Size(10, 10)); + pingpopup.setOpacity(0.8); + pingpopup.closeOnMove = true; + pingpopup.keepInMap = true; + pingpopup.panMapIfOutOfView = true; + pingpopup.setContentHTML('
Enter IP address:
' + + '
' + + '
' + + '' + + '
'); + map.addPopup(pingpopup); + + var dragpopup = new OpenLayers.Control.DragPopup(pingpopup); + map.addControl(dragpopup); + + pingpopup.div.style.overflow = 'visible'; + pingpopup.div.style.width = 'auto'; + pingpopup.div.style.height = 'auto'; + pingpopup.groupDiv.style.overflow = 'visible'; + pingpopup.groupDiv.style.width = 'auto'; + pingpopup.groupDiv.style.height = 'auto'; + pingpopup.contentDiv.style.width = 'auto'; + pingpopup.contentDiv.style.heigh = 'auto'; + //pingpopup.updateSize(); + document.forms['ipform'].ip.focus(); + } else { + } } - } - }); -// panel.addControls([pingbutton, ping2button]); - panel.addControls([pingbutton]); - map.addControl(panel); + }); +// panel.addControls([pingbutton, ping2button]); + panel.addControls([pingbutton]); + map.addControl(panel); + } map.addControl(new OpenLayers.Control.ScaleLine()); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition({ displayProjection: new OpenLayers.Projection("EPSG:4326") })); + //map.events.register('mousemove', null, popupmouse_movefunction(event) { alert('map mousemove'); }, true); + if (deviceArray || nodeArray) map.zoomToExtent(area); else From cvs w lms.org.pl Tue Nov 15 23:33:29 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 23:33:29 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111115223329.C011F302A040@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 23:33:29 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - netmap popups are draggable thanks to DragPopup class written by Matt Walker Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1606&r2=1.1607 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1606 lms/doc/ChangeLog:1.1607 --- lms/doc/ChangeLog:1.1606 Mon Nov 14 20:21:54 2011 +++ lms/doc/ChangeLog Tue Nov 15 23:33:29 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1606 2011/11/14 19:21:54 chilek Exp $ +$Id: ChangeLog,v 1.1607 2011/11/15 22:33:29 chilek Exp $ version ? (????-??-??): @@ -52,6 +52,7 @@ - 5 default base layers for maps [chilan] - ported to xajax 0.5 [chilan] - toolbar on netdevmap and possibility to ping any host (event not included in database) [chilan] + - netmap popups are draggable thanks to DragPopup class written by Matt Walker [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Tue Nov 15 23:33:30 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 23:33:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (choosegpscoords.html, netdevmap.html) Message-ID: <20111115223330.15DC5302A042@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 23:33:30 Author: chilek Path: /cvsroot/lms/templates Modified: choosegpscoords.html netdevmap.html - netmap popups are draggable thanks to DragPopup class written by Matt Walker Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/choosegpscoords.html.diff?&r1=1.9&r2=1.10 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevmap.html.diff?&r1=1.34&r2=1.35 Index: lms/templates/choosegpscoords.html diff -u lms/templates/choosegpscoords.html:1.9 lms/templates/choosegpscoords.html:1.10 --- lms/templates/choosegpscoords.html:1.9 Sat Nov 12 21:04:31 2011 +++ lms/templates/choosegpscoords.html Tue Nov 15 23:33:29 2011 @@ -1,11 +1,12 @@ - + ::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle} :{/if}:: + {if $js}
+ From cvs w lms.org.pl Tue Nov 15 23:59:26 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 15 Nov 2011 23:59:26 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (ping.php) Message-ID: <20111115225926.5F40C302A040@eftep.altec.pl> Date: Tuesday, November 15, 2011 @ 23:59:26 Author: chilek Path: /cvsroot/lms/modules Modified: ping.php - simplified ping module Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.3&r2=1.4 Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.3 lms/modules/ping.php:1.4 --- lms/modules/ping.php:1.3 Mon Nov 14 20:21:54 2011 +++ lms/modules/ping.php Tue Nov 15 23:59:26 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.3 2011/11/14 19:21:54 chilek Exp $ + * $Id: ping.php,v 1.4 2011/11/15 22:59:26 chilek Exp $ */ function refresh($params) @@ -56,34 +56,6 @@ $layout['pagetitle'] = trans('Ping'); -if (!isset($_GET['id'])) -{ - if (isset($_GET['p']) && $_GET['p'] == 'main') - { - /* Using AJAX for template plugins */ - require(LIB_DIR.'/xajax/xajax_core/xajax.inc.php'); - - $xajax = new xajax(); - $xajax->configure('errorHandler', true); - $xajax->configure('javascript URI', 'img'); - $xajax->register(XAJAX_FUNCTION, 'refresh'); - $xajax->processRequest(); - - $SMARTY->assign('xajax', $xajax->getJavascript()); - $SMARTY->assign('part', $_GET['p']); - } - - if (isset($_GET['ip'])) - $SMARTY->assign('ipaddr', $_GET['ip']); - $SMARTY->display('ping.html'); - die; -} -else - if (!$DB->GetOne('SELECT id FROM nodes WHERE id=?', array(intval($_GET['id'])))) - $SESSION->redirect('?m=nodelist'); - -$nodeid = $_GET['id']; - if (isset($_GET['p']) && $_GET['p'] == 'main') { /* Using AJAX for template plugins */ @@ -99,8 +71,8 @@ $SMARTY->assign('part', $_GET['p']); } -$SMARTY->assign('ipaddr', $LMS->GetNodeIpByID($nodeid)); -$SMARTY->assign('nodeid', $nodeid); +if (isset($_GET['ip'])) + $SMARTY->assign('ipaddr', $_GET['ip']); $SMARTY->display('ping.html'); ?> From cvs w lms.org.pl Wed Nov 16 14:06:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 14:06:45 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20111116130645.9D2E3302A041@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 14:06:45 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - we can close netmap popups by close box; also some map css cleanups Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.398&r2=1.399 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.398 lms/lib/locale/pl/strings.php:1.399 --- lms/lib/locale/pl/strings.php:1.398 Mon Nov 14 10:19:22 2011 +++ lms/lib/locale/pl/strings.php Wed Nov 16 14:06:45 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.398 2011/11/14 09:19:22 chilek Exp $ + * $Id: strings.php,v 1.399 2011/11/16 13:06:45 chilek Exp $ */ $_LANG['$a ($b addresses)'] = '$a ($b adresów)'; @@ -2517,5 +2517,7 @@ $_LANG['Destination Host Unreachable'] = 'Urządzenie docelowe jest nieosiągalne'; $_LANG['Total: $a% ($b/$c)'] = 'Razem: $a% ($b/$c)'; $_LANG['Auto Scroll'] = 'Automatyczne przewijanie'; +$_LANG['Enter IP address:'] = 'Podaj adres IP:'; +$_LANG['Ping to $a'] = 'Ping do $a'; ?> From cvs w lms.org.pl Wed Nov 16 14:06:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 14:06:45 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (ping.php) Message-ID: <20111116130645.BC34B302A042@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 14:06:45 Author: chilek Path: /cvsroot/lms/modules Modified: ping.php - we can close netmap popups by close box; also some map css cleanups Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.4&r2=1.5 Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.4 lms/modules/ping.php:1.5 --- lms/modules/ping.php:1.4 Tue Nov 15 23:59:26 2011 +++ lms/modules/ping.php Wed Nov 16 14:06:45 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.4 2011/11/15 22:59:26 chilek Exp $ + * $Id: ping.php,v 1.5 2011/11/16 13:06:45 chilek Exp $ */ function refresh($params) @@ -56,23 +56,33 @@ $layout['pagetitle'] = trans('Ping'); -if (isset($_GET['p']) && $_GET['p'] == 'main') -{ - /* Using AJAX for template plugins */ - require(LIB_DIR.'/xajax/xajax_core/xajax.inc.php'); - - $xajax = new xajax(); - $xajax->configure('errorHandler', true); - $xajax->configure('javascript URI', 'img'); - $xajax->register(XAJAX_FUNCTION, 'refresh'); - $xajax->processRequest(); - - $SMARTY->assign('xajax', $xajax->getJavascript()); - $SMARTY->assign('part', $_GET['p']); +if (isset($_GET['p'])) + $SMARTY->assign('part', $_GET['p']); + switch ($_GET['p']) { + case 'main': + /* Using AJAX for template plugins */ + require(LIB_DIR.'/xajax/xajax_core/xajax.inc.php'); + + $xajax = new xajax(); + $xajax->configure('errorHandler', true); + $xajax->configure('javascript URI', 'img'); + $xajax->register(XAJAX_FUNCTION, 'refresh'); + $xajax->processRequests(); + + $SMARTY->assign('xajax', $xajax->getJavascript()); + break; + case 'titlebar': + case 'ipform': + if (!isset($_GET['popupid'])) + die; + $SMARTY->assign('popupid', $_GET['popupid']); + break; + } } if (isset($_GET['ip'])) $SMARTY->assign('ipaddr', $_GET['ip']); + $SMARTY->display('ping.html'); ?> From cvs w lms.org.pl Wed Nov 16 14:06:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 14:06:45 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111116130645.68DC9302A040@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 14:06:45 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - we can close netmap popups by close box; also some map css cleanups Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1607&r2=1.1608 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1607 lms/doc/ChangeLog:1.1608 --- lms/doc/ChangeLog:1.1607 Tue Nov 15 23:33:29 2011 +++ lms/doc/ChangeLog Wed Nov 16 14:06:45 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1607 2011/11/15 22:33:29 chilek Exp $ +$Id: ChangeLog,v 1.1608 2011/11/16 13:06:45 chilek Exp $ version ? (????-??-??): @@ -53,6 +53,7 @@ - ported to xajax 0.5 [chilan] - toolbar on netdevmap and possibility to ping any host (event not included in database) [chilan] - netmap popups are draggable thanks to DragPopup class written by Matt Walker [chilan] + - we can close netmap popups by close box; also some map css cleanups [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Wed Nov 16 14:06:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 14:06:45 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111116130645.DB402302A043@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 14:06:45 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - we can close netmap popups by close box; also some map css cleanups Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.4&r2=1.5 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.4 lms/templates/ping.html:1.5 --- lms/templates/ping.html:1.4 Tue Nov 15 23:59:26 2011 +++ lms/templates/ping.html Wed Nov 16 14:06:45 2011 @@ -1,5 +1,25 @@ +{if $part eq "titlebar"} +
+
+
{t 0=$ipaddr}Ping to $0{/t}
+
+
+
+
+ +{elseif $part eq "ipform"} +
+
{t}Enter IP address:{/t}
+
+
+ + +
+
+
+{else} - + @@ -49,3 +69,4 @@ {/if} +{/if} \ No newline at end of file From cvs w lms.org.pl Wed Nov 16 14:19:10 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 14:19:10 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (DragPopup.js, map.css, map.js) Message-ID: <20111116131910.9A011302A040@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 14:19:10 Author: chilek Path: /cvsroot/lms/img Modified: DragPopup.js map.css map.js - typos Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/DragPopup.js.diff?&r1=1.1&r2=1.2 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.4&r2=1.5 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.7&r2=1.8 Index: lms/img/DragPopup.js diff -u lms/img/DragPopup.js:1.1 lms/img/DragPopup.js:1.2 --- lms/img/DragPopup.js:1.1 Tue Nov 15 23:33:29 2011 +++ lms/img/DragPopup.js Wed Nov 16 14:19:10 2011 @@ -30,6 +30,7 @@ this.popup.events.register('mousedown', this, this.mouseDown); this.popup.events.register('mouseup', this, this.mouseUp); this.popup.events.register('mousemove', this, this.mouseMove); + this.popup.events.register('click', this, this.click); // Define a function bound to this used to listen for // document mouseout events this.docMouseUpProxy = OpenLayers.Function.bind(this.mouseUp, this); @@ -62,6 +63,17 @@ OpenLayers.Event.stop(evt); }, + click: function(evt) { + var closeElem = document.getElementById(this.popup.div.id + '_' + 'popupCloseBox'); + if (closeElem != null) + { + var clickPnt = this.popup.events.getMousePosition(evt); + if (clickPnt.x >= closeElem.offsetLeft && clickPnt.x <= closeElem.offsetLeft + closeElem.offsetWidth + && clickPnt.y >= closeElem.offsetTop && clickPnt.y <= closeElem.offsetTop + closeElem.offsetHeight) + this.map.removePopup(this.popup); + } + }, + mouseOut: function(evt) { //console.log('map.mouseOut'); this.down = false; Index: lms/img/map.css diff -u lms/img/map.css:1.4 lms/img/map.css:1.5 --- lms/img/map.css:1.4 Tue Nov 15 23:33:29 2011 +++ lms/img/map.css Wed Nov 16 14:19:10 2011 @@ -1,14 +1,12 @@ div.olControlPanel { position: absolute; - top: 5px; - left: 60px; + left: 60px; top: 5px; } .olControlPanel div { display: block; float: left; - width: 18px; - height: 18px; + width: 18px; height: 18px; border: thin solid black; margin: 1px; background-color: white; @@ -25,34 +23,34 @@ padding: 0px; } -div.infoPopupTable { +div.lmsInfoPopupContents { + background-color: #CEBD9B; + border-color: black; border: thin solid black; - background-color: #DFD5BD; width: auto; height: auto; white-space: nowrap; overflow: visible; } -div.infoPopupName { - padding: 2px; - font-weight: bold; - width: auto; height: auto; - white-space: nowrap; -} - -div.infoPopupPing { +div.lmsInfoPopupAddress { + background-color: #DFD5BD; padding: 2px; + border: none; width: auto; height: auto; white-space: nowrap; + clear: both; } -div.infoPopupInfo { +div.lmsInfoPopupDetails { + background-color: #DFD5BD; padding: 2px; + border: none; width: auto; height: auto; white-space: nowrap; + clear: both; } -div.mapPopupTable { +div.lmsMapPopupContents { border: thin solid black; background-color: #DFD5BD; width: auto; height: auto; @@ -60,20 +58,21 @@ overflow: visible; } -div.mapPopupName { +div.lmsMapPopupName { padding: 2px; font-weight: bold; width: auto; height: auto; white-space: nowrap; } -div.mapPopupIp { +div.lmsMapPopupAddress { padding: 2px; width: auto; height: auto; white-space: nowrap; + overflow: visible; } -div.ipPopupTable { +div.lmsIpPopupTable { border: thin solid black; background-color: #DFD5BD; width: auto; height: auto; @@ -82,17 +81,38 @@ overflow: visible; } -div.ipPopupLabel { +div.lmsIpPopupLabel { font-weight: bold; } -div.popupTitleBar { - border: thin solid black; +div.lmsPopupTitleBar { background-color: #CEBD9B; - border-top-width: 1pt; border-top-style: solid; border-left-width: 1pt; border-left-style: solid; border-right-width: 1pt; border-right-style: solid; - font-weight: bold; white-space: nowrap; - overflow: hidden; + width: auto; height: auto; + overflow: visible; + border-left-width: 1pt; border-left-style: solid; border-top-width: 1pt; border-top-style: solid; border-right-width: 1pt; border-right-style: solid; +} + +div.lmsPopupTitle { + background-color: #CEBD9B; + font-weight: bold; + float: left; + width: auto; height: auto; + overflow: visible; +} + +div.lmsPopupCloseBox { + background-color: #CEBD9B; + float: right; + width: 16px; height: 16px; + padding: 1px; + overflow: visible; +} + +div.lmsPopupTitleBarBottom { + clear: both; + width: auto; height: auto; + overflow: visible; } .olPingButtonItemActive { Index: lms/img/map.js diff -u lms/img/map.js:1.7 lms/img/map.js:1.8 --- lms/img/map.js:1.7 Tue Nov 15 23:50:25 2011 +++ lms/img/map.js Wed Nov 16 14:19:10 2011 @@ -19,8 +19,7 @@ function netdevmap_updater() { - if (maprequest.status = 200) - { + if (maprequest.status = 200) { data = eval('(' + maprequest.responseText + ')'); devices = data.devices; nodes = data.nodes; @@ -52,7 +51,6 @@ nodelayer.addFeatures([newfeature]); } } - } } @@ -65,16 +63,28 @@ setTimeout("netdevmap_refresh()", lastonline_limit * 1000); } -function ping_host(id, ip) +function close_popup(id) { - for (var i = 0; i < map.popups.length, map.popups[i].id != id; i++); - map.popups[i].setContentHTML('
Ping to ' + ip + '
' - + ''); + //for (var i = 0; i < map.popups.length, map.popups[i].id != id; i++); + map.removePopup(id) +} +function ping_host(id, ip) +{ removeInvisiblePopups(); - autoiframe_setsize('autoiframe_' + id.replace('.', '_'), 400, 300); - map.popups[i].updateSize(); + for (var i = 0; i < map.popups.length, map.popups[i].id != id; i++); + //var popupid = id.replace('.', '_'); + var popupid = id; + var pingContentsRequest = OpenLayers.Request.issue({ + url: '?m=ping&p=titlebar&popupid=' + popupid + '&ip=' + ip, + async: false + }); + if (pingContentsRequest.status = 200) { + map.popups[i].setContentHTML(pingContentsRequest.responseText); + autoiframe_setsize('autoiframe_' + popupid, 400, 300); + map.popups[i].updateSize(); + } } function ping_any_host(id) @@ -313,9 +323,10 @@ new OpenLayers.LonLat(e.feature.data.lon, e.feature.data.lat) .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), new OpenLayers.Size(10, 10), - '
' + e.feature.data.name + '
' + '
' + e.feature.data.name + '
' + (e.feature.data.ipaddr.length ? - '
' + e.feature.data.ipaddr.replace(/,/g, '
') + '
' + '
' + e.feature.data.ipaddr.replace(/,/g, + '
') + '
' : '') + '
'); mappopup.setOpacity(0.8); @@ -365,25 +376,27 @@ .transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), new OpenLayers.Size(10, 10)); featurepopup.setOpacity(0.8); - featurepopup.closeOnMove = true; + //featurepopup.closeOnMove = true; //featurepopup.keepInMap = true; //featurepopup.panMapIfOutOfView = true; - var content = '
' + feature.data.name + '
'; + var content = '
' + feature.data.name + '
' + + '
'; + content += '
'; if (feature.data.type == 'netdevinfo') { if (feature.data.ipaddr.length) { var ips = feature.data.ipaddr.split(','); var nodeids = feature.data.nodeid.split(','); for (i in nodeids) - content += ''; } } else - content += ''; - content += ''; featurepopup.setContentHTML(content); @@ -404,8 +417,8 @@ feature.popup = featurepopup; }, onUnselect: function(feature) { - map.removePopup(feature.popup); - feature.popup = null; + //map.removePopup(feature.popup); + //feature.popup = null; } }); map.addControl(selectlayer); @@ -430,14 +443,15 @@ map.getLonLatFromPixel(new OpenLayers.Pixel(60, 27)).clone(), new OpenLayers.Size(10, 10)); pingpopup.setOpacity(0.8); - pingpopup.closeOnMove = true; + //pingpopup.closeOnMove = true; pingpopup.keepInMap = true; pingpopup.panMapIfOutOfView = true; - pingpopup.setContentHTML('
Enter IP address:
' - + '
' - + '
' - + '' - + '
'); + var pingPopupRequest = OpenLayers.Request.issue({ + url: '?m=ping&p=ipform&popupid=' + pingpopup.id, + async: false + }); + if (pingPopupRequest.status = 200) + pingpopup.setContentHTML(pingPopupRequest.responseText); map.addPopup(pingpopup); var dragpopup = new OpenLayers.Control.DragPopup(pingpopup); From cvs w lms.org.pl Wed Nov 16 14:19:10 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 14:19:10 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (ping.php) Message-ID: <20111116131910.B473D302A041@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 14:19:10 Author: chilek Path: /cvsroot/lms/modules Modified: ping.php - typos Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.5&r2=1.6 Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.5 lms/modules/ping.php:1.6 --- lms/modules/ping.php:1.5 Wed Nov 16 14:06:45 2011 +++ lms/modules/ping.php Wed Nov 16 14:19:10 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.5 2011/11/16 13:06:45 chilek Exp $ + * $Id: ping.php,v 1.6 2011/11/16 13:19:10 chilek Exp $ */ function refresh($params) @@ -57,7 +57,8 @@ $layout['pagetitle'] = trans('Ping'); if (isset($_GET['p'])) - $SMARTY->assign('part', $_GET['p']); +{ + $SMARTY->assign('part', $_GET['p']); switch ($_GET['p']) { case 'main': /* Using AJAX for template plugins */ @@ -67,7 +68,7 @@ $xajax->configure('errorHandler', true); $xajax->configure('javascript URI', 'img'); $xajax->register(XAJAX_FUNCTION, 'refresh'); - $xajax->processRequests(); + $xajax->processRequest(); $SMARTY->assign('xajax', $xajax->getJavascript()); break; From cvs w lms.org.pl Wed Nov 16 14:19:10 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 14:19:10 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111116131910.D666F302A042@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 14:19:10 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - typos Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.5&r2=1.6 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.5 lms/templates/ping.html:1.6 --- lms/templates/ping.html:1.5 Wed Nov 16 14:06:45 2011 +++ lms/templates/ping.html Wed Nov 16 14:19:10 2011 @@ -1,7 +1,7 @@ {if $part eq "titlebar"}
-
{t 0=$ipaddr}Ping to $0{/t}
+
{t a=$ipaddr}Ping to $a{/t}
@@ -19,7 +19,7 @@
{else} - + From cvs w lms.org.pl Wed Nov 16 15:17:48 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 15:17:48 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (messageadd.html) Message-ID: <20111116141748.F3EB5302A040@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 15:17:48 Author: chilek Path: /cvsroot/lms/templates Modified: messageadd.html - we need literal smarty tag here Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/messageadd.html.diff?&r1=1.5&r2=1.6 Index: lms/templates/messageadd.html diff -u lms/templates/messageadd.html:1.5 lms/templates/messageadd.html:1.6 --- lms/templates/messageadd.html:1.5 Thu Nov 10 07:41:01 2011 +++ lms/templates/messageadd.html Wed Nov 16 15:17:48 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -7,7 +7,9 @@ + @@ -34,21 +34,6 @@ {else} -
@@ -56,7 +41,7 @@ {t a="0" b="0" c="0"}Total: $a% ($b/$c){/t}
- + @@ -67,6 +52,34 @@
+ {/if} -{/if} \ No newline at end of file +{/if} From cvs w lms.org.pl Wed Nov 16 22:21:11 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 22:21:11 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111116212111.B8FBA302A041@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 22:21:11 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - javascript and css fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.7&r2=1.8 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.7 lms/templates/ping.html:1.8 --- lms/templates/ping.html:1.7 Wed Nov 16 18:47:08 2011 +++ lms/templates/ping.html Wed Nov 16 22:21:11 2011 @@ -8,7 +8,14 @@
{elseif $part eq "ipform"} -
+
+
+
+
+
+
+
+
{t}Enter IP address:{/t}
@@ -19,13 +26,14 @@
{else} - + ::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle} :{/if}:: + {$xajax} {if !$part} @@ -34,14 +42,14 @@ {else} - -
-
-
+ +
+
+
{t a="0" b="0" c="0"}Total: $a% ($b/$c){/t}
-
- +
+ @@ -82,4 +90,4 @@ {/if} -{/if} +{/if} \ No newline at end of file From cvs w lms.org.pl Wed Nov 16 22:21:11 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 22:21:11 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.css, map.js) Message-ID: <20111116212111.9E09E302A040@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 22:21:11 Author: chilek Path: /cvsroot/lms/img Modified: map.css map.js - javascript and css fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.5&r2=1.6 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.8&r2=1.9 Index: lms/img/map.css diff -u lms/img/map.css:1.5 lms/img/map.css:1.6 --- lms/img/map.css:1.5 Wed Nov 16 14:19:10 2011 +++ lms/img/map.css Wed Nov 16 22:21:11 2011 @@ -23,8 +23,39 @@ padding: 0px; } -div.lmsInfoPopupContents { +div.lmsPopupTitleBar { + background-color: #CEBD9B; + white-space: nowrap; + width: auto; height: auto; + overflow: visible; + border-left-width: 1pt; border-left-style: solid; border-top-width: 1pt; border-top-style: solid; border-right-width: 1pt; border-right-style: solid; +} + +div.lmsPopupTitle { background-color: #CEBD9B; + font-weight: bold; + float: left; + width: auto; height: auto; + overflow: visible; +} + +div.lmsPopupCloseBox { + background-color: #CEBD9B; + float: right; + width: 16px; height: 16px; + padding: 1px; + overflow: visible; +} + +div.lmsPopupTitleBarBottom { + clear: both; + width: auto; height: auto; + overflow: visible; +} + +div.lmsInfoPopupContents { + background-color: #DFD5BD; + padding: 6px; border-color: black; border: thin solid black; width: auto; height: auto; @@ -72,11 +103,11 @@ overflow: visible; } -div.lmsIpPopupTable { +div.lmsIpPopupContents { border: thin solid black; background-color: #DFD5BD; width: auto; height: auto; - padding: 2px; + padding: 6px; white-space: nowrap; overflow: visible; } @@ -85,33 +116,31 @@ font-weight: bold; } -div.lmsPopupTitleBar { - background-color: #CEBD9B; - white-space: nowrap; - width: auto; height: auto; - overflow: visible; - border-left-width: 1pt; border-left-style: solid; border-top-width: 1pt; border-top-style: solid; border-right-width: 1pt; border-right-style: solid; +div.lmsPingContentsFrame { + border: thin solid black; } -div.lmsPopupTitle { - background-color: #CEBD9B; - font-weight: bold; - float: left; - width: auto; height: auto; - overflow: visible; +div.lmsPingContents { + overflow: auto; + height: 270px; + padding: 2px; } -div.lmsPopupCloseBox { - background-color: #CEBD9B; - float: right; - width: 16px; height: 16px; - padding: 1px; - overflow: visible; +div.lmsPingBottom { + position: relative; } -div.lmsPopupTitleBarBottom { - clear: both; - width: auto; height: auto; +div.lmsPingSummary { + position: absolute; + left: 4px; top: 7px; width: 220px; + font-weight: bold; + white-space: nowrap; + overflow: visible; +} +div.lmsPingAutoScroll { + position: absolute; + right: 5px; top: 5px; width: 180px; + white-space: nowrap; overflow: visible; } Index: lms/img/map.js diff -u lms/img/map.js:1.8 lms/img/map.js:1.9 --- lms/img/map.js:1.8 Wed Nov 16 14:19:10 2011 +++ lms/img/map.js Wed Nov 16 22:21:11 2011 @@ -19,7 +19,7 @@ function netdevmap_updater() { - if (maprequest.status = 200) { + if (maprequest.status == 200) { data = eval('(' + maprequest.responseText + ')'); devices = data.devices; nodes = data.nodes; @@ -65,7 +65,6 @@ function close_popup(id) { - //for (var i = 0; i < map.popups.length, map.popups[i].id != id; i++); map.removePopup(id) } @@ -74,13 +73,12 @@ removeInvisiblePopups(); for (var i = 0; i < map.popups.length, map.popups[i].id != id; i++); - //var popupid = id.replace('.', '_'); var popupid = id; var pingContentsRequest = OpenLayers.Request.issue({ - url: '?m=ping&p=titlebar&popupid=' + popupid + '&ip=' + ip, + url: '?m=ping&p=titlebar&popupid=' + id + '&ip=' + ip, async: false }); - if (pingContentsRequest.status = 200) { + if (pingContentsRequest.status == 200) { map.popups[i].setContentHTML(pingContentsRequest.responseText); autoiframe_setsize('autoiframe_' + popupid, 400, 300); map.popups[i].updateSize(); @@ -450,7 +448,7 @@ url: '?m=ping&p=ipform&popupid=' + pingpopup.id, async: false }); - if (pingPopupRequest.status = 200) + if (pingPopupRequest.status == 200) pingpopup.setContentHTML(pingPopupRequest.responseText); map.addPopup(pingpopup); @@ -480,8 +478,6 @@ map.addControl(new OpenLayers.Control.LayerSwitcher()); map.addControl(new OpenLayers.Control.MousePosition({ displayProjection: new OpenLayers.Projection("EPSG:4326") })); - //map.events.register('mousemove', null, popupmouse_movefunction(event) { alert('map mousemove'); }, true); - if (deviceArray || nodeArray) map.zoomToExtent(area); else From cvs w lms.org.pl Wed Nov 16 22:30:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 22:30:39 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.css) Message-ID: <20111116213039.77F13302A040@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 22:30:39 Author: chilek Path: /cvsroot/lms/img Modified: map.css - typos Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.6&r2=1.7 Index: lms/img/map.css diff -u lms/img/map.css:1.6 lms/img/map.css:1.7 --- lms/img/map.css:1.6 Wed Nov 16 22:21:11 2011 +++ lms/img/map.css Wed Nov 16 22:30:39 2011 @@ -116,7 +116,7 @@ font-weight: bold; } -div.lmsPingContentsFrame { +body.lmsPingContentsFrame { border: thin solid black; } From cvs w lms.org.pl Wed Nov 16 22:30:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 16 Nov 2011 22:30:39 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111116213039.9711D302A041@eftep.altec.pl> Date: Wednesday, November 16, 2011 @ 22:30:39 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - typos Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.8&r2=1.9 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.8 lms/templates/ping.html:1.9 --- lms/templates/ping.html:1.8 Wed Nov 16 22:21:11 2011 +++ lms/templates/ping.html Wed Nov 16 22:30:39 2011 @@ -26,7 +26,7 @@
{else} - + @@ -45,7 +45,7 @@
-
+
{t a="0" b="0" c="0"}Total: $a% ($b/$c){/t}
From cvs w lms.org.pl Thu Nov 17 16:36:09 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 17 Nov 2011 16:36:09 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (DragPopup.js, common.js, map.css, map.js) Message-ID: <20111117153609.D74D6302A041@eftep.altec.pl> Date: Thursday, November 17, 2011 @ 16:36:09 Author: chilek Path: /cvsroot/lms/img Modified: DragPopup.js common.js map.css map.js - netdevmap: remember position, zoom, base layer and visible data layers between netdevmap visits Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/DragPopup.js.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/img/common.js.diff?&r1=1.37&r2=1.38 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.7&r2=1.8 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.9&r2=1.10 Index: lms/img/DragPopup.js diff -u lms/img/DragPopup.js:1.2 lms/img/DragPopup.js:1.3 --- lms/img/DragPopup.js:1.2 Wed Nov 16 14:19:10 2011 +++ lms/img/DragPopup.js Thu Nov 17 16:36:09 2011 @@ -50,8 +50,14 @@ mouseDown: function(evt) { //console.log('mouseDown'); - this.down = true; this.popPnt = this.popup.events.getMousePosition(evt); + var divelems = this.popup.div.getElementsByTagName('div'); + for (var i = 0; i < divelems.length, divelems[i].className != 'lmsPopupTitleBar'; i++); + if (i < divelems.length && (this.popPnt.x < divelems[i].offsetLeft || this.popPnt.x > divelems[i].offsetLeft + divelems[i].offsetWidth + || this.popPnt.y < divelems[i].offsetTop || this.popPnt.y > divelems[i].offsetTop + divelems[i].offsetHeight)) + return true; + else + this.down = true; OpenLayers.Event.observe(document, 'mouseup', this.docMouseUpProxy); OpenLayers.Event.stop(evt); }, Index: lms/img/common.js diff -u lms/img/common.js:1.37 lms/img/common.js:1.38 --- lms/img/common.js:1.37 Sat Nov 12 21:04:30 2011 +++ lms/img/common.js Thu Nov 17 16:36:09 2011 @@ -137,26 +137,28 @@ function getCookie(name) { - var cookies = document.cookie.split(';'); - for (var i=0; i Date: Thursday, November 17, 2011 @ 16:36:09 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - netdevmap: remember position, zoom, base layer and visible data layers between netdevmap visits Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1608&r2=1.1609 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1608 lms/doc/ChangeLog:1.1609 --- lms/doc/ChangeLog:1.1608 Wed Nov 16 14:06:45 2011 +++ lms/doc/ChangeLog Thu Nov 17 16:36:09 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1608 2011/11/16 13:06:45 chilek Exp $ +$Id: ChangeLog,v 1.1609 2011/11/17 15:36:09 chilek Exp $ version ? (????-??-??): @@ -54,6 +54,7 @@ - toolbar on netdevmap and possibility to ping any host (event not included in database) [chilan] - netmap popups are draggable thanks to DragPopup class written by Matt Walker [chilan] - we can close netmap popups by close box; also some map css cleanups [chilan] + - netdevmap: remember position, zoom, base layer and visible data layers between netdevmap visits [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Thu Nov 17 16:38:55 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 17 Nov 2011 16:38:55 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111117153855.82EAC302A041@eftep.altec.pl> Date: Thursday, November 17, 2011 @ 16:38:55 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - small ping fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.9&r2=1.10 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.9 lms/templates/ping.html:1.10 --- lms/templates/ping.html:1.9 Wed Nov 16 22:30:39 2011 +++ lms/templates/ping.html Thu Nov 17 16:38:55 2011 @@ -18,7 +18,7 @@
{t}Enter IP address:{/t}
- + @@ -26,7 +26,7 @@
{else} - + From cvs w lms.org.pl Thu Nov 17 16:38:55 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 17 Nov 2011 16:38:55 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (ping.php) Message-ID: <20111117153855.6A046302A040@eftep.altec.pl> Date: Thursday, November 17, 2011 @ 16:38:55 Author: chilek Path: /cvsroot/lms/modules Modified: ping.php - small ping fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.7&r2=1.8 Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.7 lms/modules/ping.php:1.8 --- lms/modules/ping.php:1.7 Wed Nov 16 18:47:07 2011 +++ lms/modules/ping.php Thu Nov 17 16:38:55 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.7 2011/11/16 17:47:07 chilek Exp $ + * $Id: ping.php,v 1.8 2011/11/17 15:38:55 chilek Exp $ */ function refresh($params) @@ -82,7 +82,7 @@ } } -if (isset($_GET['ip'])) +if (isset($_GET['ip']) && check_ip($_GET['ip'])) $SMARTY->assign('ipaddr', $_GET['ip']); $SMARTY->display('ping.html'); From cvs w lms.org.pl Thu Nov 17 23:13:07 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 17 Nov 2011 23:13:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.css, map.js) Message-ID: <20111117221307.CD3DF302A041@eftep.altec.pl> Date: Thursday, November 17, 2011 @ 23:13:07 Author: chilek Path: /cvsroot/lms/img Modified: map.css map.js - netdevmap: refresh network state on demand - added new button Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.8&r2=1.9 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.10&r2=1.11 Index: lms/img/map.css diff -u lms/img/map.css:1.8 lms/img/map.css:1.9 --- lms/img/map.css:1.8 Thu Nov 17 16:36:09 2011 +++ lms/img/map.css Thu Nov 17 23:13:07 2011 @@ -1,19 +1,3 @@ -div.olControlPanel { - position: absolute; - left: 60px; top: 5px; -} - -.olControlPanel div { - display: block; - float: left; - width: 18px; height: 18px; - border: thin solid black; - margin: 1px; - background-color: white; - background-position: center center; - background-repeat: no-repeat; -} - div.olPopup { overflow: visible; } @@ -144,18 +128,41 @@ overflow: visible; } +div.olControlPanel { + position: absolute; + left: 60px; top: 5px; +} + +.olControlPanel div { + display: block; + float: left; + width: 22px; height: 22px; + border: thin solid black; + margin: 1px; + background-position: center center; + background-repeat: no-repeat; +} + .lmsPingButtonItemActive { - background-image: url("ip.gif"); + background: white url("ip.gif"); } .lmsPingButtonItemInactive { - background-image: url("ip.gif"); + background: white url("ip.gif"); } .lmsCenterButtonItemActive { - background-image: url("network.gif"); + background: white url("network.gif"); } .lmsCenterButtonItemInactive { - background-image: url("network.gif"); + background: white url("network.gif"); +} + +.lmsRefreshButtonItemActive { + background: red url("reload.gif"); +} + +.lmsRefreshButtonItemInactive { + background: white url("reload.gif"); } Index: lms/img/map.js diff -u lms/img/map.js:1.10 lms/img/map.js:1.11 --- lms/img/map.js:1.10 Thu Nov 17 16:36:09 2011 +++ lms/img/map.js Thu Nov 17 23:13:07 2011 @@ -21,16 +21,17 @@ function netdevmap_updater() { if (maprequest.status == 200) { - data = eval('(' + maprequest.responseText + ')'); - devices = data.devices; - nodes = data.nodes; + var data = eval('(' + maprequest.responseText + ')'); + var devices = data.devices; + var nodes = data.nodes; - devicelayer = map.getLayersByName('Devices')[0]; + var devicelayer = map.getLayersByName('Devices')[0]; for (i in devices) { var features = devicelayer.getFeaturesByAttribute('id', parseInt(devices[i].id)); if (features.length && features[0].attributes.state != devices[i].state) { + devices[i].id = parseInt(devices[i].id); var newfeature = new OpenLayers.Feature.Vector( features[0].geometry.clone(), devices[i]); @@ -39,12 +40,13 @@ } } - nodelayer = map.getLayersByName('Nodes')[0]; + var nodelayer = map.getLayersByName('Nodes')[0]; for (i in nodes) { var features = nodelayer.getFeaturesByAttribute('id', parseInt(nodes[i].id)); if (features.length && features[0].attributes.state != nodes[i].state) { + nodes[i].id = parseInt(nodes[i].id); var newfeature = new OpenLayers.Feature.Vector( features[0].geometry.clone(), nodes[i]); @@ -53,15 +55,17 @@ } } } + map.getControlsBy('displayClass', 'lmsRefreshButton')[0].deactivate(); } -function netdevmap_refresh() +function netdevmap_refresh(live) { maprequest = OpenLayers.Request.issue({ - url: '?m=netdevmaprefresh', + url: '?m=netdevmaprefresh' + (live ? '&live=1' : ''), callback: netdevmap_updater }); - setTimeout("netdevmap_refresh()", lastonline_limit * 1000); + if (!live) + setTimeout("netdevmap_refresh()", lastonline_limit * 1000); } function close_popup(id) @@ -122,101 +126,44 @@ graphicWidth: 16, graphicHeight: 16, graphicXOffset: -8, - graphicYOffset: -8 - }, - { - rules: [ - new OpenLayers.Rule({ - filter: new OpenLayers.Filter.Comparison({ - type: OpenLayers.Filter.Comparison.EQUAL_TO, - property: "state", - value: 0 - }), - symbolizer: { - externalGraphic: "img/netdev_unk.png" - } - }), - new OpenLayers.Rule({ - filter: new OpenLayers.Filter.Comparison({ - type: OpenLayers.Filter.Comparison.EQUAL_TO, - property: "state", - value: 1 - }), - symbolizer: { - externalGraphic: "img/netdev_on.png" - } - }), - new OpenLayers.Rule({ - filter: new OpenLayers.Filter.Comparison({ - type: OpenLayers.Filter.Comparison.EQUAL_TO, - property: "state", - value: 2 - }), - symbolizer: { - externalGraphic: "img/netdev_off.png" + graphicYOffset: -8, + externalGraphic: "${img}" + }, { + context: { + img: function(feature) { + switch (feature.attributes.state) { + case 0: return "img/netdev_unk.png"; + case 1: return "img/netdev_on.png"; + case 2: return "img/netdev_off.png"; + default: return "img/netdev.png"; } - }), - new OpenLayers.Rule({ - elseFilter: true, - symbolizer: { - externalGraphic: "img/netdev.png" - } - }) - ] - } - ); + } + } + }); var nodestyle = new OpenLayers.Style( { graphicWidth: 16, graphicHeight: 16, graphicXOffset: -8, - graphicYOffset: -8 - }, - { - rules: [ - new OpenLayers.Rule({ - filter: new OpenLayers.Filter.Comparison({ - type: OpenLayers.Filter.Comparison.EQUAL_TO, - property: "state", - value: 0 - }), - symbolizer: { - externalGraphic: "img/node_unk.png" - } - }), - new OpenLayers.Rule({ - filter: new OpenLayers.Filter.Comparison({ - type: OpenLayers.Filter.Comparison.EQUAL_TO, - property: "state", - value: 1 - }), - symbolizer: { - externalGraphic: "img/node_on.png" + graphicYOffset: -8, + externalGraphic: "${img}" + }, { + context: { + img: function(feature) { + switch (feature.attributes.state) { + case 0: return "img/node_unk.png"; + case 1: return "img/node_on.png"; + case 2: return "img/node_off.png"; + default: return "img/node.png"; } - }), - new OpenLayers.Rule({ - filter: new OpenLayers.Filter.Comparison({ - type: OpenLayers.Filter.Comparison.EQUAL_TO, - property: "state", - value: 2 - }), - symbolizer: { - externalGraphic: "img/node_off.png" - } - }), - new OpenLayers.Rule({ - elseFilter: true, - symbolizer: { - externalGraphic: "img/node.png" - } - }) - ] - } - ); + } + } + }); var area = new OpenLayers.Bounds(); var devices = []; + //var dane = ''; if (deviceArray) for (i in deviceArray) { @@ -228,7 +175,9 @@ lonLat.lon, lonLat.lat ), deviceArray[i])); + //dane += devices[i].attributes.state + ' '; } + //alert(dane); var devicelayer = new OpenLayers.Layer.Vector("Devices", { styleMap: new OpenLayers.StyleMap(devicestyle) @@ -432,6 +381,11 @@ title: "Cetner map around network elements ...", command: 'center'}); + var refreshbutton = new OpenLayers.Control.Button({ + displayClass: "lmsRefreshButton", + title: "Refesh network state ...", + command: 'refresh'}); + var panel = new OpenLayers.Control.Panel({ type: OpenLayers.Control.TYPE_BUTTON, title: "Toolbar", @@ -481,10 +435,16 @@ else map.zoomToMaxExtent(); break; + case 'refresh': + if (!control.active) { + control.activate(); + netdevmap_refresh(true); + } + break; } } }); - panel.addControls([pingbutton, centerbutton]); + panel.addControls([pingbutton, centerbutton, refreshbutton]); map.addControl(panel); } From cvs w lms.org.pl Thu Nov 17 23:13:08 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 17 Nov 2011 23:13:08 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (map.inc.php, netdevmaprefresh.php, ping.php) Message-ID: <20111117221308.4D61E302A042@eftep.altec.pl> Date: Thursday, November 17, 2011 @ 23:13:08 Author: chilek Path: /cvsroot/lms/modules Modified: map.inc.php netdevmaprefresh.php ping.php - netdevmap: refresh network state on demand - added new button Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/map.inc.php.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevmaprefresh.php.diff?&r1=1.1&r2=1.2 http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.8&r2=1.9 Index: lms/modules/map.inc.php diff -u lms/modules/map.inc.php:1.2 lms/modules/map.inc.php:1.3 --- lms/modules/map.inc.php:1.2 Sat Nov 12 21:04:30 2011 +++ lms/modules/map.inc.php Thu Nov 17 23:13:07 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: map.inc.php,v 1.2 2011/11/12 20:04:30 chilek Exp $ + * $Id: map.inc.php,v 1.3 2011/11/17 22:13:07 chilek Exp $ */ $devices = $DB->GetAllByKey('SELECT n.id, n.name, n.location, '.$DB->GroupConcat('INET_NTOA(CASE WHEN nodes.ownerid = 0 THEN nodes.ipaddr ELSE NULL END)') @@ -37,20 +37,11 @@ foreach ($devices as $devidx => $device) if ($device['lastonline']) if (time() - $device['lastonline'] > $CONFIG['phpui']['lastonline_limit']) - { - $devices[$devidx]['img'] = 'img/netdev_off.png'; $devices[$devidx]['state'] = 2; - } else - { - $devices[$devidx]['img'] = 'img/netdev_on.png'; $devices[$devidx]['state'] = 1; - } else - { - $devices[$devidx]['img'] = 'img/netdev_unk.png'; $devices[$devidx]['state'] = 0; - } $devids = implode(',', array_keys($devices)); @@ -74,20 +65,11 @@ foreach ($nodes as $nodeidx => $node) if ($node['lastonline']) if (time() - $node['lastonline'] > $CONFIG['phpui']['lastonline_limit']) - { - $nodes[$nodeidx]['img'] = 'img/node_off.png'; $nodes[$nodeidx]['state'] = 2; - } else - { - $nodes[$nodeidx]['img'] = 'img/node_on.png'; $nodes[$nodeidx]['state'] = 1; - } else - { - $nodes[$nodeidx]['img'] = 'img/node_unk.png'; $nodes[$nodeidx]['state'] = 0; - } $nodeids = implode(',', array_keys($nodes)); Index: lms/modules/netdevmaprefresh.php diff -u lms/modules/netdevmaprefresh.php:1.1 lms/modules/netdevmaprefresh.php:1.2 --- lms/modules/netdevmaprefresh.php:1.1 Sat Nov 12 21:04:30 2011 +++ lms/modules/netdevmaprefresh.php Thu Nov 17 23:13:07 2011 @@ -21,17 +21,29 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: netdevmaprefresh.php,v 1.1 2011/11/12 20:04:30 chilek Exp $ + * $Id: netdevmaprefresh.php,v 1.2 2011/11/17 22:13:07 chilek Exp $ */ +if (isset($_GET['live'])) { + if (empty($CONFIG['phpui']['netdevmaprefresh_helper'])) + $cmd = 'sudo /sbin/pinger-addresses'; + else + $cmd = $CONFIG['phpui']['netdevmaprefresh_helper']; + exec($cmd, $output); + if (count($output)) { + $curtime = time(); + foreach ($output as $ip) + if (check_ip($ip)) + $DB->Execute('UPDATE nodes SET lastonline = ? WHERE ipaddr = INET_ATON(?)', + array($curtime, $ip)); + } + $CONFIG['phpui']['lastonline_limit'] = 20; +} + include(MODULES_DIR.'/map.inc.php'); header('Content-Type: text/plain'); -//foreach($nodes as $nodeidx => $node) -// if ($node['id'] == '2534') -// $nodes[$nodeidx]['state'] = 2; - echo '{"devices":'.json_encode($devices).',"nodes":'.json_encode($nodes).'}'; ?> Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.8 lms/modules/ping.php:1.9 --- lms/modules/ping.php:1.8 Thu Nov 17 16:38:55 2011 +++ lms/modules/ping.php Thu Nov 17 23:13:07 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.8 2011/11/17 15:38:55 chilek Exp $ + * $Id: ping.php,v 1.9 2011/11/17 22:13:07 chilek Exp $ */ function refresh($params) @@ -30,9 +30,14 @@ $objResponse = new xajaxResponse(); $ipaddr = $params['ipaddr']; - $received = intval($params['received']); - $transmitted = intval($params['transmitted']); - exec('sudo ping '.$ipaddr.' -c 1 -s 1450 -w 1.0', $output); + $received = $params['received']; + $transmitted = $params['transmitted']; + if (empty($CONFIG['phpui']['ping_helper'])) + $cmd = 'sudo ping %i -c 1 -s 1450 -w 1.0'; + else + $cmd = $CONFIG['phpui']['ping_helper']; + $cmd = preg_replace('/%i/', $ipaddr, $cmd); + exec($cmd, $output); $transmitted++; $reply = preg_grep('/icmp_[rs]eq/', $output); if (count($reply)) From cvs w lms.org.pl Thu Nov 17 23:13:07 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 17 Nov 2011 23:13:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111117221307.877CD302A040@eftep.altec.pl> Date: Thursday, November 17, 2011 @ 23:13:07 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - netdevmap: refresh network state on demand - added new button Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1609&r2=1.1610 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1609 lms/doc/ChangeLog:1.1610 --- lms/doc/ChangeLog:1.1609 Thu Nov 17 16:36:09 2011 +++ lms/doc/ChangeLog Thu Nov 17 23:13:07 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1609 2011/11/17 15:36:09 chilek Exp $ +$Id: ChangeLog,v 1.1610 2011/11/17 22:13:07 chilek Exp $ version ? (????-??-??): @@ -55,6 +55,7 @@ - netmap popups are draggable thanks to DragPopup class written by Matt Walker [chilan] - we can close netmap popups by close box; also some map css cleanups [chilan] - netdevmap: remember position, zoom, base layer and visible data layers between netdevmap visits [chilan] + - netdevmap: refresh network state on demand - added new button [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Thu Nov 17 23:21:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 17 Nov 2011 23:21:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.js) Message-ID: <20111117222140.6B4A7302A040@eftep.altec.pl> Date: Thursday, November 17, 2011 @ 23:21:40 Author: chilek Path: /cvsroot/lms/img Modified: map.js - cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.11&r2=1.12 Index: lms/img/map.js diff -u lms/img/map.js:1.11 lms/img/map.js:1.12 --- lms/img/map.js:1.11 Thu Nov 17 23:13:07 2011 +++ lms/img/map.js Thu Nov 17 23:21:40 2011 @@ -163,7 +163,6 @@ var area = new OpenLayers.Bounds(); var devices = []; - //var dane = ''; if (deviceArray) for (i in deviceArray) { @@ -175,9 +174,7 @@ lonLat.lon, lonLat.lat ), deviceArray[i])); - //dane += devices[i].attributes.state + ' '; } - //alert(dane); var devicelayer = new OpenLayers.Layer.Vector("Devices", { styleMap: new OpenLayers.StyleMap(devicestyle) From cvs w lms.org.pl Fri Nov 18 09:32:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 18 Nov 2011 09:32:46 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111118083246.3056D302A041@eftep.altec.pl> Date: Friday, November 18, 2011 @ 09:32:46 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - some visual fixes of ping popup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.10&r2=1.11 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.10 lms/templates/ping.html:1.11 --- lms/templates/ping.html:1.10 Thu Nov 17 16:38:55 2011 +++ lms/templates/ping.html Fri Nov 18 09:32:46 2011 @@ -6,7 +6,9 @@
- +
+ +
{elseif $part eq "ipform"}
@@ -26,7 +28,7 @@
{else} - + @@ -42,7 +44,7 @@ {else} - +
From cvs w lms.org.pl Fri Nov 18 09:32:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 18 Nov 2011 09:32:46 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.css, map.js) Message-ID: <20111118083246.12B40302A040@eftep.altec.pl> Date: Friday, November 18, 2011 @ 09:32:46 Author: chilek Path: /cvsroot/lms/img Modified: map.css map.js - some visual fixes of ping popup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.9&r2=1.10 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.12&r2=1.13 Index: lms/img/map.css diff -u lms/img/map.css:1.9 lms/img/map.css:1.10 --- lms/img/map.css:1.9 Thu Nov 17 23:13:07 2011 +++ lms/img/map.css Fri Nov 18 09:32:45 2011 @@ -100,8 +100,8 @@ font-weight: bold; } -body.lmsPingContentsFrame { - border: thin solid black; +div.lmsPingContentsFrame { + border: 1pt solid black; } div.lmsPingContents { @@ -112,6 +112,8 @@ div.lmsPingBottom { position: relative; + width: auto; height: auto; + overflow: visible; } div.lmsPingSummary { Index: lms/img/map.js diff -u lms/img/map.js:1.12 lms/img/map.js:1.13 --- lms/img/map.js:1.12 Thu Nov 17 23:21:40 2011 +++ lms/img/map.js Fri Nov 18 09:32:45 2011 @@ -163,6 +163,7 @@ var area = new OpenLayers.Bounds(); var devices = []; + //var dane = ''; if (deviceArray) for (i in deviceArray) { @@ -174,7 +175,9 @@ lonLat.lon, lonLat.lat ), deviceArray[i])); + //dane += devices[i].attributes.state + ' '; } + //alert(dane); var devicelayer = new OpenLayers.Layer.Vector("Devices", { styleMap: new OpenLayers.StyleMap(devicestyle) @@ -390,7 +393,7 @@ switch (control.command) { case 'ping': var pingpopup = new OpenLayers.Popup(null, - map.getLonLatFromPixel(new OpenLayers.Pixel(60, 27)).clone(), + map.getLonLatFromPixel(new OpenLayers.Pixel(61, 32)).clone(), new OpenLayers.Size(10, 10)); pingpopup.setOpacity(0.8); //pingpopup.closeOnMove = true; From cvs w lms.org.pl Fri Nov 18 10:33:36 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 18 Nov 2011 10:33:36 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (style.css) Message-ID: <20111118093336.08DC2302A040@eftep.altec.pl> Date: Friday, November 18, 2011 @ 10:33:36 Author: chilek Path: /cvsroot/lms/img Modified: style.css - autosuggest always over network map Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/style.css.diff?&r1=1.62&r2=1.63 Index: lms/img/style.css diff -u lms/img/style.css:1.62 lms/img/style.css:1.63 --- lms/img/style.css:1.62 Thu Dec 23 13:35:13 2010 +++ lms/img/style.css Fri Nov 18 10:33:35 2011 @@ -167,7 +167,7 @@ .suggestion_list a { text-decoration: none; padding-left: 2px; color: black; } .suggestion_list .selected { background-color: #CCFFCC; } .suggestion_list .selected a { color: black; } -#autosuggest { display: none; } +#autosuggest { display: none; z-index: 10000; } .overlib { width: 150px; From cvs w lms.org.pl Fri Nov 18 19:42:08 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 18 Nov 2011 19:42:08 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (LMSDB_driver_postgres.class.php) Message-ID: <20111118184208.A7029302A041@eftep.altec.pl> Date: Friday, November 18, 2011 @ 19:42:08 Author: chilek Path: /cvsroot/lms/lib Modified: LMSDB_driver_postgres.class.php - LMS postgresql driver uses E'..' for escaping backslashes (compatibility with changed default value of standard_conforming_strings to on) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMSDB_driver_postgres.class.php.diff?&r1=1.56&r2=1.57 Index: lms/lib/LMSDB_driver_postgres.class.php diff -u lms/lib/LMSDB_driver_postgres.class.php:1.56 lms/lib/LMSDB_driver_postgres.class.php:1.57 --- lms/lib/LMSDB_driver_postgres.class.php:1.56 Tue Jan 18 09:12:05 2011 +++ lms/lib/LMSDB_driver_postgres.class.php Fri Nov 18 19:42:08 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMSDB_driver_postgres.class.php,v 1.56 2011/01/18 08:12:05 alec Exp $ + * $Id: LMSDB_driver_postgres.class.php,v 1.57 2011/11/18 18:42:08 chilek Exp $ */ /* @@ -42,7 +42,7 @@ return; } - $this->_version .= ' ('.preg_replace('/^.Revision: ([0-9.]+).*/','\1',$this->_revision).'/'.preg_replace('/^.Revision: ([0-9.]+).*/','\1','$Revision: 1.56 $').')'; + $this->_version .= ' ('.preg_replace('/^.Revision: ([0-9.]+).*/','\1',$this->_revision).'/'.preg_replace('/^.Revision: ([0-9.]+).*/','\1','$Revision: 1.57 $').')'; $this->Connect($dbhost,$dbuser,$dbpasswd,$dbname); } @@ -57,7 +57,8 @@ ($dbhost != '' && $dbhost != 'localhost' ? 'host='.$dbhost : ''), ($dbuser != '' ? 'user='.$dbuser : ''), ($dbpasswd != '' ? 'password='.$dbpasswd : ''), - ($dbname != '' ? 'dbname='.$dbname : '') + ($dbname != '' ? 'dbname='.$dbname : ''), + 'connect_timeout=10' )); if($this->_dblink = @pg_connect($cstring, PGSQL_CONNECT_FORCE_NEW)) @@ -129,20 +130,23 @@ else return FALSE; } -/* + // added 'E' for postgresql 8.2 to skip warnings in error log: // HINT: Use the escape string syntax for backslashes, e.g., E'\\'. // WARNING: nonstandard use of escape in a string literal at character... + // With postgresql 9.1 value of standard_conforming_strings is default to on, + // so we have to escape backslashes with E'\\' or, otherwise, we would have to + // require from user to change above setting. function _quote_value($input) { - if($input === NULL) + if($input === NULL) return 'NULL'; elseif(gettype($input) == 'string') return 'E\''.addcslashes($input,"'\\\0").'\''; else return $input; } -*/ + function _driver_now() { return 'EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0))::integer'; From cvs w lms.org.pl Fri Nov 18 19:42:08 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 18 Nov 2011 19:42:08 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111118184208.7F114302A040@eftep.altec.pl> Date: Friday, November 18, 2011 @ 19:42:08 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - LMS postgresql driver uses E'..' for escaping backslashes (compatibility with changed default value of standard_conforming_strings to on) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1610&r2=1.1611 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1610 lms/doc/ChangeLog:1.1611 --- lms/doc/ChangeLog:1.1610 Thu Nov 17 23:13:07 2011 +++ lms/doc/ChangeLog Fri Nov 18 19:42:08 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1610 2011/11/17 22:13:07 chilek Exp $ +$Id: ChangeLog,v 1.1611 2011/11/18 18:42:08 chilek Exp $ version ? (????-??-??): @@ -56,6 +56,8 @@ - we can close netmap popups by close box; also some map css cleanups [chilan] - netdevmap: remember position, zoom, base layer and visible data layers between netdevmap visits [chilan] - netdevmap: refresh network state on demand - added new button [chilan] + - LMS postgresql driver uses E'..' for escaping backslashes (compatibility with changed default + value of standard_conforming_strings to on) [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Fri Nov 18 20:21:38 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 18 Nov 2011 20:21:38 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (LMSDB_driver_postgres.class.php) Message-ID: <20111118192138.9BBD1302A040@eftep.altec.pl> Date: Friday, November 18, 2011 @ 20:21:38 Author: chilek Path: /cvsroot/lms/lib Modified: LMSDB_driver_postgres.class.php - switched to pg_escape_string() PHP function for postgresql Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMSDB_driver_postgres.class.php.diff?&r1=1.57&r2=1.58 Index: lms/lib/LMSDB_driver_postgres.class.php diff -u lms/lib/LMSDB_driver_postgres.class.php:1.57 lms/lib/LMSDB_driver_postgres.class.php:1.58 --- lms/lib/LMSDB_driver_postgres.class.php:1.57 Fri Nov 18 19:42:08 2011 +++ lms/lib/LMSDB_driver_postgres.class.php Fri Nov 18 20:21:38 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMSDB_driver_postgres.class.php,v 1.57 2011/11/18 18:42:08 chilek Exp $ + * $Id: LMSDB_driver_postgres.class.php,v 1.58 2011/11/18 19:21:38 chilek Exp $ */ /* @@ -42,7 +42,7 @@ return; } - $this->_version .= ' ('.preg_replace('/^.Revision: ([0-9.]+).*/','\1',$this->_revision).'/'.preg_replace('/^.Revision: ([0-9.]+).*/','\1','$Revision: 1.57 $').')'; + $this->_version .= ' ('.preg_replace('/^.Revision: ([0-9.]+).*/','\1',$this->_revision).'/'.preg_replace('/^.Revision: ([0-9.]+).*/','\1','$Revision: 1.58 $').')'; $this->Connect($dbhost,$dbuser,$dbpasswd,$dbname); } @@ -131,18 +131,12 @@ return FALSE; } - // added 'E' for postgresql 8.2 to skip warnings in error log: - // HINT: Use the escape string syntax for backslashes, e.g., E'\\'. - // WARNING: nonstandard use of escape in a string literal at character... - // With postgresql 9.1 value of standard_conforming_strings is default to on, - // so we have to escape backslashes with E'\\' or, otherwise, we would have to - // require from user to change above setting. function _quote_value($input) - { + { if($input === NULL) return 'NULL'; elseif(gettype($input) == 'string') - return 'E\''.addcslashes($input,"'\\\0").'\''; + return '\''. w pg_escape_string($this->_dblink, $input).'\''; else return $input; } From cvs w lms.org.pl Sat Nov 19 14:32:32 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 19 Nov 2011 14:32:32 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (nodeinfobox.html, ping.html) Message-ID: <20111119133232.911B7302A043@eftep.altec.pl> Date: Saturday, November 19, 2011 @ 14:32:32 Author: chilek Path: /cvsroot/lms/templates Modified: nodeinfobox.html ping.html - ping is more smart now - refresh every 1 second, but can make many ping probes on server [chilan] - when network elements are covered too dense then we show these elements info in one, common popup window Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.81&r2=1.82 http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.11&r2=1.12 Index: lms/templates/nodeinfobox.html diff -u lms/templates/nodeinfobox.html:1.81 lms/templates/nodeinfobox.html:1.82 --- lms/templates/nodeinfobox.html:1.81 Sun Nov 13 00:37:22 2011 +++ lms/templates/nodeinfobox.html Sat Nov 19 14:32:32 2011 @@ -1,4 +1,4 @@ - + {/if} -{/if} \ No newline at end of file +{/if} From cvs w lms.org.pl Sat Nov 19 19:03:14 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 19 Nov 2011 19:03:14 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111119180314.B6967302A040@eftep.altec.pl> Date: Saturday, November 19, 2011 @ 19:03:14 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - it's able to pause ping [chilan] - display summary times in ping popup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1612&r2=1.1613 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1612 lms/doc/ChangeLog:1.1613 --- lms/doc/ChangeLog:1.1612 Sat Nov 19 14:32:31 2011 +++ lms/doc/ChangeLog Sat Nov 19 19:03:14 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1612 2011/11/19 13:32:31 chilek Exp $ +$Id: ChangeLog,v 1.1613 2011/11/19 18:03:14 chilek Exp $ version ? (????-??-??): @@ -63,6 +63,8 @@ probes on server [chilan] - when network elements are covered too dense then we show these elements info in one, common popup window [chilan] + - it's able to pause ping [chilan] + - display summary times in ping popup [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Sat Nov 19 19:08:56 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 19 Nov 2011 19:08:56 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (ping.php) Message-ID: <20111119180856.1B414302A040@eftep.altec.pl> Date: Saturday, November 19, 2011 @ 19:08:56 Author: chilek Path: /cvsroot/lms/modules Modified: ping.php - small fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.11&r2=1.12 Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.11 lms/modules/ping.php:1.12 --- lms/modules/ping.php:1.11 Sat Nov 19 19:03:15 2011 +++ lms/modules/ping.php Sat Nov 19 19:08:55 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.11 2011/11/19 18:03:15 chilek Exp $ + * $Id: ping.php,v 1.12 2011/11/19 18:08:55 chilek Exp $ */ function refresh($params) @@ -71,7 +71,7 @@ $objResponse->append('data', 'innerHTML', $output); $objResponse->assign('transmitted', 'value', $transmitted); $objResponse->assign('received', 'value', $received); - $objResponse->assign('total', 'innerHTML', trans('Total: $0% ($1/$2)', + $objResponse->assign('total', 'innerHTML', trans('Total: $a% ($b/$c)', round(($received / $transmitted) * 100), $received, $transmitted)); $objResponse->assign('times', 'value', json_encode($times)); $objResponse->call('ping_reply'); From cvs w lms.org.pl Sat Nov 19 19:19:57 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 19 Nov 2011 19:19:57 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (common.js) Message-ID: <20111119181957.5826F302A040@eftep.altec.pl> Date: Saturday, November 19, 2011 @ 19:19:57 Author: chilek Path: /cvsroot/lms/img Modified: common.js - small fixes again Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/common.js.diff?&r1=1.39&r2=1.40 Index: lms/img/common.js diff -u lms/img/common.js:1.39 lms/img/common.js:1.40 --- lms/img/common.js:1.39 Sat Nov 19 14:32:32 2011 +++ lms/img/common.js Sat Nov 19 19:19:57 2011 @@ -396,5 +396,5 @@ function ping_popup(ip) { popup('?m=ping&ip=' + ip, 1, 1, 30, 30); - autoiframe_setsize('autoiframe', 400, 300); + autoiframe_setsize('autoiframe', 480, 300); } From cvs w lms.org.pl Sat Nov 19 19:19:57 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 19 Nov 2011 19:19:57 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (nodeinfobox.html) Message-ID: <20111119181957.7A32D302A041@eftep.altec.pl> Date: Saturday, November 19, 2011 @ 19:19:57 Author: chilek Path: /cvsroot/lms/templates Modified: nodeinfobox.html - small fixes again Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.82&r2=1.83 Index: lms/templates/nodeinfobox.html diff -u lms/templates/nodeinfobox.html:1.82 lms/templates/nodeinfobox.html:1.83 --- lms/templates/nodeinfobox.html:1.82 Sat Nov 19 14:32:32 2011 +++ lms/templates/nodeinfobox.html Sat Nov 19 19:19:57 2011 @@ -1,4 +1,4 @@ - + Index: lms/templates/choosemac.html diff -u lms/templates/choosemac.html:1.20 lms/templates/choosemac.html:1.21 --- lms/templates/choosemac.html:1.20 Wed Jan 5 21:40:30 2011 +++ lms/templates/choosemac.html Sat Nov 19 19:37:55 2011 @@ -1,9 +1,9 @@ - + - + ::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle} :{/if}:: Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.14 lms/templates/ping.html:1.15 --- lms/templates/ping.html:1.14 Sat Nov 19 19:29:33 2011 +++ lms/templates/ping.html Sat Nov 19 19:37:56 2011 @@ -22,11 +22,11 @@
{else} - + - + ::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle} :{/if}:: From cvs w lms.org.pl Sat Nov 19 20:06:12 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 19 Nov 2011 20:06:12 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111119190612.BA57A302A041@eftep.altec.pl> Date: Saturday, November 19, 2011 @ 20:06:12 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - more elegant scrolling of ping contents Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.15&r2=1.16 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.15 lms/templates/ping.html:1.16 --- lms/templates/ping.html:1.15 Sat Nov 19 19:37:56 2011 +++ lms/templates/ping.html Sat Nov 19 20:06:12 2011 @@ -22,7 +22,7 @@
{else} - + @@ -83,7 +83,7 @@ { elem = document.getElementById('data'); if (elem && document.getElementById('autoscroll').checked) - elem.scrollTop += 1000; + elem.scrollTop = elem.scrollHeight; try { var times = JSON.parse(document.getElementById('times').value); for (var i in times) { From cvs w lms.org.pl Sat Nov 19 20:06:12 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 19 Nov 2011 20:06:12 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.css) Message-ID: <20111119190612.8DB88302A040@eftep.altec.pl> Date: Saturday, November 19, 2011 @ 20:06:12 Author: chilek Path: /cvsroot/lms/img Modified: map.css - more elegant scrolling of ping contents Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.css.diff?&r1=1.12&r2=1.13 Index: lms/img/map.css diff -u lms/img/map.css:1.12 lms/img/map.css:1.13 --- lms/img/map.css:1.12 Sat Nov 19 19:03:14 2011 +++ lms/img/map.css Sat Nov 19 20:06:12 2011 @@ -23,6 +23,7 @@ width: auto; height: 16px; line-height: 16px; overflow: visible; + padding-left: 2px; } div.lmsPopupCloseBox { @@ -108,7 +109,7 @@ div.lmsPingContentsFrame { border: 1pt solid black; - padding: 2px; + padding: 0px; background-color: #DFD5BD; } From cvs w lms.org.pl Sat Nov 19 20:12:11 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 19 Nov 2011 20:12:11 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111119191211.D7750302A040@eftep.altec.pl> Date: Saturday, November 19, 2011 @ 20:12:11 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - don't write summary times when they are not defined Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.16&r2=1.17 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.16 lms/templates/ping.html:1.17 --- lms/templates/ping.html:1.16 Sat Nov 19 20:06:12 2011 +++ lms/templates/ping.html Sat Nov 19 20:12:11 2011 @@ -22,7 +22,7 @@
{else} - + @@ -86,18 +86,20 @@ elem.scrollTop = elem.scrollHeight; try { var times = JSON.parse(document.getElementById('times').value); - for (var i in times) { - var chunks = times[i].split(' '); - var currentTime = parseFloat(chunks[0]); - sumTime += currentTime; - if (currentTime > maxTime) - maxTime = currentTime; - if (currentTime < minTime) - minTime = currentTime; + if (times.length) { + for (var i in times) { + var chunks = times[i].split(' '); + var currentTime = parseFloat(chunks[0]); + sumTime += currentTime; + if (currentTime > maxTime) + maxTime = currentTime; + if (currentTime < minTime) + minTime = currentTime; + } + var avgTime = sumTime / parseFloat(document.getElementById('received').value); + document.getElementById('summary').innerHTML = 'min/avg/max = ' + + [time_to_fixed(minTime), time_to_fixed(avgTime), time_to_fixed(maxTime)].join('/') + ' ms'; } - var avgTime = sumTime / parseFloat(document.getElementById('received').value); - document.getElementById('summary').innerHTML = 'min/avg/max = ' - + [time_to_fixed(minTime), time_to_fixed(avgTime), time_to_fixed(maxTime)].join('/') + ' ms'; } catch(e) {} if (document.getElementById('enabled').checked) { var d = new Date(); From cvs w lms.org.pl Sun Nov 20 10:37:24 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 10:37:24 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/upgradedb (postgres.2011082800.php) Message-ID: <20111120093724.72AD0302A040@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 10:37:24 Author: alec Path: /cvsroot/lms/lib/upgradedb Modified: postgres.2011082800.php - Added lost CREATE VIEW vmacs Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2011082800.php.diff?&r1=1.2&r2=1.3 Index: lms/lib/upgradedb/postgres.2011082800.php diff -u lms/lib/upgradedb/postgres.2011082800.php:1.2 lms/lib/upgradedb/postgres.2011082800.php:1.3 --- lms/lib/upgradedb/postgres.2011082800.php:1.2 Wed Sep 21 15:14:45 2011 +++ lms/lib/upgradedb/postgres.2011082800.php Sun Nov 20 10:37:24 2011 @@ -178,6 +178,11 @@ 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); + + CREATE VIEW vmacs AS + SELECT n.*, m.mac, m.id AS macid + FROM nodes n + JOIN macs m ON (n.id = m.nodeid); "); $DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2011082800', 'dbversion')); From cvs w lms.org.pl Sun Nov 20 11:54:18 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 11:54:18 +0100 (CET) Subject: [lms-commits] CVS update of lms/bin (lms-teryt) Message-ID: <20111120105418.C0EBC302A040@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 11:54:18 Author: alec Path: /cvsroot/lms/bin Modified: lms-teryt - Added code for downloading TERYT database Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-teryt.diff?&r1=1.1&r2=1.2 Index: lms/bin/lms-teryt diff -u lms/bin/lms-teryt:1.1 lms/bin/lms-teryt:1.2 --- lms/bin/lms-teryt:1.1 Wed Aug 31 12:46:44 2011 +++ lms/bin/lms-teryt Sun Nov 20 11:54:18 2011 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -Tw +#!/usr/bin/perl -w # # LMS version 1.11-cvs # @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-teryt,v 1.1 2011/08/31 10:46:44 alec Exp $ +# $Id: lms-teryt,v 1.2 2011/11/20 10:54:18 alec Exp $ use strict; use DBI; @@ -28,6 +28,7 @@ use Getopt::Long; use vars qw($configfile $quiet $help $version $update $fetch $list $merge); use Cwd; +use LWP::UserAgent; my $_version = '1.11-cvs'; @@ -100,6 +101,9 @@ my $dbpasswd = $ini->val('database', 'password') || ''; my $dbname = $ini->val('database', 'database') || 'lms'; +my $url = $ini->val('teryt', 'url') || 'http://www.stat.gov.pl/broker/access/prefile/listPreFiles.jspa'; +my $zip_bin = $ini->val('teryt', 'unzip_binary') || '/usr/bin/unzip'; + my $dir = $ini->val('teryt', 'dir') || getcwd; if (!$list) { $list = $ini->val('teryt', 'state_list') || ''; @@ -108,8 +112,42 @@ ######## Download TERYT files ################################################### if ($fetch) { + my $ua = LWP::UserAgent->new; + my $response = $ua->get($url); + + if ($response->is_success) + { + my $content = $response->content; + my $file_url = $url; + + $ua->show_progress(1); + + while ($content =~ m/href="(downloadPreFile\.jspa[^\"]+)"/g) { + my $file = $1; + $file_url =~ s/[^\/]+$//; + $file_url .= $file; + + my $response = $ua->get($file_url); + if ($response->is_success) { + my $type = $response->filename; + if ($type !~ /^(SIMC|TERC|ULIC)_[0-9]+\.zip/i) { + next; + } + my $filename = $dir.'/'.$response->filename; + # save zip file + open (FILE, ">$filename"); + print FILE $response->content; + close (FILE); + # extract file (zip -> xml) + system("$zip_bin -qd $dir $filename"); + } + } + } + else { + print STDERR "Error: ".$response->status_line."\n"; + } } if (!$update && !$merge) From cvs w lms.org.pl Sun Nov 20 14:54:41 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 14:54:41 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111120135442.05F8C302A040@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 14:54:41 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog - added %bankaccount variable for messages sent from UI Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1613&r2=1.1614 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1613 lms/doc/ChangeLog:1.1614 --- lms/doc/ChangeLog:1.1613 Sat Nov 19 19:03:14 2011 +++ lms/doc/ChangeLog Sun Nov 20 14:54:41 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1613 2011/11/19 18:03:14 chilek Exp $ +$Id: ChangeLog,v 1.1614 2011/11/20 13:54:41 alec Exp $ version ? (????-??-??): @@ -51,7 +51,7 @@ - we can ping nodes and devices watching results in popups [chilan] - 5 default base layers for maps [chilan] - ported to xajax 0.5 [chilan] - - toolbar on netdevmap and possibility to ping any host (event not included in database) [chilan] + - toolbar on netdevmap and possibility to ping any host (even not included in database) [chilan] - netmap popups are draggable thanks to DragPopup class written by Matt Walker [chilan] - we can close netmap popups by close box; also some map css cleanups [chilan] - netdevmap: remember position, zoom, base layer and visible data layers between @@ -65,6 +65,7 @@ in one, common popup window [chilan] - it's able to pause ping [chilan] - display summary times in ping popup [chilan] + - added %bankaccount variable for messages sent from UI [alec] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Sun Nov 20 14:54:42 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 14:54:42 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (messageadd.php) Message-ID: <20111120135442.542E5302A042@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 14:54:42 Author: alec Path: /cvsroot/lms/modules Modified: messageadd.php - added %bankaccount variable for messages sent from UI Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/messageadd.php.diff?&r1=1.18&r2=1.19 Index: lms/modules/messageadd.php diff -u lms/modules/messageadd.php:1.18 lms/modules/messageadd.php:1.19 --- lms/modules/messageadd.php:1.18 Fri Oct 14 18:08:59 2011 +++ lms/modules/messageadd.php Sun Nov 20 14:54:42 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: messageadd.php,v 1.18 2011/10/14 16:08:59 chilek Exp $ + * $Id: messageadd.php,v 1.19 2011/11/20 13:54:42 alec Exp $ */ function GetRecipients($filter, $type=MSG_MAIL) @@ -33,7 +33,7 @@ $customergroup = $filter['customergroup']; $nodegroup = $filter['nodegroup']; $linktype = $filter['linktype']; - + if($group == 4) { $deleted = 1; @@ -42,16 +42,16 @@ } else $deleted = 0; - + $disabled = ($group == 5) ? 1 : 0; $indebted = ($group == 6) ? 1 : 0; $notindebted = ($group == 7) ? 1 : 0; - + if($group>3) $group = 0; - - if($network) + + if($network) $net = $LMS->GetNetworkParams($network); - + if($type == MSG_SMS) { $smstable = 'JOIN (SELECT MIN(phone) AS phone, customerid @@ -60,7 +60,7 @@ GROUP BY customerid ) x ON (x.customerid = c.id)'; } - + $recipients = $LMS->DB->GetAll('SELECT c.id, email, pin, ' .($type==MSG_SMS ? 'x.phone, ': '') .$LMS->DB->Concat('c.lastname', "' '", 'c.name').' AS customername, @@ -125,6 +125,9 @@ $body = str_replace('%balance', $data['balance'], $body); $body = str_replace('%cid', $data['id'], $body); $body = str_replace('%pin', $data['pin'], $body); + if (strpos($body, '%bankaccount') !== false) { + $body = str_replace('%bankaccount', bankaccount($data['id']), $body); + } if(!(strpos($body, '%last_10_in_a_table') === FALSE)) { From cvs w lms.org.pl Sun Nov 20 14:54:42 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 14:54:42 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20111120135442.30B32302A041@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 14:54:42 Author: alec Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - added %bankaccount variable for messages sent from UI Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.400&r2=1.401 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.400 lms/lib/locale/pl/strings.php:1.401 --- lms/lib/locale/pl/strings.php:1.400 Sat Nov 19 19:03:14 2011 +++ lms/lib/locale/pl/strings.php Sun Nov 20 14:54:42 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.400 2011/11/19 18:03:14 chilek Exp $ + * $Id: strings.php,v 1.401 2011/11/20 13:54:42 alec Exp $ */ $_LANG['$a ($b addresses)'] = '$a ($b adresów)'; @@ -2505,7 +2505,7 @@ $_LANG['Add new category'] = 'Utworzenie nowej kategorii'; $_LANG['Enter device latitude (optional)'] = 'Podaj szerokość geograficzną dla urządzenia (opcjonalne)'; -$_LANG['Enter device longitude (optional)'] = 'Podaj długość geograficzną dla urzą?zenia (opcjonalne)'; +$_LANG['Enter device longitude (optional)'] = 'Podaj długość geograficzną dla urządzenia (opcjonalne)'; $_LANG['GPS coordinates:'] = 'Współrzędne geograficzne:'; $_LANG['GPS latitude:'] = 'Szerokość geograficzna:'; $_LANG['GPS longitude:'] = 'Długość geograficzna:'; From cvs w lms.org.pl Sun Nov 20 15:01:03 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 15:01:03 +0100 (CET) Subject: [lms-commits] CVS update of lms/bin (lms-payments) Message-ID: <20111120140103.6CE9F302A040@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 15:01:03 Author: alec Path: /cvsroot/lms/bin Modified: lms-payments - lms-payments: added 'check_invoices' option Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-payments.diff?&r1=1.132&r2=1.133 Index: lms/bin/lms-payments diff -u lms/bin/lms-payments:1.132 lms/bin/lms-payments:1.133 --- lms/bin/lms-payments:1.132 Fri Apr 1 13:46:52 2011 +++ lms/bin/lms-payments Sun Nov 20 15:01:03 2011 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-payments,v 1.132 2011/04/01 11:46:52 alec Exp $ +# $Id: lms-payments,v 1.133 2011/11/20 14:01:03 alec Exp $ use strict; use DBI; @@ -104,6 +104,7 @@ my $comment = $ini->val('payments', 'comment') || 'Tariff %tariff subscription for period %period'; my $s_comment = $ini->val('payments', 'settlement_comment') || $comment; my $suspension_description = $ini->val('payments', 'suspension_description') || ''; +my $check_invoices = $ini->val('payments', 'check_invoices') || 0; my $suspension_percentage = $ini->val('finances', 'suspension_percentage') || '0'; @@ -698,6 +699,23 @@ } $dbq->finish(); +# check invoices (autoclose invoices) +if ($check_invoices) +{ + my $dbq = $dbase->prepare("UPDATE documents SET closed = 1 + WHERE customerid IN ( + SELECT customerid + FROM cash WHERE time <= $currtime + GROUP BY customerid + HAVING SUM(value) >= 0 + ) + AND type IN (1, 3, 5) + AND cdate <= $currtime + AND closed = 0"); + $dbq->execute(); + $dbq->finish(); +} + # solid payments $dbq = $dbase->prepare("SELECT * FROM payments WHERE value <> 0 AND (period = ".DAY." @@ -713,7 +731,7 @@ my $sdbq = $dbase->prepare("INSERT INTO cash (time, type, value, customerid, comment) VALUES ($currtime, 1, $assign->{'value'} * -1, 0, ?)"); $sdbq->execute($assign->{'name'}.'/'.$assign->{'creditor'}); - print STDERR "CID:0\tVAL:$assign->{'value'}\tDESC:$assign->{'name'}/$assign->{'creditor'}\n" if not $quiet; + print STDERR "CID:\tVAL:$assign->{'value'}\tDESC:$assign->{'name'}/$assign->{'creditor'}\n" if not $quiet; } $dbq->finish(); From cvs w lms.org.pl Sun Nov 20 15:01:03 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 15:01:03 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111120140103.A5F0F302A041@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 15:01:03 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog - lms-payments: added 'check_invoices' option Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1614&r2=1.1615 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1614 lms/doc/ChangeLog:1.1615 --- lms/doc/ChangeLog:1.1614 Sun Nov 20 14:54:41 2011 +++ lms/doc/ChangeLog Sun Nov 20 15:01:03 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1614 2011/11/20 13:54:41 alec Exp $ +$Id: ChangeLog,v 1.1615 2011/11/20 14:01:03 alec Exp $ version ? (????-??-??): @@ -66,6 +66,7 @@ - it's able to pause ping [chilan] - display summary times in ping popup [chilan] - added %bankaccount variable for messages sent from UI [alec] + - lms-payments: added 'check_invoices' option [alec] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Sun Nov 20 21:35:07 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 21:35:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (DragPopup.js, map.js) Message-ID: <20111120203507.A9517302A040@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 21:35:07 Author: chilek Path: /cvsroot/lms/img Modified: DragPopup.js map.js - experimental support for moving popup to front by clicking on them - fixed selection feature problem: when a feature has been selected earlier, later it was not possible to select it again, because it has been still selected! Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/DragPopup.js.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.16&r2=1.17 Index: lms/img/DragPopup.js diff -u lms/img/DragPopup.js:1.3 lms/img/DragPopup.js:1.4 --- lms/img/DragPopup.js:1.3 Thu Nov 17 16:36:09 2011 +++ lms/img/DragPopup.js Sun Nov 20 21:35:07 2011 @@ -58,6 +58,7 @@ return true; else this.down = true; + this.moveToFront(); OpenLayers.Event.observe(document, 'mouseup', this.docMouseUpProxy); OpenLayers.Event.stop(evt); }, @@ -75,8 +76,14 @@ { var clickPnt = this.popup.events.getMousePosition(evt); if (clickPnt.x >= closeElem.offsetLeft && clickPnt.x <= closeElem.offsetLeft + closeElem.offsetWidth - && clickPnt.y >= closeElem.offsetTop && clickPnt.y <= closeElem.offsetTop + closeElem.offsetHeight) + && clickPnt.y >= closeElem.offsetTop && clickPnt.y <= closeElem.offsetTop + closeElem.offsetHeight) { + if (this.feature) { + this.feature.popup = null; + for (var i = 0; i < this.map.controls.length, !(this.map.controls[i] instanceof OpenLayers.Control.SelectFeature); i++); + this.map.controls[i].unselect(this.feature); + } this.map.removePopup(this.popup); + } } }, @@ -110,6 +117,16 @@ OpenLayers.Control.prototype.destroy.apply(this, []); }, + moveToFront: function() { + var popups = this.map.popups; + var maxZIndex = 0; + for (var i in popups) + if (popups[i].id != this.popup.id && popups[i].div.style.zIndex > maxZIndex) + maxZIndex = popups[i].div.style.zIndex; + if (parseInt(maxZIndex) > parseInt(this.popup.div.style.zIndex)) + this.popup.div.style.zIndex = parseInt(maxZIndex) + 1; + }, + /** @final @type String */ CLASS_NAME: "OpenLayers.Control.DragPopup" }); Index: lms/img/map.js diff -u lms/img/map.js:1.16 lms/img/map.js:1.17 --- lms/img/map.js:1.16 Sat Nov 19 19:03:14 2011 +++ lms/img/map.js Sun Nov 20 21:35:07 2011 @@ -195,7 +195,6 @@ var area = new OpenLayers.Bounds(); var devices = []; - //var dane = ''; if (deviceArray) for (i in deviceArray) { @@ -207,9 +206,7 @@ lonLat.lon, lonLat.lat ), deviceArray[i])); - //dane += devices[i].attributes.state + ' '; } - //alert(dane); var devicelayer = new OpenLayers.Layer.Vector("Devices", { styleMap: new OpenLayers.StyleMap(devicestyle) @@ -301,7 +298,8 @@ mappopup = new OpenLayers.Popup.Anchored(null, new OpenLayers.LonLat(feature.data.lon, feature.data.lat) .transform(lmsProjection, map.getProjectionObject()), - new OpenLayers.Size(10, 10), content); + new OpenLayers.Size(10, 10), content, + { size: new OpenLayers.Size(16, 16), offset: new OpenLayers.Pixel(-8, -8) }); mappopup.setOpacity(0.8); mappopup.closeOnMove = true; map.addPopup(mappopup); @@ -339,6 +337,7 @@ toggleKey: "ctrlKey", // ctrl key removes from selection multipleKey: "shiftKey", // shift key adds to selection onSelect: function(feature) { + //alert(feature); var map = feature.layer.map; if (mappopup) { @@ -381,7 +380,7 @@ map.addPopup(featurepopup); - var dragpopup = new OpenLayers.Control.DragPopup(featurepopup); + var dragpopup = new OpenLayers.Control.DragPopup(featurepopup, { feature: feature }); map.addControl(dragpopup); featurepopup.div.style.overflow = 'visible'; From cvs w lms.org.pl Sun Nov 20 21:45:49 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 20 Nov 2011 21:45:49 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.js) Message-ID: <20111120204549.28C94302A040@eftep.altec.pl> Date: Sunday, November 20, 2011 @ 21:45:49 Author: chilek Path: /cvsroot/lms/img Modified: map.js - moving popup it's not needed Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.17&r2=1.18 Index: lms/img/map.js diff -u lms/img/map.js:1.17 lms/img/map.js:1.18 --- lms/img/map.js:1.17 Sun Nov 20 21:35:07 2011 +++ lms/img/map.js Sun Nov 20 21:45:48 2011 @@ -298,8 +298,7 @@ mappopup = new OpenLayers.Popup.Anchored(null, new OpenLayers.LonLat(feature.data.lon, feature.data.lat) .transform(lmsProjection, map.getProjectionObject()), - new OpenLayers.Size(10, 10), content, - { size: new OpenLayers.Size(16, 16), offset: new OpenLayers.Pixel(-8, -8) }); + new OpenLayers.Size(10, 10), content); mappopup.setOpacity(0.8); mappopup.closeOnMove = true; map.addPopup(mappopup); From cvs w lms.org.pl Mon Nov 21 08:06:53 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 21 Nov 2011 08:06:53 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111121070653.42AC2302A040@eftep.altec.pl> Date: Monday, November 21, 2011 @ 08:06:53 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog - DDescribe patches from foxman Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1615&r2=1.1616 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1615 lms/doc/ChangeLog:1.1616 --- lms/doc/ChangeLog:1.1615 Sun Nov 20 15:01:03 2011 +++ lms/doc/ChangeLog Mon Nov 21 08:06:52 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1615 2011/11/20 14:01:03 alec Exp $ +$Id: ChangeLog,v 1.1616 2011/11/21 07:06:52 alec Exp $ version ? (????-??-??): @@ -65,8 +65,8 @@ in one, common popup window [chilan] - it's able to pause ping [chilan] - display summary times in ping popup [chilan] - - added %bankaccount variable for messages sent from UI [alec] - - lms-payments: added 'check_invoices' option [alec] + - added %bankaccount variable for messages sent from UI [foxman] + - lms-payments: added 'check_invoices' option [foxman] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Mon Nov 21 23:14:38 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 21 Nov 2011 23:14:38 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (nodeaddbox.html, nodeeditbox.html) Message-ID: <20111121221438.4A8F5302A040@eftep.altec.pl> Date: Monday, November 21, 2011 @ 23:14:38 Author: chilek Path: /cvsroot/lms/templates Modified: nodeaddbox.html nodeeditbox.html - small improve of ui teryt ergonomy Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeaddbox.html.diff?&r1=1.90&r2=1.91 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.94&r2=1.95 Index: lms/templates/nodeaddbox.html diff -u lms/templates/nodeaddbox.html:1.90 lms/templates/nodeaddbox.html:1.91 --- lms/templates/nodeaddbox.html:1.90 Sun Nov 13 00:37:21 2011 +++ lms/templates/nodeaddbox.html Mon Nov 21 23:14:37 2011 @@ -1,4 +1,4 @@ - +
@@ -69,7 +69,7 @@ - {t}TERRIT-DB{/t} + {t}TERRIT-DB{/t} Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.94 lms/templates/nodeeditbox.html:1.95 --- lms/templates/nodeeditbox.html:1.94 Sun Nov 13 00:37:21 2011 +++ lms/templates/nodeeditbox.html Mon Nov 21 23:14:37 2011 @@ -1,4 +1,4 @@ - + @@ -69,7 +69,7 @@ - {t}TERRIT-DB{/t} + {t}TERRIT-DB{/t} {* From cvs w lms.org.pl Mon Nov 21 23:18:04 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 21 Nov 2011 23:18:04 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (netdevadd.html, netdeveditbox.html) Message-ID: <20111121221804.41C19302A040@eftep.altec.pl> Date: Monday, November 21, 2011 @ 23:18:04 Author: chilek Path: /cvsroot/lms/templates Modified: netdevadd.html netdeveditbox.html - small improve of ui teryt ergonomy Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevadd.html.diff?&r1=1.34&r2=1.35 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdeveditbox.html.diff?&r1=1.37&r2=1.38 Index: lms/templates/netdevadd.html diff -u lms/templates/netdevadd.html:1.34 lms/templates/netdevadd.html:1.35 --- lms/templates/netdevadd.html:1.34 Sun Nov 13 00:37:21 2011 +++ lms/templates/netdevadd.html Mon Nov 21 23:18:04 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - + {include file="calendar_js.html"}

{$layout.pagetitle}

@@ -80,7 +80,7 @@ - {t}TERRIT-DB{/t} + {t}TERRIT-DB{/t} Index: lms/templates/netdeveditbox.html diff -u lms/templates/netdeveditbox.html:1.37 lms/templates/netdeveditbox.html:1.38 --- lms/templates/netdeveditbox.html:1.37 Sun Nov 13 00:37:21 2011 +++ lms/templates/netdeveditbox.html Mon Nov 21 23:18:04 2011 @@ -1,4 +1,4 @@ - + {include file="calendar_js.html"}
@@ -79,7 +79,7 @@ - {t}TERRIT-DB{/t} + {t}TERRIT-DB{/t} From cvs w lms.org.pl Tue Nov 22 10:42:32 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 22 Nov 2011 10:42:32 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.js) Message-ID: <20111122094232.A8ADD302A040@eftep.altec.pl> Date: Tuesday, November 22, 2011 @ 10:42:32 Author: chilek Path: /cvsroot/lms/img Modified: map.js - we don't need it Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.18&r2=1.19 Index: lms/img/map.js diff -u lms/img/map.js:1.18 lms/img/map.js:1.19 --- lms/img/map.js:1.18 Sun Nov 20 21:45:48 2011 +++ lms/img/map.js Tue Nov 22 10:42:32 2011 @@ -5,15 +5,6 @@ var lastonline_limit; var lmsProjection = new OpenLayers.Projection("EPSG:4326"); -function removeInvisiblePopups() -{ - // OpenLayers doesn't destroy closed popups, so - // we search for them here and destroy if there are ... - for (var i in map.popups) - if (!map.popups[i].visible()) - map.removePopup(map.popups[i]); -} - function set_lastonline_limit(sec) { lastonline_limit = sec; @@ -83,8 +74,6 @@ function ping_host(id, ip) { - removeInvisiblePopups(); - for (var i = 0; i < map.popups.length, map.popups[i].id != id; i++); var popupid = id; var pingContentsRequest = OpenLayers.Request.issue({ @@ -538,9 +527,5 @@ setCookie('mapSettings', map.getCenter().lon + ';' + map.getCenter().lat + ';' + map.getZoom(), true); }); - map.events.register('mousemove', map, function(e) { - removeInvisiblePopups(); - }); - return map; } From cvs w lms.org.pl Thu Nov 24 14:24:31 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 24 Nov 2011 14:24:31 +0100 (CET) Subject: [lms-commits] CVS update of lms/bin (lms-teryt) Message-ID: <20111124132431.96DD5302A040@eftep.altec.pl> Date: Thursday, November 24, 2011 @ 14:24:31 Author: alec Path: /cvsroot/lms/bin Modified: lms-teryt - Removed unsupported/redundant cast() in SQL query Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-teryt.diff?&r1=1.2&r2=1.3 Index: lms/bin/lms-teryt diff -u lms/bin/lms-teryt:1.2 lms/bin/lms-teryt:1.3 --- lms/bin/lms-teryt:1.2 Sun Nov 20 11:54:18 2011 +++ lms/bin/lms-teryt Thu Nov 24 14:24:31 2011 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-teryt,v 1.2 2011/11/20 10:54:18 alec Exp $ +# $Id: lms-teryt,v 1.3 2011/11/24 13:24:31 alec Exp $ use strict; use DBI; @@ -241,11 +241,11 @@ ######### Get current TERC database ################################################## my %terc; $dbq = $dbase->prepare(" - SELECT ident AS woj, CAST(0 AS text) AS pow, CAST(0 AS text) AS gmi, 0 AS rodz, + SELECT ident AS woj, '0' AS pow, '0' AS gmi, 0 AS rodz, UPPER(name) AS nazwa, id, 'WOJ' AS type FROM location_states UNION - SELECT s.ident AS woj, d.ident AS pow, CAST(0 AS text) AS gmi, 0 AS rodz, + SELECT s.ident AS woj, d.ident AS pow, '0' AS gmi, 0 AS rodz, d.name AS nazwa, d.id, 'POW' AS type FROM location_districts d JOIN location_states s ON (d.stateid = s.id) From cvs w lms.org.pl Thu Nov 24 14:53:37 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 24 Nov 2011 14:53:37 +0100 (CET) Subject: [lms-commits] CVS update of lms/bin (lms-teryt) Message-ID: <20111124135337.31FFB302A040@eftep.altec.pl> Date: Thursday, November 24, 2011 @ 14:53:37 Author: alec Path: /cvsroot/lms/bin Modified: lms-teryt - Added (more) printing errors on file operations Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-teryt.diff?&r1=1.3&r2=1.4 Index: lms/bin/lms-teryt diff -u lms/bin/lms-teryt:1.3 lms/bin/lms-teryt:1.4 --- lms/bin/lms-teryt:1.3 Thu Nov 24 14:24:31 2011 +++ lms/bin/lms-teryt Thu Nov 24 14:53:37 2011 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-teryt,v 1.3 2011/11/24 13:24:31 alec Exp $ +# $Id: lms-teryt,v 1.4 2011/11/24 13:53:37 alec Exp $ use strict; use DBI; @@ -137,9 +137,9 @@ my $filename = $dir.'/'.$response->filename; # save zip file - open (FILE, ">$filename"); - print FILE $response->content; - close (FILE); + open(FILE, ">$filename") or die $!; + print FILE $response->content or die $!; + close(FILE) or die $!; # extract file (zip -> xml) system("$zip_bin -qd $dir $filename"); } From cvs w lms.org.pl Thu Nov 24 18:15:37 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 24 Nov 2011 18:15:37 +0100 (CET) Subject: [lms-commits] CVS update of lms (index.php) Message-ID: <20111124171537.EA26F302A040@eftep.altec.pl> Date: Thursday, November 24, 2011 @ 18:15:37 Author: chilek Path: /cvsroot/lms Modified: index.php - if user doesn't have finances management privilege then he can't see any financial information Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/index.php.diff?&r1=1.228&r2=1.229 Index: lms/index.php diff -u lms/index.php:1.228 lms/index.php:1.229 --- lms/index.php:1.228 Sat Oct 22 13:03:22 2011 +++ lms/index.php Thu Nov 24 18:15:37 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: index.php,v 1.228 2011/10/22 11:03:22 alec Exp $ + * $Id: index.php,v 1.229 2011/11/24 17:15:37 chilek Exp $ */ // REPLACE THIS WITH PATH TO YOUR CONFIG FILE @@ -220,7 +220,7 @@ } if(isset($access['table'][$level]['privilege'])) - $CONFIG['phpui'][$access['table'][$level]['privilege']] = TRUE; + $CONFIG['privileges'][$access['table'][$level]['privilege']] = TRUE; } if($allow && ! $deny) From cvs w lms.org.pl Thu Nov 24 18:15:38 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 24 Nov 2011 18:15:38 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111124171538.1DDA0302A041@eftep.altec.pl> Date: Thursday, November 24, 2011 @ 18:15:38 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - if user doesn't have finances management privilege then he can't see any financial information Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1616&r2=1.1617 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1616 lms/doc/ChangeLog:1.1617 --- lms/doc/ChangeLog:1.1616 Mon Nov 21 08:06:52 2011 +++ lms/doc/ChangeLog Thu Nov 24 18:15:37 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1616 2011/11/21 07:06:52 alec Exp $ +$Id: ChangeLog,v 1.1617 2011/11/24 17:15:37 chilek Exp $ version ? (????-??-??): @@ -67,6 +67,8 @@ - display summary times in ping popup [chilan] - added %bankaccount variable for messages sent from UI [foxman] - lms-payments: added 'check_invoices' option [foxman] + - if user doesn't have finances management privilege then he can't see any + financial information [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Thu Nov 24 18:15:38 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 24 Nov 2011 18:15:38 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (9 files) Message-ID: <20111124171538.95A3F302A043@eftep.altec.pl> Date: Thursday, November 24, 2011 @ 18:15:38 Author: chilek Path: /cvsroot/lms/templates Modified: customerassignments.html customerassignmentsedit.html customerinfo.html customerinfobox.html customerinfoshort.html customerlist.html tariffinfo.html tarifflist.html welcome.html - if user doesn't have finances management privilege then he can't see any financial information Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerassignments.html.diff?&r1=1.45&r2=1.46 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerassignmentsedit.html.diff?&r1=1.24&r2=1.25 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfo.html.diff?&r1=1.10&r2=1.11 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfobox.html.diff?&r1=1.51&r2=1.52 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfoshort.html.diff?&r1=1.28&r2=1.29 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerlist.html.diff?&r1=1.18&r2=1.19 http://cvs.lms.org.pl/viewvc/Development/lms/templates/tariffinfo.html.diff?&r1=1.63&r2=1.64 http://cvs.lms.org.pl/viewvc/Development/lms/templates/tarifflist.html.diff?&r1=1.70&r2=1.71 http://cvs.lms.org.pl/viewvc/Development/lms/templates/welcome.html.diff?&r1=1.89&r2=1.90 Index: lms/templates/customerassignments.html diff -u lms/templates/customerassignments.html:1.45 lms/templates/customerassignments.html:1.46 --- lms/templates/customerassignments.html:1.45 Thu Nov 10 07:41:00 2011 +++ lms/templates/customerassignments.html Thu Nov 24 18:15:38 2011 @@ -1,4 +1,4 @@ - + {assign var=today value=$smarty.now|date_format:"%x 00:00:00"}{assign var=today value=$today|date_format:"%s"}
@@ -22,8 +22,12 @@
- - + + @@ -48,10 +52,10 @@ {if $a.nodes}({foreach from=$a.nodes item=item key=key}{$item.name}{if $key+1 - - + + Index: lms/templates/customerassignmentsedit.html diff -u lms/templates/customerassignmentsedit.html:1.24 lms/templates/customerassignmentsedit.html:1.25 --- lms/templates/customerassignmentsedit.html:1.24 Thu Nov 10 07:41:00 2011 +++ lms/templates/customerassignmentsedit.html Thu Nov 24 18:15:38 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"}

{/if} -{if $printmenu=="customer" || $printmenu=="finances"} +{if ($printmenu=="customer" || $printmenu=="finances") && ($_config.privileges.finances_management|chkconfig || $adminuser)}

{t}Liability:{/t}{t}Value:{/t}{t}Discount:{/t} + {if $_config.privileges.finances_management|chkconfig || 4adminuser}{t}Value:{/t}{/if} + + {if $_config.privileges.finances_management|chkconfig || $adminuser}{t}Discount:{/t}{/if} + {t}Accounting:{/t} {t}Downceil:{/t} {t}Upceil:{/t} - {$a.value|money_format} + {if $_config.privileges.finances_management|chkconfig || $adminuser}{$a.value|money_format}{/if} - {if $a.discount!=0}{$a.discount}%{else}-{/if} + {if $_config.privileges.finances_management|chkconfig || $adminuser}{if $a.discount!=0}{$a.discount}%{else}-{/if}{/if} {$a.payday} @@ -87,8 +91,16 @@ {/foreach}
{t}Total:{/t}{sum array=$assignments column="real_value" string_format=$LANGDEFS.$_language.money_format}({sum array=$assignments column="real_disc_value" string_format=$LANGDEFS.$_language.money_format}) + {if $_config.privileges.finances_management|chkconfig || $adminuser} + {sum array=$assignments column="real_value" string_format=$LANGDEFS.$_language.money_format} + {/if} + + {if $_config.privileges.finances_management|chkconfig || $adminuser} + ({sum array=$assignments column="real_disc_value" string_format=$LANGDEFS.$_language.money_format}) + {/if} +   {sum array=$assignments column="real_downceil" assign=downceilsum}{if $downceilsum}{$downceilsum} kbit/s{/if} {sum array=$assignments column="real_upceil" assign=upceilsum}{if $upceilsum}{$upceilsum} kbit/s{/if}
@@ -885,7 +885,7 @@

{/if} -{if $printmenu=="customer" || $printmenu=="finances"} +{if ($printmenu=="customer" || $printmenu=="finances") && ($_config.privileges.finances_management|chkconfig || $adminuser)}

From cvs w lms.org.pl Fri Nov 25 14:00:03 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 14:00:03 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (customerlist.html) Message-ID: <20111125130003.7E417302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 14:00:03 Author: chilek Path: /cvsroot/lms/templates Modified: customerlist.html - we don't need to show account link for users without finances management privilege Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerlist.html.diff?&r1=1.19&r2=1.20 Index: lms/templates/customerlist.html diff -u lms/templates/customerlist.html:1.19 lms/templates/customerlist.html:1.20 --- lms/templates/customerlist.html:1.19 Thu Nov 24 18:15:38 2011 +++ lms/templates/customerlist.html Fri Nov 25 14:00:03 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -103,8 +103,10 @@ - + $smarty.const.MSG_MAIL} style="display: none"{/if}> @@ -136,7 +142,7 @@ - + $smarty.const.MSG_MAIL} style="display: none"{/if}> @@ -147,6 +153,17 @@ + + + + + - + $smarty.const.MSG_MAIL} style="display: none"{/if}> @@ -169,7 +186,7 @@ - + $smarty.const.MSG_ANYSMS} style="display: none"{/if}> @@ -180,7 +197,7 @@ - + $smarty.const.MSG_MAIL} style="display: none"{/if}> Index: lms/templates/messageinfo.html diff -u lms/templates/messageinfo.html:1.2 lms/templates/messageinfo.html:1.3 --- lms/templates/messageinfo.html:1.2 Fri Oct 14 18:09:04 2011 +++ lms/templates/messageinfo.html Fri Nov 25 15:41:39 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

- {if $customerlist[customerlist].balance < 0} - [ {t}Account{/t} ] + {if $_config.privileges.finances_management|chkconfig || $adminuser} + {if $customerlist[customerlist].balance < 0} + [ {t}Account{/t} ] + {/if} {/if} {if $customerlist[customerlist].account} {if $customerlist[customerlist].status eq 3} From cvs w lms.org.pl Fri Nov 25 15:41:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 15:41:39 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111125144139.1FDDB302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 15:41:39 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - we can send sms to any phone number from outside database Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1618&r2=1.1619 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1618 lms/doc/ChangeLog:1.1619 --- lms/doc/ChangeLog:1.1618 Fri Nov 25 12:12:57 2011 +++ lms/doc/ChangeLog Fri Nov 25 15:41:38 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1618 2011/11/25 11:12:57 chilek Exp $ +$Id: ChangeLog,v 1.1619 2011/11/25 14:41:38 chilek Exp $ version ? (????-??-??): @@ -70,6 +70,7 @@ - if user doesn't have finances management privilege then he can't see any financial information [chilan] - possibility to show selected device or node on map [chilan] + - we can send sms to any phone number from outside database [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Fri Nov 25 15:41:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 15:41:39 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (3 files) Message-ID: <20111125144139.CEBAD302A044@eftep.altec.pl> Date: Friday, November 25, 2011 @ 15:41:39 Author: chilek Path: /cvsroot/lms/templates Modified: messageadd.html messageinfo.html messagelist.html - we can send sms to any phone number from outside database Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/messageadd.html.diff?&r1=1.6&r2=1.7 http://cvs.lms.org.pl/viewvc/Development/lms/templates/messageinfo.html.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/templates/messagelist.html.diff?&r1=1.3&r2=1.4 Index: lms/templates/messageadd.html diff -u lms/templates/messageadd.html:1.6 lms/templates/messageadd.html:1.7 --- lms/templates/messageadd.html:1.6 Wed Nov 16 15:17:48 2011 +++ lms/templates/messageadd.html Fri Nov 25 15:41:39 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -17,17 +17,22 @@ } function typesel(elem) { - if(elem == 'typesms') { + if(elem == 'typesms' || elem == 'typeanysms') { document.getElementById('mailbody').style.display = 'none'; document.getElementById('mailfrom').style.display = 'none'; document.getElementById('mailsender').style.display = 'none'; document.getElementById('attachment').style.display = 'none'; + if (elem == 'typeanysms') + document.getElementById('phonenumber').style.display = 'table-row'; + else + document.getElementById('phonenumber').style.display = 'none'; document.getElementById('smsbody').style.display = 'table-row'; } else { document.getElementById('mailbody').style.display = ''; document.getElementById('mailfrom').style.display = ''; document.getElementById('mailsender').style.display = ''; document.getElementById('attachment').style.display = ''; + document.getElementById('phonenumber').style.display = 'none'; document.getElementById('smsbody').style.display = 'none'; } } @@ -121,11 +126,12 @@ {t}Type:{/t}
- + $smarty.const.MSG_ANYSMS} CHECKED{/if} {tip trigger="type" text="Select message type"} onclick="typesel(this.id)"> +
@@ -158,7 +175,7 @@
@@ -126,7 +126,11 @@ {assign var=item value=$itemlist[itemlist]}
- {$item.customer|truncate:45:"...":true} ({$item.customerid|string_format:"%04d"}) + {if $item.customerid} + {$item.customer|truncate:45:"...":true} ({$item.customerid|string_format:"%04d"}) + {else} + {t}none{/t} + {/if} {$item.destination|escape} Index: lms/templates/messagelist.html diff -u lms/templates/messagelist.html:1.3 lms/templates/messagelist.html:1.4 --- lms/templates/messagelist.html:1.3 Fri Oct 14 18:09:04 2011 +++ lms/templates/messagelist.html Fri Nov 25 15:41:39 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -38,6 +38,7 @@ +   {t}Status:{/t}
- {if $message.type == $smarty.const.MSG_SMS} + {if $message.type > $smarty.const.MSG_MAIL} sms {else} email From cvs w lms.org.pl Fri Nov 25 15:41:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 15:41:39 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (messageadd.php, messageinfo.php) Message-ID: <20111125144139.9E06F302A043@eftep.altec.pl> Date: Friday, November 25, 2011 @ 15:41:39 Author: chilek Path: /cvsroot/lms/modules Modified: messageadd.php messageinfo.php - we can send sms to any phone number from outside database Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/messageadd.php.diff?&r1=1.19&r2=1.20 http://cvs.lms.org.pl/viewvc/Development/lms/modules/messageinfo.php.diff?&r1=1.8&r2=1.9 Index: lms/modules/messageadd.php diff -u lms/modules/messageadd.php:1.19 lms/modules/messageadd.php:1.20 --- lms/modules/messageadd.php:1.19 Sun Nov 20 14:54:42 2011 +++ lms/modules/messageadd.php Fri Nov 25 15:41:39 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: messageadd.php,v 1.19 2011/11/20 13:54:42 alec Exp $ + * $Id: messageadd.php,v 1.20 2011/11/25 14:41:39 chilek Exp $ */ function GetRecipients($filter, $type=MSG_MAIL) @@ -119,15 +119,14 @@ function BodyVars(&$body, $data) { - global $LMS, $LANGDEFS; + global $LMS, $LANGDEFS; $body = str_replace('%customer', $data['customername'], $body); $body = str_replace('%balance', $data['balance'], $body); $body = str_replace('%cid', $data['id'], $body); $body = str_replace('%pin', $data['pin'], $body); - if (strpos($body, '%bankaccount') !== false) { - $body = str_replace('%bankaccount', bankaccount($data['id']), $body); - } + if (strpos($body, '%bankaccount') !== false) + $body = str_replace('%bankaccount', bankaccount($data['id']), $body); if(!(strpos($body, '%last_10_in_a_table') === FALSE)) { @@ -153,7 +152,7 @@ { $message = $_POST['message']; - $message['type'] = $message['type'] == MSG_MAIL ? MSG_MAIL : MSG_SMS; + $message['type'] = $message['type'] == MSG_MAIL ? MSG_MAIL : ($message['type'] == MSG_SMS ? MSG_SMS : MSG_ANYSMS); if(empty($message['customerid']) && ($message['group'] < 0 || $message['group'] > 7)) $error['group'] = trans('Incorrect customers group!'); @@ -161,7 +160,7 @@ if($message['type'] == MSG_MAIL) { $message['body'] = $message['mailbody']; - + if($message['sender']=='') $error['sender'] = trans('Sender e-mail is required!'); elseif(!check_email($message['sender'])) @@ -175,8 +174,17 @@ $message['body'] = $message['smsbody']; $message['sender'] = ''; $message['from'] = ''; + $phonenumbers = array(); + if ($message['type'] == MSG_ANYSMS) + { + $message['phonenumber'] = preg_replace('/[ \t]/', '', $message['phonenumber']); + if (preg_match('/^[\+]?[0-9]+(,[\+]?[0-9]+)*$/', $message['phonenumber'])) + $phonenumbers = preg_split('/,/', $message['phonenumber']); + else + $error['phonenumber'] = trans('Specified phone number is not correct!'); + } } - + if($message['subject']=='') $error['subject'] = trans('Message subject is required!'); @@ -209,8 +217,13 @@ if(!$error) { + $recipients = array(); if(empty($message['customerid'])) - $recipients = GetRecipients($message, $message['type']); + if ($message['type'] == MSG_SMS) + $recipients = GetRecipients($message, $message['type']); + else + foreach($phonenumbers as $phone) + $recipients[]['phone'] = $phone; else $recipients = GetRecipient($message['customerid'], $message['type']); @@ -219,11 +232,11 @@ } if(!$error) - { + { set_time_limit(0); $message['body'] = str_replace("\r", '', $message['body']); - + if($message['type'] == MSG_MAIL) $message['body'] = wordwrap($message['body'],76,"\n"); @@ -241,29 +254,28 @@ $AUTH->id, $message['type']==MSG_MAIL ? '"'.$message['from'].'" <'.$message['sender'].'>' : '', )); - + $msgid = $DB->GetLastInsertID('messages'); foreach($recipients as $key => $row) { if($message['type'] == MSG_MAIL) $recipients[$key]['destination'] = $row['email']; - else { + else $recipients[$key]['destination'] = $row['phone']; - } - + $DB->Execute('INSERT INTO messageitems (messageid, customerid, destination, status) VALUES (?, ?, ?, ?)', array( $msgid, - $row['id'], + isset($row['id']) ? $row['id'] : 0, $recipients[$key]['destination'], MSG_NEW, )); } - + $DB->CommitTrans(); - + if($message['type'] == MSG_MAIL) { $files = NULL; @@ -291,7 +303,7 @@ $body = $message['body']; BodyVars($body, $row); - + if($message['type'] == MSG_MAIL) { $headers['To'] = '<'.$row['destination'].'>'; @@ -299,27 +311,27 @@ } else { - $row['destination'] = preg_replace('/[^0-9]/', '', $row['destination']); + $row['destination'] = preg_replace('/[^\+0-9]/', '', $row['destination']); echo ' '; } - + echo trans('$a of $b ($c) $d:', ($key+1), sizeof($recipients), sprintf('%02.1f%%',round((100/sizeof($recipients))*($key+1),1)), $row['customername'].' <'.$row['destination'].'>'); flush(); - + if($message['type'] == MSG_MAIL) $result = $LMS->SendMail($row['destination'], $headers, $body, $files); else $result = $LMS->SendSMS($row['destination'], $body, $msgid); - + if (is_string($result)) echo " $result"; else if ($result == MSG_SENT) echo ' ['.trans('sent').']'; else echo ' ['.trans('added').']'; - + echo "
\n"; if (!is_int($result) || $result == MSG_SENT) @@ -332,7 +344,7 @@ $row['id'], )); } - + $SMARTY->display('footer.html'); $SESSION->close(); die; Index: lms/modules/messageinfo.php diff -u lms/modules/messageinfo.php:1.8 lms/modules/messageinfo.php:1.9 --- lms/modules/messageinfo.php:1.8 Fri Oct 14 18:08:59 2011 +++ lms/modules/messageinfo.php Fri Nov 25 15:41:39 2011 @@ -21,19 +21,19 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: messageinfo.php,v 1.8 2011/10/14 16:08:59 chilek Exp $ + * $Id: messageinfo.php,v 1.9 2011/11/25 14:41:39 chilek Exp $ */ function GetItemList($id, $order='id,desc', $search=NULL, $cat=NULL, $status=NULL) { global $DB; - + if($order=='') $order='id,desc'; - + list($order,$direction) = sscanf($order, '%[^,],%s'); ($direction=='desc') ? $direction = 'desc' : $direction = 'asc'; - + switch($order) { case 'customer': @@ -46,10 +46,10 @@ $sqlord = ' ORDER BY i.id'; break; } - + if($search!='' && $cat) - { - switch($cat) + { + switch($cat) { case 'customerid': $where[] = ' i.customerid = '.intval($search); @@ -62,7 +62,7 @@ break; } } - + if($status) { switch($status) @@ -73,31 +73,31 @@ $where[] = 'i.status = '.$status; break; } - } - + } + if(!empty($where)) $where = ' AND '.implode(' AND ', $where); - + $result = $DB->GetAll('SELECT i.id, i.customerid, i.status, i.error, i.destination, i.lastdate, ' .$DB->Concat('UPPER(c.lastname)',"' '",'c.name').' AS customer - FROM messageitems i - JOIN customers c ON (c.id = i.customerid) + FROM messageitems i + LEFT JOIN customers c ON (c.id = i.customerid) LEFT JOIN ( SELECT DISTINCT a.customerid FROM customerassignments a - JOIN excludedgroups e ON (a.customergroupid = e.customergroupid) + JOIN excludedgroups e ON (a.customergroupid = e.customergroupid) WHERE e.userid = lms_current_user() ) e ON (e.customerid = c.id) WHERE e.customerid IS NULL AND i.messageid = '.intval($id) .(!empty($where) ? $where : '') - .$sqlord.' '.$direction); + .$sqlord.' '.$direction); $result['status'] = $status; $result['order'] = $order; $result['direction'] = $direction; - + return $result; -} +} $message = $DB->GetRow('SELECT m.*, u.name FROM messages m @@ -160,8 +160,8 @@ $listdata['total'] = sizeof($itemlist); if ($SESSION->is_set('milp') && !isset($_GET['page'])) - $SESSION->restore('milp', $_GET['page']); - + $SESSION->restore('milp', $_GET['page']); + $page = (empty($_GET['page']) ? 1 : $_GET['page']); $pagelimit = (empty($CONFIG['phpui']['messagelist_pagelimit']) ? $listdata['total'] : $CONFIG['phpui']['messagelist_pagelimit']); $SESSION->save('milp', $page); From cvs w lms.org.pl Fri Nov 25 15:41:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 15:41:39 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (definitions.php) Message-ID: <20111125144139.49FF5302A041@eftep.altec.pl> Date: Friday, November 25, 2011 @ 15:41:39 Author: chilek Path: /cvsroot/lms/lib Modified: definitions.php - we can send sms to any phone number from outside database Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/definitions.php.diff?&r1=1.37&r2=1.38 Index: lms/lib/definitions.php diff -u lms/lib/definitions.php:1.37 lms/lib/definitions.php:1.38 --- lms/lib/definitions.php:1.37 Fri Oct 14 18:08:56 2011 +++ lms/lib/definitions.php Fri Nov 25 15:41:39 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: definitions.php,v 1.37 2011/10/14 16:08:56 chilek Exp $ + * $Id: definitions.php,v 1.38 2011/11/25 14:41:39 chilek Exp $ */ // that definitions should be included before LMS.class.php but after Smarty @@ -47,6 +47,7 @@ define('MSG_MAIL', 1); define('MSG_SMS', 2); +define('MSG_ANYSMS', 3); // Account types define('ACCOUNT_SHELL', 1); From cvs w lms.org.pl Fri Nov 25 15:41:39 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 15:41:39 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20111125144139.71C5B302A042@eftep.altec.pl> Date: Friday, November 25, 2011 @ 15:41:39 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - we can send sms to any phone number from outside database Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.402&r2=1.403 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.402 lms/lib/locale/pl/strings.php:1.403 --- lms/lib/locale/pl/strings.php:1.402 Fri Nov 25 12:12:57 2011 +++ lms/lib/locale/pl/strings.php Fri Nov 25 15:41:39 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.402 2011/11/25 11:12:57 chilek Exp $ + * $Id: strings.php,v 1.403 2011/11/25 14:41:39 chilek Exp $ */ $_LANG['$a ($b addresses)'] = '$a ($b adresów)'; @@ -2521,4 +2521,9 @@ $_LANG['Enter IP address:'] = 'Podaj adres IP:'; $_LANG['Ping to $a'] = 'Ping do $a'; $_LANG['Enabled'] = 'Włączony'; + +$_LANG['any sms'] = 'dowolny sms'; +$_LANG['Enter phone numbers separated by commas'] = 'Podaj numery telefonów oddzielone przecinkami'; +$_LANG['Specified phone number is not correct!'] = 'Podany numer telefonu nie jest poprawny!'; + ?> From cvs w lms.org.pl Fri Nov 25 15:51:16 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 15:51:16 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (messageadd.php) Message-ID: <20111125145116.B8A10302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 15:51:16 Author: chilek Path: /cvsroot/lms/modules Modified: messageadd.php - unneeded + in regexp Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/messageadd.php.diff?&r1=1.20&r2=1.21 Index: lms/modules/messageadd.php diff -u lms/modules/messageadd.php:1.20 lms/modules/messageadd.php:1.21 --- lms/modules/messageadd.php:1.20 Fri Nov 25 15:41:39 2011 +++ lms/modules/messageadd.php Fri Nov 25 15:51:16 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: messageadd.php,v 1.20 2011/11/25 14:41:39 chilek Exp $ + * $Id: messageadd.php,v 1.21 2011/11/25 14:51:16 chilek Exp $ */ function GetRecipients($filter, $type=MSG_MAIL) @@ -311,7 +311,7 @@ } else { - $row['destination'] = preg_replace('/[^\+0-9]/', '', $row['destination']); + $row['destination'] = preg_replace('/[^0-9]/', '', $row['destination']); echo ' '; } From cvs w lms.org.pl Fri Nov 25 20:01:17 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 20:01:17 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (choosegpscoords.html) Message-ID: <20111125190117.7BCE0302A041@eftep.altec.pl> Date: Friday, November 25, 2011 @ 20:01:17 Author: chilek Path: /cvsroot/lms/templates Modified: choosegpscoords.html - some map improvements and fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/choosegpscoords.html.diff?&r1=1.11&r2=1.12 Index: lms/templates/choosegpscoords.html diff -u lms/templates/choosegpscoords.html:1.11 lms/templates/choosegpscoords.html:1.12 --- lms/templates/choosegpscoords.html:1.11 Sat Nov 19 19:37:55 2011 +++ lms/templates/choosegpscoords.html Fri Nov 25 20:01:17 2011 @@ -1,5 +1,5 @@ - + @@ -78,7 +78,10 @@ {/foreach} {/if} - map = createMap(devices, devlinks, nodes, nodelinks, false); + if (targetfield1.value.match(/[0-9]+\.[0-9]+/) && targetfield2.value.match(/[0-9]+\.[0-9]+/)) + map = createMap(devices, devlinks, nodes, nodelinks, false, targetfield1.value, targetfield2.value); + else + map = createMap(devices, devlinks, nodes, nodelinks, false); map.events.register("click", map, function(e) { From cvs w lms.org.pl Fri Nov 25 20:01:17 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 20:01:17 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (netdevmap.php) Message-ID: <20111125190117.56D5E302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 20:01:17 Author: chilek Path: /cvsroot/lms/modules Modified: netdevmap.php - some map improvements and fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevmap.php.diff?&r1=1.74&r2=1.75 Index: lms/modules/netdevmap.php diff -u lms/modules/netdevmap.php:1.74 lms/modules/netdevmap.php:1.75 --- lms/modules/netdevmap.php:1.74 Fri Nov 25 12:12:57 2011 +++ lms/modules/netdevmap.php Fri Nov 25 20:01:17 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: netdevmap.php,v 1.74 2011/11/25 11:12:57 chilek Exp $ + * $Id: netdevmap.php,v 1.75 2011/11/25 19:01:17 chilek Exp $ */ function drawtext($x, $y, $text, $r, $g, $b) @@ -332,8 +332,8 @@ if (isset($_GET['nodeid'])) { $nodeid = intval($_GET['nodeid']); - $SMARTY->assign('lon', $devices[$nodeid]['lon']); - $SMARTY->assign('lat', $devices[$nodeid]['lat']); + $SMARTY->assign('lon', $nodes[$nodeid]['lon']); + $SMARTY->assign('lat', $nodes[$nodeid]['lat']); } $SMARTY->assign('type', $type); From cvs w lms.org.pl Fri Nov 25 20:11:47 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 20:11:47 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (choosegpscoords.html) Message-ID: <20111125191147.C5125302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 20:11:47 Author: chilek Path: /cvsroot/lms/templates Modified: choosegpscoords.html - some disambiguation in gps coords regexp match Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/choosegpscoords.html.diff?&r1=1.12&r2=1.13 Index: lms/templates/choosegpscoords.html diff -u lms/templates/choosegpscoords.html:1.12 lms/templates/choosegpscoords.html:1.13 --- lms/templates/choosegpscoords.html:1.12 Fri Nov 25 20:01:17 2011 +++ lms/templates/choosegpscoords.html Fri Nov 25 20:11:47 2011 @@ -1,5 +1,5 @@ - + @@ -78,7 +78,7 @@ {/foreach} {/if} - if (targetfield1.value.match(/[0-9]+\.[0-9]+/) && targetfield2.value.match(/[0-9]+\.[0-9]+/)) + if (targetfield1.value.match(/^[0-9]+\.[0-9]+$/) && targetfield2.value.match(/^[0-9]+\.[0-9]+$/)) map = createMap(devices, devlinks, nodes, nodelinks, false, targetfield1.value, targetfield2.value); else map = createMap(devices, devlinks, nodes, nodelinks, false); From cvs w lms.org.pl Fri Nov 25 20:30:41 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 20:30:41 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.js) Message-ID: <20111125193041.0C7F9302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 20:30:41 Author: chilek Path: /cvsroot/lms/img Modified: map.js - maximal, valid, common zoom for google maps is 20 Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.20&r2=1.21 Index: lms/img/map.js diff -u lms/img/map.js:1.20 lms/img/map.js:1.21 --- lms/img/map.js:1.20 Fri Nov 25 12:12:57 2011 +++ lms/img/map.js Fri Nov 25 20:30:40 2011 @@ -144,13 +144,13 @@ var map = new OpenLayers.Map("map"); var gsat = new OpenLayers.Layer.Google("Google Satellite", - {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 22, visibility: false}); + {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 20, visibility: false}); var gphy = new OpenLayers.Layer.Google("Google Physical", {type: google.maps.MapTypeId.TERRAIN, visibility: false}); var gmap = new OpenLayers.Layer.Google("Google Streets", // the default {numZoomLevels: 20, visibility: false}); var ghyb = new OpenLayers.Layer.Google("Google Hybrid", - {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 22, visibility: true}); + {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20, visibility: true}); var osm = new OpenLayers.Layer.OSM(); map.addLayers([gsat, gphy, gmap, ghyb, osm]); From cvs w lms.org.pl Fri Nov 25 21:14:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 21:14:45 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.js) Message-ID: <20111125201445.565E6302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 21:14:45 Author: chilek Path: /cvsroot/lms/img Modified: map.js - some redesign of map controls Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.21&r2=1.22 Index: lms/img/map.js diff -u lms/img/map.js:1.21 lms/img/map.js:1.22 --- lms/img/map.js:1.21 Fri Nov 25 20:30:40 2011 +++ lms/img/map.js Fri Nov 25 21:14:44 2011 @@ -142,7 +142,10 @@ { strokeColor: '#ff0000', strokeOpacity: 0.5, strokeWidth: 2 } ]; - var map = new OpenLayers.Map("map"); + var map = new OpenLayers.Map("map", { + controls: [new OpenLayers.Control.KeyboardDefaults(), + new OpenLayers.Control.PanZoomBar(), + new OpenLayers.Control.Navigation()] }); var gsat = new OpenLayers.Layer.Google("Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 20, visibility: false}); var gphy = new OpenLayers.Layer.Google("Google Physical", From cvs w lms.org.pl Fri Nov 25 21:22:55 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 21:22:55 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.js) Message-ID: <20111125202255.C6358302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 21:22:55 Author: chilek Path: /cvsroot/lms/img Modified: map.js - added permalink to map Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.22&r2=1.23 Index: lms/img/map.js diff -u lms/img/map.js:1.22 lms/img/map.js:1.23 --- lms/img/map.js:1.22 Fri Nov 25 21:14:44 2011 +++ lms/img/map.js Fri Nov 25 21:22:55 2011 @@ -145,7 +145,8 @@ var map = new OpenLayers.Map("map", { controls: [new OpenLayers.Control.KeyboardDefaults(), new OpenLayers.Control.PanZoomBar(), - new OpenLayers.Control.Navigation()] }); + new OpenLayers.Control.Navigation(), + new OpenLayers.Control.Permalink("Permalink")] }); var gsat = new OpenLayers.Layer.Google("Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels: 20, visibility: false}); var gphy = new OpenLayers.Layer.Google("Google Physical", From cvs w lms.org.pl Fri Nov 25 21:43:13 2011 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 25 Nov 2011 21:43:13 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (map.inc.php) Message-ID: <20111125204313.53B76302A040@eftep.altec.pl> Date: Friday, November 25, 2011 @ 21:43:13 Author: chilek Path: /cvsroot/lms/modules Modified: map.inc.php - fixed sql bug which appear when we have some nodes, but don't have any devices Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/map.inc.php.diff?&r1=1.3&r2=1.4 Index: lms/modules/map.inc.php diff -u lms/modules/map.inc.php:1.3 lms/modules/map.inc.php:1.4 --- lms/modules/map.inc.php:1.3 Thu Nov 17 23:13:07 2011 +++ lms/modules/map.inc.php Fri Nov 25 21:43:13 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: map.inc.php,v 1.3 2011/11/17 22:13:07 chilek Exp $ + * $Id: map.inc.php,v 1.4 2011/11/25 20:43:13 chilek Exp $ */ $devices = $DB->GetAllByKey('SELECT n.id, n.name, n.location, '.$DB->GroupConcat('INET_NTOA(CASE WHEN nodes.ownerid = 0 THEN nodes.ipaddr ELSE NULL END)') @@ -73,16 +73,19 @@ $nodeids = implode(',', array_keys($nodes)); - $nodelinks = $DB->GetAll('SELECT n.id AS nodeid, netdev, linktype AS type FROM nodes n WHERE netdev > 0 AND ownerid > 0 - AND n.id IN ('.$nodeids.') AND netdev IN ('.$devids.')'); - if ($nodelinks) - foreach ($nodelinks as $nodelinkidx => $nodelink) - { - $nodelinks[$nodelinkidx]['nodelat'] = $nodes[$nodelink['nodeid']]['lat']; - $nodelinks[$nodelinkidx]['nodelon'] = $nodes[$nodelink['nodeid']]['lon']; - $nodelinks[$nodelinkidx]['netdevlat'] = $devices[$nodelink['netdev']]['lat']; - $nodelinks[$nodelinkidx]['netdevlon'] = $devices[$nodelink['netdev']]['lon']; - } + if ($devices) + { + $nodelinks = $DB->GetAll('SELECT n.id AS nodeid, netdev, linktype AS type FROM nodes n WHERE netdev > 0 AND ownerid > 0 + AND n.id IN ('.$nodeids.') AND netdev IN ('.$devids.')'); + if ($nodelinks) + foreach ($nodelinks as $nodelinkidx => $nodelink) + { + $nodelinks[$nodelinkidx]['nodelat'] = $nodes[$nodelink['nodeid']]['lat']; + $nodelinks[$nodelinkidx]['nodelon'] = $nodes[$nodelink['nodeid']]['lon']; + $nodelinks[$nodelinkidx]['netdevlat'] = $devices[$nodelink['netdev']]['lat']; + $nodelinks[$nodelinkidx]['netdevlon'] = $devices[$nodelink['netdev']]['lon']; + } + } } $SMARTY->assign('devices', $devices); From cvs w lms.org.pl Sat Nov 26 10:48:14 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 10:48:14 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (map.js) Message-ID: <20111126094814.A00BD302A040@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 10:48:14 Author: chilek Path: /cvsroot/lms/img Modified: map.js - commented out removeInvisiblePopups() calls Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/map.js.diff?&r1=1.23&r2=1.24 Index: lms/img/map.js diff -u lms/img/map.js:1.23 lms/img/map.js:1.24 --- lms/img/map.js:1.23 Fri Nov 25 21:22:55 2011 +++ lms/img/map.js Sat Nov 26 10:48:14 2011 @@ -85,7 +85,7 @@ function ping_host(id, ip) { - removeInvisiblePopups(); + //removeInvisiblePopups(); for (var i = 0; i < map.popups.length, map.popups[i].id != id; i++); var popupid = id; @@ -554,9 +554,9 @@ setCookie('mapSettings', map.getCenter().lon + ';' + map.getCenter().lat + ';' + map.getZoom(), true); }); - map.events.register('mousemove', map, function(e) { - removeInvisiblePopups(); - }); + //map.events.register('mousemove', map, function(e) { + // removeInvisiblePopups(); + //}); return map; } From cvs w lms.org.pl Sat Nov 26 12:31:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 12:31:46 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (messageadd.html) Message-ID: <20111126113146.5ECAF302A042@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 12:31:46 Author: chilek Path: /cvsroot/lms/templates Modified: messageadd.html - can send any sms to selected users Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/messageadd.html.diff?&r1=1.7&r2=1.8 Index: lms/templates/messageadd.html diff -u lms/templates/messageadd.html:1.7 lms/templates/messageadd.html:1.8 --- lms/templates/messageadd.html:1.7 Fri Nov 25 15:41:39 2011 +++ lms/templates/messageadd.html Sat Nov 26 12:31:46 2011 @@ -1,7 +1,7 @@ {include file="header.html"} - +

{$layout.pagetitle}

- + @@ -153,6 +164,20 @@ + + + + + + + $smarty.const.MSG_ANYSMS} style="display: none"{/if}> + + + $smarty.const.MSG_MAIL} style="display: none"{/if}> - @@ -218,6 +250,8 @@ {include file="footer.html"} From cvs w lms.org.pl Sat Nov 26 12:31:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 12:31:46 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111126113146.1342B302A040@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 12:31:46 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - can send any sms to selected users Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1619&r2=1.1620 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1619 lms/doc/ChangeLog:1.1620 --- lms/doc/ChangeLog:1.1619 Fri Nov 25 15:41:38 2011 +++ lms/doc/ChangeLog Sat Nov 26 12:31:45 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1619 2011/11/25 14:41:38 chilek Exp $ +$Id: ChangeLog,v 1.1620 2011/11/26 11:31:45 chilek Exp $ version ? (????-??-??): @@ -71,6 +71,7 @@ financial information [chilan] - possibility to show selected device or node on map [chilan] - we can send sms to any phone number from outside database [chilan] + - can send any sms to selected users [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Sat Nov 26 12:31:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 12:31:46 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (messageadd.php) Message-ID: <20111126113146.34039302A041@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 12:31:46 Author: chilek Path: /cvsroot/lms/modules Modified: messageadd.php - can send any sms to selected users Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/messageadd.php.diff?&r1=1.21&r2=1.22 Index: lms/modules/messageadd.php diff -u lms/modules/messageadd.php:1.21 lms/modules/messageadd.php:1.22 --- lms/modules/messageadd.php:1.21 Fri Nov 25 15:51:16 2011 +++ lms/modules/messageadd.php Sat Nov 26 12:31:46 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: messageadd.php,v 1.21 2011/11/25 14:51:16 chilek Exp $ + * $Id: messageadd.php,v 1.22 2011/11/26 11:31:46 chilek Exp $ */ function GetRecipients($filter, $type=MSG_MAIL) @@ -180,7 +180,9 @@ $message['phonenumber'] = preg_replace('/[ \t]/', '', $message['phonenumber']); if (preg_match('/^[\+]?[0-9]+(,[\+]?[0-9]+)*$/', $message['phonenumber'])) $phonenumbers = preg_split('/,/', $message['phonenumber']); - else + if (count($message['users'])) + $phonenumbers = array_merge($phonenumbers, $message['users']); + if (empty($phonenumbers)) $error['phonenumber'] = trans('Specified phone number is not correct!'); } } @@ -374,6 +376,7 @@ $SMARTY->assign('customergroups', $LMS->CustomergroupGetAll()); $SMARTY->assign('nodegroups', $LMS->GetNodeGroupNames()); $SMARTY->assign('userinfo', $LMS->GetUserInfo($AUTH->id)); +$SMARTY->assign('users', $DB->GetAll('SELECT name, phone FROM users WHERE phone <> \'\' ORDER BY name')); $SMARTY->display('messageadd.html'); ?> From cvs w lms.org.pl Sat Nov 26 13:52:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 13:52:45 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20111126125245.B907B302A041@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 13:52:45 Author: chilek Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - remember selected users beetween send attempts Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.403&r2=1.404 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.403 lms/lib/locale/pl/strings.php:1.404 --- lms/lib/locale/pl/strings.php:1.403 Fri Nov 25 15:41:39 2011 +++ lms/lib/locale/pl/strings.php Sat Nov 26 13:52:45 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.403 2011/11/25 14:41:39 chilek Exp $ + * $Id: strings.php,v 1.404 2011/11/26 12:52:45 chilek Exp $ */ $_LANG['$a ($b addresses)'] = '$a ($b adresów)'; @@ -2525,5 +2525,7 @@ $_LANG['any sms'] = 'dowolny sms'; $_LANG['Enter phone numbers separated by commas'] = 'Podaj numery telefonów oddzielone przecinkami'; $_LANG['Specified phone number is not correct!'] = 'Podany numer telefonu nie jest poprawny!'; +$_LANG['Characters:'] = 'Znaków:'; +$_LANG['Select users'] = 'Wybierz użytkowników'; ?> From cvs w lms.org.pl Sat Nov 26 13:52:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 13:52:45 +0100 (CET) Subject: [lms-commits] CVS update of lms/img (common.js) Message-ID: <20111126125245.4C28A302A040@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 13:52:45 Author: chilek Path: /cvsroot/lms/img Modified: common.js - remember selected users beetween send attempts Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/common.js.diff?&r1=1.40&r2=1.41 Index: lms/img/common.js diff -u lms/img/common.js:1.40 lms/img/common.js:1.41 --- lms/img/common.js:1.40 Sat Nov 19 19:19:57 2011 +++ lms/img/common.js Sat Nov 26 13:52:44 2011 @@ -213,7 +213,7 @@ return {x:x, y:y}; } -function multiselect(formid, elemid, def) +function multiselect(formid, elemid, def, selected) { var old_element = document.getElementById(elemid); var form = document.getElementById(formid); @@ -222,11 +222,15 @@ return; } + var selected_elements = null; + if (selected) + selected_elements = '|' + selected.join('|') + '|'; + // create new multiselect div var new_element = document.createElement('DIV'); new_element.className = 'multiselect'; new_element.id = elemid; - new_element.innerHTML = def ? def : ''; + new_element.innerHTML = def && !selected ? def : ''; // save (overlib) popups new_element.onmouseover = old_element.onmouseover; @@ -253,6 +257,10 @@ box.type = 'checkbox'; box.name = old_element.name; box.value = old_element.options[i].value; + if (selected_elements && selected_elements.indexOf('|' + old_element.options[i].value + '|') != -1) { + box.checked = true; + addClass(li, 'selected'); + } span.innerHTML = old_element.options[i].text; From cvs w lms.org.pl Sat Nov 26 13:52:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 13:52:46 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (messageadd.html) Message-ID: <20111126125246.7F7A3302A040@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 13:52:46 Author: chilek Path: /cvsroot/lms/templates Modified: messageadd.html - remember selected users beetween send attempts Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/messageadd.html.diff?&r1=1.8&r2=1.9 Index: lms/templates/messageadd.html diff -u lms/templates/messageadd.html:1.8 lms/templates/messageadd.html:1.9 --- lms/templates/messageadd.html:1.8 Sat Nov 26 12:31:46 2011 +++ lms/templates/messageadd.html Sat Nov 26 13:52:46 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -251,7 +251,12 @@ {include file="footer.html"} From cvs w lms.org.pl Sat Nov 26 13:52:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 13:52:46 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (messageadd.php) Message-ID: <20111126125246.2176B302A042@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 13:52:46 Author: chilek Path: /cvsroot/lms/modules Modified: messageadd.php - remember selected users beetween send attempts Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/messageadd.php.diff?&r1=1.22&r2=1.23 Index: lms/modules/messageadd.php diff -u lms/modules/messageadd.php:1.22 lms/modules/messageadd.php:1.23 --- lms/modules/messageadd.php:1.22 Sat Nov 26 12:31:46 2011 +++ lms/modules/messageadd.php Sat Nov 26 13:52:45 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: messageadd.php,v 1.22 2011/11/26 11:31:46 chilek Exp $ + * $Id: messageadd.php,v 1.23 2011/11/26 12:52:45 chilek Exp $ */ function GetRecipients($filter, $type=MSG_MAIL) From cvs w lms.org.pl Sat Nov 26 14:30:40 2011 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 26 Nov 2011 14:30:40 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (messageadd.html) Message-ID: <20111126133040.668CA302A040@eftep.altec.pl> Date: Saturday, November 26, 2011 @ 14:30:40 Author: chilek Path: /cvsroot/lms/templates Modified: messageadd.html - don't show some form elements when send sms to customer Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/messageadd.html.diff?&r1=1.9&r2=1.10 Index: lms/templates/messageadd.html diff -u lms/templates/messageadd.html:1.9 lms/templates/messageadd.html:1.10 --- lms/templates/messageadd.html:1.9 Sat Nov 26 13:52:46 2011 +++ lms/templates/messageadd.html Sat Nov 26 14:30:40 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

@@ -23,6 +23,7 @@ document.getElementById('mailfrom').style.display = 'none'; document.getElementById('mailsender').style.display = 'none'; document.getElementById('attachment').style.display = 'none'; + {if !$message.customerid} if (elem == 'typeanysms') { document.getElementById('phonenumber').style.display = 'table-row'; document.getElementById('users').style.display = 'table-row'; @@ -30,6 +31,7 @@ document.getElementById('phonenumber').style.display = 'none'; document.getElementById('users').style.display = 'none'; } + {/if} document.getElementById('smsbody').style.display = 'table-row'; document.getElementById('charscount').style.display = 'table-row'; } else { @@ -139,7 +141,9 @@ $smarty.const.MSG_MAIL} style="display: none"{/if}> @@ -164,6 +168,7 @@ +{if !$message.customerid} +{/if}
+ {t}Characters:{/t} 0
@@ -204,7 +236,7 @@ {t}Attachment:{/t} +
$smarty.const.MSG_ANYSMS} CHECKED{/if} {tip trigger="type" text="Select message type"} onclick="typesel(this.id)"> + {if !$message.customerid} + {/if}
From cvs w lms.org.pl Mon Nov 28 23:08:49 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 28 Nov 2011 23:08:49 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/upgradedb (2 files) Message-ID: <20111128220849.C101B302A040@eftep.altec.pl> Date: Monday, November 28, 2011 @ 23:08:49 Author: chilek Path: /cvsroot/lms/lib/upgradedb Modified: mysql.2011110800.php postgres.2011110800.php - first we drop views, then alter tables and finally create views Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2011110800.php.diff?&r1=1.2&r2=1.3 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2011110800.php.diff?&r1=1.2&r2=1.3 Index: lms/lib/upgradedb/mysql.2011110800.php diff -u lms/lib/upgradedb/mysql.2011110800.php:1.2 lms/lib/upgradedb/mysql.2011110800.php:1.3 --- lms/lib/upgradedb/mysql.2011110800.php:1.2 Wed Nov 9 10:34:06 2011 +++ lms/lib/upgradedb/mysql.2011110800.php Mon Nov 28 23:08:49 2011 @@ -21,21 +21,21 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: mysql.2011110800.php,v 1.2 2011/11/09 09:34:06 chilek Exp $ + * $Id: mysql.2011110800.php,v 1.3 2011/11/28 22:08:49 chilek Exp $ */ $DB->BeginTrans(); +$DB->Execute("DROP VIEW vnodes"); +$DB->Execute("DROP VIEW vmacs"); + $DB->Execute("ALTER TABLE nodes ADD longitude decimal(10, 6) DEFAULT NULL"); $DB->Execute("ALTER TABLE nodes ADD latitude decimal(10, 6) DEFAULT NULL"); -$DB->Execute("DROP VIEW vnodes"); $DB->Execute("CREATE VIEW vnodes AS SELECT n.*, m.mac FROM nodes n LEFT JOIN vnodes_mac m ON (n.id = m.nodeid)"); - -$DB->Execute("DROP VIEW vmacs"); $DB->Execute("CREATE VIEW vmacs AS SELECT n.*, m.mac, m.id AS macid FROM nodes n Index: lms/lib/upgradedb/postgres.2011110800.php diff -u lms/lib/upgradedb/postgres.2011110800.php:1.2 lms/lib/upgradedb/postgres.2011110800.php:1.3 --- lms/lib/upgradedb/postgres.2011110800.php:1.2 Wed Nov 9 10:34:06 2011 +++ lms/lib/upgradedb/postgres.2011110800.php Mon Nov 28 23:08:49 2011 @@ -21,23 +21,26 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: postgres.2011110800.php,v 1.2 2011/11/09 09:34:06 chilek Exp $ + * $Id: postgres.2011110800.php,v 1.3 2011/11/28 22:08:49 chilek Exp $ */ $DB->BeginTrans(); +$DB->Execute(" + DROP VIEW vnodes; + DROP VIEW vmacs; +"); + $DB->Execute("ALTER TABLE nodes ADD longitude numeric(10, 6) DEFAULT NULL"); $DB->Execute("ALTER TABLE nodes ADD latitude numeric(10, 6) DEFAULT NULL"); + $DB->Execute(" - DROP VIEW vnodes; 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); - - DROP VIEW vmacs; CREATE VIEW vmacs AS SELECT n.*, m.mac, m.id AS macid FROM nodes n From cvs w lms.org.pl Mon Nov 28 23:29:11 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 28 Nov 2011 23:29:11 +0100 (CET) Subject: [lms-commits] CVS update of lms/daemon/modules/ewx-pt (ewx-pt.c) Message-ID: <20111128222911.C7CDF302A040@eftep.altec.pl> Date: Monday, November 28, 2011 @ 23:29:11 Author: chilek Path: /cvsroot/lms/daemon/modules/ewx-pt Modified: ewx-pt.c - missed comma in sql query Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/daemon/modules/ewx-pt/ewx-pt.c.diff?&r1=1.17&r2=1.18 Index: lms/daemon/modules/ewx-pt/ewx-pt.c diff -u lms/daemon/modules/ewx-pt/ewx-pt.c:1.17 lms/daemon/modules/ewx-pt/ewx-pt.c:1.18 --- lms/daemon/modules/ewx-pt/ewx-pt.c:1.17 Wed Aug 31 12:58:13 2011 +++ lms/daemon/modules/ewx-pt/ewx-pt.c Mon Nov 28 23:29:11 2011 @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ewx-pt.c,v 1.17 2011/08/31 10:58:13 alec Exp $ + * $Id: ewx-pt.c,v 1.18 2011/11/28 22:29:11 chilek Exp $ */ #include @@ -181,9 +181,9 @@ g->db_free(&res); // existing nodes with current config for insert, update or delete (if access=0) - query = strdup("SELECT n.id, n.ipaddr, n.access " - "(SELECT m.mac FROM macs m WHERE m.nodeid = n.id ORDER BY m.id LIMIT 1) AS mac, " - "INET_NTOA(n.ipaddr) AS ip, LOWER(n.name) AS name, n.passwd, n.chkmac " + query = strdup("SELECT n.id, n.ipaddr, n.access, " + "(SELECT m.mac FROM macs m WHERE m.nodeid = n.id ORDER BY m.id LIMIT 1) AS mac, " + "INET_NTOA(n.ipaddr) AS ip, LOWER(n.name) AS name, n.passwd, n.chkmac " "FROM nodes n " "WHERE 1=1 " // skip disabled nodes when aren't in ewx_pt_config From cvs w lms.org.pl Tue Nov 29 01:09:50 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 29 Nov 2011 01:09:50 +0100 (CET) Subject: [lms-commits] CVS update of lms/daemon/modules/ewx-pt (ewx-pt.c) Message-ID: <20111129000950.CEA5E302A040@eftep.altec.pl> Date: Tuesday, November 29, 2011 @ 01:09:50 Author: chilek Path: /cvsroot/lms/daemon/modules/ewx-pt Modified: ewx-pt.c - fixed segfault in ewx-pt Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/daemon/modules/ewx-pt/ewx-pt.c.diff?&r1=1.18&r2=1.19 Index: lms/daemon/modules/ewx-pt/ewx-pt.c diff -u lms/daemon/modules/ewx-pt/ewx-pt.c:1.18 lms/daemon/modules/ewx-pt/ewx-pt.c:1.19 --- lms/daemon/modules/ewx-pt/ewx-pt.c:1.18 Mon Nov 28 23:29:11 2011 +++ lms/daemon/modules/ewx-pt/ewx-pt.c Tue Nov 29 01:09:50 2011 @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ewx-pt.c,v 1.18 2011/11/28 22:29:11 chilek Exp $ + * $Id: ewx-pt.c,v 1.19 2011/11/29 00:09:50 chilek Exp $ */ #include @@ -515,7 +515,7 @@ g->db_pexec(g->conn, "INSERT INTO ewx_pt_config (nodeid, name, passwd, ipaddr, mac) " "VALUES (?, '?', '?', INET_ATON('?'), '?')", - h.id, h.name, h.passwd, h.ip, h.mac); + itoa(h.id), h.name, h.passwd, h.ip, h.mac); #ifdef DEBUG1 syslog(LOG_INFO, "DEBUG: [%s/ewx-pt] Added node %s (%05d)", ewx->base.instance, h.name, h.id); #endif From cvs w lms.org.pl Tue Nov 29 01:27:13 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 29 Nov 2011 01:27:13 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20111129002713.1EC39302A040@eftep.altec.pl> Date: Tuesday, November 29, 2011 @ 01:27:13 Author: chilek Path: /cvsroot/lms/doc Modified: ChangeLog - added %if substitution symbol for interface name Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1620&r2=1.1621 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1620 lms/doc/ChangeLog:1.1621 --- lms/doc/ChangeLog:1.1620 Sat Nov 26 12:31:45 2011 +++ lms/doc/ChangeLog Tue Nov 29 01:27:12 2011 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1620 2011/11/26 11:31:45 chilek Exp $ +$Id: ChangeLog,v 1.1621 2011/11/29 00:27:12 chilek Exp $ version ? (????-??-??): @@ -72,6 +72,7 @@ - possibility to show selected device or node on map [chilan] - we can send sms to any phone number from outside database [chilan] - can send any sms to selected users [chilan] + - added %if substitution symbol for interface name [chilan] version 1.11.13 Dira (2011-04-07) From cvs w lms.org.pl Tue Nov 29 01:27:13 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 29 Nov 2011 01:27:13 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (ping.php) Message-ID: <20111129002713.4102D302A041@eftep.altec.pl> Date: Tuesday, November 29, 2011 @ 01:27:13 Author: chilek Path: /cvsroot/lms/modules Modified: ping.php - added %if substitution symbol for interface name Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/ping.php.diff?&r1=1.12&r2=1.13 Index: lms/modules/ping.php diff -u lms/modules/ping.php:1.12 lms/modules/ping.php:1.13 --- lms/modules/ping.php:1.12 Sat Nov 19 19:08:55 2011 +++ lms/modules/ping.php Tue Nov 29 01:27:13 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ping.php,v 1.12 2011/11/19 18:08:55 chilek Exp $ + * $Id: ping.php,v 1.13 2011/11/29 00:27:13 chilek Exp $ */ function refresh($params) @@ -30,6 +30,7 @@ // xajax response $objResponse = new xajaxResponse(); + $iface = $params['interface']; $ipaddr = $params['ipaddr']; $received = $params['received']; $transmitted = $params['transmitted']; @@ -37,6 +38,7 @@ $cmd = 'sudo ping %i -c 1 -s 1450 -w 1.0'; else $cmd = $CONFIG['phpui']['ping_helper']; + $cmd = preg_replace('/%if/', $iface, $cmd); $cmd = preg_replace('/%i/', $ipaddr, $cmd); exec($cmd, $output); $sent = preg_grep('/^[0-9]+[[:blank:]]+packets[[:blank:]]+transmitted/i', $output); @@ -106,7 +108,12 @@ $layout['pagetitle'] = trans('Ping'); if (isset($_GET['ip']) && check_ip($_GET['ip'])) +{ $SMARTY->assign('ipaddr', $_GET['ip']); + $netid = $LMS->GetNetIDByIP($_GET['ip']); + if ($netid) + $SMARTY->assign('interface', $DB->GetOne('SELECT interface FROM networks WHERE id = ?', array($netid))); +} $SMARTY->display('ping.html'); From cvs w lms.org.pl Tue Nov 29 01:27:13 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 29 Nov 2011 01:27:13 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (ping.html) Message-ID: <20111129002713.617E0302A042@eftep.altec.pl> Date: Tuesday, November 29, 2011 @ 01:27:13 Author: chilek Path: /cvsroot/lms/templates Modified: ping.html - added %if substitution symbol for interface name Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/ping.html.diff?&r1=1.17&r2=1.18 Index: lms/templates/ping.html diff -u lms/templates/ping.html:1.17 lms/templates/ping.html:1.18 --- lms/templates/ping.html:1.17 Sat Nov 19 20:12:11 2011 +++ lms/templates/ping.html Tue Nov 29 01:27:13 2011 @@ -22,7 +22,7 @@ {else} - + @@ -51,6 +51,7 @@
+ From cvs w lms.org.pl Tue Nov 29 02:22:08 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 29 Nov 2011 02:22:08 +0100 (CET) Subject: [lms-commits] CVS update of lms/daemon/modules/ewx-pt (ewx-pt.c) Message-ID: <20111129012208.93B2D302A040@eftep.altec.pl> Date: Tuesday, November 29, 2011 @ 02:22:08 Author: chilek Path: /cvsroot/lms/daemon/modules/ewx-pt Modified: ewx-pt.c - typo Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/daemon/modules/ewx-pt/ewx-pt.c.diff?&r1=1.19&r2=1.20 Index: lms/daemon/modules/ewx-pt/ewx-pt.c diff -u lms/daemon/modules/ewx-pt/ewx-pt.c:1.19 lms/daemon/modules/ewx-pt/ewx-pt.c:1.20 --- lms/daemon/modules/ewx-pt/ewx-pt.c:1.19 Tue Nov 29 01:09:50 2011 +++ lms/daemon/modules/ewx-pt/ewx-pt.c Tue Nov 29 02:22:08 2011 @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ewx-pt.c,v 1.19 2011/11/29 00:09:50 chilek Exp $ + * $Id: ewx-pt.c,v 1.20 2011/11/29 01:22:08 chilek Exp $ */ #include @@ -146,7 +146,7 @@ if(j != mnc) { - syslog(LOG_ERR, "[%s/ewx-stm] Network %s already included in 'dummy_mac_networks' option. Skipping.", all_nets[i].name, ewx->base.instance); + syslog(LOG_ERR, "[%s/ewx-pt] Network %s already included in 'dummy_mac_networks' option. Skipping.", all_nets[i].name, ewx->base.instance); continue; } From cvs w lms.org.pl Tue Nov 29 20:34:51 2011 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 29 Nov 2011 20:34:51 +0100 (CET) Subject: [lms-commits] CVS update of lms/daemon/modules/ewx-pt (ewx-pt.c) Message-ID: <20111129193451.E82F3302A040@eftep.altec.pl> Date: Tuesday, November 29, 2011 @ 20:34:51 Author: chilek Path: /cvsroot/lms/daemon/modules/ewx-pt Modified: ewx-pt.c - fixed "copy-paste" bugs Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/daemon/modules/ewx-pt/ewx-pt.c.diff?&r1=1.20&r2=1.21 Index: lms/daemon/modules/ewx-pt/ewx-pt.c diff -u lms/daemon/modules/ewx-pt/ewx-pt.c:1.20 lms/daemon/modules/ewx-pt/ewx-pt.c:1.21 --- lms/daemon/modules/ewx-pt/ewx-pt.c:1.20 Tue Nov 29 02:22:08 2011 +++ lms/daemon/modules/ewx-pt/ewx-pt.c Tue Nov 29 20:34:51 2011 @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ewx-pt.c,v 1.20 2011/11/29 01:22:08 chilek Exp $ + * $Id: ewx-pt.c,v 1.21 2011/11/29 19:34:51 chilek Exp $ */ #include @@ -169,13 +169,13 @@ for (hc=0; hcdb_nrows(res); hc++) { hosts = (struct host*) realloc(hosts, (sizeof(struct host) * (hc+1))); - hosts[hc].id = atoi(g->db_get_data(res, anc, "nodeid")); - hosts[hc].nodeid = atoi(g->db_get_data(res, anc, "id")); - hosts[hc].name = strdup(g->db_get_data(res, anc, "name")); - hosts[hc].mac = strdup(g->db_get_data(res, anc, "mac")); - hosts[hc].passwd = strdup(g->db_get_data(res, anc, "passwd")); - hosts[hc].ip = strdup(g->db_get_data(res, anc, "ip")); - hosts[hc].ipaddr = inet_addr(g->db_get_data(res, anc, "ipaddr")); + hosts[hc].id = atoi(g->db_get_data(res, hc, "nodeid")); + hosts[hc].nodeid = atoi(g->db_get_data(res, hc, "id")); + hosts[hc].name = strdup(g->db_get_data(res, hc, "name")); + hosts[hc].mac = strdup(g->db_get_data(res, hc, "mac")); + hosts[hc].passwd = strdup(g->db_get_data(res, hc, "passwd")); + hosts[hc].ip = strdup(g->db_get_data(res, hc, "ip")); + hosts[hc].ipaddr = inet_addr(g->db_get_data(res, hc, "ipaddr")); hosts[hc].status = UNKNOWN; } g->db_free(&res); @@ -304,9 +304,9 @@ } // Other node with matching credentials (name, ip, mac) else if (hosts[n].status == UNKNOWN) { - if (strcmp(hosts[n].name, h.name) + if (!strcmp(hosts[n].name, h.name) ) { - del_node(g, ewx, sh, &hosts[i]); + del_node(g, ewx, sh, &hosts[n]); savetables = 1; } } @@ -321,6 +321,8 @@ update_node(g, ewx, sh, &h, &hosts[found]); savetables = 1; } + else + hosts[found].status = STATUS_OK; } else { add_node(g, ewx, sh, &h);