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"}