From cvs w lms.org.pl Thu Aug 25 14:27:47 2011 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 25 Aug 2011 14:27:47 +0200 (CEST) Subject: [lms-commits] CVS update of lms/bin (lms-notify-sms) Message-ID: <20110825122747.2E9CA30278A0@eftep.altec.pl> Date: Thursday, August 25, 2011 @ 14:27:47 Author: alec Path: /cvsroot/lms/bin Modified: lms-notify-sms - Fixed wrong prefix, when the prefix is set to empty string Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-notify-sms.diff?&r1=1.44&r2=1.45 Index: lms/bin/lms-notify-sms diff -u lms/bin/lms-notify-sms:1.44 lms/bin/lms-notify-sms:1.45 --- lms/bin/lms-notify-sms:1.44 Tue Jan 18 09:11:58 2011 +++ lms/bin/lms-notify-sms Thu Aug 25 14:27:46 2011 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-notify-sms,v 1.44 2011/01/18 08:11:58 alec Exp $ +# $Id: lms-notify-sms,v 1.45 2011/08/25 12:27:46 alec Exp $ use strict; use DBI; @@ -171,7 +171,9 @@ } $query->finish(); -$cfg{'prefix'} = sprintf("%d", $cfg{'prefix'}); +if ($cfg{'prefix'} ne '') { + $cfg{'prefix'} = sprintf("%d", $cfg{'prefix'}); +} if ($script_service) { $cfg{'service'} = $script_service; From cvs w lms.org.pl Mon Aug 29 13:30:35 2011 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 29 Aug 2011 13:30:35 +0200 (CEST) Subject: [lms-commits] CVS update of lms/doc (lms.pgsql) Message-ID: <20110829113035.CDE9430278A0@eftep.altec.pl> Date: Monday, August 29, 2011 @ 13:30:35 Author: alec Path: /cvsroot/lms/doc Modified: lms.pgsql - Fixed DDL script Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.pgsql.diff?&r1=1.185&r2=1.186 Index: lms/doc/lms.pgsql diff -u lms/doc/lms.pgsql:1.185 lms/doc/lms.pgsql:1.186 --- lms/doc/lms.pgsql:1.185 Wed May 25 08:24:55 2011 +++ lms/doc/lms.pgsql Mon Aug 29 13:30:35 2011 @@ -1,4 +1,4 @@ -/* $Id: lms.pgsql,v 1.185 2011/05/25 06:24:55 alec Exp $ */ +/* $Id: lms.pgsql,v 1.186 2011/08/29 11:30:35 alec Exp $ */ /* -------------------------------------------------------- Structure of table "users" @@ -636,15 +636,6 @@ /* -------------------------------------------------- Tables for RT (Helpdesk) -----------------------------------------------------*/ -DROP TABLE IF EXISTS rtattachments CASCADE; -CREATE TABLE rtattachments ( - messageid integer NOT NULL - REFERENCES rtmessages (id) ON DELETE CASCADE ON UPDATE CASCADE, - filename varchar(255) DEFAULT '' NOT NULL, - contenttype varchar(255) DEFAULT '' NOT NULL -); - -CREATE INDEX rtattachments_message_idx ON rtattachments (messageid); DROP SEQUENCE IF EXISTS rtqueues_id_seq; CREATE SEQUENCE rtqueues_id_seq; @@ -735,6 +726,16 @@ CONSTRAINT rtrights_userid_key UNIQUE (userid, queueid) ); +DROP TABLE IF EXISTS rtattachments CASCADE; +CREATE TABLE rtattachments ( + messageid integer NOT NULL + REFERENCES rtmessages (id) ON DELETE CASCADE ON UPDATE CASCADE, + filename varchar(255) DEFAULT '' NOT NULL, + contenttype varchar(255) DEFAULT '' NOT NULL +); + +CREATE INDEX rtattachments_message_idx ON rtattachments (messageid); + /* --------------------------------------------------- Structure of table "passwd" (accounts) ------------------------------------------------------*/ From cvs w lms.org.pl Wed Aug 31 12:46:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 31 Aug 2011 12:46:45 +0200 (CEST) Subject: [lms-commits] CVS update of lms/img (common.js, location.png) Message-ID: <20110831104645.9F44F30278A2@eftep.altec.pl> Date: Wednesday, August 31, 2011 @ 12:46:45 Author: alec Path: /cvsroot/lms/img Added: location.png Modified: common.js - Implemented nodes/devices localization database - lms-teryt: Script for Polish TERYT localization database import Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/img/common.js.diff?&r1=1.34&r2=1.35 http://cvs.lms.org.pl/viewvc/Development/lms/img/location.png?rev=1.1 Index: lms/img/common.js diff -u lms/img/common.js:1.34 lms/img/common.js:1.35 --- lms/img/common.js:1.34 Thu Mar 31 13:11:21 2011 +++ lms/img/common.js Wed Aug 31 12:46:45 2011 @@ -77,6 +77,11 @@ return openSelectWindow('?m=choosenode&id='+customerid,'choosenode',350,200,'true',formfield); } +function locationchoosewin(varname, formname, city, street) +{ + return openSelectWindow('?m=chooselocation&name='+varname+'&form='+formname+'&city='+city+'&street='+street,'chooselocation',350,200,'true'); +} + function sendvalue(targetfield, value) { targetfield.value = value; @@ -351,3 +356,22 @@ o3_removecounter++; return nd(); } + +function check_teryt(locid, init) +{ + var checked = document.getElementById('teryt').checked; + + if (locid) { + var loc = document.getElementById(locid); + if (checked) { + if (!init) + loc.value = ''; + loc.setAttribute('readonly', true); + } + else { + loc.removeAttribute('readonly'); + } + } + + return checked; +} \ No newline at end of file Index: lms/img/location.png <> From cvs w lms.org.pl Wed Aug 31 12:46:45 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 31 Aug 2011 12:46:45 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib (4 files) Message-ID: <20110831104645.EBC9130278A3@eftep.altec.pl> Date: Wednesday, August 31, 2011 @ 12:46:45 Author: alec Path: /cvsroot/lms/lib Modified: LMS.class.php accesstable.php common.php upgradedb.php - Implemented nodes/devices localization database - lms-teryt: Script for Polish TERYT localization database import Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMS.class.php.diff?&r1=1.1070&r2=1.1071 http://cvs.lms.org.pl/viewvc/Development/lms/lib/accesstable.php.diff?&r1=1.140&r2=1.141 http://cvs.lms.org.pl/viewvc/Development/lms/lib/common.php.diff?&r1=1.126&r2=1.127 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb.php.diff?&r1=1.192&r2=1.193 Index: lms/lib/LMS.class.php diff -u lms/lib/LMS.class.php:1.1070 lms/lib/LMS.class.php:1.1071 --- lms/lib/LMS.class.php:1.1070 Thu Apr 21 13:52:57 2011 +++ lms/lib/LMS.class.php Wed Aug 31 12:46:45 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMS.class.php,v 1.1070 2011/04/21 11:52:57 alec Exp $ + * $Id: LMS.class.php,v 1.1071 2011/08/31 10:46:45 alec 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.1070 $'; + var $_revision = '$Revision: 1.1071 $'; function LMS(&$DB, &$AUTH, &$CONFIG) // class variables setting { @@ -957,8 +957,7 @@ if ($result = $this->DB->GetAll('SELECT id, name, mac, ipaddr, inet_ntoa(ipaddr) AS ip, ipaddr_pub, inet_ntoa(ipaddr_pub) AS ip_pub, passwd, access, - warning, info, ownerid, lastonline, - location_address, location_zip, location_city, + warning, info, ownerid, lastonline, location, (SELECT COUNT(*) FROM nodegroupassignments WHERE nodeid = vnodes.id) AS gcount FROM vnodes @@ -1270,8 +1269,8 @@ { $this->DB->Execute('UPDATE nodes SET name=UPPER(?), ipaddr_pub=inet_aton(?), ipaddr=inet_aton(?), passwd=?, netdev=?, moddate=?NOW?, - modid=?, access=?, warning=?, ownerid=?, info=?, - location_address=?, location_zip=?, location_city=?, + modid=?, access=?, warning=?, ownerid=?, info=?, location=?, + location_city=?, location_street=?, location_house=?, location_flat=?, chkmac=?, halfduplex=?, linktype=?, port=?, nas=? WHERE id=?', array($nodedata['name'], @@ -1284,9 +1283,11 @@ $nodedata['warning'], $nodedata['ownerid'], $nodedata['info'], - $nodedata['location_address'], - $nodedata['location_zip'], - $nodedata['location_city'], + $nodedata['location'], + $nodedata['location_city'] ? $nodedata['location_city'] : null, + $nodedata['location_street'] ? $nodedata['location_street'] : null, + $nodedata['location_house'] ? $nodedata['location_house'] : null, + $nodedata['location_flat'] ? $nodedata['location_flat'] : null, $nodedata['chkmac'], $nodedata['halfduplex'], isset($nodedata['linktype']) ? 1 : 0, @@ -1295,8 +1296,6 @@ $nodedata['id'] )); - $this->UpdateCountryState($nodedata['location_zip'], $nodedata['stateid']); - $this->DB->Execute('DELETE FROM macs WHERE nodeid=?', array($nodedata['id'])); foreach($nodedata['macs'] as $mac) { $this->DB->Execute('INSERT INTO macs (mac, nodeid) VALUES(?, ?)', @@ -1364,11 +1363,15 @@ function GetNode($id) { - if($result = $this->DB->GetRow('SELECT vnodes.*, - inet_ntoa(ipaddr) AS ip, inet_ntoa(ipaddr_pub) AS ip_pub - FROM vnodes - WHERE id = ?', array($id))) - { + if ($result = $this->DB->GetRow('SELECT n.*, + inet_ntoa(n.ipaddr) AS ip, inet_ntoa(n.ipaddr_pub) AS ip_pub, + lc.name AS city_name, ls.name AS street_name, lt.name AS street_type + FROM vnodes n + LEFT JOIN location_cities lc ON (lc.id = n.location_city) + LEFT JOIN location_streets ls ON (ls.id = n.location_street) + LEFT JOIN location_street_types lt ON (lt.id = ls.typeid) + WHERE n.id = ?', array($id)) + ) { $result['owner'] = $this->GetCustomerName($result['ownerid']); $result['createdby'] = $this->GetUserName($result['creatorid']); $result['modifiedby'] = $this->GetUserName($result['modid']); @@ -1388,15 +1391,6 @@ $result['netname'] = $net['name']; } - // Get state name - if ($result['location_zip'] && ($cstate = $this->DB->GetRow('SELECT s.id, s.name - FROM states s, zipcodes - WHERE zip = ? AND stateid = s.id', array($result['location_zip']))) - ) { - $result['stateid'] = $cstate['id']; - $result['cstate'] = $cstate['name']; - } - return $result; } else return FALSE; @@ -1563,10 +1557,10 @@ { if($this->DB->Execute('INSERT INTO nodes (name, ipaddr, ipaddr_pub, ownerid, passwd, creatorid, creationdate, access, warning, info, netdev, - location_address, location_zip, location_city, + location, location_city, location_street, location_house, location_flat, linktype, port, chkmac, halfduplex, nas) - VALUES (?, inet_aton(?),inet_aton(?), ?, ?, ?, - ?NOW?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + VALUES (?, inet_aton(?), inet_aton(?), ?, ?, ?, + ?NOW?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array(strtoupper($nodedata['name']), $nodedata['ipaddr'], $nodedata['ipaddr_pub'], @@ -1577,9 +1571,11 @@ $nodedata['warning'], $nodedata['info'], $nodedata['netdev'], - $nodedata['location_address'], - $nodedata['location_zip'], - $nodedata['location_city'], + $nodedata['location'], + $nodedata['location_city'] ? $nodedata['location_city'] : null, + $nodedata['location_street'] ? $nodedata['location_street'] : null, + $nodedata['location_house'] ? $nodedata['location_house'] : null, + $nodedata['location_flat'] ? $nodedata['location_flat'] : null, isset($nodedata['linktype']) ? 1 : 0, isset($nodedata['port']) && $nodedata['netdev'] ? intval($nodedata['port']) : 0, $nodedata['chkmac'], @@ -1589,8 +1585,6 @@ { $id = $this->DB->GetLastInsertID('nodes'); - $this->UpdateCountryState($nodedata['location_zip'], $nodedata['stateid']); - foreach($nodedata['macs'] as $mac) $this->DB->Execute('INSERT INTO macs (mac, nodeid) VALUES(?, ?)', array(strtoupper($mac), $id)); @@ -3263,10 +3257,10 @@ break; } - $netdevlist = $this->DB->GetAll('SELECT d.id, d.name, d.location, - d.description, d.producer, d.model, d.serialnumber, d.ports, + $netdevlist = $this->DB->GetAll('SELECT d.id, d.name, d.location, + d.description, d.producer, d.model, d.serialnumber, d.ports, (SELECT COUNT(*) FROM nodes WHERE netdev=d.id AND ownerid > 0) - + (SELECT COUNT(*) FROM netlinks WHERE src = d.id OR dst = d.id) + + (SELECT COUNT(*) FROM netlinks WHERE src = d.id OR dst = d.id) AS takenports FROM netdevices d ' .($sqlord != '' ? $sqlord.' '.$direction : '')); @@ -3299,10 +3293,14 @@ function GetNetDev($id) { - $result = $this->DB->GetRow('SELECT d.*, t.name AS nastypename, c.name AS channel + $result = $this->DB->GetRow('SELECT d.*, t.name AS nastypename, c.name AS channel, + lc.name AS city_name, ls.name AS street_name, lt.name AS street_type FROM netdevices d LEFT JOIN nastypes t ON (t.id = d.nastype) LEFT JOIN ewx_channels c ON (d.channelid = c.id) + LEFT JOIN location_cities lc ON (lc.id = d.location_city) + LEFT JOIN location_streets ls ON (ls.id = d.location_street) + LEFT JOIN location_street_types lt ON (lt.id = ls.typeid) WHERE d.id = ?', array($id)); $result['takenports'] = $this->CountNetDevLinks($id); @@ -3331,30 +3329,34 @@ $this->DB->Execute('DELETE FROM netdevices WHERE id=?', array($id)); $this->DB->CommitTrans(); } - function NetDevAdd($netdevdata) + function NetDevAdd($data) { - if ($this->DB->Execute('INSERT INTO netdevices (name, location, - description, producer, model, serialnumber, + if ($this->DB->Execute('INSERT INTO netdevices (name, location, + location_city, location_street, location_house, location_flat, + description, producer, model, serialnumber, ports, purchasetime, guaranteeperiod, shortname, - nastype, clients, secret, community, channelid) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', - array($netdevdata['name'], - $netdevdata['location'], - $netdevdata['description'], - $netdevdata['producer'], - $netdevdata['model'], - $netdevdata['serialnumber'], - $netdevdata['ports'], - $netdevdata['purchasetime'], - $netdevdata['guaranteeperiod'], - $netdevdata['shortname'], - $netdevdata['nastype'], - $netdevdata['clients'], - $netdevdata['secret'], - $netdevdata['community'], - !empty($netdevdata['channelid']) ? $netdevdata['channelid'] : NULL, + nastype, clients, secret, community, channelid) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + array($data['name'], + $data['location'], + $data['location_city'] ? $data['location_city'] : null, + $data['location_street'] ? $data['location_street'] : null, + $data['location_house'] ? $data['location_house'] : null, + $data['location_flat'] ? $data['location_flat'] : null, + $data['description'], + $data['producer'], + $data['model'], + $data['serialnumber'], + $data['ports'], + $data['purchasetime'], + $data['guaranteeperiod'], + $data['shortname'], + $data['nastype'], + $data['clients'], + $data['secret'], + $data['community'], + !empty($data['channelid']) ? $data['channelid'] : NULL, ))) { - $id = $this->DB->GetLastInsertID('netdevices'); // EtherWerX support (devices have some limits) @@ -3363,7 +3365,7 @@ { $this->DB->BeginTrans(); $this->DB->LockTables('ewx_channels'); - + if($newid = $this->DB->GetOne('SELECT n.id + 1 FROM ewx_channels n LEFT OUTER JOIN ewx_channels n2 ON n.id + 1 = n2.id WHERE n2.id IS NULL AND n.id <= 99999 @@ -3372,39 +3374,44 @@ $this->DB->Execute('UPDATE ewx_channels SET id = ? WHERE id = ?', array($newid, $id)); $id = $newid; } - + $this->DB->UnLockTables(); $this->DB->CommitTrans(); } - + return $id; } else return FALSE; } - function NetDevUpdate($netdevdata) + function NetDevUpdate($data) { - $this->DB->Execute('UPDATE netdevices SET name=?, location=?, description=?, producer=?, + $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=? WHERE id=?', - array( $netdevdata['name'], - $netdevdata['location'], - $netdevdata['description'], - $netdevdata['producer'], - $netdevdata['model'], - $netdevdata['serialnumber'], - $netdevdata['ports'], - $netdevdata['purchasetime'], - $netdevdata['guaranteeperiod'], - $netdevdata['shortname'], - $netdevdata['nastype'], - $netdevdata['clients'], - $netdevdata['secret'], - $netdevdata['community'], - !empty($netdevdata['channelid']) ? $netdevdata['channelid'] : NULL, - $netdevdata['id'] + array($data['name'], + $data['description'], + $data['producer'], + $data['location'], + $data['location_city'] ? $data['location_city'] : null, + $data['location_street'] ? $data['location_street'] : null, + $data['location_house'] ? $data['location_house'] : null, + $data['location_flat'] ? $data['location_flat'] : null, + $data['model'], + $data['serialnumber'], + $data['ports'], + $data['purchasetime'], + $data['guaranteeperiod'], + $data['shortname'], + $data['nastype'], + $data['clients'], + $data['secret'], + $data['community'], + !empty($data['channelid']) ? $data['channelid'] : NULL, + $data['id'] )); } Index: lms/lib/accesstable.php diff -u lms/lib/accesstable.php:1.140 lms/lib/accesstable.php:1.141 --- lms/lib/accesstable.php:1.140 Wed Mar 16 16:24:24 2011 +++ lms/lib/accesstable.php Wed Aug 31 12:46:45 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: accesstable.php,v 1.140 2011/03/16 15:24:24 chilek Exp $ + * $Id: accesstable.php,v 1.141 2011/08/31 10:46:45 alec Exp $ */ unset($access); @@ -47,7 +47,7 @@ $access['table'][5]['allow_reg'] = '^((customer|document)(add|edit|info|infoshort|list|del|print|search|warn|cutoffstop|group)|documentgen|documentview|nodewarn|choosenode)$'; $access['table'][6]['name'] = trans('nodes management'); -$access['table'][6]['allow_reg'] = '^(node(add|info|infoshort|list|listshort|scan|search|del|edit|print|warn)|choose(mac|ip))$'; +$access['table'][6]['allow_reg'] = '^(node(add|info|infoshort|list|listshort|scan|search|del|edit|print|warn)|choose(mac|ip|location))$'; $access['table'][7]['name'] = trans('traffic stats'); $access['table'][7]['allow_reg'] = '^(traffic|traffic(print|graph))$'; @@ -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)$'; +$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'][14]['name'] = trans('timetable management'); $access['table'][14]['allow_reg'] = '^(event(list|edit|add|del|info|print|search)|choosecustomer)$'; Index: lms/lib/common.php diff -u lms/lib/common.php:1.126 lms/lib/common.php:1.127 --- lms/lib/common.php:1.126 Tue Jan 18 09:12:05 2011 +++ lms/lib/common.php Wed Aug 31 12:46:45 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: common.php,v 1.126 2011/01/18 08:12:05 alec Exp $ + * $Id: common.php,v 1.127 2011/08/31 10:46:45 alec Exp $ */ // Common functions, that making it in class would be nonsense :) @@ -688,6 +688,30 @@ } } +function location_str($data) +{ + $location = $data['city_name']; + + if ($data['location_flat']) { + $h = $CONFIG['phpui']['house_template'] ? $CONFIG['phpui']['house_template'] : '%h/%f'; + $h = str_replace('%h', $data['location_house'], $h); + $h = str_replace('%f', $data['location_flat'], $h); + } + else + $h = $data['location_house']; + + if ($data['street_name']) { + $street = $data['street_type'] .' '. $data['street_name']; + $location .= ($location ? ', ' : '') . $street; + } + + if ($h) + $location .= ' ' . $h; + + return $location; +} + + /* Functions for modularized LMS */ function plugin_handle($name) { Index: lms/lib/upgradedb.php diff -u lms/lib/upgradedb.php:1.192 lms/lib/upgradedb.php:1.193 --- lms/lib/upgradedb.php:1.192 Fri Apr 15 19:47:28 2011 +++ lms/lib/upgradedb.php Wed Aug 31 12:46:45 2011 @@ -21,10 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: upgradedb.php,v 1.192 2011/04/15 17:47:28 alec Exp $ + * $Id: upgradedb.php,v 1.193 2011/08/31 10:46:45 alec Exp $ */ -define('DBVERSION', '2011041500'); // here should be always the newest version of database! +define('DBVERSION', '2011082800'); // 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 Wed Aug 31 12:46:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 31 Aug 2011 12:46:46 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20110831104646.30F5230278A4@eftep.altec.pl> Date: Wednesday, August 31, 2011 @ 12:46:46 Author: alec Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - Implemented nodes/devices localization database - lms-teryt: Script for Polish TERYT localization database import Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.390&r2=1.391 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.390 lms/lib/locale/pl/strings.php:1.391 --- lms/lib/locale/pl/strings.php:1.390 Thu Apr 7 12:28:16 2011 +++ lms/lib/locale/pl/strings.php Wed Aug 31 12:46:45 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.390 2011/04/07 10:28:16 alec Exp $ + * $Id: strings.php,v 1.391 2011/08/31 10:46:45 alec Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresów)'; @@ -454,7 +454,6 @@ $_LANG['Enter date of settlement in YYYY/MM/DD format (empty field means current date) or click to select it from calendar'] = 'Wprowadź datę wystawienia w formacie RRRR/MM/DD lub kliknij by wybrać ją z kalendarza. Puste pole oznacza datę dzisiejszą'; $_LANG['Enter deadline in days (optional)'] = 'Wprowadź termin zapłaty w dniach (opcjonalnie)'; $_LANG['Enter description (optional)'] = 'Wprowadź opis (opcjonalnie)'; -$_LANG['Enter device location (optional)'] = 'Wprowadź lokalizację urządzenia (opcjonalnie)'; $_LANG['Enter device model (optional)'] = 'Wprowadź model urządzenia (opcjonalnie)'; $_LANG['Enter device name'] = 'Wprowadź nazwę urządzenia'; $_LANG['Enter device producer (optional)'] = 'Wprowadź producenta urządzenia (opcjonalnie)'; @@ -484,6 +483,7 @@ $_LANG['Enter last address of DHCP range (optional)'] = 'Wprowadź końcowy adres zakresu DHCP (opcjonalnie)'; $_LANG['Enter limit of packets in time unit (optional)'] = 'Wprowadź limit pakietów w jednostce czasu (opcjonalnie)'; $_LANG['Enter limit of simultaneous connections (optional)'] = 'Wprowadź limit równoczesnych połączeń (opcjonalnie)'; +$_LANG['Enter location (optional)'] = 'Wprowadź położenie (opcjonalnie)'; $_LANG['Enter MAC address'] = 'Wprowadź adres MAC'; $_LANG['Enter maximum download value (optional)'] = 'Wprowadź maksymalną wartość downloadu (opcjonalnie)'; $_LANG['Enter maximum upload value (optional)'] = 'Wprowadź maksymalną wartość uploadu (opcjonalnie)'; @@ -1660,8 +1660,7 @@ $_LANG['REGON'] = 'REGON'; $_LANG['REGON:'] = 'REGON:'; $_LANG['unknown'] = 'nieznany'; -$_LANG['Enter node location'] = 'Wprowadź lokalizację komputera'; -$_LANG['Enter node location (optional)'] = 'Wprowadź lokalizację komputera (opcjonalnie)'; +$_LANG['Enter node location'] = 'Wprowadź położenie komputera'; $_LANG['ICN:'] = 'Dowód osobisty:'; $_LANG['RBE:'] = 'EDG/KRS:'; $_LANG['Allows you to add new document'] = 'Dodanie nowego dokumentu'; @@ -2379,9 +2378,7 @@ $_LANG['fax'] = 'fax'; $_LANG['Select domain type'] = 'Wybierz typ domeny'; $_LANG['Enter city of service address (optional)'] = 'Wprowadź nazwę miasta dla adresu dodoręczeń (opcjonalnie)'; -$_LANG['Enter city (optional)'] = 'Wprowadź nazwę miasta (opcjonalnie)'; $_LANG['Enter zip code of service address (optional)'] = 'Wprowadź kod pocztowy dla adresu do doręczeń (opcjonalnie)'; -$_LANG['Enter zip code (optional)'] = 'Wprowadź kod pocztowy (opcjonalnie)'; $_LANG['All cash operations from that package will be lost.'] = 'Wszystkie operacje kasowe z tego pakietu zostaną usunięte.'; $_LANG['Are you sure, you want to delete this package and related operations?'] = 'Czy na pewno chcesz usunąć tą paczkę i powiązane operacje?'; $_LANG['Do you want to remove package "$0"?'] = 'Czy chesz usunąć paczkę "$0"?'; @@ -2462,5 +2459,28 @@ $_LANG['by date'] = 'wg daty'; $_LANG['Select date type'] = 'Wybierz typ daty'; $_LANG['in debt above 100%'] = 'zadłużeni ponad 100%'; +$_LANG[''] = 'gm.'; +$_LANG[''] = 'pow.'; +$_LANG['City'] = 'Miejscowość'; +$_LANG['Click to select location'] = 'Kliknij aby wybrać położenie'; +$_LANG['District'] = 'Powiat'; +$_LANG['Enter city name'] = 'Wprowadź nazwę miasta'; +$_LANG['Enter flat number'] = 'Wprowadź numer mieszkania'; +$_LANG['Enter house number'] = 'Wprowadź numer domu'; +$_LANG['Flat No.'] = 'Nr mieszkania'; +$_LANG['House No.'] = 'Nr domu'; +$_LANG['Location database is empty.'] = 'Baza adresowa jest pusta.'; +$_LANG['Select city'] = 'Wybierz miejscowość'; +$_LANG['Select district'] = 'Wybierz powiat'; +$_LANG['Select location'] = 'Wybierz położenie'; +$_LANG['Select state'] = 'Wybierz województwo'; +$_LANG['Select street'] = 'Wybierz ulicę'; +$_LANG['State'] = 'Województwo'; +$_LANG['Street'] = 'Ulica'; +$_LANG['TERRIT-DB'] = 'Baza TERYT'; +$_LANG['City has not been selected!'] = 'Nie wybrano miasta!'; +$_LANG['Flat number is too long (max. 8 characters)!'] = 'Numer mieszkania jest za długi (max. 8 znaków)!'; +$_LANG['House number is required!'] = 'Numer domu jest wymagany!'; +$_LANG['House number is too long (max. 8 characters)!'] = 'Numer domu jest za długi (max. 8 znaków)!'; ?> From cvs w lms.org.pl Wed Aug 31 12:46:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 31 Aug 2011 12:46:46 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/upgradedb (2 files) Message-ID: <20110831104646.6200A30278A2@eftep.altec.pl> Date: Wednesday, August 31, 2011 @ 12:46:46 Author: alec Path: /cvsroot/lms/lib/upgradedb Added: mysql.2011082800.php postgres.2011082800.php - Implemented nodes/devices localization database - lms-teryt: Script for Polish TERYT localization database import Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2011082800.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2011082800.php?rev=1.1 Index: lms/lib/upgradedb/mysql.2011082800.php diff -u /dev/null lms/lib/upgradedb/mysql.2011082800.php:1.1 --- /dev/null Wed Aug 31 12:46:46 2011 +++ lms/lib/upgradedb/mysql.2011082800.php Wed Aug 31 12:46:46 2011 @@ -0,0 +1,183 @@ +BeginTrans(); + +// wojewodztwa +$DB->Execute(" + CREATE TABLE location_states ( + id int(11) NOT NULL auto_increment, + ident varchar(8) NOT NULL, -- TERYT: WOJ + name varchar(64) NOT NULL, -- TERYT: NAZWA + PRIMARY KEY (id), + UNIQUE KEY name (name) + ) ENGINE=INNODB"); +// powiaty +$DB->Execute(" + CREATE TABLE location_districts ( + id int(11) NOT NULL auto_increment, + name varchar(64) NOT NULL, --TERYT: NAZWA + ident varchar(8) NOT NULL, --TERYT: POW + stateid int(11) NOT NULL --TERYT: WOJ + REFERENCES location_states (id) ON DELETE CASCADE ON UPDATE CASCADE, + PRIMARY KEY (id), + UNIQUE KEY stateid (stateid, name) + ) ENGINE=INNODB"); +// gminy +$DB->Execute(" + CREATE TABLE location_boroughs ( + id int(11) NOT NULL auto_increment, + name varchar(64) NOT NULL, -- TERYT: NAZWA + ident varchar(8) NOT NULL, -- TERYT: GMI + districtid int(11) NOT NULL + REFERENCES location_districts (id) ON DELETE CASCADE ON UPDATE CASCADE, + type smallint NOT NULL, -- TERYT: RODZ + PRIMARY KEY (id), + UNIQUE KEY districtid (districtid, name, type) + ) ENGINE=INNODB"); +// miasta +$DB->Execute(" + CREATE TABLE location_cities ( + id int(11) NOT NULL auto_increment, + ident varchar(8) NOT NULL, -- TERYT: SYM / SYMPOD + name varchar(64) NOT NULL, -- TERYT: NAZWA + cityid int(11) DEFAULT NULL + boroughid int(11) DEFAULT NULL + REFERENCES location_boroughs (id) ON DELETE CASCADE ON UPDATE CASCADE, + PRIMARY KEY (id), + INDEX cityid (cityid); + INDEX boroughid (boroughid, name); + ) ENGINE=INNODB"); +// cechy ulic +$DB->Execute(" + CREATE TABLE location_street_types ( + id int(11) NOT NULL auto_increment, + name varchar(8) NOT NULL, -- TERYT: CECHA + PRIMARY KEY (id) + ) ENGINE=INNODB"); +// ulice +$DB->Execute(" + CREATE TABLE location_streets ( + id int(11) NOT NULL auto_increment, + name varchar(64) NOT NULL, -- TERYT: NAZWA_1 + ident varchar(8) NOT NULL, -- TERYT: SYM_UL + typeid int(11) DEFAULT NULL + REFERENCES location_street_types (id) ON DELETE SET NULL ON UPDATE CASCADE, + cityid int(11) NOT NULL + REFERENCES location_cities (id) ON DELETE CASCADE ON UPDATE CASCADE, + PRIMARY KEY (id), + UNIQUE (cityid, name, ident) + ) ENGINE=INNODB"); + +// netdevices +$DB->Execute("ALTER TABLE netdevices ADD location_city int(11) DEFAULT NULL + REFERENCES location_cities (id) ON DELETE SET NULL ON UPDATE CASCADE"); +$DB->Execute("ALTER TABLE netdevices ADD location_street int(11) DEFAULT NULL + REFERENCES location_streets (id) ON DELETE SET NULL ON UPDATE CASCADE"); +$DB->Execute("ALTER TABLE netdevices ADD location_house varchar(8) DEFAULT NULL"); +$DB->Execute("ALTER TABLE netdevices ADD location_flat varchar(8) DEFAULT NULL"); +$DB->Execute("ALTER TABLE netdevices ADD INDEX location_street (location_street)"); +$DB->Execute("ALTER TABLE netdevices ADD INDEX location_city (location_city, location_street, location_house, location_flat)"); + +$DB->Execute("ALTER TABLE nodes ADD location varchar(255) DEFAULT NULL"); + +$nodes = $DB->GetAll("SELECT id, location_city AS city, location_address AS addr + FROM nodes WHERE location_city <> '' OR location_address <> ''"); +if ($nodes) foreach ($nodes as $n) { + $loc = $n['addr']; + if ($n['city'] && strpos($loc, $n['city']) === false) + $loc = $n['city'] . ($loc ? ', ' . $loc : ''); + + $DB->Execute("UPDATE nodes SET location = ? WHERE id = ?", array($loc, $n['id'])); +} + +// do we need zip code for node address? No. +$DB->Execute("ALTER TABLE nodes DROP location_zip CASCADE"); +$DB->Execute("ALTER TABLE nodes DROP location_city CASCADE"); +$DB->Execute("ALTER TABLE nodes DROP location_address CASCADE"); + +// nodes +$DB->Execute("ALTER TABLE nodes ADD location_city int(11) DEFAULT NULL + REFERENCES location_cities (id) ON DELETE SET NULL ON UPDATE CASCADE"); +$DB->Execute("ALTER TABLE nodes ADD location_street int(11) DEFAULT NULL + REFERENCES location_streets (id) ON DELETE SET NULL ON UPDATE CASCADE"); +$DB->Execute("ALTER TABLE nodes ADD location_house varchar(8) DEFAULT NULL"); +$DB->Execute("ALTER TABLE nodes ADD location_flat varchar(8) DEFAULT NULL"); +$DB->Execute("ALTER TABLE nodes ADD INDEX location_street (location_street)"); +$DB->Execute("ALTER TABLE nodes ADD INDEX location_city (location_city, location_street, location_house, location_flat)"); + +// TERYT database views (irrelevant fields are skipped) +$DB->Execute(" + CREATE VIEW teryt_terc AS + SELECT ident AS woj, '0' AS pow, '0' AS gmi, 0 AS rodz, + UPPER(name) AS nazwa + FROM location_states + UNION + SELECT s.ident AS woj, d.ident AS pow, '0' AS gmi, 0 AS rodz, + d.name AS nazwa + FROM location_districts d + JOIN location_states s ON (d.stateid = s.id) + UNION + SELECT s.ident AS woj, d.ident AS pow, b.ident AS gmi, b.type AS rodz, + b.name AS nazwa + FROM location_boroughs b + JOIN location_districts d ON (b.districtid = d.id) + JOIN location_states s ON (d.stateid = s.id) +"); +$DB->Execute(" + CREATE VIEW teryt_simc AS + SELECT s.ident AS woj, d.ident AS pow, b.ident AS gmi, b.type AS rodz_gmi, + c.ident AS sym, c.name AS nazwa, + (CASE WHEN cc.ident IS NOT NULL THEN cc.ident ELSE c.ident END) AS sympod + FROM location_cities c + JOIN location_boroughs b ON (c.boroughid = b.id) + JOIN location_districts d ON (b.districtid = d.id) + JOIN location_states s ON (d.stateid = s.id) + LEFT JOIN location_cities cc ON (c.cityid = cc.id) +"); +$DB->Execute(" + CREATE VIEW teryt_ulic AS + SELECT st.ident AS woj, d.ident AS pow, b.ident AS gmi, b.type AS rodz_gmi, + c.ident AS sym, s.ident AS sym_ul, s.name AS nazwa_1, t.name AS cecha, s.id + FROM location_streets s + JOIN location_street_types t ON (s.typeid = t.id) + JOIN location_cities c ON (s.cityid = c.id) + JOIN location_boroughs b ON (c.boroughid = b.id) + JOIN location_districts d ON (b.districtid = d.id) + JOIN location_states st ON (d.stateid = st.id) +"); +$DB->Execute(" + 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); +"); + +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2011060100', 'dbversion')); + +$DB->CommitTrans(); + +?> Index: lms/lib/upgradedb/postgres.2011082800.php diff -u /dev/null lms/lib/upgradedb/postgres.2011082800.php:1.1 --- /dev/null Wed Aug 31 12:46:46 2011 +++ lms/lib/upgradedb/postgres.2011082800.php Wed Aug 31 12:46:46 2011 @@ -0,0 +1,187 @@ +BeginTrans(); + +$DB->Execute(" + -- wojewodztwa + CREATE SEQUENCE location_states_id_seq; + CREATE TABLE location_states ( + id integer DEFAULT nextval('location_states_id_seq'::text) NOT NULL, + ident varchar(8) NOT NULL, -- TERYT: WOJ + name varchar(64) NOT NULL, -- TERYT: NAZWA + PRIMARY KEY (id), + UNIQUE (name) + ); + -- powiaty + CREATE SEQUENCE location_districts_id_seq; + CREATE TABLE location_districts ( + id integer DEFAULT nextval('location_districts_id_seq'::text) NOT NULL, + name varchar(64) NOT NULL, --TERYT: NAZWA + ident varchar(8) NOT NULL, --TERYT: POW + stateid integer NOT NULL --TERYT: WOJ + REFERENCES location_states (id) ON DELETE CASCADE ON UPDATE CASCADE, + PRIMARY KEY (id), + UNIQUE (stateid, name) + ); + + -- gminy + CREATE SEQUENCE location_boroughs_id_seq; + CREATE TABLE location_boroughs ( + id integer DEFAULT nextval('location_boroughs_id_seq'::text) NOT NULL, + name varchar(64) NOT NULL, -- TERYT: NAZWA + ident varchar(8) NOT NULL, -- TERYT: GMI + districtid integer NOT NULL + REFERENCES location_districts (id) ON DELETE CASCADE ON UPDATE CASCADE, + type smallint NOT NULL, -- TERYT: RODZ + PRIMARY KEY (id), + UNIQUE (districtid, name, type) + ); + + -- miasta + CREATE SEQUENCE location_cities_id_seq; + CREATE TABLE location_cities ( + id integer DEFAULT nextval('location_cities_id_seq'::text) NOT NULL, + ident varchar(8) NOT NULL, -- TERYT: SYM / SYMPOD + name varchar(64) NOT NULL, -- TERYT: NAZWA + cityid integer DEFAULT NULL, + boroughid integer DEFAULT NULL + REFERENCES location_boroughs (id) ON DELETE CASCADE ON UPDATE CASCADE, + PRIMARY KEY (id) + ); + CREATE INDEX location_cities_cityid ON location_cities (cityid); + CREATE INDEX location_cities_boroughid ON location_cities (boroughid, name); + + -- cechy ulic + CREATE SEQUENCE location_street_types_id_seq; + CREATE TABLE location_street_types ( + id integer DEFAULT nextval('location_street_types_id_seq'::text) NOT NULL, + name varchar(8) NOT NULL, -- TERYT: CECHA + PRIMARY KEY (id) + ); + -- ulice + CREATE SEQUENCE location_streets_id_seq; + CREATE TABLE location_streets ( + id integer DEFAULT nextval('location_streets_id_seq'::text) NOT NULL, + name varchar(64) NOT NULL, -- TERYT: NAZWA_1 + ident varchar(8) NOT NULL, -- TERYT: SYM_UL + typeid integer DEFAULT NULL + REFERENCES location_street_types (id) ON DELETE SET NULL ON UPDATE CASCADE, + cityid integer NOT NULL + REFERENCES location_cities (id) ON DELETE CASCADE ON UPDATE CASCADE, + PRIMARY KEY (id), + UNIQUE (cityid, name, ident) + ); + + -- netdevices + ALTER TABLE netdevices ADD location_street integer DEFAULT NULL + REFERENCES location_streets (id) ON DELETE SET NULL ON UPDATE CASCADE; + ALTER TABLE netdevices ADD location_city integer DEFAULT NULL + REFERENCES location_cities (id) ON DELETE SET NULL ON UPDATE CASCADE; + ALTER TABLE netdevices ADD location_house varchar(8) DEFAULT NULL; + ALTER TABLE netdevices ADD location_flat varchar(8) DEFAULT NULL; + CREATE INDEX netdevices_location_street_idx ON netdevices (location_street); + CREATE INDEX netdevices_location_city_idx ON netdevices (location_city, location_street, location_house, location_flat); + + -- nodes + ALTER TABLE nodes ADD location varchar(255) DEFAULT NULL; +"); + +$nodes = $DB->GetAll("SELECT id, location_city AS city, location_address AS addr + FROM nodes WHERE location_city <> '' OR location_address <> ''"); + +if ($nodes) foreach ($nodes as $n) { + $loc = $n['addr']; + if ($n['city'] && strpos($loc, $n['city']) === false) + $loc = $n['city'] . ($loc ? ', ' . $loc : ''); + + $DB->Execute("UPDATE nodes SET location = ? WHERE id = ?", array($loc, $n['id'])); +} + +$DB->Execute(" + -- do we need zip code for node address? No. + ALTER TABLE nodes DROP location_zip CASCADE; + ALTER TABLE nodes DROP location_city CASCADE; + ALTER TABLE nodes DROP location_address CASCADE; + + -- nodes + ALTER TABLE nodes ADD location_city integer DEFAULT NULL + REFERENCES location_cities (id) ON DELETE SET NULL ON UPDATE CASCADE; + ALTER TABLE nodes ADD location_street integer DEFAULT NULL + REFERENCES location_streets (id) ON DELETE SET NULL ON UPDATE CASCADE; + ALTER TABLE nodes ADD location_house varchar(8) DEFAULT NULL; + ALTER TABLE nodes ADD location_flat varchar(8) DEFAULT NULL; + CREATE INDEX nodes_location_street_idx ON nodes (location_street); + CREATE INDEX nodes_location_city_idx ON nodes (location_city, location_street, location_house, location_flat); + + -- TERYT database views (irrelevant fields are skipped) + CREATE VIEW teryt_terc AS + SELECT ident AS woj, 0::text AS pow, 0::text AS gmi, 0 AS rodz, + UPPER(name) AS nazwa + FROM location_states + UNION + SELECT s.ident AS woj, d.ident AS pow, 0::text AS gmi, 0 AS rodz, + d.name AS nazwa + FROM location_districts d + JOIN location_states s ON (d.stateid = s.id) + UNION + SELECT s.ident AS woj, d.ident AS pow, b.ident AS gmi, b.type AS rodz, + b.name AS nazwa + FROM location_boroughs b + JOIN location_districts d ON (b.districtid = d.id) + JOIN location_states s ON (d.stateid = s.id); + + CREATE VIEW teryt_simc AS + SELECT s.ident AS woj, d.ident AS pow, b.ident AS gmi, b.type AS rodz_gmi, + c.ident AS sym, c.name AS nazwa, + (CASE WHEN cc.ident IS NOT NULL THEN cc.ident ELSE c.ident END) AS sympod + FROM location_cities c + JOIN location_boroughs b ON (c.boroughid = b.id) + JOIN location_districts d ON (b.districtid = d.id) + JOIN location_states s ON (d.stateid = s.id) + LEFT JOIN location_cities cc ON (c.cityid = cc.id); + + CREATE VIEW teryt_ulic AS + SELECT st.ident AS woj, d.ident AS pow, b.ident AS gmi, b.type AS rodz_gmi, + c.ident AS sym, s.ident AS sym_ul, s.name AS nazwa_1, t.name AS cecha, s.id + FROM location_streets s + JOIN location_street_types t ON (s.typeid = t.id) + JOIN location_cities c ON (s.cityid = c.id) + JOIN location_boroughs b ON (c.boroughid = b.id) + JOIN location_districts d ON (b.districtid = d.id) + JOIN location_states st ON (d.stateid = st.id); + + 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); +"); + +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2011082800', 'dbversion')); + +$DB->CommitTrans(); + +?> From cvs w lms.org.pl Wed Aug 31 12:46:46 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 31 Aug 2011 12:46:46 +0200 (CEST) Subject: [lms-commits] CVS update of lms/modules (5 files) Message-ID: <20110831104646.B8C6630278A2@eftep.altec.pl> Date: Wednesday, August 31, 2011 @ 12:46:46 Author: alec Path: /cvsroot/lms/modules Added: chooselocation.php Modified: netdevadd.php netdevedit.php nodeadd.php nodeedit.php - Implemented nodes/devices localization database - lms-teryt: Script for Polish TERYT localization database import Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/chooselocation.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevadd.php.diff?&r1=1.31&r2=1.32 http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevedit.php.diff?&r1=1.72&r2=1.73 http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodeadd.php.diff?&r1=1.99&r2=1.100 http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodeedit.php.diff?&r1=1.119&r2=1.120 Index: lms/modules/chooselocation.php diff -u /dev/null lms/modules/chooselocation.php:1.1 --- /dev/null Wed Aug 31 12:46:46 2011 +++ lms/modules/chooselocation.php Wed Aug 31 12:46:46 2011 @@ -0,0 +1,214 @@ +GetAll('SELECT s.id, s.name, t.name AS typename + FROM location_streets s + LEFT JOIN location_street_types t ON (s.typeid = t.id) + WHERE s.cityid = ? + ORDER BY s.name', array($cityid)); + + if ($list) + foreach ($list as $idx => $row) { + if ($row['typename']) { + $row['name'] .= ', ' . $row['typename']; + unset($row['typename']); + $list[$idx] = $row; + } + } + + return $list; +} + +function get_loc_cities($districtid) +{ + global $DB; + + $list = $DB->GetAll('SELECT c.id, c.name, b.name AS borough, b.type AS btype + FROM location_cities c + JOIN location_boroughs b ON (c.boroughid = b.id) + WHERE b.districtid = ? + ORDER BY c.name, b.type', array($districtid)); + + if ($list) + foreach ($list as $idx => $row) { + $name = sprintf('%s (%s%s)', $row['name'], + $row['btype'] < 4 ? trans('') : '', $row['borough']); + $list[$idx] = array('id' => $row['id'], 'name' => $name); + } + + return $list; +} + + +if (isset($_GET['ajax']) && isset($_GET['what'])) +{ + header('Content-type: text/plain'); + $search = urldecode(trim($_GET['what'])); + + if (!strlen($search)) { + print "false;"; + die; + } + + $list = $DB->GetAll('SELECT c.id, c.name, + b.name AS borough, b.type AS btype, + d.name AS district, d.id AS districtid, + s.name AS state, s.id AS stateid + FROM location_cities c + JOIN location_boroughs b ON (c.boroughid = b.id) + JOIN location_districts d ON (b.districtid = d.id) + JOIN location_states s ON (d.stateid = s.id) + WHERE c.name ?LIKE? '.$DB->Escape("%$search%").' + ORDER BY c.name, b.type LIMIT 10'); + + $eligible = $actions = array(); + if ($list) + foreach ($list as $idx => $row) { + $name = sprintf('%s (%s%s, %s)', $row['name'], + $row['btype'] < 4 ? trans('') : '', $row['borough'], + trans('') . $row['district']); + + $eligible[$idx] = escape_js($name); + $actions[$idx] = sprintf("javascript: search_update(%d,%d,%d)", + $row['id'], $row['districtid'], $row['stateid']); + } + + if ($eligible) { + print "this.eligible = [\"".implode('","',$eligible)."\"];\n"; + print "this.actions = [\"".implode('","',$actions)."\"];\n"; + } else { + print "false;\n"; + } + die; +} + +require(LIB_DIR.'/xajax/xajax.inc.php'); + +function select_location($what, $id) +{ + global $DB; + + $JSResponse = new xajaxResponse(); + + if ($what == 'state') + $stateid = $id; + else if ($what == 'district') + $districtid = $id; + else if ($what == 'city') + $cityid = $id; + else if (!$what && preg_match('/^([0-9]+):([0-9]+):([0-9]+)$/', $id, $m)) { + $cityid = $m[1]; + $districtid = $m[2]; + $stateid = $m[3]; + } + + if ($stateid) { + $list = $DB->GetAll('SELECT id, name + FROM location_districts WHERE stateid = ? + ORDER BY name', array($stateid)); + + $JSResponse->addScriptCall('update_selection', 'district', + $list ? $list : array(), !$what ? $districtid : 0); + } + + if ($districtid) { + $list = get_loc_cities($districtid); + $JSResponse->addScriptCall('update_selection', 'city', + $list ? $list : array(), !$what ? $cityid : 0); + } + + if ($cityid) { + $list = get_loc_streets($cityid); + $JSResponse->addScriptCall('update_selection', 'street', $list ? $list : array()); + } + + return $JSResponse; +} + +$xajax = new xajax(); +//$xajax->debugOn(); +$xajax->errorHandlerOn(); +$xajax->registerFunction('select_location'); +$xajax->processRequests(); + +$SMARTY->assign('xajax', $xajax->getJavascript('img/', 'xajax.js')); + +$layout['pagetitle'] = trans('Select location'); + +$streetid = isset($_GET['street']) ? intval($_GET['street']) : 0; +$cityid = isset($_GET['city']) ? intval($_GET['city']) : 0; + +$states = $DB->GetAll('SELECT id, name, ident + FROM location_states ORDER BY name'); + +if ($streetid) { + $data = $DB->GetRow('SELECT s.id AS streetid, s.cityid, b.districtid, d.stateid + FROM location_streets s + JOIN location_cities c ON (s.cityid = c.id) + JOIN location_boroughs b ON (c.boroughid = b.id) + JOIN location_districts d ON (b.districtid = d.id) + WHERE s.id = ?', array($streetid)); +} +else if ($cityid) { + $data = $DB->GetRow('SELECT c.id AS cityid, b.districtid, d.stateid + FROM location_cities c + JOIN location_boroughs b ON (c.boroughid = b.id) + JOIN location_districts d ON (b.districtid = d.id) + WHERE c.id = ?', array($cityid)); +} +else if (count($states)) { + $data['stateid'] = $states[key($states)]['id']; +} + +if (!empty($data['stateid'])) { + $districts = $DB->GetAll('SELECT id, ident, name + FROM location_districts WHERE stateid = ?', array($data['stateid'])); + $SMARTY->assign('districts', $districts); +} + +if (!empty($data['districtid'])) { + $cities = get_loc_cities($data['districtid']); + $SMARTY->assign('cities', $cities); +} + +if (!empty($data['cityid'])) { + $streets = get_loc_streets($data['cityid']); + $SMARTY->assign('streets', $streets); +} + +$data['varname'] = $_GET['name']; +$data['formname'] = $_GET['form']; + +$SMARTY->assign('data', $data); +$SMARTY->assign('states', $states); +$SMARTY->display('chooselocation.html'); + +?> Index: lms/modules/netdevadd.php diff -u lms/modules/netdevadd.php:1.31 lms/modules/netdevadd.php:1.32 --- lms/modules/netdevadd.php:1.31 Tue Jan 18 09:12:23 2011 +++ lms/modules/netdevadd.php Wed Aug 31 12:46:46 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: netdevadd.php,v 1.31 2011/01/18 08:12:23 alec Exp $ + * $Id: netdevadd.php,v 1.32 2011/08/31 10:46:46 alec Exp $ */ if(isset($_POST['netdev'])) @@ -37,7 +37,7 @@ $netdevdata['clients'] = 0; else $netdevdata['clients'] = intval($netdevdata['clients']); - + if($netdevdata['name'] == '') $error['name'] = trans('Device name is required!'); elseif(strlen($netdevdata['name'])>32) @@ -72,20 +72,28 @@ $error['purchasedate'] = trans('Purchase date cannot be empty when guarantee period is set!'); } - if(!$error) - { + if(!$error) + { if($netdevdata['guaranteeperiod'] == -1) $netdevdata['guaranteeperiod'] = NULL; - + if(!isset($netdevdata['shortname'])) $netdevdata['shortname'] = ''; - if(!isset($netdevdata['secret'])) $netdevdata['secret'] = ''; - if(!isset($netdevdata['community'])) $netdevdata['community'] = ''; - if(!isset($netdevdata['nastype'])) $netdevdata['nastype'] = 0; - + if(!isset($netdevdata['secret'])) $netdevdata['secret'] = ''; + if(!isset($netdevdata['community'])) $netdevdata['community'] = ''; + if(!isset($netdevdata['nastype'])) $netdevdata['nastype'] = 0; + + if (empty($netdevdata['teryt'])) { + $netdevdata['location_city'] = null; + $netdevdata['location_street'] = null; + $netdevdata['location_house'] = null; + $netdevdata['location_flat'] = null; + } + $netdevid = $LMS->NetDevAdd($netdevdata); + $SESSION->redirect('?m=netdevinfo&id='.$netdevid); - } - + } + $SMARTY->assign('error', $error); $SMARTY->assign('netdev', $netdevdata); } Index: lms/modules/netdevedit.php diff -u lms/modules/netdevedit.php:1.72 lms/modules/netdevedit.php:1.73 --- lms/modules/netdevedit.php:1.72 Tue Jan 18 09:12:23 2011 +++ lms/modules/netdevedit.php Wed Aug 31 12:46:46 2011 @@ -21,13 +21,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: netdevedit.php,v 1.72 2011/01/18 08:12:23 alec Exp $ + * $Id: netdevedit.php,v 1.73 2011/08/31 10:46:46 alec Exp $ */ if(! $LMS->NetDevExists($_GET['id'])) { $SESSION->redirect('?m=netdevlist'); -} +} $action = !empty($_GET['action']) ? $_GET['action'] : ''; $edit = ''; @@ -47,9 +47,9 @@ elseif ($dev2['ports'] < $dev1['takenports']) { $error['replace'] = trans('It scans for ports in destination device!'); - } - - if(!$error) + } + + if(!$error) { $links1 = $DB->GetAll('(SELECT type, (CASE src WHEN ? THEN dst ELSE src END) AS id, @@ -75,7 +75,7 @@ $dev2['id'], $dev2['id'], $dev2['id'])); $DB->BeginTrans(); - + $DB->Execute('UPDATE netdevices SET location = ? WHERE id = ?', array($dev1['location'], $dev2['id'])); $DB->Execute('UPDATE netdevices SET location = ? WHERE id = ?', @@ -83,7 +83,7 @@ $LMS->NetDevDelLinks($dev1['id']); $LMS->NetDevDelLinks($dev2['id']); - + $ports = array(); // przypisujemy urzadzenia/komputer, probujac zachowac numeracje portow if ($links1) foreach($links1 as $row) @@ -98,10 +98,10 @@ $sport = $i; break; } - + $ports[$sport] = $sport; } - + if(isset($row['dstport'])) // device $LMS->NetDevLink($dev2['id'], $row['id'], $row['type'], $sport, $row['dstport']); else // node @@ -121,23 +121,23 @@ $sport = $i; break; } - + $ports[$sport] = $sport; } - + if(isset($row['dstport'])) // device $LMS->NetDevLink($dev1['id'], $row['id'], $row['type'], $sport, $row['dstport']); else // node $LMS->NetDevLinkNode($row['id'], $dev1['id'], $row['type'], $sport); } - + $DB->CommitTrans(); $SESSION->redirect('?m=netdevinfo&id='.$_GET['id']); } - + break; - + case 'disconnect': $LMS->NetDevUnLink($_GET['id'],$_GET['devid']); @@ -161,7 +161,7 @@ case 'nas': $DB->Execute('UPDATE nodes SET nas=? WHERE id=?', array($_GET['nas'], $_GET['ip'])); $SESSION->redirect('?m=netdevinfo&id='.$_GET['id'].'&ip='.$_GET['ip']); - + case 'connect': $linktype = !empty($_GET['linktype']) ? intval($_GET['linktype']) : '0'; @@ -213,7 +213,7 @@ } $SESSION->save('devlinktype', $linktype); - + if(!$error) { $LMS->NetDevLink($dev['id'], $_GET['id'], $linktype, $dev['srcport'], $dev['dstport']); @@ -223,7 +223,7 @@ $SMARTY->assign('connect', $dev); break; - + case 'connectnode': $linktype = !empty($_GET['linktype']) ? intval($_GET['linktype']) : '0'; @@ -239,9 +239,9 @@ { if(!preg_match('/^[0-9]+$/', $node['port']) || $node['port'] > $ports) { - $error['port'] = trans('Incorrect port number!'); + $error['port'] = trans('Incorrect port number!'); } - elseif($DB->GetOne('SELECT id FROM nodes WHERE netdev=? AND port=? AND ownerid>0', + elseif($DB->GetOne('SELECT id FROM nodes WHERE netdev=? AND port=? AND ownerid>0', array($_GET['id'], $node['port'])) || $DB->GetOne('SELECT 1 FROM netlinks WHERE (src = ? OR dst = ?) AND (CASE src WHEN ? THEN srcport ELSE dstport END) = ?', @@ -252,8 +252,8 @@ } $SESSION->save('nodelinktype', $linktype); - - if(!$error) + + if(!$error) { $LMS->NetDevLinkNode($node['id'], $_GET['id'], $linktype, $node['port']); $SESSION->redirect('?m=netdevinfo&id='.$_GET['id']); @@ -301,7 +301,7 @@ { $DB->Execute('DELETE FROM nodes WHERE id = ? AND ownerid = 0', array($_GET['ip'])); } - + $SESSION->redirect('?m=netdevinfo&id='.$_GET['id']); case 'ipset': @@ -313,7 +313,7 @@ $LMS->IPSetU($_GET['id'], $_GET['access']); header('Location: ?'.$SESSION->get('backto')); - break; + break; case 'formaddip': @@ -326,7 +326,7 @@ foreach($nodeipdata as $key => $value) if($key != 'macs') $nodeipdata[$key] = trim($value); - + if(!isset($_GET['newmac'])) { if($nodeipdata['ipaddr']=='' && empty($nodeipdata['macs']) && $nodeipdata['name']=='' && $nodeipdata['passwd']=='') @@ -404,7 +404,7 @@ $SMARTY->assign('nodeipdata',$nodeipdata); $edit='addip'; break; - + case 'formeditip': $subtitle = trans('IP address edit'); @@ -523,7 +523,7 @@ $error['name'] = trans('Specified name is too long (max.$0 characters)!','32'); $netdevdata['ports'] = intval($netdevdata['ports']); - + if($netdevdata['ports'] < $LMS->CountNetDevLinks($_GET['id'])) $error['ports'] = trans('Connected devices number exceeds number of ports!'); @@ -531,7 +531,7 @@ $netdevdata['clients'] = 0; else $netdevdata['clients'] = intval($netdevdata['clients']); - + $netdevdata['purchasetime'] = 0; if($netdevdata['purchasedate'] != '') { @@ -567,20 +567,32 @@ $netdevdata['guaranteeperiod'] = NULL; if(!isset($netdevdata['shortname'])) $netdevdata['shortname'] = ''; - if(!isset($netdevdata['secret'])) $netdevdata['secret'] = ''; - if(!isset($netdevdata['community'])) $netdevdata['community'] = ''; - if(!isset($netdevdata['nastype'])) $netdevdata['nastype'] = 0; + if(!isset($netdevdata['secret'])) $netdevdata['secret'] = ''; + if(!isset($netdevdata['community'])) $netdevdata['community'] = ''; + if(!isset($netdevdata['nastype'])) $netdevdata['nastype'] = 0; + + if (empty($netdevdata['teryt'])) { + $netdevdata['location_city'] = null; + $netdevdata['location_street'] = null; + $netdevdata['location_house'] = null; + $netdevdata['location_flat'] = null; + } $LMS->NetDevUpdate($netdevdata); $SESSION->redirect('?m=netdevinfo&id='.$_GET['id']); } } -else +else { $netdevdata = $LMS->GetNetDev($_GET['id']); - + if($netdevdata['purchasetime']) $netdevdata['purchasedate'] = date('Y/m/d', $netdevdata['purchasetime']); + + if ($netdevdata['city_name'] || $netdevdata['street_name']) { + $netdevdata['teryt'] = true; + $netdevdata['location'] = location_str($netdevdata); + } } $netdevdata['id'] = $_GET['id']; Index: lms/modules/nodeadd.php diff -u lms/modules/nodeadd.php:1.99 lms/modules/nodeadd.php:1.100 --- lms/modules/nodeadd.php:1.99 Fri Mar 4 14:06:22 2011 +++ lms/modules/nodeadd.php Wed Aug 31 12:46:46 2011 @@ -21,9 +21,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodeadd.php,v 1.99 2011/03/04 13:06:22 alec Exp $ + * $Id: nodeadd.php,v 1.100 2011/08/31 10:46:46 alec Exp $ */ - +/* if(isset($_GET['ajax'])) { header('Content-type: text/plain'); @@ -31,17 +31,14 @@ switch($_GET['mode']) { - case 'address': + case 'address': $mode='location_address'; if ($CONFIG['database']['type'] == 'mysql' || $CONFIG['database']['type'] == 'mysqli') $mode = 'substring(location_address from 1 for length(location_address)-locate(\' \',reverse(location_address))+1)'; elseif($CONFIG['database']['type'] == 'postgres') $mode = 'substring(location_address from \'^.* \')'; break; - case 'zip': - $mode='location_zip'; - break; - case 'city': + case 'city': $mode='location_city'; break; } @@ -69,7 +66,7 @@ } exit; } - +*/ $nodedata['access'] = 1; $nodedata['ownerid'] = 0; @@ -115,7 +112,7 @@ }else{ $SESSION->redirect('?m=nodelist'); } - + if($nodedata['name']=='') $error['name'] = trans('Node name is required!'); elseif(strlen($nodedata['name']) > 32) @@ -164,7 +161,7 @@ elseif($value!='') $error['mac'.$key] = trans('Incorrect MAC address!'); if(empty($macs)) - $error['mac'] = trans('MAC address is required!'); + $error['mac0'] = trans('MAC address is required!'); $nodedata['macs'] = $macs; if(strlen($nodedata['passwd']) > 32) @@ -172,7 +169,7 @@ if (!$nodedata['ownerid']) $error['ownerid'] = trans('Customer not selected!'); - if(! $LMS->CustomerExists($nodedata['ownerid'])) + else if(! $LMS->CustomerExists($nodedata['ownerid'])) $error['ownerid'] = trans('You have to select owner!'); else { @@ -209,17 +206,18 @@ else $nodedata['netdev'] = 0; - if($nodedata['location_zip'] !='' && !check_zip($nodedata['location_zip']) && !isset($nodedata['zipwarning'])) - { - $error['location_zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); - $nodedata['zipwarning'] = 1; - } - if(!isset($nodedata['chkmac'])) $nodedata['chkmac'] = 0; if(!isset($nodedata['halfduplex'])) $nodedata['halfduplex'] = 0; if(!$error) { + if (empty($nodedata['teryt'])) { + $nodedata['location_city'] = null; + $nodedata['location_street'] = null; + $nodedata['location_house'] = null; + $nodedata['location_flat'] = null; + } + $nodedata = $LMS->ExecHook('node_add_before', $nodedata); $nodeid = $LMS->NodeAdd($nodedata); @@ -279,7 +277,6 @@ $nodedata = $LMS->ExecHook('node_add_init', $nodedata); -$SMARTY->assign('cstateslist',$LMS->GetCountryStates()); $SMARTY->assign('netdevices', $LMS->GetNetDevNames()); $SMARTY->assign('error', $error); $SMARTY->assign('nodedata', $nodedata); Index: lms/modules/nodeedit.php diff -u lms/modules/nodeedit.php:1.119 lms/modules/nodeedit.php:1.120 --- lms/modules/nodeedit.php:1.119 Thu Mar 10 11:33:15 2011 +++ lms/modules/nodeedit.php Wed Aug 31 12:46:46 2011 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodeedit.php,v 1.119 2011/03/10 10:33:15 chilek Exp $ + * $Id: nodeedit.php,v 1.120 2011/08/31 10:46:46 alec Exp $ */ $action = isset($_GET['action']) ? $_GET['action'] : ''; @@ -203,14 +203,15 @@ else if($nodeedit['access'] && $LMS->GetCustomerStatus($nodeedit['ownerid']) < 3) $error['access'] = trans('Node owner is not connected!'); - if($nodeedit['location_zip'] !='' && !check_zip($nodeedit['location_zip']) && !isset($nodeedit['zipwarning'])) - { - $error['location_zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); - $zipwarning = 1; - } - if(!$error) { + if (empty($nodeedit['teryt'])) { + $nodeedit['location_city'] = null; + $nodeedit['location_street'] = null; + $nodeedit['location_house'] = null; + $nodeedit['location_flat'] = null; + } + $nodeedit = $LMS->ExecHook('node_edit_before', $nodeedit); $LMS->NodeUpdate($nodeedit, ($customerid != $nodeedit['ownerid'])); @@ -231,9 +232,12 @@ $nodeinfo['halfduplex'] = $nodeedit['halfduplex']; $nodeinfo['port'] = $nodeedit['port']; $nodeinfo['zipwarning'] = empty($zipwarning) ? 0 : 1; - $nodeinfo['location_zip'] = $nodeedit['location_zip']; - $nodeinfo['location_address'] = $nodeedit['location_address']; + $nodeinfo['location'] = $nodeedit['location']; $nodeinfo['location_city'] = $nodeedit['location_city']; + $nodeinfo['location_street'] = $nodeedit['location_street']; + $nodeinfo['location_house'] = $nodeedit['location_house']; + $nodeinfo['location_flat'] = $nodeedit['location_flat']; + $nodeinfo['teryt'] = empty($nodeedit['teryt']) ? 0 : 1; $nodeinfo['stateid'] = $nodeedit['stateid']; if($nodeedit['ipaddr_pub']=='0.0.0.0') @@ -247,6 +251,11 @@ $nodeedit['macs'][] = ''; $nodeinfo = array_merge($nodeinfo, $nodeedit); } + + if ($nodeinfo['city_name'] || $nodeinfo['street_name']) { + $nodeinfo['teryt'] = true; + $nodeinfo['location'] = location_str($nodeinfo); + } } if(empty($nodeinfo['macs'])) @@ -261,7 +270,6 @@ $nodeinfo = $LMS->ExecHook('node_edit_init', $nodeinfo); -$SMARTY->assign('cstateslist',$LMS->GetCountryStates()); $SMARTY->assign('netdevices', $LMS->GetNetDevNames()); $SMARTY->assign('nodegroups', $LMS->GetNodeGroupNamesByNode($nodeid)); $SMARTY->assign('othernodegroups', $LMS->GetNodeGroupNamesWithoutNode($nodeid)); From cvs w lms.org.pl Wed Aug 31 12:46:47 2011 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 31 Aug 2011 12:46:47 +0200 (CEST) Subject: [lms-commits] CVS update of lms/templates (6 files) Message-ID: <20110831104647.1478730278A2@eftep.altec.pl> Date: Wednesday, August 31, 2011 @ 12:46:47 Author: alec Path: /cvsroot/lms/templates Added: chooselocation.html Modified: netdevadd.html netdeveditbox.html nodeaddbox.html nodeeditbox.html nodeinfobox.html - Implemented nodes/devices localization database - lms-teryt: Script for Polish TERYT localization database import Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/chooselocation.html?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevadd.html.diff?&r1=1.28&r2=1.29 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdeveditbox.html.diff?&r1=1.31&r2=1.32 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeaddbox.html.diff?&r1=1.84&r2=1.85 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.88&r2=1.89 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.74&r2=1.75 Index: lms/templates/chooselocation.html diff -u /dev/null lms/templates/chooselocation.html:1.1 --- /dev/null Wed Aug 31 12:46:47 2011 +++ lms/templates/chooselocation.html Wed Aug 31 12:46:46 2011 @@ -0,0 +1,266 @@ + + + + + + + + ::: LMS :{if $layout.pagetitle neq ""} {$layout.pagetitle} :{/if}:: + + + + {$xajax} + + +{popup_init src="img/overlib.js"} + {if !empty($states)} +
+ + + {/if} + + {if empty($states)} + + {else} + + + + + + + + + + + + + + + + + + + + + + + + + + + + {/if} +
+

 

+

 

+

{t}Location database is empty.{/t}

+

 

+

 

+
{t}State{/t}: + +
+ {t}Submit{/t} + {t}Cancel{/t} +
+{literal} + +{/literal} + + Index: lms/templates/netdevadd.html diff -u lms/templates/netdevadd.html:1.28 lms/templates/netdevadd.html:1.29 --- lms/templates/netdevadd.html:1.28 Tue Mar 9 10:23:00 2010 +++ lms/templates/netdevadd.html Wed Aug 31 12:46:46 2011 @@ -1,5 +1,5 @@ {include file="header.html"} - + {include file="calendar_js.html"}

{$layout.pagetitle}

@@ -72,8 +72,15 @@ {t}Location:{/t} - - + + + »»» +
+ + + + + {t}TERRIT-DB{/t} {if $_config.phpui.radius|chkconfig} @@ -216,6 +223,7 @@ document.forms['netdevadd'].elements['netdev[name]'].focus(); BUL_TIMECOMPONENT = false; var cal1 = new calendar(document.forms['netdevadd'].elements['netdev[purchasedate]']); +check_teryt('location', true); //--> {include file="footer.html"} Index: lms/templates/netdeveditbox.html diff -u lms/templates/netdeveditbox.html:1.31 lms/templates/netdeveditbox.html:1.32 --- lms/templates/netdeveditbox.html:1.31 Tue Mar 9 10:23:00 2010 +++ lms/templates/netdeveditbox.html Wed Aug 31 12:46:46 2011 @@ -1,4 +1,4 @@ - + {include file="calendar_js.html"} @@ -72,7 +72,14 @@ {t}Location:{/t} {if $_config.phpui.radius|chkconfig} @@ -227,11 +234,12 @@ {t}Submit{/t} {t}Cancel{/t} - +
- + + »»» +
+ + + + + {t}TERRIT-DB{/t}
Index: lms/templates/nodeaddbox.html diff -u lms/templates/nodeaddbox.html:1.84 lms/templates/nodeaddbox.html:1.85 --- lms/templates/nodeaddbox.html:1.84 Fri Dec 17 09:39:08 2010 +++ lms/templates/nodeaddbox.html Wed Aug 31 12:46:46 2011 @@ -1,4 +1,4 @@ - + @@ -58,45 +58,18 @@ - @@ -152,8 +125,8 @@
+ {t}Location:{/t} - - - - - - - - - - - - - {if $nodedata.zipwarning} - - {/if} - - {if $cstateslist} - - - - - {/if} -
{t}Address:{/t}
{t}City:{/t}
{t}Zip:{/t}
{t}State:{/t} - -
- + + »»» +
+ + + + + {t}TERRIT-DB{/t}
- {t}MAC checking{/t}:  - {t}Half duplex{/t}: + {t}MAC checking{/t}:  + {t}Half duplex{/t}:
@@ -238,7 +211,8 @@ if (val = document.forms['nodeadd'].elements['nodedata[ownerid]'].value) document.forms['nodeadd'].elements['nodedata[customerid]'].value = val; } + + check_teryt('location', true); //--> {/literal} - Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.88 lms/templates/nodeeditbox.html:1.89 --- lms/templates/nodeeditbox.html:1.88 Wed Jan 5 21:50:25 2011 +++ lms/templates/nodeeditbox.html Wed Aug 31 12:46:46 2011 @@ -1,4 +1,4 @@ - + @@ -23,7 +23,7 @@ {t}IP address:{/t} - »»» + »»» @@ -58,45 +58,18 @@ - + {t}Location:{/t} - - - - - - - - - - - - - {if $nodeinfo.zipwarning} - - {/if} - - {if $cstateslist} - - - - - {/if} -
{t}Address:{/t}
{t}City:{/t}
{t}Zip:{/t}
{t}State:{/t} - -
- + + »»» +
+ + + + + {t}TERRIT-DB{/t} {* @@ -249,6 +222,8 @@ if (val = document.forms['editnode'].elements['nodeedit[ownerid]'].value) document.forms['editnode'].elements['nodeedit[customerid]'].value = val; } + + check_teryt('location', true); //--> {/literal} Index: lms/templates/nodeinfobox.html diff -u lms/templates/nodeinfobox.html:1.74 lms/templates/nodeinfobox.html:1.75 --- lms/templates/nodeinfobox.html:1.74 Fri Dec 17 09:39:08 2010 +++ lms/templates/nodeinfobox.html Wed Aug 31 12:46:46 2011 @@ -1,4 +1,4 @@ - +