From cvs w lms.org.pl Fri Dec 3 12:12:38 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 3 Dec 2010 12:12:38 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (cashimport.php) Message-ID: <20101203111238.B3FD53027B8D@hydra.altec.pl> Date: Friday, December 3, 2010 @ 12:12:38 Author: alec Path: /cvsroot/lms/modules Modified: cashimport.php - Fix calculations Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/cashimport.php.diff?&r1=1.25&r2=1.26 Index: lms/modules/cashimport.php diff -u lms/modules/cashimport.php:1.25 lms/modules/cashimport.php:1.26 --- lms/modules/cashimport.php:1.25 Thu Mar 11 14:07:44 2010 +++ lms/modules/cashimport.php Fri Dec 3 12:12:38 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: cashimport.php,v 1.25 2010/03/11 13:07:44 alec Exp $ + * $Id: cashimport.php,v 1.26 2010/12/03 11:12:38 alec Exp $ */ $layout['pagetitle'] = trans('Cash Operations Import'); @@ -114,12 +114,12 @@ $customers = $_POST['customer']; foreach($marks as $id) { - if(isset($customers[$id])) + if(!empty($customers[$id])) { $DB->BeginTrans(); - + $import = $DB->GetRow('SELECT * FROM cashimport WHERE id = ?', array($id)); - + $balance['time'] = $import['date']; $balance['type'] = 1; $balance['value'] = $import['value']; @@ -127,7 +127,7 @@ $balance['comment'] = $import['description']; $balance['importid'] = $import['id']; $balance['sourceid'] = $import['sourceid']; - + if($import['value'] > 0 && isset($CONFIG['finances']['cashimport_checkinvoices']) && chkconfig($CONFIG['finances']['cashimport_checkinvoices'])) { @@ -146,11 +146,12 @@ { foreach($invoices as $inv) $sum += $inv['value']; - + $bval = $LMS->GetCustomerBalance($customers[$id]); - $value = $bval + $import['value'] + $sum; + $value = f_round($bval + $import['value'] + $sum); - foreach($invoices as $inv) + foreach($invoices as $inv) { + $inv['value'] = f_round($inv['value']); if($inv['value'] > $value) break; else @@ -159,12 +160,13 @@ $DB->Execute('UPDATE documents SET closed = 1 WHERE id = ? OR reference = ?', array($inv['id'], $inv['id'])); - + $value -= $inv['value']; } + } } } - + $DB->Execute('UPDATE cashimport SET closed = 1 WHERE id = ?', array($id)); $LMS->AddBalance($balance); From cvs w lms.org.pl Thu Dec 9 11:10:04 2010 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 9 Dec 2010 11:10:04 +0100 (CET) Subject: [lms-commits] CVS update of lms/contrib (initLMS.php) Message-ID: <20101209101004.D45AD3027B8B@hydra.altec.pl> Date: Thursday, December 9, 2010 @ 11:10:04 Author: alec Path: /cvsroot/lms/contrib Modified: initLMS.php - add some constant definitions required by LMS core functions Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/contrib/initLMS.php.diff?&r1=1.25&r2=1.26 Index: lms/contrib/initLMS.php diff -u lms/contrib/initLMS.php:1.25 lms/contrib/initLMS.php:1.26 --- lms/contrib/initLMS.php:1.25 Mon May 24 09:43:16 2010 +++ lms/contrib/initLMS.php Thu Dec 9 11:10:04 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: initLMS.php,v 1.25 2010/05/24 07:43:16 chilek Exp $ + * $Id: initLMS.php,v 1.26 2010/12/09 10:10:04 alec Exp $ */ // REPLACE THIS WITH PATH TO YOU CONFIG FILE @@ -33,8 +33,15 @@ // Check for configuration vars and set default values $CONFIG['directories']['sys_dir'] = (! $CONFIG['directories']['sys_dir'] ? getcwd() : $CONFIG['directories']['sys_dir']); $CONFIG['directories']['lib_dir'] = (! $CONFIG['directories']['lib_dir'] ? $CONFIG['directories']['sys_dir'].'/lib' : $CONFIG['directories']['lib_dir']); +$CONFIG['directories']['doc_dir'] = (!isset($CONFIG['directories']['doc_dir']) ? $CONFIG['directories']['sys_dir'].'/documents' : $CONFIG['directories']['doc_dir']); +$CONFIG['directories']['modules_dir'] = (!isset($CONFIG['directories']['modules_dir']) ? $CONFIG['directories']['sys_dir'].'/modules' : $CONFIG['directories']['modules_dir']); -require_once($CONFIG['directories']['lib_dir'].'/config.php'); +define('SYS_DIR', $CONFIG['directories']['sys_dir']); +define('LIB_DIR', $CONFIG['directories']['lib_dir']); +define('DOC_DIR', $CONFIG['directories']['doc_dir']); +define('MODULES_DIR', $CONFIG['directories']['modules_dir']); + +require_once(LIB_DIR.'/config.php'); // Init database $_DBTYPE = $CONFIG['database']['type']; @@ -43,7 +50,7 @@ $_DBPASS = $CONFIG['database']['password']; $_DBNAME = $CONFIG['database']['database']; -require_once($CONFIG['directories']['lib_dir'].'/LMSDB.php'); +require_once(LIB_DIR.'/LMSDB.php'); $DB = DBInit($_DBTYPE, $_DBHOST, $_DBUSER, $_DBPASS, $_DBNAME); @@ -57,10 +64,10 @@ // Include required files (including sequence is important) -require_once($CONFIG['directories']['lib_dir'].'/language.php'); -require_once($CONFIG['directories']['lib_dir'].'/definitions.php'); -require_once($CONFIG['directories']['lib_dir'].'/common.php'); -require_once($CONFIG['directories']['lib_dir'].'/LMS.class.php'); +require_once(LIB_DIR.'/language.php'); +require_once(LIB_DIR.'/definitions.php'); +require_once(LIB_DIR.'/common.php'); +require_once(LIB_DIR.'/LMS.class.php'); $AUTH = NULL; From cvs w lms.org.pl Fri Dec 10 17:48:14 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 10 Dec 2010 17:48:14 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (netdevedit.php) Message-ID: <20101210164814.68685302C928@hydra.altec.pl> Date: Friday, December 10, 2010 @ 17:48:14 Author: chilek Path: /cvsroot/lms/modules Modified: netdevedit.php - missed proper mac validation Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/netdevedit.php.diff?&r1=1.70&r2=1.71 Index: lms/modules/netdevedit.php diff -u lms/modules/netdevedit.php:1.70 lms/modules/netdevedit.php:1.71 --- lms/modules/netdevedit.php:1.70 Fri May 7 14:22:31 2010 +++ lms/modules/netdevedit.php Fri Dec 10 17:48:13 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: netdevedit.php,v 1.70 2010/05/07 12:22:31 chilek Exp $ + * $Id: netdevedit.php,v 1.71 2010/12/10 16:48:13 chilek Exp $ */ if(! $LMS->NetDevExists($_GET['id'])) @@ -377,6 +377,7 @@ $error['mac'.$key] = trans('Incorrect MAC address!'); if(empty($macs)) $error['mac0'] = trans('MAC address is required!'); + $nodeipdata['macs'] = $macs; if(strlen($nodeipdata['passwd']) > 32) $error['passwd'] = trans('Password is too long (max.32 characters)!'); From cvs w lms.org.pl Tue Dec 14 09:16:30 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/html/pl (devel-db.html) Message-ID: <20101214081630.751A43039A44@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:30 Author: alec Path: /cvsroot/lms/doc/html/pl Modified: devel-db.html - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/html/pl/devel-db.html.diff?&r1=1.67&r2=1.68 Index: lms/doc/html/pl/devel-db.html diff -u lms/doc/html/pl/devel-db.html:1.67 lms/doc/html/pl/devel-db.html:1.68 --- lms/doc/html/pl/devel-db.html:1.67 Wed Jun 23 16:03:53 2010 +++ lms/doc/html/pl/devel-db.html Tue Dec 14 09:16:30 2010 @@ -294,6 +294,18 @@ >paytype - typ płatności faktur (zobacz tabela documents)einvoice - zezwolenie na faktury elektroniczneinvoicenotice - zezwolenie na dostarczanie faktur pocztą elektronicznąmailingnotice - zezwolenie na dostarczanie informacji pocztą elektroniczną lub smsem Date: Tuesday, December 14, 2010 @ 09:16:30 Author: alec Path: /cvsroot/lms/doc/sgml Modified: advanced.sgml - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/sgml/advanced.sgml.diff?&r1=1.114&r2=1.115 Index: lms/doc/sgml/advanced.sgml diff -u lms/doc/sgml/advanced.sgml:1.114 lms/doc/sgml/advanced.sgml:1.115 --- lms/doc/sgml/advanced.sgml:1.114 Wed Jun 23 16:03:53 2010 +++ lms/doc/sgml/advanced.sgml Tue Dec 14 09:16:30 2010 @@ -1,4 +1,4 @@ - + For curious @@ -124,6 +124,9 @@ cutoffstop - date to which customers cutting off is disabled paytime - invoices deadline in days paytype - invoices payment type identifier (see documents table) + einvoice - enables e-invoices + invoicenotice - enables invoices delivery via e-mail + mailingnotice - enables messages delivery via e-mail or sms From cvs w lms.org.pl Tue Dec 14 09:16:30 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/html/en (devel-db.html) Message-ID: <20101214081630.54B6230340FF@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:30 Author: alec Path: /cvsroot/lms/doc/html/en Modified: devel-db.html - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/html/en/devel-db.html.diff?&r1=1.60&r2=1.61 Index: lms/doc/html/en/devel-db.html diff -u lms/doc/html/en/devel-db.html:1.60 lms/doc/html/en/devel-db.html:1.61 --- lms/doc/html/en/devel-db.html:1.60 Wed Jun 23 16:03:53 2010 +++ lms/doc/html/en/devel-db.html Tue Dec 14 09:16:30 2010 @@ -290,6 +290,18 @@ >paytype - invoices payment type identifier (see documents table)einvoice - enables e-invoicesinvoicenotice - enables invoices delivery via e-mailmailingnotice - enables messages delivery via e-mail or sms Date: Tuesday, December 14, 2010 @ 09:16:30 Author: alec Path: /cvsroot/lms/doc/sgml/pl Modified: advanced.sgml - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/sgml/pl/advanced.sgml.diff?&r1=1.76&r2=1.77 Index: lms/doc/sgml/pl/advanced.sgml diff -u lms/doc/sgml/pl/advanced.sgml:1.76 lms/doc/sgml/pl/advanced.sgml:1.77 --- lms/doc/sgml/pl/advanced.sgml:1.76 Wed Jun 23 16:03:53 2010 +++ lms/doc/sgml/pl/advanced.sgml Tue Dec 14 09:16:30 2010 @@ -1,4 +1,4 @@ - + Dla dociekliwych @@ -128,6 +128,9 @@ cutoffstop - data, do której blokowanie klientów zadłużonych jest wyłączone paytime - termin płatności faktur paytype - typ płatności faktur (zobacz tabela documents) + einvoice - zezwolenie na faktury elektroniczne + invoicenotice - zezwolenie na dostarczanie faktur pocztą elektroniczną + mailingnotice - zezwolenie na dostarczanie informacji pocztą elektroniczną lub smsem From cvs w lms.org.pl Tue Dec 14 09:16:30 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc (5 files) Message-ID: <20101214081630.2C14C30340FE@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:30 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog README README.pl lms.mysql lms.pgsql - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1518&r2=1.1519 http://cvs.lms.org.pl/viewvc/Development/lms/doc/README.diff?&r1=1.225&r2=1.226 http://cvs.lms.org.pl/viewvc/Development/lms/doc/README.pl.diff?&r1=1.54&r2=1.55 http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.mysql.diff?&r1=1.174&r2=1.175 http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.pgsql.diff?&r1=1.170&r2=1.171 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1518 lms/doc/ChangeLog:1.1519 --- lms/doc/ChangeLog:1.1518 Tue Nov 30 12:43:40 2010 +++ lms/doc/ChangeLog Tue Dec 14 09:16:29 2010 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1518 2010/11/30 11:43:40 alec Exp $ +$Id: ChangeLog,v 1.1519 2010/12/14 08:16:29 alec Exp $ version ? (????-??-??) @@ -45,6 +45,9 @@ placed in one file for all subnetworks (alec) - allow setting assignment period for disposable liabilities (alec) - improved performance of traffic database compacting procedure (alec) + - added "consent to e-invoices" switch in customer data (alec) + - added "consent to invoices delivery via e-mail" switch in customer data (alec) + - added "consent to messages delivery via e-mail or sms" switch in customer data (alec) version 1.11.10 Kri (2010-04-19) Index: lms/doc/README diff -u lms/doc/README:1.225 lms/doc/README:1.226 --- lms/doc/README:1.225 Mon Sep 20 14:23:37 2010 +++ lms/doc/README Tue Dec 14 09:16:29 2010 @@ -5357,6 +5357,9 @@ cutoffstop - date to which customers cutting off is disabled paytime - invoices deadline in days paytype - invoices payment type identifier (see documents table) + einvoice - enables e-invoices + invoicenotice - enables invoices delivery via e-mail + mailingnotice - enables messages delivery via e-mail or sms __________________________________________________________________ 7.2.3. Customer groups ('customergroups') Index: lms/doc/README.pl diff -u lms/doc/README.pl:1.54 lms/doc/README.pl:1.55 --- lms/doc/README.pl:1.54 Mon Sep 20 14:23:37 2010 +++ lms/doc/README.pl Tue Dec 14 09:16:29 2010 @@ -6260,6 +6260,10 @@ wyłączone paytime - termin płatności faktur paytype - typ płatności faktur (zobacz tabela documents) + einvoice - zezwolenie na faktury elektroniczne + invoicenotice - zezwolenie na dostarczanie faktur pocztą elektroniczną + mailingnotice - zezwolenie na dostarczanie informacji pocztą + elektroniczną lub smsem __________________________________________________________________ 7.2.3. Grupy klientów ('customergroups') Index: lms/doc/lms.mysql diff -u lms/doc/lms.mysql:1.174 lms/doc/lms.mysql:1.175 --- lms/doc/lms.mysql:1.174 Mon Jun 28 11:23:03 2010 +++ lms/doc/lms.mysql Tue Dec 14 09:16:29 2010 @@ -1,5 +1,5 @@ # -------------------------------------------------------- -# $Id: lms.mysql,v 1.174 2010/06/28 09:23:03 alec Exp $ +# $Id: lms.mysql,v 1.175 2010/12/14 08:16:29 alec Exp $ # -------------------------------------------------------- # @@ -34,7 +34,8 @@ id int(11) NOT NULL auto_increment, tariffid int(11) NOT NULL DEFAULT '0', liabilityid int(11) NOT NULL DEFAULT '0', - customerid int(11) NOT NULL DEFAULT '0', + customerid int(11) NOT NULL + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE, period smallint NOT NULL DEFAULT '0', at int(11) NOT NULL DEFAULT '0', datefrom int(11) NOT NULL DEFAULT '0', @@ -625,6 +626,9 @@ pin int(6) NOT NULL DEFAULT '0', cutoffstop int(11) NOT NULL DEFAULT '0', consentdate int(11) NOT NULL DEFAULT '0', + einvoice tinyint(1) DEFAULT NULL, + invoicenotice tinyint(1) DEFAULT NULL, + mailingnotice tinyint(1) DEFAULT NULL, divisionid int(11) NOT NULL DEFAULT '0', paytime tinyint NOT NULL DEFAULT '-1', paytype smallint DEFAULT NULL, @@ -653,10 +657,13 @@ DROP TABLE IF EXISTS customerassignments; CREATE TABLE customerassignments ( id int(11) NOT NULL auto_increment, - customergroupid int(11) NOT NULL DEFAULT '0', - customerid int(11) NOT NULL DEFAULT '0', + customergroupid int(11) NOT NULL + REFERENCES customergroups (id) ON DELETE CASCADE ON UPDATE CASCADE, + customerid int(11) NOT NULL + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (id), - UNIQUE KEY customerassignment (customergroupid, customerid) + UNIQUE KEY customerassignment (customergroupid, customerid), + INDEX customerid (customerid) ) ENGINE=InnoDB; # -------------------------------------------------------- @@ -1098,10 +1105,12 @@ DROP TABLE IF EXISTS excludedgroups; CREATE TABLE excludedgroups ( id int(11) NOT NULL auto_increment, - customergroupid int(11) NOT NULL DEFAULT 0, + customergroupid int(11) NOT NULL, + REFERENCES customergroups (id) ON DELETE CASCADE ON UPDATE CASCADE, userid int(11) NOT NULL DEFAULT 0, PRIMARY KEY (id), - UNIQUE KEY userid (userid, customergroupid) + UNIQUE KEY userid (userid, customergroupid), + KEY customergroupid (customergroupid) ) ENGINE=InnoDB; # -------------------------------------------------------- @@ -1375,4 +1384,4 @@ # -------------------------------------------------------- -INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010062800'); +INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121000'); Index: lms/doc/lms.pgsql diff -u lms/doc/lms.pgsql:1.170 lms/doc/lms.pgsql:1.171 --- lms/doc/lms.pgsql:1.170 Fri Nov 26 11:35:41 2010 +++ lms/doc/lms.pgsql Tue Dec 14 09:16:29 2010 @@ -1,4 +1,4 @@ -/* $Id: lms.pgsql,v 1.170 2010/11/26 10:35:41 alec Exp $ */ +/* $Id: lms.pgsql,v 1.171 2010/12/14 08:16:29 alec Exp $ */ /* -------------------------------------------------------- Structure of table "users" @@ -34,7 +34,8 @@ id integer default nextval('assignments_id_seq'::text) NOT NULL, tariffid integer DEFAULT 0 NOT NULL, liabilityid integer DEFAULT 0 NOT NULL, - customerid integer DEFAULT 0 NOT NULL, + customerid integer NOT NULL + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE, period smallint DEFAULT 0 NOT NULL, at integer DEFAULT 0 NOT NULL, datefrom integer DEFAULT 0 NOT NULL, @@ -462,9 +463,12 @@ pin integer DEFAULT 0 NOT NULL, cutoffstop integer DEFAULT 0 NOT NULL, consentdate integer DEFAULT 0 NOT NULL, + einvoice smallint DEFAULT NULL, + invoicenotice smallint DEFAULT NULL, + mailingnotice smallint DEFAULT NULL, divisionid integer DEFAULT 0 NOT NULL, - paytime smallint DEFAULT -1 NOT NULL, - paytype smallint DEFAULT NULL, + paytime smallint DEFAULT -1 NOT NULL, + paytype smallint DEFAULT NULL, PRIMARY KEY (id) ); @@ -493,12 +497,16 @@ DROP TABLE customerassignments CASCADE; CREATE TABLE customerassignments ( id integer DEFAULT nextval('customerassignments_id_seq'::text) NOT NULL, - customergroupid integer DEFAULT 0 NOT NULL, - customerid integer DEFAULT 0 NOT NULL, + customergroupid integer NOT NULL, + REFERENCES customergroups (id) ON DELETE CASCADE ON UPDATE CASCADE, + customerid integer NOT NULL + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (id), UNIQUE (customergroupid, customerid) ); +CREATE INDEX customerassignments_customerid_idx ON customerassignments (customerid); + /* -------------------------------------------------------- Structure of table "stats" -------------------------------------------------------- */ @@ -1142,11 +1150,13 @@ DROP TABLE excludedgroups CASCADE; CREATE TABLE excludedgroups ( id integer NOT NULL DEFAULT nextval('excludedgroups_id_seq'::text), - customergroupid integer NOT NULL DEFAULT 0, + customergroupid integer NOT NULL, + REFERENCES customergroups (id) ON DELETE CASCADE ON UPDATE CASCADE, userid integer NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE (userid, customergroupid) ); +CREATE INDEX excludedgroups_customergroupid_idx ON excludedgroups (customergroupid); /* --------------------------------------------------- Structure of table "states" @@ -1475,4 +1485,4 @@ INSERT INTO nastypes (name) VALUES ('usrhiper'); INSERT INTO nastypes (name) VALUES ('other'); -INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010081700'); +INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121000'); From cvs w lms.org.pl Tue Dec 14 09:16:31 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:31 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20101214081631.5501E3039A47@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:31 Author: alec Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.365&r2=1.366 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.365 lms/lib/locale/pl/strings.php:1.366 --- lms/lib/locale/pl/strings.php:1.365 Fri Jul 9 10:45:52 2010 +++ lms/lib/locale/pl/strings.php Tue Dec 14 09:16:31 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.365 2010/07/09 08:45:52 alec Exp $ + * $Id: strings.php,v 1.366 2010/12/14 08:16:31 alec Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresów)'; @@ -1960,7 +1960,10 @@ $_LANG['Enter notice contents'] = 'Wprowadź treść powiadomienia'; $_LANG['Select days number of cutoff suspending'] = 'Wybierz ilość dni zawieszenia blokowania'; $_LANG['Open attachment'] = 'Otwórz załącznik'; -$_LANG['Consent for personal data processing:'] = 'Zgoda na przetwarzanie danych osobowych:'; +$_LANG['Consent to personal data processing:'] = 'Zgoda na przetwarzanie danych osobowych:'; +$_LANG['Consent to electronic invoices:'] = 'Zgoda na faktury elektroniczne:'; +$_LANG['Consent to invoices delivery via e-mail:'] = 'Zgoda na dostarczanie faktur pocztą elektroniczną:'; +$_LANG['Consent to messages delivery via e-mail or sms:'] = 'Zgoda na dostarczanie informacji pocztą elektr. lub smsem:'; $_LANG['no consent'] = 'brak zgody'; $_LANG['Rows: $0'] = 'Liczba wierszy: $0'; $_LANG['private person'] = 'osoba fizyczna'; From cvs w lms.org.pl Tue Dec 14 09:16:31 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:31 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/upgradedb (2 files) Message-ID: <20101214081631.91A783039A4B@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:31 Author: alec Path: /cvsroot/lms/lib/upgradedb Added: mysql.2010121000.php postgres.2010121000.php - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2010121000.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2010121000.php?rev=1.1 Index: lms/lib/upgradedb/mysql.2010121000.php diff -u /dev/null lms/lib/upgradedb/mysql.2010121000.php:1.1 --- /dev/null Tue Dec 14 09:16:31 2010 +++ lms/lib/upgradedb/mysql.2010121000.php Tue Dec 14 09:16:31 2010 @@ -0,0 +1,67 @@ +BeginTrans(); + +$DB->EXECUTE("DROP VIEW customersview"); + +$DB->EXECUTE("ALTER TABLE customers ADD einvoice tinyint(1) DEFAULT NULL"); +$DB->EXECUTE("ALTER TABLE customers ADD invoicenotice tinyint(1) DEFAULT NULL"); +$DB->EXECUTE("ALTER TABLE customers ADD mailingnotice tinyint(1) DEFAULT NULL"); + +$DB->EXECUTE("CREATE VIEW customersview AS + SELECT c.* FROM customers c + WHERE NOT EXISTS ( + SELECT 1 FROM customerassignments a + JOIN excludedgroups e ON (a.customergroupid = e.customergroupid) + WHERE e.userid = lms_current_user() AND a.customerid = c.id)"); + +$DB->EXECUTE("DELETE FROM assignments WHERE customerid NOT IN (SELECT id FROM customers)"); +$DB->EXECUTE("ALTER TABLE assignments ADD FOREIGN KEY (customerid) + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE"); +$DB->EXECUTE("ALTER TABLE assignments MODIFY customerid int(11) NOT NULL"); + +$DB->EXECUTE("DELETE FROM customerassignments WHERE customerid NOT IN (SELECT id FROM customers)"); +$DB->EXECUTE("ALTER TABLE customerassignments ADD FOREIGN KEY (customerid) + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE"); +$DB->EXECUTE("ALTER TABLE customerassignments MODIFY customerid int(11) NOT NULL"); + +$DB->EXECUTE("DELETE FROM customerassignments WHERE customergroupid NOT IN (SELECT id FROM customergroups)"); +$DB->EXECUTE("ALTER TABLE customerassignments ADD FOREIGN KEY (customergroupid) + REFERENCES customergroups (id) ON DELETE CASCADE ON UPDATE CASCADE"); +$DB->EXECUTE("ALTER TABLE customerassignments MODIFY customergroupid int(11) NOT NULL"); + +$DB->EXECUTE("ALTER TABLE customerassignments ADD INDEX customerid (customerid)"); + +$DB->EXECUTE("DELETE FROM excludedgroups WHERE customergroupid NOT IN (SELECT id FROM customergroups)"); +$DB->EXECUTE("ALTER TABLE excludedgroups ADD FOREIGN KEY (customergroupid) + REFERENCES customergroups (id) ON DELETE CASCADE ON UPDATE CASCADE"); +$DB->EXECUTE("ALTER TABLE excludedgroups MODIFY customergroupid int(11) NOT NULL"); + +$DB->EXECUTE("ALTER TABLE excludedgroups ADD INDEX customergroupid (customergroupid)"); + +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2010121000', 'dbversion')); + +$DB->CommitTrans(); + +?> Index: lms/lib/upgradedb/postgres.2010121000.php diff -u /dev/null lms/lib/upgradedb/postgres.2010121000.php:1.1 --- /dev/null Tue Dec 14 09:16:31 2010 +++ lms/lib/upgradedb/postgres.2010121000.php Tue Dec 14 09:16:31 2010 @@ -0,0 +1,69 @@ +BeginTrans(); + +$DB->Execute(" + DROP VIEW customersview; + + ALTER TABLE customers ADD einvoice smallint DEFAULT NULL; + ALTER TABLE customers ADD invoicenotice smallint DEFAULT NULL; + ALTER TABLE customers ADD mailingnotice smallint DEFAULT NULL; + + CREATE VIEW customersview AS + SELECT c.* FROM customers c + WHERE NOT EXISTS ( + SELECT 1 FROM customerassignments a + JOIN excludedgroups e ON (a.customergroupid = e.customergroupid) + WHERE e.userid = lms_current_user() AND a.customerid = c.id); + + DELETE FROM assignments WHERE customerid NOT IN (SELECT id FROM customers); + ALTER TABLE assignments ADD FOREIGN KEY (customerid) + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE; + ALTER TABLE assignments ALTER customerid DROP DEFAULT; + + DELETE FROM customerassignments WHERE customerid NOT IN (SELECT id FROM customers); + ALTER TABLE customerassignments ADD FOREIGN KEY (customerid) + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE; + ALTER TABLE customerassignments ALTER customerid DROP DEFAULT; + + DELETE FROM customerassignments WHERE customergroupid NOT IN (SELECT id FROM customergroups); + ALTER TABLE customerassignments ADD FOREIGN KEY (customergroupid) + REFERENCES customergroups (id) ON DELETE CASCADE ON UPDATE CASCADE; + ALTER TABLE customerassignments ALTER customergroupid DROP DEFAULT; + + CREATE INDEX customerassignments_customerid_idx ON customerassignments (customerid); + + DELETE FROM excludedgroups WHERE customergroupid NOT IN (SELECT id FROM customergroups); + ALTER TABLE excludedgroups ADD FOREIGN KEY (customergroupid) + REFERENCES customergroups (id) ON DELETE CASCADE ON UPDATE CASCADE; + ALTER TABLE excludedgroups ALTER customergroupid DROP DEFAULT; + + CREATE INDEX excludedgroups_customergroupid_idx ON excludedgroups (customergroupid); +"); + +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2010121000', 'dbversion')); + +$DB->CommitTrans(); + +?> From cvs w lms.org.pl Tue Dec 14 09:16:31 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:31 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/sk (strings.php) Message-ID: <20101214081631.756D33039A49@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:31 Author: alec Path: /cvsroot/lms/lib/locale/sk Modified: strings.php - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/sk/strings.php.diff?&r1=1.13&r2=1.14 Index: lms/lib/locale/sk/strings.php diff -u lms/lib/locale/sk/strings.php:1.13 lms/lib/locale/sk/strings.php:1.14 --- lms/lib/locale/sk/strings.php:1.13 Thu Mar 11 14:07:35 2010 +++ lms/lib/locale/sk/strings.php Tue Dec 14 09:16:31 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.13 2010/03/11 13:07:35 alec Exp $ + * $Id: strings.php,v 1.14 2010/12/14 08:16:31 alec Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresy)'; @@ -1996,7 +1996,7 @@ $_LANG['Enter warning message contents'] = 'Zadajte text varovania'; $_LANG['Select days number of cutoff suspending'] = 'Vyberte počet dní od pozastavenia blokovania'; $_LANG['Open attachment'] = 'Otvoriť prílohu'; -$_LANG['Consent for personal data processing:'] = 'Súhlas na spracovanie osobných údajov:'; +$_LANG['Consent to personal data processing:'] = 'Súhlas na spracovanie osobných údajov:'; $_LANG['no consent'] = 'bez dohody'; $_LANG['TRANSFER'] = 'TRANSFER'; $_LANG['Rows: $0'] = 'Počet riadkov: $0'; From cvs w lms.org.pl Tue Dec 14 09:16:31 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:31 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/lt (strings.php) Message-ID: <20101214081631.2E9393039A46@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:31 Author: alec Path: /cvsroot/lms/lib/locale/lt Modified: strings.php - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/lt/strings.php.diff?&r1=1.8&r2=1.9 Index: lms/lib/locale/lt/strings.php diff -u lms/lib/locale/lt/strings.php:1.8 lms/lib/locale/lt/strings.php:1.9 --- lms/lib/locale/lt/strings.php:1.8 Tue Jun 22 08:19:31 2010 +++ lms/lib/locale/lt/strings.php Tue Dec 14 09:16:31 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.8 2010/06/22 06:19:31 chilek Exp $ + * $Id: strings.php,v 1.9 2010/12/14 08:16:31 alec Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresas)'; @@ -1996,7 +1996,7 @@ $_LANG['Enter warning message contents'] = '?veskite persp?jimo turin?'; $_LANG['Select days number of cutoff suspending'] = 'Pasirink blokavimo nutraukimo dien? skaiči?'; $_LANG['Open attachment'] = 'Atidaryk prikabintą failą'; -$_LANG['Consent for personal data processing:'] = 'Sutikimas naudoti asmens duomenis:'; +$_LANG['Consent to personal data processing:'] = 'Sutikimas naudoti asmens duomenis:'; $_LANG['no consent'] = 'n?ra sutikimo'; $_LANG['TRANSFER'] = 'PERVEDIMAS'; $_LANG['Rows: $0'] = 'Eiluči? skaičius: $0'; From cvs w lms.org.pl Tue Dec 14 09:16:30 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:30 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (LMS.class.php, upgradedb.php) Message-ID: <20101214081631.084F33039A44@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:30 Author: alec Path: /cvsroot/lms/lib Modified: LMS.class.php upgradedb.php - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMS.class.php.diff?&r1=1.1038&r2=1.1039 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb.php.diff?&r1=1.179&r2=1.180 Index: lms/lib/LMS.class.php diff -u lms/lib/LMS.class.php:1.1038 lms/lib/LMS.class.php:1.1039 --- lms/lib/LMS.class.php:1.1038 Fri Jul 9 10:45:51 2010 +++ lms/lib/LMS.class.php Tue Dec 14 09:16:30 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMS.class.php,v 1.1038 2010/07/09 08:45:51 alec Exp $ + * $Id: LMS.class.php,v 1.1039 2010/12/14 08:16:30 alec Exp $ */ // LMS Class - contains internal LMS database functions used @@ -34,7 +34,7 @@ var $CONFIG; // table including lms.ini options var $cache = array(); // internal cache var $_version = '1.11-cvs'; // class version - var $_revision = '$Revision: 1.1038 $'; + var $_revision = '$Revision: 1.1039 $'; function LMS(&$DB, &$AUTH, &$CONFIG) // class variables setting { @@ -387,37 +387,41 @@ function CustomerAdd($customeradd) { - if($this->DB->Execute('INSERT INTO customers (name, lastname, type, - address, zip, city, countryid, email, ten, ssn, status, creationdate, - creatorid, info, notes, serviceaddr, message, pin, regon, rbe, - icn, cutoffstop, consentdate, divisionid, paytime, paytype) - VALUES (?, UPPER(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?NOW?, - ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', - array(lms_ucwords($customeradd['name']), - $customeradd['lastname'], + if($this->DB->Execute('INSERT INTO customers (name, lastname, type, + address, zip, city, countryid, email, ten, ssn, status, creationdate, + creatorid, info, notes, serviceaddr, message, pin, regon, rbe, + icn, cutoffstop, consentdate, einvoice, divisionid, paytime, paytype, + invoicenotice, mailingnotice) + VALUES (?, UPPER(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?NOW?, + ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + array(lms_ucwords($customeradd['name']), + $customeradd['lastname'], empty($customeradd['type']) ? 0 : 1, - $customeradd['address'], - $customeradd['zip'], - $customeradd['city'], - $customeradd['countryid'], - $customeradd['email'], - $customeradd['ten'], - $customeradd['ssn'], - $customeradd['status'], - $this->AUTH->id, - $customeradd['info'], + $customeradd['address'], + $customeradd['zip'], + $customeradd['city'], + $customeradd['countryid'], + $customeradd['email'], + $customeradd['ten'], + $customeradd['ssn'], + $customeradd['status'], + $this->AUTH->id, + $customeradd['info'], $customeradd['notes'], - $customeradd['serviceaddr'], - $customeradd['message'], + $customeradd['serviceaddr'], + $customeradd['message'], $customeradd['pin'], $customeradd['regon'], $customeradd['rbe'], $customeradd['icn'], $customeradd['cutoffstop'], $customeradd['consentdate'], + $customeradd['einvoice'], $customeradd['divisionid'], $customeradd['paytime'], !empty($customeradd['paytype']) ? $customeradd['paytype'] : NULL, + $customeradd['invoicenotice'], + $customeradd['mailingnotice'], ))) { return $this->DB->GetLastInsertID('customers'); @@ -428,7 +432,7 @@ function DeleteCustomer($id) { $this->DB->BeginTrans(); - + $this->DB->Execute('UPDATE customers SET deleted=1, moddate=?NOW?, modid=? WHERE id=?', array($this->AUTH->id, $id)); $this->DB->Execute('DELETE FROM customerassignments WHERE customerid=?', array($id)); @@ -443,7 +447,7 @@ // Remove Userpanel rights if(!empty($this->CONFIG['directories']['userpanel_dir'])) $this->DB->Execute('DELETE FROM up_rights_assignments WHERE customerid=?', array($id)); - + $this->DB->CommitTrans(); } @@ -453,7 +457,8 @@ zip=?, city=?, countryid=?, email=?, ten=?, ssn=?, moddate=?NOW?, modid=?, info=?, notes=?, serviceaddr=?, lastname=UPPER(?), name=?, deleted=0, message=?, pin=?, regon=?, icn=?, rbe=?, - cutoffstop=?, consentdate=?, divisionid=?, paytime=?, paytype=? + cutoffstop=?, consentdate=?, einvoice=?, invoicenotice=?, mailingnotice=?, + divisionid=?, paytime=?, paytype=? WHERE id=?', array( $customerdata['status'], empty($customerdata['type']) ? 0 : 1, @@ -477,6 +482,9 @@ $customerdata['rbe'], $customerdata['cutoffstop'], $customerdata['consentdate'], + $customerdata['einvoice'], + $customerdata['invoicenotice'], + $customerdata['mailingnotice'], $customerdata['divisionid'], $customerdata['paytime'], $customerdata['paytype'] ? $customerdata['paytype'] : null, @@ -527,7 +535,7 @@ $result['up_logins'] = $this->DB->GetRow('SELECT lastlogindate, lastloginip, failedlogindate, failedloginip FROM up_customers WHERE customerid = ?', array($result['id'])); - + if($cstate = $this->DB->GetRow('SELECT s.id, s.name FROM states s, zipcodes WHERE zip = ? AND stateid = s.id', array($result['zip']))) { @@ -544,7 +552,7 @@ $result['contacts'] = $this->DB->GetAll('SELECT phone, name FROM customercontacts WHERE customerid = ? ORDER BY id', array($result['id'])); - + return $result; } else @@ -977,15 +985,12 @@ function CustomergroupDelete($id) { - if (!$this->CustomergroupWithCustomerGet($id)) - { - $this->DB->BeginTrans(); + if (!$this->CustomergroupWithCustomerGet($id)) + { $this->DB->Execute('DELETE FROM customergroups WHERE id=?', array($id)); - $this->DB->Execute('DELETE FROM excludedgroups WHERE customergroupid=?', array($id)); - $this->DB->CommitTrans(); return TRUE; - } - else + } + else return FALSE; } Index: lms/lib/upgradedb.php diff -u lms/lib/upgradedb.php:1.179 lms/lib/upgradedb.php:1.180 --- lms/lib/upgradedb.php:1.179 Tue Aug 17 10:55:35 2010 +++ lms/lib/upgradedb.php Tue Dec 14 09:16:30 2010 @@ -21,10 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: upgradedb.php,v 1.179 2010/08/17 08:55:35 alec Exp $ + * $Id: upgradedb.php,v 1.180 2010/12/14 08:16:30 alec Exp $ */ -define('DBVERSION', '2010081700'); // here should be always the newest version of database! +define('DBVERSION', '2010121000'); // here should be always the newest version of database! // it placed here to avoid read disk every time when we call this file. /* @@ -43,23 +43,23 @@ return $files; } -if($dbversion = $DB->GetOne('SELECT keyvalue FROM dbinfo WHERE keytype = ?',array('dbversion'))) +if($dbversion = $DB->GetOne('SELECT keyvalue FROM dbinfo WHERE keytype = ?',array('dbversion'))) { if(DBVERSION > $dbversion) { set_time_limit(0); $lastupgrade = $dbversion; $_dbtype = $CONFIG['database']['type'] == 'mysqli' ? 'mysql' : $CONFIG['database']['type']; - + $upgradelist = getdir(LIB_DIR.'/upgradedb/', '^'.$_dbtype.'.[0-9]{10}.php$'); if(sizeof($upgradelist)) foreach($upgradelist as $upgrade) { $upgradeversion = preg_replace('/^'.$_dbtype.'\.([0-9]{10})\.php$/','\1',$upgrade); - + if($upgradeversion > $dbversion && $upgradeversion <= DBVERSION) $pendingupgrades[] = $upgradeversion; } - + if(sizeof($pendingupgrades)) { sort($pendingupgrades); @@ -73,6 +73,7 @@ } } } +} $layout['dbschversion'] = isset($lastupgrade) ? $lastupgrade : DBVERSION; From cvs w lms.org.pl Tue Dec 14 09:16:31 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 09:16:31 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (4 files) Message-ID: <20101214081631.C84D0302C928@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 09:16:31 Author: alec Path: /cvsroot/lms/templates Modified: customeradd.html customereditbox.html customerinfobox.html customerinfoshort.html - added "consent to e-invoices" switch in customer data - added "consent to invoices delivery via e-mail" switch in customer data - added "consent to messages delivery via e-mail or sms" switch in customer data Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/customeradd.html.diff?&r1=1.38&r2=1.39 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customereditbox.html.diff?&r1=1.35&r2=1.36 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfobox.html.diff?&r1=1.44&r2=1.45 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfoshort.html.diff?&r1=1.18&r2=1.19 Index: lms/templates/customeradd.html diff -u lms/templates/customeradd.html:1.38 lms/templates/customeradd.html:1.39 --- lms/templates/customeradd.html:1.38 Mon Jun 21 10:58:17 2010 +++ lms/templates/customeradd.html Tue Dec 14 09:16:31 2010 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{literal} - + {foreach from=$customeradd.contacts item=item key=key} + - - {foreach from=$customeradd.contacts item=item key=key} - - - - - {/foreach} -
+ + + + + {/foreach} + + + {t}Add contact field{/t} »»» @@ -245,11 +246,17 @@ - + - {t}Deadline:{/t} @@ -258,27 +265,27 @@ - - - - - - - - {t}Payment type:{/t} {foreach from=$_PAYTYPES item=item key=key} {/foreach} - - - - - - - - {t}Cutoff suspending:{/t} @@ -291,17 +298,51 @@ - - + + + + - + - {t}Consent for personal data processing:{/t} - - - + + + + + + + + + + + + + + + + + +
+ {t}Consent to personal data processing:{/t} + + +
+ {t}Consent to electronic invoices:{/t} + + +
+ {t}Consent to invoices delivery via e-mail:{/t} + + +
+ {t}Consent to messages delivery via e-mail or sms:{/t} + + +
+ + Index: lms/templates/customereditbox.html diff -u lms/templates/customereditbox.html:1.35 lms/templates/customereditbox.html:1.36 --- lms/templates/customereditbox.html:1.35 Mon Jun 21 10:58:17 2010 +++ lms/templates/customereditbox.html Tue Dec 14 09:16:31 2010 @@ -1,4 +1,4 @@ - + {literal} + {foreach from=$customerinfo.contacts item=item key=key} - - - {foreach from=$customerinfo.contacts item=item key=key} - - - - - {/foreach} -
+ + + + + + {/foreach} + + + {t}Add contact field{/t} »»» @@ -239,11 +240,17 @@ - + - {t}Deadline:{/t} @@ -252,28 +259,27 @@ - - - - - - - - {t}Payment type:{/t} + + + + + {t}Payment type:{/t} + + - - - - - - - - {t}Cutoff suspending:{/t} @@ -286,16 +292,51 @@ + + + - + - {t}Consent for personal data processing:{/t} - - + + + + + + + + + + + + + + + + + +
+ {t}Consent to personal data processing:{/t} + + +
+ {t}Consent to electronic invoices:{/t} + + +
+ {t}Consent to invoices delivery via e-mail:{/t} + + +
+ {t}Consent to messages delivery via e-mail or sms:{/t} + + +
+ Index: lms/templates/customerinfobox.html diff -u lms/templates/customerinfobox.html:1.44 lms/templates/customerinfobox.html:1.45 --- lms/templates/customerinfobox.html:1.44 Mon Jun 21 10:58:17 2010 +++ lms/templates/customerinfobox.html Tue Dec 14 09:16:31 2010 @@ -1,4 +1,4 @@ - + - -{if $customerinfo.contacts} +{foreach from=$customerinfo.contacts item=item} -{/if} +{/foreach} {if $customerinfo.serviceaddr neq ""} -{/if} +{/if} - - - -{if $customerinfo.cutoffstop > $smarty.now} - - - - -{/if} - - - - +
@@ -44,7 +44,7 @@
+ @@ -54,18 +54,16 @@ {if $customerinfo.country}
{t}{$customerinfo.country}{/t}{/if}
- {foreach from=$customerinfo.contacts item=item} - {if $item.phone}{$item.phone}{if $item.name} ({$item.name|truncate:"40":"...":true}){/if}
{/if} - {/foreach} + {if $item.phone}{$item.phone}{if $item.name} ({$item.name|truncate:"40":"...":true}){/if}
{/if}
@@ -181,43 +179,82 @@ {$customerinfo.bankaccount}
+ - {t}Deadline:{/t} {if $customerinfo.paytime eq -1}{t}default{/t}{else}{$customerinfo.paytime} {t}days{/t}{/if} + + + + + + + + + + {if $customerinfo.cutoffstop > $smarty.now} + + + + {/if} +
+ {t}Deadline:{/t} + + {if $customerinfo.paytime eq -1}{t}default{/t}{else}{$customerinfo.paytime} {t}days{/t}{/if} +
+ {t}Payment type:{/t} + + {assign var=paytype value=$customerinfo.paytype}{if $_PAYTYPES.$paytype}{$_PAYTYPES.$paytype}{else}{t}default{/t}{/if} +
+ + {t 0=$customerinfo.cutoffstop|date_format:"%Y/%m/%d"}Cutoff suspended to $0{/t} + +
+ - {t}Payment type:{/t} {assign var=paytype value=$customerinfo.paytype}{if $_PAYTYPES.$paytype}{$_PAYTYPES.$paytype}{else}{t}default{/t}{/if} -
- - - - {t 0=$customerinfo.cutoffstop|date_format:"%Y/%m/%d"}Cutoff suspended to $0{/t} - -
- - - {t}Consent for personal data processing:{/t} {if $customerinfo.consentdate}{$customerinfo.consentdate}{else}{t}no consent{/t}{/if} -
+ + + + + + + + + + + + + + + + +
+ {t}Consent to personal data processing:{/t} + + {if $customerinfo.consentdate}{$customerinfo.consentdate}{else}{t}no{/t}{/if} +
+ {t}Consent to electronic invoices:{/t} + + {if $customerinfo.einvoice}{t}yes{/t}{else}{t}no{/t}{/if} +
+ {t}Consent to invoices delivery via e-mail:{/t} + + {if $customerinfo.invoicenotice}{t}yes{/t}{else}{t}no{/t}{/if} +
+ {t}Consent to messages delivery via e-mail or sms:{/t} + + {if $customerinfo.mailingnotice}{t}yes{/t}{else}{t}no{/t}{/if} +
+ + @@ -332,7 +369,7 @@ {t}Delete{/t} [ {t}Delete{/t} ] {/if} - {if $info_link} + {if $info_link} {t}Info{/t} [ {t}Info{/t} ] {/if} Index: lms/templates/customerinfoshort.html diff -u lms/templates/customerinfoshort.html:1.18 lms/templates/customerinfoshort.html:1.19 --- lms/templates/customerinfoshort.html:1.18 Mon May 24 09:43:18 2010 +++ lms/templates/customerinfoshort.html Tue Dec 14 09:16:31 2010 @@ -1,5 +1,5 @@ - + @@ -22,7 +22,7 @@ {if $customerinfo.status eq "3"}{/if} {if $customerinfo.status eq "2"}{/if} - {if $customerinfo.status eq "1"}{/if} + {if $customerinfo.status eq "1"}{/if} {if $customerinfo.status eq "3"}{t}connected{/t}{/if} @@ -40,18 +40,16 @@ {t}{$customerinfo.country}{/t} -{if $customerinfo.contacts} +{foreach from=$customerinfo.contacts item=item} - {foreach from=$customerinfo.contacts item=item} - {if $item.phone}{$item.phone}{if $item.name} ({$item.name|truncate:"40":"...":true}){/if}
{/if} - {/foreach} + {if $item.phone}{$item.phone}{if $item.name} ({$item.name|truncate:"40":"...":true}){/if}
{/if} -{/if} +{/foreach} {if $customerinfo.serviceaddr neq ""} From cvs w lms.org.pl Tue Dec 14 15:03:57 2010 From: cvs w lms.org.pl (LMS CVS) Date: Tue, 14 Dec 2010 15:03:57 +0100 (CET) Subject: [lms-commits] CVS update of lms/devel (strings.sh) Message-ID: <20101214140357.3B4C1302C928@hydra.altec.pl> Date: Tuesday, December 14, 2010 @ 15:03:57 Author: alec Path: /cvsroot/lms/devel Modified: strings.sh - Fix test operator Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/devel/strings.sh.diff?&r1=1.17&r2=1.18 Index: lms/devel/strings.sh diff -u lms/devel/strings.sh:1.17 lms/devel/strings.sh:1.18 --- lms/devel/strings.sh:1.17 Fri Jan 30 14:10:47 2009 +++ lms/devel/strings.sh Tue Dec 14 15:03:57 2010 @@ -106,7 +106,7 @@ rm tmp_strings echo "done." -if [ $diff == 1 ] +if [ "$diff" = "1" ] then echo -n "Creating diff... " # parse new and old strings.php files @@ -124,7 +124,7 @@ rm strings.new 2>/dev/null rm strings.old 2>/dev/null DIFFLINESNUM=`cat strings.diff | wc -l` - if [ $DIFFLINESNUM == 0 ] + if [ "$DIFFLINESNUM" = "0" ] then rm strings.diff fi From cvs w lms.org.pl Wed Dec 15 13:10:14 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:14 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/html/en (devel-db.html) Message-ID: <20101215121014.58FEF3039A45@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:14 Author: alec Path: /cvsroot/lms/doc/html/en Modified: devel-db.html - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/html/en/devel-db.html.diff?&r1=1.61&r2=1.62 Index: lms/doc/html/en/devel-db.html diff -u lms/doc/html/en/devel-db.html:1.61 lms/doc/html/en/devel-db.html:1.62 --- lms/doc/html/en/devel-db.html:1.61 Tue Dec 14 09:16:30 2010 +++ lms/doc/html/en/devel-db.html Wed Dec 15 13:10:14 2010 @@ -1776,6 +1776,10 @@ >name - contact name/descriptiontype - contact type (sum of: 1-mobile, 2-fax) Date: Wednesday, December 15, 2010 @ 13:10:14 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog README README.pl lms.mysql lms.pgsql - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1519&r2=1.1520 http://cvs.lms.org.pl/viewvc/Development/lms/doc/README.diff?&r1=1.226&r2=1.227 http://cvs.lms.org.pl/viewvc/Development/lms/doc/README.pl.diff?&r1=1.55&r2=1.56 http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.mysql.diff?&r1=1.175&r2=1.176 http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.pgsql.diff?&r1=1.171&r2=1.172 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1519 lms/doc/ChangeLog:1.1520 --- lms/doc/ChangeLog:1.1519 Tue Dec 14 09:16:29 2010 +++ lms/doc/ChangeLog Wed Dec 15 13:10:13 2010 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1519 2010/12/14 08:16:29 alec Exp $ +$Id: ChangeLog,v 1.1520 2010/12/15 12:10:13 alec Exp $ version ? (????-??-??) @@ -48,6 +48,7 @@ - added "consent to e-invoices" switch in customer data (alec) - added "consent to invoices delivery via e-mail" switch in customer data (alec) - added "consent to messages delivery via e-mail or sms" switch in customer data (alec) + - added possibility to set type (mobile/fax) of customer contact (alec) version 1.11.10 Kri (2010-04-19) Index: lms/doc/README diff -u lms/doc/README:1.226 lms/doc/README:1.227 --- lms/doc/README:1.226 Tue Dec 14 09:16:29 2010 +++ lms/doc/README Wed Dec 15 13:10:13 2010 @@ -5750,6 +5750,7 @@ customerid - customer serial number phone - phone number name - contact name/description + type - contact type (sum of: 1-mobile, 2-fax) __________________________________________________________________ 7.2.36. Domains ('domains') Index: lms/doc/README.pl diff -u lms/doc/README.pl:1.55 lms/doc/README.pl:1.56 --- lms/doc/README.pl:1.55 Tue Dec 14 09:16:29 2010 +++ lms/doc/README.pl Wed Dec 15 13:10:13 2010 @@ -6657,6 +6657,7 @@ customerid - identyfikator klienta phone - numer telefoniczny name - nazwa/opis kontaktu + type - typ kontaktu (suma flag: 1-komórka, 2-fax) __________________________________________________________________ 7.2.36. Domeny ('domains') Index: lms/doc/lms.mysql diff -u lms/doc/lms.mysql:1.175 lms/doc/lms.mysql:1.176 --- lms/doc/lms.mysql:1.175 Tue Dec 14 09:16:29 2010 +++ lms/doc/lms.mysql Wed Dec 15 13:10:14 2010 @@ -1,5 +1,5 @@ # -------------------------------------------------------- -# $Id: lms.mysql,v 1.175 2010/12/14 08:16:29 alec Exp $ +# $Id: lms.mysql,v 1.176 2010/12/15 12:10:14 alec Exp $ # -------------------------------------------------------- # @@ -929,12 +929,12 @@ disabled tinyint(1) DEFAULT '0' NOT NULL, PRIMARY KEY (id), UNIQUE KEY name (name) -) ENGINE=InnoDB; +) ENGINE=InnoDB; # -------------------------------------------------------- # # Structure of table cashreglog -# +# DROP TABLE IF EXISTS cashreglog; CREATE TABLE cashreglog ( id int(11) NOT NULL auto_increment, @@ -1009,7 +1009,8 @@ DROP TABLE IF EXISTS imessengers; CREATE TABLE imessengers ( id int(11) NOT NULL auto_increment, - customerid int(11) NOT NULL DEFAULT '0', + customerid int(11) NOT NULL + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE, uid varchar(32) NOT NULL DEFAULT '', type tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (id), @@ -1023,9 +1024,11 @@ DROP TABLE IF EXISTS customercontacts; CREATE TABLE customercontacts ( id int(11) NOT NULL auto_increment, - customerid int(11) NOT NULL DEFAULT 0, + customerid int(11) NOT NULL + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE, name varchar(255) NOT NULL DEFAULT '', phone varchar(255) NOT NULL DEFAULT '', + type smallint DEFAULT NULL, PRIMARY KEY (id), INDEX customerid (customerid), INDEX phone (phone) @@ -1292,9 +1295,9 @@ fieldvalue varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (id) ) ENGINE=InnoDB; - + INSERT INTO uiconfig (section, var) - VALUES ('userpanel', 'data_consent_text'); + VALUES ('userpanel', 'data_consent_text'); INSERT INTO uiconfig (section, var, value, description, disabled) VALUES ('userpanel', 'disable_transferform', '0', '', 0); INSERT INTO uiconfig (section, var, value, description, disabled) @@ -1384,4 +1387,4 @@ # -------------------------------------------------------- -INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121000'); +INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121400'); Index: lms/doc/lms.pgsql diff -u lms/doc/lms.pgsql:1.171 lms/doc/lms.pgsql:1.172 --- lms/doc/lms.pgsql:1.171 Tue Dec 14 09:16:29 2010 +++ lms/doc/lms.pgsql Wed Dec 15 13:10:14 2010 @@ -1,4 +1,4 @@ -/* $Id: lms.pgsql,v 1.171 2010/12/14 08:16:29 alec Exp $ */ +/* $Id: lms.pgsql,v 1.172 2010/12/15 12:10:14 alec Exp $ */ /* -------------------------------------------------------- Structure of table "users" @@ -1119,7 +1119,8 @@ DROP TABLE imessengers CASCADE; CREATE TABLE imessengers ( id integer DEFAULT nextval('imessengers_id_seq'::text) NOT NULL, - customerid integer DEFAULT 0 NOT NULL, + customerid integer NOT NULL + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE, uid varchar(32) DEFAULT '' NOT NULL, type smallint DEFAULT 0 NOT NULL, PRIMARY KEY (id) @@ -1134,9 +1135,11 @@ DROP TABLE customercontacts CASCADE; CREATE TABLE customercontacts ( id integer DEFAULT nextval('customercontacts_id_seq'::text) NOT NULL, - customerid integer NOT NULL DEFAULT 0, + customerid integer NOT NULL + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE, name varchar(255) NOT NULL DEFAULT '', phone varchar(255) NOT NULL DEFAULT '', + type smallint DEFAULT NULL, PRIMARY KEY (id) ); CREATE INDEX customercontacts_customerid_idx ON customercontacts (customerid); @@ -1485,4 +1488,4 @@ INSERT INTO nastypes (name) VALUES ('usrhiper'); INSERT INTO nastypes (name) VALUES ('other'); -INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121000'); +INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121400'); From cvs w lms.org.pl Wed Dec 15 13:10:14 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:14 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/sgml (advanced.sgml) Message-ID: <20101215121014.A57D53039A47@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:14 Author: alec Path: /cvsroot/lms/doc/sgml Modified: advanced.sgml - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/sgml/advanced.sgml.diff?&r1=1.115&r2=1.116 Index: lms/doc/sgml/advanced.sgml diff -u lms/doc/sgml/advanced.sgml:1.115 lms/doc/sgml/advanced.sgml:1.116 --- lms/doc/sgml/advanced.sgml:1.115 Tue Dec 14 09:16:30 2010 +++ lms/doc/sgml/advanced.sgml Wed Dec 15 13:10:14 2010 @@ -1,4 +1,4 @@ - + For curious @@ -545,6 +545,7 @@ customerid - customer serial number phone - phone number name - contact name/description + type - contact type (sum of: 1-mobile, 2-fax)
From cvs w lms.org.pl Wed Dec 15 13:10:13 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:13 +0100 (CET) Subject: [lms-commits] CVS update of lms/bin (lms-notify-sms) Message-ID: <20101215121013.C4EB730340FE@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:13 Author: alec Path: /cvsroot/lms/bin Modified: lms-notify-sms - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-notify-sms.diff?&r1=1.42&r2=1.43 Index: lms/bin/lms-notify-sms diff -u lms/bin/lms-notify-sms:1.42 lms/bin/lms-notify-sms:1.43 --- lms/bin/lms-notify-sms:1.42 Tue Mar 30 09:29:06 2010 +++ lms/bin/lms-notify-sms Wed Dec 15 13:10:13 2010 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-notify-sms,v 1.42 2010/03/30 07:29:06 alec Exp $ +# $Id: lms-notify-sms,v 1.43 2010/12/15 12:10:13 alec Exp $ use strict; use DBI; @@ -137,21 +137,17 @@ my $dbase; my $utsfmt; -my $regexp; if($dbtype =~ /mysql/) { $dbase = DBI->connect("DBI:mysql:database=$dbname;host=$dbhost","$dbuser","$dbpasswd", { RaiseError => 1 }); $dbase->do("SET NAMES utf8"); $utsfmt = "UNIX_TIMESTAMP()"; - - $regexp = "REPLACE(REPLACE(phone, '-', ''), ' ', '') REGEXP '^(\\\\+%prefix|0)?(88[0-9]|5[01][0-9]|6[069][0-9]|7[2789][0-9])[0-9]{6}\$'"; } elsif($dbtype eq "postgres") { $dbase = DBI->connect("DBI:Pg:dbname=$dbname;host=$dbhost","$dbuser","$dbpasswd", { RaiseError => 1 }); $utsfmt = "EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0))"; - $regexp = "regexp_replace(phone, '[^0-9]', '') ~ '^(%prefix|0|)(88[0-9]|5[01][0-9]|6[069][0-9]|7[2789][0-9])[0-9]{6}$'"; } else { @@ -176,7 +172,6 @@ $query->finish(); $cfg{'prefix'} = sprintf("%d", $cfg{'prefix'}); -$regexp =~ s/\%prefix/$cfg{'prefix'}/; if ($script_service) { $cfg{'service'} = $script_service; @@ -253,7 +248,7 @@ } if ($data =~ /\%number/) { $data =~ s/\%number/$row->{'doc_number'}/g; - } + } if ($data =~ /\%value/) { $data =~ s/\%value/$row->{'value'}/g; } @@ -274,7 +269,7 @@ if ($p != $cfg{'prefix'}) { $phone = $cfg{'prefix'} . $phone; } - + if ($cfg{'service'} eq 'gnokii') { system("echo $sms | gnokii --sendsms $phone"); return 2; # MSG_SENT @@ -289,11 +284,11 @@ } my $filename = $dir.'/lms-'.$msgid.'-'.$phone; $sms = asciize(decode('utf-8', $sms)); - + open(SMSFILE, ">$filename") or return 'Unable to create file '.$filename.'!'; printf(SMSFILE "To: %s\n\n%s", $phone, $sms); close(SMSFILE); - + return 1; #MSG_NEW } else { return 'Unknown SMS service!'; @@ -308,14 +303,14 @@ (messageid, customerid, destination, status) VALUES (?, ?, ?, ?)"); $dbqi->execute($msgid, $cid, $phone, 1); - + my $result = send_sms($phone, $data, $msgid); my $time = mktime(localtime()); $dbqi = $dbase->prepare("UPDATE messageitems SET status = ?, lastdate = ?, error = ? WHERE messageid = ? AND customerid = ?"); - + if ($result =~ /[^0-9]/) { $dbqi->execute(3, $time, $result, $msgid, $cid); } elsif ($result == 2) { # MSG_SENT @@ -359,7 +354,7 @@ JOIN cash ON (c.id = cash.customerid) JOIN (SELECT MIN(phone) AS phone, customerid FROM customercontacts - WHERE $regexp + WHERE (type & 1) = 1 GROUP BY customerid ) x ON (x.customerid = c.id) GROUP BY c.id, c.pin, c.lastname, c.name, x.phone @@ -404,7 +399,7 @@ JOIN customers c ON (c.id = d.customerid) JOIN (SELECT MIN(phone) AS phone, customerid FROM customercontacts - WHERE $regexp + WHERE (type & 1) = 1 GROUP BY customerid ) x ON (x.customerid = d.customerid) JOIN (SELECT SUM(value) * -1 AS value, docid @@ -463,7 +458,7 @@ JOIN customers c ON (c.id = d.customerid) JOIN (SELECT MIN(phone) AS phone, customerid FROM customercontacts - WHERE $regexp + WHERE (type & 1) = 1 GROUP BY customerid ) x ON (x.customerid = d.customerid) JOIN (SELECT SUM(value) * -1 AS value, docid @@ -523,7 +518,7 @@ JOIN customers c ON (c.id = d.customerid) JOIN (SELECT MIN(phone) AS phone, customerid FROM customercontacts - WHERE $regexp + WHERE (type & 1) = 1 GROUP BY customerid ) x ON (x.customerid = d.customerid) JOIN (SELECT SUM(value) * -1 AS value, docid From cvs w lms.org.pl Wed Dec 15 13:10:15 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:15 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (4 files) Message-ID: <20101215121015.25D243039A45@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:15 Author: alec Path: /cvsroot/lms/lib Modified: LMS.class.php definitions.php language.php upgradedb.php - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMS.class.php.diff?&r1=1.1039&r2=1.1040 http://cvs.lms.org.pl/viewvc/Development/lms/lib/definitions.php.diff?&r1=1.33&r2=1.34 http://cvs.lms.org.pl/viewvc/Development/lms/lib/language.php.diff?&r1=1.53&r2=1.54 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb.php.diff?&r1=1.180&r2=1.181 Index: lms/lib/LMS.class.php diff -u lms/lib/LMS.class.php:1.1039 lms/lib/LMS.class.php:1.1040 --- lms/lib/LMS.class.php:1.1039 Tue Dec 14 09:16:30 2010 +++ lms/lib/LMS.class.php Wed Dec 15 13:10:14 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMS.class.php,v 1.1039 2010/12/14 08:16:30 alec Exp $ + * $Id: LMS.class.php,v 1.1040 2010/12/15 12:10:14 alec Exp $ */ // LMS Class - contains internal LMS database functions used @@ -34,7 +34,7 @@ var $CONFIG; // table including lms.ini options var $cache = array(); // internal cache var $_version = '1.11-cvs'; // class version - var $_revision = '$Revision: 1.1039 $'; + var $_revision = '$Revision: 1.1040 $'; function LMS(&$DB, &$AUTH, &$CONFIG) // class variables setting { @@ -433,7 +433,7 @@ { $this->DB->BeginTrans(); - $this->DB->Execute('UPDATE customers SET deleted=1, moddate=?NOW?, modid=? + $this->DB->Execute('UPDATE customers SET deleted=1, moddate=?NOW?, modid=? WHERE id=?', array($this->AUTH->id, $id)); $this->DB->Execute('DELETE FROM customerassignments WHERE customerid=?', array($id)); $this->DB->Execute('DELETE FROM assignments WHERE customerid=?', array($id)); @@ -517,6 +517,8 @@ function GetCustomer($id, $short=false) { + global $CONTACTTYPES; + if($result = $this->DB->GetRow('SELECT c.*, ' .$this->DB->Concat('UPPER(c.lastname)',"' '",'c.name').' AS customername, d.shortname AS division, d.account, co.name AS country @@ -549,10 +551,21 @@ $result['messengers'] = $this->DB->GetAllByKey('SELECT uid, type FROM imessengers WHERE customerid = ? ORDER BY type', 'type', array($result['id'])); - $result['contacts'] = $this->DB->GetAll('SELECT phone, name + $result['contacts'] = $this->DB->GetAll('SELECT phone, name, type FROM customercontacts WHERE customerid = ? ORDER BY id', array($result['id'])); + if (is_array($result['contacts'])) + foreach ($result['contacts'] as $idx => $row) { + $types = array(); + foreach ($CONTACTTYPES as $tidx => $tname) + if ($row['type'] & $tidx) + $types[] = $tname; + + if ($types) + $result['contacts'][$idx]['typestr'] = implode('/', $types); + } + return $result; } else @@ -634,7 +647,7 @@ $groupless = ($state == 8) ? 1 : 0; $tariffless = ($state == 9) ? 1 : 0; $suspended = ($state == 10) ? 1 : 0; - + if($state>3) $state = 0; Index: lms/lib/definitions.php diff -u lms/lib/definitions.php:1.33 lms/lib/definitions.php:1.34 --- lms/lib/definitions.php:1.33 Mon Jun 21 10:58:16 2010 +++ lms/lib/definitions.php Wed Dec 15 13:10:14 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: definitions.php,v 1.33 2010/06/21 08:58:16 alec Exp $ + * $Id: definitions.php,v 1.34 2010/12/15 12:10:14 alec Exp $ */ // that definitions should be included before LMS.class.php but after Smarty @@ -32,7 +32,12 @@ define('RT_RESOLVED', 2); define('RT_DEAD', 3); -$RT_STATES = array(RT_NEW => trans('new'), RT_OPEN => trans('opened'), RT_RESOLVED => trans('resolved'), RT_DEAD => trans('dead')); +$RT_STATES = array( + RT_NEW => trans('new'), + RT_OPEN => trans('opened'), + RT_RESOLVED => trans('resolved'), + RT_DEAD => trans('dead') +); // Messages status and type define('MSG_NEW', 1); @@ -51,24 +56,6 @@ define('ACCOUNT_SQL', 16); // Document types -$DOCTYPES = array( - 1 => trans('invoice'), - 2 => trans('cash receipt'), - 3 => trans('credit note'), // faktura korygujaca -// 4 => trans('credit memo'), // nota korygujaca - 5 => trans('debit note'), // nota obciazeniowa/debetowa/odsetkowa - -1 => trans('contract'), - -2 => trans('annex'), - -3 => trans('protocol'), - -4 => trans('order'), - -5 => trans('customer sheet'), // karta klienta - -6 => trans('contract termination'), - -7 => trans('payments book'), // ksiazeczka oplat - -8 => trans('payment summons'), // wezwanie do zapłaty - -9 => trans('payment pre-summons'), // przedsądowe wezw. do zapłaty - -10 => trans('other'), -); - define('DOC_INVOICE', 1); define('DOC_RECEIPT', 2); define('DOC_CNOTE', 3); @@ -81,15 +68,33 @@ define('DOC_SHEET', -5); define('DOC_OTHER', -10); +$DOCTYPES = array( + DOC_INVOICE => trans('invoice'), + DOC_RECEIPT => trans('cash receipt'), + DOC_CNOTE => trans('credit note'), // faktura korygujaca +// DOC_CMEMO => trans('credit memo'), // nota korygujaca + DOC_DNOTE => trans('debit note'), // nota obciazeniowa/debetowa/odsetkowa + DOC_CONTRACT => trans('contract'), + DOC_ANNEX => trans('annex'), + DOC_PROTOCOL => trans('protocol'), + DOC_ORDER => trans('order'), + DOC_SHEET => trans('customer sheet'), // karta klienta + -6 => trans('contract termination'), + -7 => trans('payments book'), // ksiazeczka oplat + -8 => trans('payment summons'), // wezwanie do zapłaty + -9 => trans('payment pre-summons'), // przedsądowe wezw. do zapłaty + DOC_OTHER => trans('other'), +); + // Guarantee periods $GUARANTEEPERIODS = array( --1 => trans('lifetime'), - 0 => trans('none'), -12 => trans('$0 months', 12), -24 => trans('24 months', 24), -36 => trans('$0 months', 36), -48 => trans('$0 months', 48), -60 => trans('$0 months', 60) + -1 => trans('lifetime'), + 0 => trans('none'), + 12 => trans('$0 months', 12), + 24 => trans('24 months', 24), + 36 => trans('$0 months', 36), + 48 => trans('$0 months', 48), + 60 => trans('$0 months', 60) ); // Internet Messengers @@ -98,7 +103,7 @@ define('IM_SKYPE', 2); $MESSENGERS = array( - IM_GG => trans('Gadu-Gadu'), + IM_GG => trans('Gadu-Gadu'), IM_YAHOO => trans('Yahoo'), IM_SKYPE => trans('Skype'), ); @@ -134,21 +139,18 @@ DAILY => trans('daily'), ); - // Tariff types -$TARIFFTYPES = array( - 1 => trans('internet'), - 2 => trans('hosting'), - 3 => trans('service'), - -1 => trans('other'), -); - define('TARIFF_INTERNET', 1); define('TARIFF_HOSTING', 2); define('TARIFF_SERVICE', 3); define('TARIFF_OTHER', -1); -define('DEFAULT_NUMBER_TEMPLATE', '%N/LMS/%Y'); +$TARIFFTYPES = array( + TARIFF_INTERNET => trans('internet'), + TARIFF_HOSTING => trans('hosting'), + TARIFF_SERVICE => trans('service'), + TARIFF_OTHER => trans('other'), +); $PAYTYPES = array( 1 => trans('cash'), @@ -160,6 +162,15 @@ 7 => trans('contract'), ); +// Contact types +define('CONTACT_MOBILE', 1); +define('CONTACT_FAX', 2); + +$CONTACTTYPES = array( + CONTACT_MOBILE => trans('mobile'), + CONTACT_FAX => trans('fax'), +); + if(isset($SMARTY)) { $SMARTY->assign('_DOCTYPES', $DOCTYPES); @@ -170,6 +181,9 @@ $SMARTY->assign('_MESSENGERS', $MESSENGERS); $SMARTY->assign('_TARIFFTYPES', $TARIFFTYPES); $SMARTY->assign('_PAYTYPES', $PAYTYPES); + $SMARTY->assign('_CONTACTTYPES', $CONTACTTYPES); } +define('DEFAULT_NUMBER_TEMPLATE', '%N/LMS/%Y'); + ?> Index: lms/lib/language.php diff -u lms/lib/language.php:1.53 lms/lib/language.php:1.54 --- lms/lib/language.php:1.53 Mon May 24 08:52:02 2010 +++ lms/lib/language.php Wed Dec 15 13:10:14 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: language.php,v 1.53 2010/05/24 06:52:02 chilek Exp $ + * $Id: language.php,v 1.54 2010/12/15 12:10:14 alec Exp $ */ function trans() @@ -50,7 +50,7 @@ 'charset' => 'UTF-8', 'html' => 'pl', 'money_format' => '%01.2f zł', - 'mobile' => '(88[0-9]|5[01][0-9]|6[069][0-9]|7[2789][0-9])[0-9]{6}', +// 'mobile' => '(88[0-9]|5[01][0-9]|6[069][0-9]|7[2789][0-9])[0-9]{6}', ), 'lt' => array( 'name' => 'Lithuanian', @@ -59,7 +59,7 @@ 'charset' => 'UTF-8', 'html' => 'lt', 'money_format' => '%01.2f LT', - 'mobile' => '(88[08]|50[0-9]|6[09][0-9])[0-9]{6}', +// 'mobile' => '(88[08]|50[0-9]|6[09][0-9])[0-9]{6}', ), 'en' => array( 'name' => 'English', @@ -68,7 +68,7 @@ 'charset' => 'UTF-8', 'html' => 'en', 'money_format' => '$ %01.2f', - 'mobile' => '(88[08]|50[0-9]|6[09][0-9])[0-9]{6}', +// 'mobile' => '(88[08]|50[0-9]|6[09][0-9])[0-9]{6}', ), 'sk' => array( 'name' => 'Slovak', @@ -77,7 +77,7 @@ 'charset' => 'UTF-8', 'html' => 'sk', 'money_format' => '%01.2f EUR', - 'mobile' => '(88[08]|50[0-9]|6[09][0-9])[0-9]{6}', +// 'mobile' => '(88[08]|50[0-9]|6[09][0-9])[0-9]{6}', ), 'ro' => array( 'name' => 'Romanian', @@ -86,7 +86,7 @@ 'charset' => 'UTF-8', 'html' => 'ro', 'money_format' => '%01.2f RON', - 'mobile' => '(88[08]|50[0-9]|6[09][0-9])[0-9]{6}', +// 'mobile' => '(88[08]|50[0-9]|6[09][0-9])[0-9]{6}', ), ); Index: lms/lib/upgradedb.php diff -u lms/lib/upgradedb.php:1.180 lms/lib/upgradedb.php:1.181 --- lms/lib/upgradedb.php:1.180 Tue Dec 14 09:16:30 2010 +++ lms/lib/upgradedb.php Wed Dec 15 13:10:15 2010 @@ -21,10 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: upgradedb.php,v 1.180 2010/12/14 08:16:30 alec Exp $ + * $Id: upgradedb.php,v 1.181 2010/12/15 12:10:15 alec Exp $ */ -define('DBVERSION', '2010121000'); // here should be always the newest version of database! +define('DBVERSION', '2010121400'); // 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 Dec 15 13:10:14 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:14 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/html/pl (devel-db.html) Message-ID: <20101215121014.822C93039A46@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:14 Author: alec Path: /cvsroot/lms/doc/html/pl Modified: devel-db.html - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/html/pl/devel-db.html.diff?&r1=1.68&r2=1.69 Index: lms/doc/html/pl/devel-db.html diff -u lms/doc/html/pl/devel-db.html:1.68 lms/doc/html/pl/devel-db.html:1.69 --- lms/doc/html/pl/devel-db.html:1.68 Tue Dec 14 09:16:30 2010 +++ lms/doc/html/pl/devel-db.html Wed Dec 15 13:10:14 2010 @@ -1776,6 +1776,10 @@ >name - nazwa/opis kontaktutype - typ kontaktu (suma flag: 1-komórka, 2-fax) Date: Wednesday, December 15, 2010 @ 13:10:15 Author: alec Path: /cvsroot/lms/lib/upgradedb Added: mysql.2010121400.php postgres.2010121400.php - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2010121400.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2010121400.php?rev=1.1 Index: lms/lib/upgradedb/mysql.2010121400.php diff -u /dev/null lms/lib/upgradedb/mysql.2010121400.php:1.1 --- /dev/null Wed Dec 15 13:10:15 2010 +++ lms/lib/upgradedb/mysql.2010121400.php Wed Dec 15 13:10:15 2010 @@ -0,0 +1,52 @@ +BeginTrans(); + +$DB->Execute("DELETE FROM customercontacts WHERE customerid NOT IN (SELECT id FROM customers)"); +$DB->Execute("ALTER TABLE customercontacts ADD FOREIGN KEY (customerid) + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE"); +$DB->Execute("ALTER TABLE customercontacts ALTER customerid DROP DEFAULT"); + +$DB->Execute("DELETE FROM imessengers WHERE customerid NOT IN (SELECT id FROM customers)"); +$DB->Execute("ALTER TABLE imessengers ADD FOREIGN KEY (customerid) + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE"); +$DB->Execute("ALTER TABLE imessengers ALTER customerid DROP DEFAULT"); + +$DB->Execute("ALTER TABLE customercontacts ADD type smallint DEFAULT NULL"); +$DB->Execute("UPDATE customercontacts SET type = 2 WHERE name LIKE '%fax%'"); + +$lang = $DB->GetOne("SELECT value FROM uiconfig WHERE var='lang' AND section='phpui' AND disabled=0"); +if (!$lang) + $lang = $CONFIG['phpui']['lang']; + +if ($lang == 'pl') { + $DB->Execute("UPDATE customercontacts SET type = COALESCE(type, 0) + 1 + WHERE REPLACE(REPLACE(phone, '-', ''), ' ', '') REGEXP '^(\\\\+[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')); + +$DB->CommitTrans(); + +?> Index: lms/lib/upgradedb/postgres.2010121400.php diff -u /dev/null lms/lib/upgradedb/postgres.2010121400.php:1.1 --- /dev/null Wed Dec 15 13:10:15 2010 +++ lms/lib/upgradedb/postgres.2010121400.php Wed Dec 15 13:10:15 2010 @@ -0,0 +1,54 @@ +BeginTrans(); + +$DB->Execute(" + DELETE FROM customercontacts WHERE customerid NOT IN (SELECT id FROM customers); + ALTER TABLE customercontacts ADD FOREIGN KEY (customerid) + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE; + ALTER TABLE customercontacts ALTER customerid DROP DEFAULT; + + DELETE FROM imessengers WHERE customerid NOT IN (SELECT id FROM customers); + ALTER TABLE imessengers ADD FOREIGN KEY (customerid) + REFERENCES customers (id) ON DELETE CASCADE ON UPDATE CASCADE; + ALTER TABLE imessengers ALTER customerid DROP DEFAULT; + + ALTER TABLE customercontacts ADD type smallint DEFAULT NULL; + UPDATE customercontacts SET type = 2 WHERE name ILIKE '%fax%'; +"); + +$lang = $DB->GetOne("SELECT value FROM uiconfig WHERE var='lang' AND section='phpui' AND disabled=0"); +if (!$lang) + $lang = $CONFIG['phpui']['lang']; + +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}$'"); +} + +$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2010121400', 'dbversion')); + +$DB->CommitTrans(); + +?> From cvs w lms.org.pl Wed Dec 15 13:10:14 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:14 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/sgml/pl (advanced.sgml) Message-ID: <20101215121014.CA7093039A49@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:14 Author: alec Path: /cvsroot/lms/doc/sgml/pl Modified: advanced.sgml - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/sgml/pl/advanced.sgml.diff?&r1=1.77&r2=1.78 Index: lms/doc/sgml/pl/advanced.sgml diff -u lms/doc/sgml/pl/advanced.sgml:1.77 lms/doc/sgml/pl/advanced.sgml:1.78 --- lms/doc/sgml/pl/advanced.sgml:1.77 Tue Dec 14 09:16:30 2010 +++ lms/doc/sgml/pl/advanced.sgml Wed Dec 15 13:10:14 2010 @@ -1,4 +1,4 @@ - + Dla dociekliwych @@ -548,6 +548,7 @@ customerid - identyfikator klienta phone - numer telefoniczny name - nazwa/opis kontaktu + type - typ kontaktu (suma flag: 1-komórka, 2-fax) From cvs w lms.org.pl Wed Dec 15 13:10:15 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:15 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/sk (strings.php) Message-ID: <20101215121015.6C7023039A45@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:15 Author: alec Path: /cvsroot/lms/lib/locale/sk Modified: strings.php - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/sk/strings.php.diff?&r1=1.14&r2=1.15 Index: lms/lib/locale/sk/strings.php diff -u lms/lib/locale/sk/strings.php:1.14 lms/lib/locale/sk/strings.php:1.15 --- lms/lib/locale/sk/strings.php:1.14 Tue Dec 14 09:16:31 2010 +++ lms/lib/locale/sk/strings.php Wed Dec 15 13:10:15 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.14 2010/12/14 08:16:31 alec Exp $ + * $Id: strings.php,v 1.15 2010/12/15 12:10:15 alec Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresy)'; @@ -1997,7 +1997,6 @@ $_LANG['Select days number of cutoff suspending'] = 'Vyberte počet dní od pozastavenia blokovania'; $_LANG['Open attachment'] = 'Otvoriť prílohu'; $_LANG['Consent to personal data processing:'] = 'Súhlas na spracovanie osobných údajov:'; -$_LANG['no consent'] = 'bez dohody'; $_LANG['TRANSFER'] = 'TRANSFER'; $_LANG['Rows: $0'] = 'Počet riadkov: $0'; $_LANG['private person'] = 'Súkromná osoba'; From cvs w lms.org.pl Wed Dec 15 13:10:15 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:15 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20101215121015.4A94B3039A46@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:15 Author: alec Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.366&r2=1.367 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.366 lms/lib/locale/pl/strings.php:1.367 --- lms/lib/locale/pl/strings.php:1.366 Tue Dec 14 09:16:31 2010 +++ lms/lib/locale/pl/strings.php Wed Dec 15 13:10:15 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.366 2010/12/14 08:16:31 alec Exp $ + * $Id: strings.php,v 1.367 2010/12/15 12:10:15 alec Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresów)'; @@ -1964,7 +1964,6 @@ $_LANG['Consent to electronic invoices:'] = 'Zgoda na faktury elektroniczne:'; $_LANG['Consent to invoices delivery via e-mail:'] = 'Zgoda na dostarczanie faktur pocztą elektroniczną:'; $_LANG['Consent to messages delivery via e-mail or sms:'] = 'Zgoda na dostarczanie informacji pocztą elektr. lub smsem:'; -$_LANG['no consent'] = 'brak zgody'; $_LANG['Rows: $0'] = 'Liczba wierszy: $0'; $_LANG['private person'] = 'osoba fizyczna'; $_LANG['legal entity'] = 'osoba prawna / firma'; @@ -2378,5 +2377,8 @@ $_LANG['Select default invoices payment type'] = 'Wybierz domyślny typ płatności faktury'; $_LANG['Select payment type'] = 'Wybierz typ płatności'; $_LANG['Tariff'] = 'Taryfa'; +$_LANG['mobile'] = 'tel.kom.'; +$_LANG['fax'] = 'fax'; +$_LANG['Select domain type'] = 'Wybierz typ domeny'; ?> From cvs w lms.org.pl Wed Dec 15 13:10:15 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:15 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (4 files) Message-ID: <20101215121015.C0E41302C928@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:15 Author: alec Path: /cvsroot/lms/modules Modified: customeradd.php customeredit.php genfake.php messageadd.php - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/customeradd.php.diff?&r1=1.32&r2=1.33 http://cvs.lms.org.pl/viewvc/Development/lms/modules/customeredit.php.diff?&r1=1.41&r2=1.42 http://cvs.lms.org.pl/viewvc/Development/lms/modules/genfake.php.diff?&r1=1.79&r2=1.80 http://cvs.lms.org.pl/viewvc/Development/lms/modules/messageadd.php.diff?&r1=1.12&r2=1.13 Index: lms/modules/customeradd.php diff -u lms/modules/customeradd.php:1.32 lms/modules/customeradd.php:1.33 --- lms/modules/customeradd.php:1.32 Thu Mar 11 14:07:44 2010 +++ lms/modules/customeradd.php Wed Dec 15 13:10:15 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: customeradd.php,v 1.32 2010/03/11 13:07:44 alec Exp $ + * $Id: customeradd.php,v 1.33 2010/12/15 12:10:15 alec Exp $ */ if(isset($_GET['ajax'])) @@ -141,7 +141,7 @@ $error['skype'] = trans('Incorrect IM uin!'); break; } - + if($val) $im[$idx] = $val; } @@ -149,11 +149,14 @@ { $phone = trim($val['phone']); $name = trim($val['name']); - + $type = !empty($val['type']) ? array_sum($val['type']) : NULL; + + $customeradd['contacts'][$idx]['type'] = $type; + if($name && !$phone) $error['contact'.$idx] = trans('Phone number is required!'); - elseif($phone) - $contacts[] = array('name' => $name, 'phone' => $phone); + elseif ($phone) + $contacts[] = array('name' => $name, 'phone' => $phone, 'type' => $type); } if(!$error) @@ -175,8 +178,8 @@ if(isset($contacts) && $id) foreach($contacts as $contact) - $DB->Execute('INSERT INTO customercontacts (customerid, phone, name) - VALUES(?, ?, ?)', array($id, $contact['phone'], $contact['name'])); + $DB->Execute('INSERT INTO customercontacts (customerid, phone, name, type) + VALUES(?, ?, ?, ?)', array($id, $contact['phone'], $contact['name'], $contact['type'])); if($customeradd['zip'] && $customeradd['stateid']) { Index: lms/modules/customeredit.php diff -u lms/modules/customeredit.php:1.41 lms/modules/customeredit.php:1.42 --- lms/modules/customeredit.php:1.41 Thu Mar 11 14:07:45 2010 +++ lms/modules/customeredit.php Wed Dec 15 13:10:15 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: customeredit.php,v 1.41 2010/03/11 13:07:45 alec Exp $ + * $Id: customeredit.php,v 1.42 2010/12/15 12:10:15 alec Exp $ */ $action = isset($_GET['action']) ? $_GET['action'] : ''; $exists = $LMS->CustomerExists($_GET['id']); @@ -105,14 +105,17 @@ } foreach($customerdata['contacts'] as $idx => $val) - { + { $phone = trim($val['phone']); $name = trim($val['name']); - + $type = !empty($val['type']) ? array_sum($val['type']) : NULL; + + $customerdata['contacts'][$idx]['type'] = $type; + if($name && !$phone) $error['contact'.$idx] = trans('Phone number is required!'); elseif($phone) - $contacts[] = array('name' => $name, 'phone' => $phone); + $contacts[] = array('name' => $name, 'phone' => $phone, 'type' => $type); } if(!$error) @@ -141,8 +144,8 @@ $DB->Execute('DELETE FROM customercontacts WHERE customerid = ?', array($customerdata['id'])); if(isset($contacts)) foreach($contacts as $contact) - $DB->Execute('INSERT INTO customercontacts (customerid, phone, name) - VALUES(?, ?, ?)', array($customerdata['id'], $contact['phone'], $contact['name'])); + $DB->Execute('INSERT INTO customercontacts (customerid, phone, name, type) + VALUES(?, ?, ?, ?)', array($customerdata['id'], $contact['phone'], $contact['name'], $contact['type'])); if($customerdata['zip'] && $customerdata['stateid']) { Index: lms/modules/genfake.php diff -u lms/modules/genfake.php:1.79 lms/modules/genfake.php:1.80 --- lms/modules/genfake.php:1.79 Mon Jun 21 10:58:16 2010 +++ lms/modules/genfake.php Wed Dec 15 13:10:15 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: genfake.php,v 1.79 2010/06/21 08:58:16 alec Exp $ + * $Id: genfake.php,v 1.80 2010/12/15 12:10:15 alec Exp $ */ // Lastnames @@ -1989,7 +1989,8 @@ 'settlement' => 0, 'nodes' => NULL )); - $DB->Execute('INSERT INTO customercontacts (customerid, phone) VALUES (?, ?)', array($id, $customeradd['phone'])); + $DB->Execute('INSERT INTO customercontacts (customerid, phone) + VALUES (?, ?)', array($id, $customeradd['phone'])); $nodes = mt_rand(1,2); for($j = 0; $j < $nodes; $j++) Index: lms/modules/messageadd.php diff -u lms/modules/messageadd.php:1.12 lms/modules/messageadd.php:1.13 --- lms/modules/messageadd.php:1.12 Mon May 24 09:43:17 2010 +++ lms/modules/messageadd.php Wed Dec 15 13:10:15 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: messageadd.php,v 1.12 2010/05/24 07:43:17 chilek Exp $ + * $Id: messageadd.php,v 1.13 2010/12/15 12:10:15 alec Exp $ */ function GetRecipients($filter, $type=MSG_MAIL) @@ -54,15 +54,9 @@ if($type == MSG_SMS) { - if ($CONFIG['database']['type'] == 'postgres') - $smswhere = "WHERE regexp_replace(phone, '[^0-9]', '') ~ '^([0-9]{2}|0|)" - .$LANGDEFS[$_language]['mobile'].'$\''; - else - $smswhere = "WHERE REPLACE(REPLACE(phone, '-', ''), ' ', '') REGEXP '^(\\\\+[0-9]{2}|0)?" - .$LANGDEFS[$_language]['mobile'].'$\''; - $smstable = 'JOIN (SELECT MIN(phone) AS phone, customerid - FROM customercontacts '.$smswhere.' + FROM customercontacts + WHERE (type & '.CONTACT_MOBILE.') = '.CONTACT_MOBILE.' GROUP BY customerid ) x ON (x.customerid = c.id)'; } @@ -102,27 +96,17 @@ function GetRecipient($customerid, $type=MSG_MAIL) { global $DB, $LMS, $CONFIG, $LANGDEFS, $_language; - + if($type == MSG_SMS) { - if ($CONFIG['database']['type'] == 'postgres') - { - $smswhere = " AND regexp_replace(phone, '[^0-9]', '') ~ '^([0-9]{2}|0|)" - .$LANGDEFS[$_language]['mobile'].'$\''; - } - else - { - $smswhere = " AND REPLACE(REPLACE(phone, '-', ''), ' ', '') REGEXP '^(\\\\+[0-9]{2}|0)?" - .$LANGDEFS[$_language]['mobile'].'$\''; - } - $smstable = 'JOIN (SELECT phone, customerid FROM customercontacts - WHERE customerid = '.$customerid . $smswhere - .' ORDER BY phone LIMIT 1 + WHERE customerid = '.$customerid.' + AND (type & '.CONTACT_MOBILE.') = '.CONTACT_MOBILE.' + ORDER BY phone LIMIT 1 ) x ON (x.customerid = c.id)'; } - + return $DB->GetAll('SELECT c.id, email, pin, ' .($type==MSG_SMS ? 'x.phone, ': '') .$DB->Concat('c.lastname', "' '", 'c.name').' AS customername, From cvs w lms.org.pl Wed Dec 15 13:10:16 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 15 Dec 2010 13:10:16 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (7 files) Message-ID: <20101215121016.23C1C302C928@hydra.altec.pl> Date: Wednesday, December 15, 2010 @ 13:10:16 Author: alec Path: /cvsroot/lms/templates Modified: customeradd.html customereditbox.html customerinfobox.html customerinfoshort.html domainadd.html domainedit.html printindex.html - added possibility to set type (mobile/fax) of customer contact (alec) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/customeradd.html.diff?&r1=1.39&r2=1.40 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customereditbox.html.diff?&r1=1.36&r2=1.37 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfobox.html.diff?&r1=1.45&r2=1.46 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfoshort.html.diff?&r1=1.19&r2=1.20 http://cvs.lms.org.pl/viewvc/Development/lms/templates/domainadd.html.diff?&r1=1.19&r2=1.20 http://cvs.lms.org.pl/viewvc/Development/lms/templates/domainedit.html.diff?&r1=1.17&r2=1.18 http://cvs.lms.org.pl/viewvc/Development/lms/templates/printindex.html.diff?&r1=1.97&r2=1.98 Index: lms/templates/customeradd.html diff -u lms/templates/customeradd.html:1.39 lms/templates/customeradd.html:1.40 --- lms/templates/customeradd.html:1.39 Tue Dec 14 09:16:31 2010 +++ lms/templates/customeradd.html Wed Dec 15 13:10:15 2010 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{literal} + Index: lms/templates/printindex.html diff -u lms/templates/printindex.html:1.97 lms/templates/printindex.html:1.98 --- lms/templates/printindex.html:1.97 Mon Apr 19 12:56:15 2010 +++ lms/templates/printindex.html Wed Dec 15 13:10:15 2010 @@ -1,10 +1,10 @@ {include file="header.html"} - +

{$layout.pagetitle}

{include file="calendar_js.html"} {if $printmenu=="customer"}

- +
@@ -189,10 +189,10 @@ From cvs w lms.org.pl Fri Dec 17 09:39:07 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/html/en (devel-db.html) Message-ID: <20101217083907.0E0D13039A45@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:07 Author: alec Path: /cvsroot/lms/doc/html/en Modified: devel-db.html - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/html/en/devel-db.html.diff?&r1=1.62&r2=1.63 Index: lms/doc/html/en/devel-db.html diff -u lms/doc/html/en/devel-db.html:1.62 lms/doc/html/en/devel-db.html:1.63 --- lms/doc/html/en/devel-db.html:1.62 Wed Dec 15 13:10:14 2010 +++ lms/doc/html/en/devel-db.html Fri Dec 17 09:39:06 2010 @@ -224,6 +224,22 @@ >location_address - address - street, apartment, flat, etclocation_address - adres lokalizacji - ulica, nr domu, nr lokalu + + + + {foreach from=$customeradd.contacts item=item key=key}
- + - {t}Network Balance Sheet{/t} + {t}Network Balance Sheet{/t}
post_address - correspondence address - street, apartment, flat, etc
post_zip - correspondence address - zip code
post_city - correspondence address - location (city)
post_countryid - correspondence address - country identifier
ten - tax exempt number
serviceaddr - correspondence address
creationdate - record creation date
location - location (address)
location_zip - address - zip code
location_city - address - location (city)
Date: Friday, December 17, 2010 @ 09:39:07 Author: alec Path: /cvsroot/lms/doc/html/pl Modified: devel-db.html - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/html/pl/devel-db.html.diff?&r1=1.69&r2=1.70 Index: lms/doc/html/pl/devel-db.html diff -u lms/doc/html/pl/devel-db.html:1.69 lms/doc/html/pl/devel-db.html:1.70 --- lms/doc/html/pl/devel-db.html:1.69 Wed Dec 15 13:10:14 2010 +++ lms/doc/html/pl/devel-db.html Fri Dec 17 09:39:07 2010 @@ -228,6 +228,22 @@ >
post_address - adres korespondencyjny (ulica, nr domu, nr lokalu)
post_zip - adres korespondencyjny - kod pocztowy
post_city - adres korespondencyjny - nazwa miasta
post_countryid - adres korespondencyjny - identyfikator kraju
ten - numer identyfikacji podatkowej NIP
serviceaddr - adres do doręczeń (np. na faktury)
creationdate - czas utworzenia wpisu
location - lokalizacja (adres)
location_zip - adres lokalizacji - kod pocztowy
location_city - adres lokalizacji - miasto
Date: Friday, December 17, 2010 @ 09:39:06 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog README README.pl lms.mysql lms.pgsql - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1520&r2=1.1521 http://cvs.lms.org.pl/viewvc/Development/lms/doc/README.diff?&r1=1.227&r2=1.228 http://cvs.lms.org.pl/viewvc/Development/lms/doc/README.pl.diff?&r1=1.56&r2=1.57 http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.mysql.diff?&r1=1.176&r2=1.177 http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.pgsql.diff?&r1=1.172&r2=1.173 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1520 lms/doc/ChangeLog:1.1521 --- lms/doc/ChangeLog:1.1520 Wed Dec 15 13:10:13 2010 +++ lms/doc/ChangeLog Fri Dec 17 09:39:06 2010 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1520 2010/12/15 12:10:13 alec Exp $ +$Id: ChangeLog,v 1.1521 2010/12/17 08:39:06 alec Exp $ version ? (????-??-??) @@ -49,6 +49,8 @@ - added "consent to invoices delivery via e-mail" switch in customer data (alec) - added "consent to messages delivery via e-mail or sms" switch in customer data (alec) - added possibility to set type (mobile/fax) of customer contact (alec) + - customer service address split into separate fields: address, zip, city, country (alec) + - node location address split into separate fields: address, zip, city (alec) version 1.11.10 Kri (2010-04-19) Index: lms/doc/README diff -u lms/doc/README:1.227 lms/doc/README:1.228 --- lms/doc/README:1.227 Wed Dec 15 13:10:13 2010 +++ lms/doc/README Fri Dec 17 09:39:06 2010 @@ -5340,6 +5340,10 @@ zip - zip code city - location (city) countryid - country identifier + post_address - correspondence address - street, apartment, flat, etc + post_zip - correspondence address - zip code + post_city - correspondence address - location (city) + post_countryid - correspondence address - country identifier ten - tax exempt number ssn - social security number regon - business registration number @@ -5347,7 +5351,6 @@ icn - identity card number info - additional information notes - notes - serviceaddr - correspondence address creationdate - record creation date moddate - record modification date creatorid - serial of LMS user who created this record @@ -5451,7 +5454,9 @@ halfduplex - half/full duplex mode (0/1) lastonline - last network activity timestamp info - additional information - location - location (address) + location_address - address - street, apartment, flat, etc + location_zip - address - zip code + location_city - address - location (city) nas - NAS flag (1/0) __________________________________________________________________ Index: lms/doc/README.pl diff -u lms/doc/README.pl:1.56 lms/doc/README.pl:1.57 --- lms/doc/README.pl:1.56 Wed Dec 15 13:10:13 2010 +++ lms/doc/README.pl Fri Dec 17 09:39:06 2010 @@ -6242,6 +6242,10 @@ zip - kod pocztowy city - nazwa miasta countryid - identyfikator kraju + post_address - adres korespondencyjny (ulica, nr domu, nr lokalu) + post_zip - adres korespondencyjny - kod pocztowy + post_city - adres korespondencyjny - nazwa miasta + post_countryid - adres korespondencyjny - identyfikator kraju ten - numer identyfikacji podatkowej NIP ssn - numer PESEL regon - numer REGON @@ -6249,7 +6253,6 @@ icn - numer dowodu osobistego info - dodatkowe informacje notes - notatki - serviceaddr - adres do doręczeń (np. na faktury) creationdate - czas utworzenia wpisu moddate - czas modyfikacji creatorid - identyfikator użytkownika tworzącego wpis @@ -6357,7 +6360,9 @@ warning - ostrzegaj/nie ostrzegaj (1/0) lastonline - znacznik czasu ostatniej obecności w sieci info - informacje dodatkowe - location - lokalizacja (adres) + location_address - adres lokalizacji - ulica, nr domu, nr lokalu + location_zip - adres lokalizacji - kod pocztowy + location_city - adres lokalizacji - miasto nas - flaga NAS (0/1) __________________________________________________________________ Index: lms/doc/lms.mysql diff -u lms/doc/lms.mysql:1.176 lms/doc/lms.mysql:1.177 --- lms/doc/lms.mysql:1.176 Wed Dec 15 13:10:14 2010 +++ lms/doc/lms.mysql Fri Dec 17 09:39:06 2010 @@ -1,5 +1,5 @@ # -------------------------------------------------------- -# $Id: lms.mysql,v 1.176 2010/12/15 12:10:14 alec Exp $ +# $Id: lms.mysql,v 1.177 2010/12/17 08:39:06 alec Exp $ # -------------------------------------------------------- # @@ -27,6 +27,53 @@ # -------------------------------------------------------- # +# Structure of table customers (customers) +# +DROP TABLE IF EXISTS customers; +CREATE TABLE customers ( + id int(11) NOT NULL auto_increment, + lastname varchar(128) NOT NULL DEFAULT '', + name varchar(128) NOT NULL DEFAULT '', + status smallint NOT NULL DEFAULT '0', + type smallint NOT NULL DEFAULT '0', + email varchar(255) NOT NULL DEFAULT '', + address varchar(255) NOT NULL DEFAULT '', + zip varchar(10) NOT NULL DEFAULT '', + city varchar(32) NOT NULL DEFAULT '', + countryid int(11) DEFAULT NULL, + post_address varchar(255) DEFAULT NULL, + post_zip varchar(10) DEFAULT NULL, + post_city varchar(32) DEFAULT NULL, + post_countryid int(11) DEFAULT NULL, + ten varchar(16) NOT NULL DEFAULT '', + ssn varchar(11) NOT NULL DEFAULT '', + regon varchar(255) NOT NULL DEFAULT '', + rbe varchar(255) NOT NULL DEFAULT '', + icn varchar(255) NOT NULL DEFAULT '', + info text NOT NULL, + notes text NOT NULL DEFAULT '', + creationdate int(11) NOT NULL DEFAULT '0', + moddate int(11) NOT NULL DEFAULT '0', + creatorid int(11) NOT NULL DEFAULT '0', + modid int(11) NOT NULL DEFAULT '0', + deleted tinyint(1) NOT NULL DEFAULT '0', + message text NOT NULL, + pin int(6) NOT NULL DEFAULT '0', + cutoffstop int(11) NOT NULL DEFAULT '0', + consentdate int(11) NOT NULL DEFAULT '0', + einvoice tinyint(1) DEFAULT NULL, + invoicenotice tinyint(1) DEFAULT NULL, + mailingnotice tinyint(1) DEFAULT NULL, + divisionid int(11) NOT NULL DEFAULT '0', + paytime tinyint NOT NULL DEFAULT '-1', + paytype smallint DEFAULT NULL, + PRIMARY KEY (id), + INDEX zip (zip), + INDEX name (lastname, name) +) ENGINE=InnoDB; + +# -------------------------------------------------------- +# # Structure of table assignments # DROP TABLE IF EXISTS assignments; @@ -329,7 +376,9 @@ halfduplex tinyint(1) NOT NULL DEFAULT '0', lastonline int(11) NOT NULL DEFAULT '0', info text NOT NULL DEFAULT '', - location text NOT NULL DEFAULT '', + location_address varchar(255) DEFAULT NULL, + location_zip varchar(10) DEFAULT NULL, + location_city varchar(32) DEFAULT NULL, nas tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (id), UNIQUE KEY name (name), @@ -345,9 +394,9 @@ # DROP TABLE IF EXISTS macs; CREATE TABLE macs ( - id int(11) NOT NULL auto_increment, - mac varchar(17) NOT NULL DEFAULT '', - nodeid int(11) NOT NULL, + id int(11) NOT NULL auto_increment, + mac varchar(17) NOT NULL DEFAULT '', + nodeid int(11) NOT NULL, PRIMARY KEY (id), FOREIGN KEY (nodeid) REFERENCES nodes (id) ON DELETE CASCADE ON UPDATE CASCADE, UNIQUE KEY mac (mac, nodeid) @@ -595,50 +644,6 @@ # -------------------------------------------------------- # -# Structure of table customers (customers) -# -DROP TABLE IF EXISTS customers; -CREATE TABLE customers ( - id int(11) NOT NULL auto_increment, - lastname varchar(128) NOT NULL DEFAULT '', - name varchar(128) NOT NULL DEFAULT '', - status smallint NOT NULL DEFAULT '0', - type smallint NOT NULL DEFAULT '0', - email varchar(255) NOT NULL DEFAULT '', - address varchar(255) NOT NULL DEFAULT '', - zip varchar(10) NOT NULL DEFAULT '', - city varchar(32) NOT NULL DEFAULT '', - countryid int(11) NOT NULL DEFAULT '0', - ten varchar(16) NOT NULL DEFAULT '', - ssn varchar(11) NOT NULL DEFAULT '', - regon varchar(255) NOT NULL DEFAULT '', - rbe varchar(255) NOT NULL DEFAULT '', - icn varchar(255) NOT NULL DEFAULT '', - info text NOT NULL, - notes text NOT NULL DEFAULT '', - serviceaddr text NOT NULL DEFAULT '', - creationdate int(11) NOT NULL DEFAULT '0', - moddate int(11) NOT NULL DEFAULT '0', - creatorid int(11) NOT NULL DEFAULT '0', - modid int(11) NOT NULL DEFAULT '0', - deleted tinyint(1) NOT NULL DEFAULT '0', - message text NOT NULL, - pin int(6) NOT NULL DEFAULT '0', - cutoffstop int(11) NOT NULL DEFAULT '0', - consentdate int(11) NOT NULL DEFAULT '0', - einvoice tinyint(1) DEFAULT NULL, - invoicenotice tinyint(1) DEFAULT NULL, - mailingnotice tinyint(1) DEFAULT NULL, - divisionid int(11) NOT NULL DEFAULT '0', - paytime tinyint NOT NULL DEFAULT '-1', - paytype smallint DEFAULT NULL, - PRIMARY KEY (id), - INDEX zip (zip), - INDEX name (lastname, name) -) ENGINE=InnoDB; - -# -------------------------------------------------------- -# # Structure of table customergroups # DROP TABLE IF EXISTS customergroups; @@ -1387,4 +1392,4 @@ # -------------------------------------------------------- -INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121400'); +INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121600'); Index: lms/doc/lms.pgsql diff -u lms/doc/lms.pgsql:1.172 lms/doc/lms.pgsql:1.173 --- lms/doc/lms.pgsql:1.172 Wed Dec 15 13:10:14 2010 +++ lms/doc/lms.pgsql Fri Dec 17 09:39:06 2010 @@ -1,4 +1,4 @@ -/* $Id: lms.pgsql,v 1.172 2010/12/15 12:10:14 alec Exp $ */ +/* $Id: lms.pgsql,v 1.173 2010/12/17 08:39:06 alec Exp $ */ /* -------------------------------------------------------- Structure of table "users" @@ -24,6 +24,55 @@ UNIQUE (login) ); +/* -------------------------------------------------------- + Structure of table "customers" (customers) +-------------------------------------------------------- */ +DROP SEQUENCE customers_id_seq; +CREATE SEQUENCE customers_id_seq; +DROP TABLE customers CASCADE; +CREATE TABLE customers ( + id integer DEFAULT nextval('customers_id_seq'::text) NOT NULL, + lastname varchar(128) DEFAULT '' NOT NULL, + name varchar(128) DEFAULT '' NOT NULL, + status smallint DEFAULT 0 NOT NULL, + type smallint DEFAULT 0 NOT NULL, + email varchar(255) DEFAULT '' NOT NULL, + address varchar(255) DEFAULT '' NOT NULL, + zip varchar(10) DEFAULT '' NOT NULL, + city varchar(32) DEFAULT '' NOT NULL, + countryid integer DEFAULT NULL, + post_address varchar(255) DEFAULT NULL, + post_zip varchar(10) DEFAULT NULL, + post_city varchar(32) DEFAULT NULL, + post_countryid integer DEFAULT NULL, + ten varchar(16) DEFAULT '' NOT NULL, + ssn varchar(11) DEFAULT '' NOT NULL, + regon varchar(255) DEFAULT '' NOT NULL, + rbe varchar(255) DEFAULT '' NOT NULL, -- EDG/KRS + icn varchar(255) DEFAULT '' NOT NULL, -- dow.os. + info text DEFAULT '' NOT NULL, + notes text DEFAULT '' NOT NULL, + creationdate integer DEFAULT 0 NOT NULL, + moddate integer DEFAULT 0 NOT NULL, + creatorid integer DEFAULT 0 NOT NULL, + modid integer DEFAULT 0 NOT NULL, + deleted smallint DEFAULT 0 NOT NULL, + message text DEFAULT '' NOT NULL, + pin integer DEFAULT 0 NOT NULL, + cutoffstop integer DEFAULT 0 NOT NULL, + consentdate integer DEFAULT 0 NOT NULL, + einvoice smallint DEFAULT NULL, + invoicenotice smallint DEFAULT NULL, + mailingnotice smallint DEFAULT NULL, + divisionid integer DEFAULT 0 NOT NULL, + paytime smallint DEFAULT -1 NOT NULL, + paytype smallint DEFAULT NULL, + PRIMARY KEY (id) +); + +CREATE INDEX customers_zip_idx ON customers (zip); +CREATE INDEX customers_lastname_idx ON customers (lastname, name); + /* ---------------------------------------------------- Structure of table "assignments" ---------------------------------------------------*/ @@ -131,8 +180,10 @@ chkmac smallint DEFAULT 1 NOT NULL, halfduplex smallint DEFAULT 0 NOT NULL, lastonline integer DEFAULT 0 NOT NULL, - info text DEFAULT '' NOT NULL, - location text DEFAULT '' NOT NULL, + info text DEFAULT '' NOT NULL, + location_address varchar(255) DEFAULT NULL, + location_zip varchar(10) DEFAULT NULL, + location_city varchar(32) DEFAULT NULL, nas smallint DEFAULT 0 NOT NULL, PRIMARY KEY (id), UNIQUE (name), @@ -430,52 +481,6 @@ CREATE INDEX numberplanassignments_divisionid_idx ON numberplanassignments (divisionid); /* -------------------------------------------------------- - Structure of table "customers" (customers) --------------------------------------------------------- */ -DROP SEQUENCE customers_id_seq; -CREATE SEQUENCE customers_id_seq; -DROP TABLE customers CASCADE; -CREATE TABLE customers ( - id integer DEFAULT nextval('customers_id_seq'::text) NOT NULL, - lastname varchar(128) DEFAULT '' NOT NULL, - name varchar(128) DEFAULT '' NOT NULL, - status smallint DEFAULT 0 NOT NULL, - type smallint DEFAULT 0 NOT NULL, - email varchar(255) DEFAULT '' NOT NULL, - address varchar(255) DEFAULT '' NOT NULL, - zip varchar(10) DEFAULT '' NOT NULL, - city varchar(32) DEFAULT '' NOT NULL, - countryid integer DEFAULT 0 NOT NULL, - ten varchar(16) DEFAULT '' NOT NULL, - ssn varchar(11) DEFAULT '' NOT NULL, - regon varchar(255) DEFAULT '' NOT NULL, - rbe varchar(255) DEFAULT '' NOT NULL, -- EDG/KRS - icn varchar(255) DEFAULT '' NOT NULL, -- dow.os. - info text DEFAULT '' NOT NULL, - notes text DEFAULT '' NOT NULL, - serviceaddr text DEFAULT '' NOT NULL, - creationdate integer DEFAULT 0 NOT NULL, - moddate integer DEFAULT 0 NOT NULL, - creatorid integer DEFAULT 0 NOT NULL, - modid integer DEFAULT 0 NOT NULL, - deleted smallint DEFAULT 0 NOT NULL, - message text DEFAULT '' NOT NULL, - pin integer DEFAULT 0 NOT NULL, - cutoffstop integer DEFAULT 0 NOT NULL, - consentdate integer DEFAULT 0 NOT NULL, - einvoice smallint DEFAULT NULL, - invoicenotice smallint DEFAULT NULL, - mailingnotice smallint DEFAULT NULL, - divisionid integer DEFAULT 0 NOT NULL, - paytime smallint DEFAULT -1 NOT NULL, - paytype smallint DEFAULT NULL, - PRIMARY KEY (id) -); - -CREATE INDEX customers_zip_idx ON customers (zip); -CREATE INDEX customers_lastname_idx ON customers (lastname, name); - -/* -------------------------------------------------------- Structure of table "customergroups" -------------------------------------------------------- */ DROP SEQUENCE customergroups_id_seq; @@ -1412,11 +1417,11 @@ SELECT $1::text; $$ LANGUAGE SQL IMMUTABLE; -CREATE VIEW nas AS +CREATE VIEW nas AS SELECT n.id, inet_ntoa(n.ipaddr) AS nasname, d.shortname, d.nastype AS type, - d.clients AS ports, d.secret, d.community, d.description - FROM nodes n - JOIN netdevices d ON (n.netdev = d.id) + d.clients AS ports, d.secret, d.community, d.description + FROM nodes n + JOIN netdevices d ON (n.netdev = d.id) WHERE n.nas = 1; CREATE VIEW vnodes AS @@ -1488,4 +1493,4 @@ INSERT INTO nastypes (name) VALUES ('usrhiper'); INSERT INTO nastypes (name) VALUES ('other'); -INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121400'); +INSERT INTO dbinfo (keytype, keyvalue) VALUES ('dbversion', '2010121600'); From cvs w lms.org.pl Fri Dec 17 09:39:06 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:06 +0100 (CET) Subject: [lms-commits] CVS update of lms/contrib/customer_otherip (2 files) Message-ID: <20101217083906.86BE130340FE@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:06 Author: alec Path: /cvsroot/lms/contrib/customer_otherip Modified: invoice.php invoice_pdf.php - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/contrib/customer_otherip/invoice.php.diff?&r1=1.14&r2=1.15 http://cvs.lms.org.pl/viewvc/Development/lms/contrib/customer_otherip/invoice_pdf.php.diff?&r1=1.16&r2=1.17 Index: lms/contrib/customer_otherip/invoice.php diff -u lms/contrib/customer_otherip/invoice.php:1.14 lms/contrib/customer_otherip/invoice.php:1.15 --- lms/contrib/customer_otherip/invoice.php:1.14 Thu Mar 11 14:07:29 2010 +++ lms/contrib/customer_otherip/invoice.php Fri Dec 17 09:39:06 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: invoice.php,v 1.14 2010/03/11 13:07:29 alec Exp $ + * $Id: invoice.php,v 1.15 2010/12/17 08:39:06 alec Exp $ */ include('class.php'); @@ -51,7 +51,6 @@ $ntempl = docnumber($invoice['number'], $invoice['template'], $invoice['cdate']); $layout['pagetitle'] = trans('Invoice No. $0', $ntempl); -$invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); $invoice['last'] = TRUE; $SMARTY->assign('invoice',$invoice); $SMARTY->display(SMARTY_TEMPLATES_DIR.'/clearheader.html'); Index: lms/contrib/customer_otherip/invoice_pdf.php diff -u lms/contrib/customer_otherip/invoice_pdf.php:1.16 lms/contrib/customer_otherip/invoice_pdf.php:1.17 --- lms/contrib/customer_otherip/invoice_pdf.php:1.16 Thu Mar 11 14:07:29 2010 +++ lms/contrib/customer_otherip/invoice_pdf.php Fri Dec 17 09:39:06 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: invoice_pdf.php,v 1.16 2010/03/11 13:07:29 alec Exp $ + * $Id: invoice_pdf.php,v 1.17 2010/12/17 08:39:06 alec Exp $ */ // Faktury w PDF, do użycia z formularzami FT-0100 (c) Polarnet // w razie pytań mailto:lexx w polarnet.org @@ -168,12 +168,12 @@ global $invoice,$pdf; $font_size=12; $y=$y-text_align_left($x,$y,$font_size,"".iconv("UTF-8","ISO-8859-2",$invoice['name']).""); - if ($invoice['serviceaddr']) { - $tmp = explode("\n",iconv("UTF-8","ISO-8859-2",$invoice['serviceaddr'])); - foreach ($tmp as $line) $y=$y-text_align_left($x,$y,$font_size,"".$line.""); + if ($invoice['post_address']) { + $y=$y-text_align_left($x,$y,$font_size,"".iconv("UTF-8","ISO-8859-2",$invoice['post_address']).""); + $y=$y-text_align_left($x,$y,$font_size,"".iconv("UTF-8","ISO-8859-2",$invoice['post_zip']." ".$invoice['post_city']).""); } else { - $y=$y-text_align_left($x,$y,$font_size,"".iconv("UTF-8","ISO-8859-2",$invoice['address']).""); - $y=$y-text_align_left($x,$y,$font_size,"".iconv("UTF-8","ISO-8859-2",$invoice['zip']." ".$invoice['city']).""); + $y=$y-text_align_left($x,$y,$font_size,"".iconv("UTF-8","ISO-8859-2",$invoice['address']).""); + $y=$y-text_align_left($x,$y,$font_size,"".iconv("UTF-8","ISO-8859-2",$invoice['zip']." ".$invoice['city']).""); } return $y; } @@ -386,7 +386,6 @@ $invoice = $LMS->GetInvoiceContent($_GET['id']); -$invoice['serviceaddr'] = $LMS->GetUserServiceAddress($invoice['customerid']); $invoice['last'] = TRUE; $type = trans('ORIGINAL'); invoice_body(); From cvs w lms.org.pl Fri Dec 17 09:39:07 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/sgml (advanced.sgml) Message-ID: <20101217083907.54B8F3039A47@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:07 Author: alec Path: /cvsroot/lms/doc/sgml Modified: advanced.sgml - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/sgml/advanced.sgml.diff?&r1=1.116&r2=1.117 Index: lms/doc/sgml/advanced.sgml diff -u lms/doc/sgml/advanced.sgml:1.116 lms/doc/sgml/advanced.sgml:1.117 --- lms/doc/sgml/advanced.sgml:1.116 Wed Dec 15 13:10:14 2010 +++ lms/doc/sgml/advanced.sgml Fri Dec 17 09:39:07 2010 @@ -1,4 +1,4 @@ - + For curious @@ -106,7 +106,11 @@ address - street address (street, apartment, flat, etc) zip - zip code city - location (city) - countryid - country identifier + countryid - country identifier + post_address - correspondence address - street, apartment, flat, etc + post_zip - correspondence address - zip code + post_city - correspondence address - location (city) + post_countryid - correspondence address - country identifier ten - tax exempt number ssn - social security number regon - business registration number @@ -114,7 +118,6 @@ icn - identity card number info - additional information notes - notes - serviceaddr - correspondence address creationdate - record creation date moddate - record modification date creatorid - serial of LMS user who created this record @@ -225,8 +228,10 @@ halfduplex - half/full duplex mode (0/1) lastonline - last network activity timestamp info - additional information - location - location (address) - nas - NAS flag (1/0) + location_address - address - street, apartment, flat, etc + location_zip - address - zip code + location_city - address - location (city) + nas - NAS flag (1/0) @@ -397,7 +402,7 @@ validfrom - binding period start validto - binding period end - + Documents numbering plans ('numberplans') From cvs w lms.org.pl Fri Dec 17 09:39:07 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/doc/sgml/pl (advanced.sgml) Message-ID: <20101217083907.783B13039A49@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:07 Author: alec Path: /cvsroot/lms/doc/sgml/pl Modified: advanced.sgml - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/sgml/pl/advanced.sgml.diff?&r1=1.78&r2=1.79 Index: lms/doc/sgml/pl/advanced.sgml diff -u lms/doc/sgml/pl/advanced.sgml:1.78 lms/doc/sgml/pl/advanced.sgml:1.79 --- lms/doc/sgml/pl/advanced.sgml:1.78 Wed Dec 15 13:10:14 2010 +++ lms/doc/sgml/pl/advanced.sgml Fri Dec 17 09:39:07 2010 @@ -1,4 +1,4 @@ - + Dla dociekliwych @@ -111,6 +111,10 @@ zip - kod pocztowy city - nazwa miasta countryid - identyfikator kraju + post_address - adres korespondencyjny (ulica, nr domu, nr lokalu) + post_zip - adres korespondencyjny - kod pocztowy + post_city - adres korespondencyjny - nazwa miasta + post_countryid - adres korespondencyjny - identyfikator kraju ten - numer identyfikacji podatkowej NIP ssn - numer PESEL regon - numer REGON @@ -118,7 +122,6 @@ icn - numer dowodu osobistego info - dodatkowe informacje notes - notatki - serviceaddr - adres do doręczeń (np. na faktury) creationdate - czas utworzenia wpisu moddate - czas modyfikacji creatorid - identyfikator użytkownika tworzącego wpis @@ -229,7 +232,9 @@ warning - ostrzegaj/nie ostrzegaj (1/0) lastonline - znacznik czasu ostatniej obecności w sieci info - informacje dodatkowe - location - lokalizacja (adres) + location_address - adres lokalizacji - ulica, nr domu, nr lokalu + location_zip - adres lokalizacji - kod pocztowy + location_city - adres lokalizacji - miasto nas - flaga NAS (0/1) From cvs w lms.org.pl Fri Dec 17 09:39:07 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20101217083907.DAEE53039A46@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:07 Author: alec Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.367&r2=1.368 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.367 lms/lib/locale/pl/strings.php:1.368 --- lms/lib/locale/pl/strings.php:1.367 Wed Dec 15 13:10:15 2010 +++ lms/lib/locale/pl/strings.php Fri Dec 17 09:39:07 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.367 2010/12/15 12:10:15 alec Exp $ + * $Id: strings.php,v 1.368 2010/12/17 08:39:07 alec Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresów)'; @@ -2380,5 +2380,9 @@ $_LANG['mobile'] = 'tel.kom.'; $_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)'; ?> From cvs w lms.org.pl Fri Dec 17 09:39:07 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib/upgradedb (2 files) Message-ID: <20101217083908.06D223039A4B@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:07 Author: alec Path: /cvsroot/lms/lib/upgradedb Added: mysql.2010121600.php postgres.2010121600.php - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/mysql.2010121600.php?rev=1.1 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb/postgres.2010121600.php?rev=1.1 Index: lms/lib/upgradedb/mysql.2010121600.php diff -u /dev/null lms/lib/upgradedb/mysql.2010121600.php:1.1 --- /dev/null Fri Dec 17 09:39:07 2010 +++ lms/lib/upgradedb/mysql.2010121600.php Fri Dec 17 09:39:07 2010 @@ -0,0 +1,113 @@ +BeginTrans(); + +$DB->Execute("DROP VIEW customersview"); +$DB->Execute("DROP VIEW vnodes"); +$DB->Execute("DROP VIEW vmacs"); + +$DB->Execute("ALTER TABLE customers ADD post_address varchar(255) DEFAULT NULL"); +$DB->Execute("ALTER TABLE customers ADD post_zip varchar(10) DEFAULT NULL"); +$DB->Execute("ALTER TABLE customers ADD post_city varchar(32) DEFAULT NULL"); +$DB->Execute("ALTER TABLE customers ADD post_countryid integer DEFAULT NULL"); +$DB->Execute("ALTER TABLE customers MODIFY countryid int(11) DEFAULT NULL"); + +$DB->Execute("ALTER TABLE nodes ADD location_address varchar(255) DEFAULT NULL"); +$DB->Execute("ALTER TABLE nodes ADD location_zip varchar(10) DEFAULT NULL"); +$DB->Execute("ALTER TABLE nodes ADD location_city varchar(32) DEFAULT NULL"); + +/* + Here, we'll try to split old address into parts + We'll handle only one (Polish) format: +
+ +*/ +function parse_address_tmp($addr) +{ + $regexp = '/\n([0-9]{2}-[0-9]{3})\s+(.*)/'; + if (preg_match($regexp, $addr, $matches)) { + $zip = $matches[1]; + $city = $matches[2]; + $street = trim(preg_replace($regexp, '', $addr)); + $street = trim(array_shift(explode("\n", $street))); + + if ($street) + return array($zip, $city, $street); + } + else { + // first line only + $addr = trim(array_shift(explode("\n", $addr))); + return array(NULL, NULL, $addr); + } + return NULL; +} + +$data = $DB->GetAll("SELECT id, serviceaddr FROM customers WHERE serviceaddr <> ''"); +if (is_array($data)) { + foreach ($data as $row) { + $addr = parse_address_tmp($row['serviceaddr']); + if (!empty($addr)) { + $DB->Execute('UPDATE customers SET post_address=?, post_zip=?, post_city=? + WHERE id=?', array($addr[2], $addr[0], $addr[1], $row['id'])); + } + } +} + +$data = $DB->GetAll("SELECT id, location FROM nodes WHERE location <> ''"); +if (is_array($data)) { + foreach ($data as $row) { + $addr = parse_address_tmp($row['location']); + if (!empty($addr)) { + $DB->Execute('UPDATE nodes SET location_address=?, location_zip=?, location_city=? + WHERE id=?', array($addr[2], $addr[0], $addr[1], $row['id'])); + } + } +} + +$DB->Execute("ALTER TABLE customers DROP serviceaddr"); +$DB->Execute("ALTER TABLE nodes DROP location"); + +$DB->Execute("CREATE VIEW customersview AS + SELECT c.* FROM customers c + WHERE NOT EXISTS ( + SELECT 1 FROM customerassignments a + JOIN excludedgroups e ON (a.customergroupid = e.customergroupid) + WHERE e.userid = lms_current_user() AND a.customerid = c.id)"); + +$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("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('2010121600', 'dbversion')); + +$DB->CommitTrans(); + +?> + Index: lms/lib/upgradedb/postgres.2010121600.php diff -u /dev/null lms/lib/upgradedb/postgres.2010121600.php:1.1 --- /dev/null Fri Dec 17 09:39:07 2010 +++ lms/lib/upgradedb/postgres.2010121600.php Fri Dec 17 09:39:07 2010 @@ -0,0 +1,119 @@ +BeginTrans(); + +$DB->Execute(" + DROP VIEW customersview; + DROP VIEW vnodes; + DROP VIEW vmacs; + + ALTER TABLE customers ADD post_address varchar(255) DEFAULT NULL; + ALTER TABLE customers ADD post_zip varchar(10) DEFAULT NULL; + ALTER TABLE customers ADD post_city varchar(32) DEFAULT NULL; + ALTER TABLE customers ADD post_countryid integer DEFAULT NULL; + + ALTER TABLE customers ALTER countryid DROP NOT NULL; + ALTER TABLE customers ALTER countryid SET DEFAULT NULL; + + ALTER TABLE nodes ADD location_address varchar(255) DEFAULT NULL; + ALTER TABLE nodes ADD location_zip varchar(10) DEFAULT NULL; + ALTER TABLE nodes ADD location_city varchar(32) DEFAULT NULL; +"); + +/* + Here, we'll try to split old address into parts + We'll handle only one (Polish) format: +
+ +*/ +function parse_address_tmp($addr) +{ + $regexp = '/\n([0-9]{2}-[0-9]{3})\s+(.*)/'; + if (preg_match($regexp, $addr, $matches)) { + $zip = $matches[1]; + $city = $matches[2]; + $street = trim(preg_replace($regexp, '', $addr)); + $street = trim(array_shift(explode("\n", $street))); + + if ($street) + return array($zip, $city, $street); + } + else { + // first line only + $addr = trim(array_shift(explode("\n", $addr))); + return array(NULL, NULL, $addr); + } + return NULL; +} + +$data = $DB->GetAll("SELECT id, serviceaddr FROM customers WHERE serviceaddr <> ''"); +if (is_array($data)) { + foreach ($data as $row) { + $addr = parse_address_tmp($row['serviceaddr']); + if (!empty($addr)) { + $DB->Execute('UPDATE customers SET post_address=?, post_zip=?, post_city=? + WHERE id=?', array($addr[2], $addr[0], $addr[1], $row['id'])); + } + } +} + +$data = $DB->GetAll("SELECT id, location FROM nodes WHERE location <> ''"); +if (is_array($data)) { + foreach ($data as $row) { + $addr = parse_address_tmp($row['location']); + if (!empty($addr)) { + $DB->Execute('UPDATE nodes SET location_address=?, location_zip=?, location_city=? + WHERE id=?', array($addr[2], $addr[0], $addr[1], $row['id'])); + } + } +} + +$DB->Execute(" + ALTER TABLE customers DROP serviceaddr; + ALTER TABLE nodes DROP location; + + CREATE VIEW customersview AS + SELECT c.* FROM customers c + WHERE NOT EXISTS ( + SELECT 1 FROM customerassignments a + JOIN excludedgroups e ON (a.customergroupid = e.customergroupid) + WHERE e.userid = lms_current_user() AND a.customerid = c.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); + + 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('2010121600', 'dbversion')); + +$DB->CommitTrans(); + +?> From cvs w lms.org.pl Fri Dec 17 09:39:07 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:07 +0100 (CET) Subject: [lms-commits] CVS update of lms/lib (LMS.class.php, upgradedb.php) Message-ID: <20101217083907.B1B0C3039A45@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:07 Author: alec Path: /cvsroot/lms/lib Modified: LMS.class.php upgradedb.php - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/LMS.class.php.diff?&r1=1.1040&r2=1.1041 http://cvs.lms.org.pl/viewvc/Development/lms/lib/upgradedb.php.diff?&r1=1.181&r2=1.182 Index: lms/lib/LMS.class.php diff -u lms/lib/LMS.class.php:1.1040 lms/lib/LMS.class.php:1.1041 --- lms/lib/LMS.class.php:1.1040 Wed Dec 15 13:10:14 2010 +++ lms/lib/LMS.class.php Fri Dec 17 09:39:07 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: LMS.class.php,v 1.1040 2010/12/15 12:10:14 alec Exp $ + * $Id: LMS.class.php,v 1.1041 2010/12/17 08:39:07 alec Exp $ */ // LMS Class - contains internal LMS database functions used @@ -34,7 +34,7 @@ var $CONFIG; // table including lms.ini options var $cache = array(); // internal cache var $_version = '1.11-cvs'; // class version - var $_revision = '$Revision: 1.1040 $'; + var $_revision = '$Revision: 1.1041 $'; function LMS(&$DB, &$AUTH, &$CONFIG) // class variables setting { @@ -363,11 +363,6 @@ return $this->DB->GetOne('SELECT email FROM customers WHERE id=?', array($id)); } - function GetCustomerServiceAddress($id) - { - return $this->DB->GetOne('SELECT serviceaddr FROM customers WHERE id=?', array($id)); - } - function CustomerExists($id) { switch($this->DB->GetOne('SELECT deleted FROM customersview WHERE id=?', array($id))) @@ -389,11 +384,12 @@ { if($this->DB->Execute('INSERT INTO customers (name, lastname, type, address, zip, city, countryid, email, ten, ssn, status, creationdate, - creatorid, info, notes, serviceaddr, message, pin, regon, rbe, + post_address, post_zip, post_city, post_countryid, + creatorid, info, notes, message, pin, regon, rbe, icn, cutoffstop, consentdate, einvoice, divisionid, paytime, paytype, invoicenotice, mailingnotice) VALUES (?, UPPER(?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?NOW?, - ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array(lms_ucwords($customeradd['name']), $customeradd['lastname'], empty($customeradd['type']) ? 0 : 1, @@ -405,10 +401,13 @@ $customeradd['ten'], $customeradd['ssn'], $customeradd['status'], + $customeradd['post_address'], + $customeradd['post_zip'], + $customeradd['post_city'], + $customeradd['post_countryid'], $this->AUTH->id, $customeradd['info'], $customeradd['notes'], - $customeradd['serviceaddr'], $customeradd['message'], $customeradd['pin'], $customeradd['regon'], @@ -422,8 +421,12 @@ !empty($customeradd['paytype']) ? $customeradd['paytype'] : NULL, $customeradd['invoicenotice'], $customeradd['mailingnotice'], - ))) - { + )) + ) { + $this->UpdateCountryState($customeradd['zip'], $customeradd['stateid']); + if ($customeradd['post_zip'] != $customeradd['zip']) { + $this->UpdateCountryState($customeradd['post_zip'], $customeradd['post_stateid']); + } return $this->DB->GetLastInsertID('customers'); } else return FALSE; @@ -453,33 +456,37 @@ function CustomerUpdate($customerdata) { - return $this->DB->Execute('UPDATE customers SET status=?, type=?, address=?, - zip=?, city=?, countryid=?, email=?, ten=?, ssn=?, moddate=?NOW?, modid=?, - info=?, notes=?, serviceaddr=?, lastname=UPPER(?), name=?, - deleted=0, message=?, pin=?, regon=?, icn=?, rbe=?, + $res = $this->DB->Execute('UPDATE customers SET status=?, type=?, address=?, + zip=?, city=?, countryid=?, email=?, ten=?, ssn=?, moddate=?NOW?, modid=?, + post_address=?, post_zip=?, post_city=?, post_countryid=?, + info=?, notes=?, lastname=UPPER(?), name=?, + deleted=0, message=?, pin=?, regon=?, icn=?, rbe=?, cutoffstop=?, consentdate=?, einvoice=?, invoicenotice=?, mailingnotice=?, - divisionid=?, paytime=?, paytype=? - WHERE id=?', - array( $customerdata['status'], + divisionid=?, paytime=?, paytype=? + WHERE id=?', + array( $customerdata['status'], empty($customerdata['type']) ? 0 : 1, - $customerdata['address'], - $customerdata['zip'], - $customerdata['city'], + $customerdata['address'], + $customerdata['zip'], + $customerdata['city'], $customerdata['countryid'], - $customerdata['email'], - $customerdata['ten'], - $customerdata['ssn'], + $customerdata['email'], + $customerdata['ten'], + $customerdata['ssn'], isset($this->AUTH->id) ? $this->AUTH->id : 0, - $customerdata['info'], + $customerdata['post_address'], + $customerdata['post_zip'], + $customerdata['post_city'], + $customerdata['post_countryid'], + $customerdata['info'], $customerdata['notes'], - $customerdata['serviceaddr'], - $customerdata['lastname'], - lms_ucwords($customerdata['name']), + $customerdata['lastname'], + lms_ucwords($customerdata['name']), $customerdata['message'], $customerdata['pin'], - $customerdata['regon'], - $customerdata['icn'], - $customerdata['rbe'], + $customerdata['regon'], + $customerdata['icn'], + $customerdata['rbe'], $customerdata['cutoffstop'], $customerdata['consentdate'], $customerdata['einvoice'], @@ -490,6 +497,15 @@ $customerdata['paytype'] ? $customerdata['paytype'] : null, $customerdata['id'], )); + + if ($res) { + $this->UpdateCountryState($customerdata['zip'], $customerdata['stateid']); + if ($customerdata['post_zip'] != $customerdata['zip']) { + $this->UpdateCountryState($customerdata['post_zip'], $customerdata['post_stateid']); + } + } + + return $res; } function GetCustomerNodesNo($id) @@ -518,13 +534,12 @@ function GetCustomer($id, $short=false) { global $CONTACTTYPES; - + if($result = $this->DB->GetRow('SELECT c.*, ' .$this->DB->Concat('UPPER(c.lastname)',"' '",'c.name').' AS customername, - d.shortname AS division, d.account, co.name AS country + d.shortname AS division, d.account FROM customers'.(defined('LMS-UI') ? 'view' : '').' c LEFT JOIN divisions d ON (d.id = c.divisionid) - LEFT JOIN countries co ON (co.id = c.countryid) WHERE c.id = ?', array($id))) { if(!$short) @@ -538,12 +553,38 @@ failedlogindate, failedloginip FROM up_customers WHERE customerid = ?', array($result['id'])); - if($cstate = $this->DB->GetRow('SELECT s.id, s.name FROM states s, zipcodes - WHERE zip = ? AND stateid = s.id', array($result['zip']))) - { + // Get country name + if ($result['countryid']) { + $result['country'] = $this->DB->GetOne('SELECT name FROM countries WHERE id = ?', + array($result['countryid'])); + } + if ($result['countryid'] == $result['post_countryid']) { + $result['post_country'] = $result['country']; + } + else if ($result['post_countryid']) { + $result['country'] = $this->DB->GetOne('SELECT name FROM countries WHERE id = ?', + array($result['post_countryid'])); + } + + // Get state name + if ($cstate = $this->DB->GetRow('SELECT s.id, s.name + FROM states s, zipcodes + WHERE zip = ? AND stateid = s.id', array($result['zip'])) + ) { $result['stateid'] = $cstate['id']; $result['cstate'] = $cstate['name']; } + if ($result['zip'] == $result['post_zip']) { + $result['post_stateid'] = $result['stateid']; + $result['post_cstate'] = $result['cstate']; + } + else if ($result['post_zip'] && ($cstate = $this->DB->GetRow('SELECT s.id, s.name + FROM states s, zipcodes + WHERE zip = ? AND stateid = s.id', array($result['post_zip']))) + ) { + $result['post_stateid'] = $cstate['id']; + $result['post_cstate'] = $cstate['name']; + } } $result['balance'] = $this->GetCustomerBalance($result['id']); $result['bankaccount'] = bankaccount($result['id'], $result['account']); @@ -673,7 +714,7 @@ case 'address': // UPPER here is a workaround for postgresql ILIKE bug $searchargs[] = "(UPPER($key) ?LIKE? UPPER(".$this->DB->Escape("%$value%").') - OR UPPER(serviceaddr) ?LIKE? UPPER('.$this->DB->Escape("%$value%").'))'; + OR UPPER(post_$key) ?LIKE? UPPER('.$this->DB->Escape("%$value%").'))'; break; case 'customername': // UPPER here is a workaround for postgresql ILIKE bug @@ -844,7 +885,8 @@ 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, location, lastonline, + warning, info, ownerid, lastonline, + location_address, location_zip, location_city, (SELECT COUNT(*) FROM nodegroupassignments WHERE nodeid = vnodes.id) AS gcount FROM vnodes @@ -1152,22 +1194,25 @@ function NodeUpdate($nodedata, $deleteassignments=FALSE) { - $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=?, chkmac=?, halfduplex=?, linktype=?, port=?, nas=? - WHERE id=?', - array($nodedata['name'], - $nodedata['ipaddr_pub'], - $nodedata['ipaddr'], - $nodedata['passwd'], - $nodedata['netdev'], - $this->AUTH->id, - $nodedata['access'], - $nodedata['warning'], - $nodedata['ownerid'], - $nodedata['info'], - $nodedata['location'], + $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=?, + chkmac=?, halfduplex=?, linktype=?, port=?, nas=? + WHERE id=?', + array($nodedata['name'], + $nodedata['ipaddr_pub'], + $nodedata['ipaddr'], + $nodedata['passwd'], + $nodedata['netdev'], + $this->AUTH->id, + $nodedata['access'], + $nodedata['warning'], + $nodedata['ownerid'], + $nodedata['info'], + $nodedata['location_address'], + $nodedata['location_zip'], + $nodedata['location_city'], $nodedata['chkmac'], $nodedata['halfduplex'], isset($nodedata['linktype']) ? 1 : 0, @@ -1175,15 +1220,18 @@ isset($nodedata['nas']) ? $nodedata['nas'] : 0, $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) - { + foreach($nodedata['macs'] as $mac) { $this->DB->Execute('INSERT INTO macs (mac, nodeid) VALUES(?, ?)', array(strtoupper($mac), $nodedata['id'])); } - if($deleteassignments) + if($deleteassignments) { $this->DB->Execute('DELETE FROM nodeassignments WHERE nodeid = ?', array($nodedata['id'])); + } } function DeleteNode($id) @@ -1242,11 +1290,9 @@ function GetNode($id) { - if($result = $this->DB->GetRow('SELECT id, name, ownerid, ipaddr, inet_ntoa(ipaddr) AS ip, - ipaddr_pub, inet_ntoa(ipaddr_pub) AS ip_pub, mac, passwd, access, - warning, creationdate, moddate, creatorid, modid, netdev, lastonline, - info, location, chkmac, halfduplex, linktype, port, nas - FROM vnodes + 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))) { $result['owner'] = $this->GetCustomerName($result['ownerid']); @@ -1268,6 +1314,15 @@ $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; @@ -1438,11 +1493,12 @@ function NodeAdd($nodedata) { - if($this->DB->Execute('INSERT INTO nodes (name, ipaddr, ipaddr_pub, ownerid, - passwd, creatorid, creationdate, access, warning, info, netdev, - linktype, port, location, chkmac, halfduplex, nas) - VALUES (?, inet_aton(?),inet_aton(?), ?, ?, ?, - ?NOW?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + 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, + linktype, port, chkmac, halfduplex, nas) + VALUES (?, inet_aton(?),inet_aton(?), ?, ?, ?, + ?NOW?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array(strtoupper($nodedata['name']), $nodedata['ipaddr'], $nodedata['ipaddr_pub'], @@ -1453,9 +1509,11 @@ $nodedata['warning'], $nodedata['info'], $nodedata['netdev'], + $nodedata['location_address'], + $nodedata['location_zip'], + $nodedata['location_city'], isset($nodedata['linktype']) ? 1 : 0, isset($nodedata['port']) && $nodedata['netdev'] ? intval($nodedata['port']) : 0, - $nodedata['location'], $nodedata['chkmac'], $nodedata['halfduplex'], isset($nodedata['nas']) ? $nodedata['nas'] : 0, @@ -1463,6 +1521,8 @@ { $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)); @@ -1960,7 +2020,7 @@ if($result = $this->DB->GetRow('SELECT d.id, d.number, d.name, d.customerid, d.userid, d.address, d.zip, d.city, d.countryid, cn.name AS country, d.ten, d.ssn, d.cdate, d.paytime, d.paytype, d.numberplanid, - d.closed, d.reference, d.reason, d.divisionid, + d.closed, d.reference, d.reason, d.divisionid, (SELECT name FROM users WHERE id = d.userid) AS user, n.template, ds.name AS division_name, ds.shortname AS division_shortname, ds.address AS division_address, ds.zip AS division_zip, @@ -1968,13 +2028,14 @@ ds.ten AS division_ten, ds.regon AS division_regon, ds.account AS account, ds.inv_header AS division_header, ds.inv_footer AS division_footer, ds.inv_author AS division_author, ds.inv_cplace AS division_cplace, - c.pin AS customerpin, c.divisionid AS current_divisionid + c.pin AS customerpin, c.divisionid AS current_divisionid, + c.post_address, c.post_zip, c.post_city, c.post_countryid FROM documents d JOIN customers c ON (c.id = d.customerid) LEFT JOIN countries cn ON (cn.id = d.countryid) LEFT JOIN divisions ds ON (ds.id = d.divisionid) LEFT JOIN numberplans n ON (d.numberplanid = n.id) - WHERE d.id = ? AND (d.type = ? OR d.type = ?)', + WHERE d.id = ? AND (d.type = ? OR d.type = ?)', array($invoiceid, DOC_INVOICE, DOC_CNOTE))) { $result['discount'] = 0; @@ -2070,6 +2131,12 @@ $result['month'] = date('m',$result['cdate']); $result['pesel'] = $result['ssn']; $result['nip'] = $result['ten']; + if ($result['post_address']) { + $result['serviceaddr'] = $result['post_address']; + if ($result['post_zip'] && $result['post_city']) { + $result['serviceaddr'] .= "\n".$result['post_zip'].' '.$result['post_city']; + } + } return $result; } @@ -2089,17 +2156,18 @@ ds.ten AS division_ten, ds.regon AS division_regon, ds.account AS account, ds.inv_header AS division_header, ds.inv_footer AS division_footer, ds.inv_author AS division_author, ds.inv_cplace AS division_cplace, - c.pin AS customerpin, c.divisionid AS current_divisionid + c.pin AS customerpin, c.divisionid AS current_divisionid, + c.post_address, c.post_zip, c.post_city, c.post_countryid FROM documents d JOIN customers c ON (c.id = d.customerid) LEFT JOIN countries cn ON (cn.id = d.countryid) LEFT JOIN divisions ds ON (ds.id = d.divisionid) LEFT JOIN numberplans n ON (d.numberplanid = n.id) - WHERE d.id = ? AND d.type = ?', + WHERE d.id = ? AND d.type = ?', array($id, DOC_DNOTE))) { $result['value'] = 0; - + if(!$result['division_header']) $result['division_header'] = $result['division_name']."\n" .$result['division_address']."\n".$result['division_zip'].' '.$result['division_city'] @@ -2107,7 +2175,7 @@ && $result['division_countryid'] != $result['countryid'] ? "\n".trans($this->GetCountryName($result['division_countryid'])) : '') .($result['division_ten'] != '' ? "\n".trans('TEN').' '.$result['division_ten'] : ''); - + if($result['content'] = $this->DB->GetAll('SELECT value, itemid, description FROM debitnotecontents @@ -2133,6 +2201,14 @@ $result['customerbalancelistlimit'] = $this->CONFIG['notes']['print_balance_history_limit']; } + // for backward compatibility + if ($result['post_address']) { + $result['serviceaddr'] = $result['post_address']; + if ($result['post_zip'] && $result['post_city']) { + $result['serviceaddr'] .= "\n".$result['post_zip'].' '.$result['post_city']; + } + } + return $result; } else @@ -3011,7 +3087,7 @@ $sqlord = ' ORDER BY name'; break; } - + $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) @@ -4194,17 +4270,17 @@ case CONTINUOUS: $number = $this->DB->GetOne('SELECT MAX(number) FROM documents WHERE type = ? AND numberplanid = ?', array($doctype, $planid)); - + return $number ? ++$number : 1; break; } - + $number = $this->DB->GetOne(' SELECT MAX(number) FROM documents WHERE cdate >= ? AND cdate < ? AND type = ? AND numberplanid = ?', array($start, $end, $doctype, $planid)); - + return $number ? ++$number : 1; } @@ -4212,10 +4288,10 @@ { if($planid) $period = $this->DB->GetOne('SELECT period FROM numberplans WHERE id=?', array($planid)); - + $period = isset($period) ? $period : YEARLY; $cdate = $cdate ? $cdate : time(); - + switch($period) { case DAILY: @@ -4263,7 +4339,7 @@ array($doctype, $number, $planid)) ? TRUE : FALSE; break; } - + return $this->DB->GetOne('SELECT number FROM documents WHERE cdate >= ? AND cdate < ? AND type = ? AND number = ? AND numberplanid = ?', array($start, $end, $doctype, $number, $planid)) ? TRUE : FALSE; @@ -4284,6 +4360,24 @@ return $this->DB->GetOne('SELECT name FROM countries WHERE id = ?', array($id)); } + function UpdateCountryState($zip, $stateid) + { + if (empty($zip) || empty($stateid)) { + return; + } + + $cstate = $this->DB->GetOne('SELECT stateid FROM zipcodes WHERE zip = ?', array($zip)); + + if ($cstate === NULL) { + $this->DB->Execute('INSERT INTO zipcodes (stateid, zip) VALUES (?, ?)', + array($stateid, $zip)); + } + else if ($cstate != $stateid) { + $this->DB->Execute('UPDATE zipcodes SET stateid = ? WHERE zip = ?', + array($stateid, $zip)); + } + } + function GetNAStypes() { return $this->DB->GetAllByKey('SELECT id, name FROM nastypes ORDER BY name', 'id'); Index: lms/lib/upgradedb.php diff -u lms/lib/upgradedb.php:1.181 lms/lib/upgradedb.php:1.182 --- lms/lib/upgradedb.php:1.181 Wed Dec 15 13:10:15 2010 +++ lms/lib/upgradedb.php Fri Dec 17 09:39:07 2010 @@ -21,10 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: upgradedb.php,v 1.181 2010/12/15 12:10:15 alec Exp $ + * $Id: upgradedb.php,v 1.182 2010/12/17 08:39:07 alec Exp $ */ -define('DBVERSION', '2010121400'); // here should be always the newest version of database! +define('DBVERSION', '2010121600'); // here should be always the newest version of database! // it placed here to avoid read disk every time when we call this file. /* From cvs w lms.org.pl Fri Dec 17 09:39:08 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:08 +0100 (CET) Subject: [lms-commits] CVS update of lms/modules (9 files) Message-ID: <20101217083908.5FB4630000A0@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:08 Author: alec Path: /cvsroot/lms/modules Modified: customeradd.php customeredit.php genfake.php invoice.php invoice_pdf.inc.php invoice_pdf.php nodeadd.php nodeedit.php note.php - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/customeradd.php.diff?&r1=1.33&r2=1.34 http://cvs.lms.org.pl/viewvc/Development/lms/modules/customeredit.php.diff?&r1=1.42&r2=1.43 http://cvs.lms.org.pl/viewvc/Development/lms/modules/genfake.php.diff?&r1=1.80&r2=1.81 http://cvs.lms.org.pl/viewvc/Development/lms/modules/invoice.php.diff?&r1=1.82&r2=1.83 http://cvs.lms.org.pl/viewvc/Development/lms/modules/invoice_pdf.inc.php.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/modules/invoice_pdf.php.diff?&r1=1.94&r2=1.95 http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodeadd.php.diff?&r1=1.95&r2=1.96 http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodeedit.php.diff?&r1=1.115&r2=1.116 http://cvs.lms.org.pl/viewvc/Development/lms/modules/note.php.diff?&r1=1.4&r2=1.5 Index: lms/modules/customeradd.php diff -u lms/modules/customeradd.php:1.33 lms/modules/customeradd.php:1.34 --- lms/modules/customeradd.php:1.33 Wed Dec 15 13:10:15 2010 +++ lms/modules/customeradd.php Fri Dec 17 09:39:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: customeradd.php,v 1.33 2010/12/15 12:10:15 alec Exp $ + * $Id: customeradd.php,v 1.34 2010/12/17 08:39:08 alec Exp $ */ if(isset($_GET['ajax'])) @@ -47,14 +47,20 @@ } if (!isset($mode)) { print 'false;'; exit; } - $candidates = $DB->GetAll('SELECT '.$mode.' as item, count(id) as entries FROM customers WHERE '.$mode.' != \'\' AND lower('.$mode.') ?LIKE? lower(\'%'.$search.'%\') GROUP BY item ORDER BY entries desc, item asc'); + + $candidates = $DB->GetAll('SELECT '.$mode.' as item, count(id) as entries + FROM customers + WHERE '.$mode.' != \'\' AND lower('.$mode.') ?LIKE? lower(\'%'.$search.'%\') + GROUP BY item + ORDER BY entries desc, item asc + LIMIT 15'); + $eglible=array(); $descriptions=array(); if ($candidates) foreach($candidates as $idx => $row) { $eglible[$row['item']] = escape_js($row['item']); $descriptions[$row['item']] = escape_js($row['entries'].' '.trans('entries')); } - header('Content-type: text/plain'); if ($eglible) { print preg_replace('/$/',"\");\n","this.eligible = new Array(\"".implode('","',$eglible)); print preg_replace('/$/',"\");\n","this.descriptions = new Array(\"".implode('","',$descriptions)); @@ -108,12 +114,17 @@ if($customeradd['regon'] != '' && !check_regon($customeradd['regon'])) $error['regon'] = trans('Incorrect Business Registration Number!'); - + if($customeradd['zip'] !='' && !check_zip($customeradd['zip']) && !isset($customeradd['zipwarning'])) { $error['zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); $customeradd['zipwarning'] = 1; } + if($customeradd['post_zip'] !='' && !check_zip($customeradd['post_zip']) && !isset($customeradd['post_zipwarning'])) + { + $error['post_zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); + $customeradd['post_zipwarning'] = 1; + } if($customeradd['pin'] == '') $error['pin'] = trans('PIN code is required!'); @@ -168,7 +179,7 @@ $customeradd['consentdate'] = 0; if(!isset($customeradd['divisionid'])) $customeradd['divisionid'] = 0; - + $id = $LMS->CustomerAdd($customeradd); if(isset($im) && $id) @@ -181,23 +192,11 @@ $DB->Execute('INSERT INTO customercontacts (customerid, phone, name, type) VALUES(?, ?, ?, ?)', array($id, $contact['phone'], $contact['name'], $contact['type'])); - if($customeradd['zip'] && $customeradd['stateid']) - { - $cstate = $DB->GetOne('SELECT stateid FROM zipcodes WHERE zip = ?', array($customeradd['zip'])); - - if($cstate === NULL) - $DB->Execute('INSERT INTO zipcodes (stateid, zip) VALUES (?, ?)', - array($customeradd['stateid'], $customeradd['zip'])); - elseif($cstate != $customeradd['stateid']) - $DB->Execute('UPDATE zipcodes SET stateid = ? WHERE zip = ?', - array($customeradd['stateid'], $customeradd['zip'])); - } - if(!isset($customeradd['reuse'])) { $SESSION->redirect('?m=customerinfo&id='.$id); } - + $reuse['status'] = $customeradd['status']; $reuse['contacts'][] = array(); unset($customeradd); Index: lms/modules/customeredit.php diff -u lms/modules/customeredit.php:1.42 lms/modules/customeredit.php:1.43 --- lms/modules/customeredit.php:1.42 Wed Dec 15 13:10:15 2010 +++ lms/modules/customeredit.php Fri Dec 17 09:39:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: customeredit.php,v 1.42 2010/12/15 12:10:15 alec Exp $ + * $Id: customeredit.php,v 1.43 2010/12/17 08:39:08 alec Exp $ */ $action = isset($_GET['action']) ? $_GET['action'] : ''; $exists = $LMS->CustomerExists($_GET['id']); @@ -43,7 +43,7 @@ if($customerdata['lastname']=='') $error['customername'] = trans('\'Last/Company Name\' and \'First Name\' fields cannot be empty!'); - + if($customerdata['address']=='') $error['address'] = trans('Address required!'); @@ -70,6 +70,11 @@ $error['zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); $zipwarning = 1; } + if($customerdata['post_zip'] !='' && !check_zip($customerdata['post_zip']) && !isset($customerdata['post_zipwarning'])) + { + $error['post_zip'] = trans('Incorrect ZIP code! If you are sure you want to accept it, then click "Submit" again.'); + $post_zipwarning = 1; + } if($customerdata['email']!='' && !check_email($customerdata['email'])) $error['email'] = trans('Incorrect email!'); @@ -122,9 +127,9 @@ { if($customerdata['cutoffstop']) $customerdata['cutoffstop'] = mktime(23,59,59,date('m'), date('d') + $customerdata['cutoffstop']); - + $consent = $DB->GetOne('SELECT consentdate FROM customers WHERE id = ?', array($customerdata['id'])); - + if(!isset($customerdata['consentdate'])) $customerdata['consentdate'] = 0; elseif($consent) @@ -132,9 +137,9 @@ if(!isset($customerdata['divisionid'])) $customerdata['divisionid'] = 0; - + $LMS->CustomerUpdate($customerdata); - + $DB->Execute('DELETE FROM imessengers WHERE customerid = ?', array($customerdata['id'])); if(isset($im)) foreach($im as $idx => $val) @@ -146,18 +151,6 @@ foreach($contacts as $contact) $DB->Execute('INSERT INTO customercontacts (customerid, phone, name, type) VALUES(?, ?, ?, ?)', array($customerdata['id'], $contact['phone'], $contact['name'], $contact['type'])); - - if($customerdata['zip'] && $customerdata['stateid']) - { - $cstate = $DB->GetOne('SELECT stateid FROM zipcodes WHERE zip = ?', array($customerdata['zip'])); - - if($cstate === NULL) - $DB->Execute('INSERT INTO zipcodes (stateid, zip) VALUES (?, ?)', - array($customerdata['stateid'], $customerdata['zip'])); - elseif($cstate != $customerdata['stateid']) - $DB->Execute('UPDATE zipcodes SET stateid = ? WHERE zip = ?', - array($customerdata['stateid'], $customerdata['zip'])); - } $SESSION->redirect('?m=customerinfo&id='.$customerdata['id']); } @@ -173,7 +166,9 @@ $customerinfo['customername'] = $olddata['customername']; $customerinfo['balance'] = $olddata['balance']; $customerinfo['stateid'] = isset($olddata['stateid']) ? $olddata['stateid'] : 0; + $customerinfo['post_stateid'] = isset($olddata['post_stateid']) ? $olddata['post_stateid'] : 0; $customerinfo['zipwarning'] = empty($zipwarning) ? 0 : 1; + $customerinfo['post_zipwarning'] = empty($post_zipwarning) ? 0 : 1; $customerinfo['tenwarning'] = empty($tenwarning) ? 0 : 1; $customerinfo['ssnwarning'] = empty($ssnwarning) ? 0 : 1; Index: lms/modules/genfake.php diff -u lms/modules/genfake.php:1.80 lms/modules/genfake.php:1.81 --- lms/modules/genfake.php:1.80 Wed Dec 15 13:10:15 2010 +++ lms/modules/genfake.php Fri Dec 17 09:39:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: genfake.php,v 1.80 2010/12/15 12:10:15 alec Exp $ + * $Id: genfake.php,v 1.81 2010/12/17 08:39:08 alec Exp $ */ // Lastnames @@ -1966,7 +1966,6 @@ $customeradd['rbe'] = ''; $customeradd['icn'] = ''; $customeradd['notes'] = ''; - $customeradd['serviceaddr'] = ''; $customeradd['info'] = ''; $customeradd['message'] = ''; $customeradd['pin'] = mt_rand(10000,99999); Index: lms/modules/invoice.php diff -u lms/modules/invoice.php:1.82 lms/modules/invoice.php:1.83 --- lms/modules/invoice.php:1.82 Thu Mar 11 14:07:46 2010 +++ lms/modules/invoice.php Fri Dec 17 09:39:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: invoice.php,v 1.82 2010/03/11 13:07:46 alec Exp $ + * $Id: invoice.php,v 1.83 2010/12/17 08:39:08 alec Exp $ */ if(strtolower($CONFIG['invoices']['type']) == 'pdf') @@ -73,14 +73,13 @@ if(!empty($_GET['duplicate'])) $which[] = trans('DUPLICATE'); if(!sizeof($which)) $which[] = trans('ORIGINAL'); - + $count = sizeof($ids) * sizeof($which); $i=0; foreach($ids as $idx => $invoiceid) { $invoice = $LMS->GetInvoiceContent($invoiceid); - $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); - + foreach($which as $type) { $i++; @@ -125,8 +124,8 @@ if(!empty($_GET['original'])) $which[] = trans('ORIGINAL'); if(!empty($_GET['copy'])) $which[] = trans('COPY'); if(!empty($_GET['duplicate'])) $which[] = trans('DUPLICATE'); - - if(!sizeof($which)) $which[] = trans('ORIGINAL'); + + if(!sizeof($which)) $which[] = trans('ORIGINAL'); $count = sizeof($ids) * sizeof($which); $i=0; @@ -136,7 +135,6 @@ foreach($ids as $idx => $invoiceid) { $invoice = $LMS->GetInvoiceContent($invoiceid); - $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); foreach($which as $type) { @@ -158,8 +156,6 @@ else $layout['pagetitle'] = trans('Credit Note No. $0', $number); - $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); - $which = array(); if(!empty($_GET['original'])) $which[] = trans('ORIGINAL'); Index: lms/modules/invoice_pdf.inc.php diff -u lms/modules/invoice_pdf.inc.php:1.3 lms/modules/invoice_pdf.inc.php:1.4 --- lms/modules/invoice_pdf.inc.php:1.3 Mon Jun 21 10:58:16 2010 +++ lms/modules/invoice_pdf.inc.php Fri Dec 17 09:39:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: invoice_pdf.inc.php,v 1.3 2010/06/21 08:58:16 alec Exp $ + * $Id: invoice_pdf.inc.php,v 1.4 2010/12/17 08:39:08 alec Exp $ */ // Faktury w PDF, do użycia z formularzami FT-0100 (c) Polarnet // w razie pytań mailto:lexx w polarnet.org @@ -182,12 +182,12 @@ foreach ($tmp as $line) $y=$y-text_align_left($x,$y,$font_size,"".$line.""); */ $y = text_wrap($x, $y, 160, $font_size, ''.iconv("UTF-8","ISO-8859-2//TRANSLIT",$invoice['name'].''), 'left'); - if ($invoice['serviceaddr']) { - $tmp = preg_split('/\r?\n/', iconv("UTF-8","ISO-8859-2//TRANSLIT",$invoice['serviceaddr'])); - foreach ($tmp as $line) $y=$y-text_align_left($x,$y,$font_size,''.$line.''); + if ($invoice['post_address']) { + $y=$y-text_align_left($x,$y,$font_size,''.iconv('UTF-8','ISO-8859-2//TRANSLIT',$invoice['post_address']).''); + $y=$y-text_align_left($x,$y,$font_size,''.iconv('UTF-8','ISO-8859-2//TRANSLIT',$invoice['post_zip']." ".$invoice['post_city']).''); } else { - $y=$y-text_align_left($x,$y,$font_size,''.iconv('UTF-8','ISO-8859-2//TRANSLIT',$invoice['address']).''); - $y=$y-text_align_left($x,$y,$font_size,''.iconv('UTF-8','ISO-8859-2//TRANSLIT',$invoice['zip']." ".$invoice['city']).''); + $y=$y-text_align_left($x,$y,$font_size,''.iconv('UTF-8','ISO-8859-2//TRANSLIT',$invoice['address']).''); + $y=$y-text_align_left($x,$y,$font_size,''.iconv('UTF-8','ISO-8859-2//TRANSLIT',$invoice['zip']." ".$invoice['city']).''); } return $y; } @@ -195,7 +195,7 @@ function invoice_data_row($x,$y,$width,$font_size,$margin,$data,$t_width,$t_justify) { global $pdf; - $fy=$y-$margin-$pdf->GetFontHeight($font_size); + $fy=$y-$margin-$pdf->GetFontHeight($font_size); $left = $x+$margin; $ny = $fy; $cols = sizeof($data); Index: lms/modules/invoice_pdf.php diff -u lms/modules/invoice_pdf.php:1.94 lms/modules/invoice_pdf.php:1.95 --- lms/modules/invoice_pdf.php:1.94 Thu Mar 11 14:07:46 2010 +++ lms/modules/invoice_pdf.php Fri Dec 17 09:39:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: invoice_pdf.php,v 1.94 2010/03/11 13:07:46 alec Exp $ + * $Id: invoice_pdf.php,v 1.95 2010/12/17 08:39:08 alec Exp $ */ function invoice_body() @@ -94,7 +94,6 @@ foreach($ids as $idx => $invoiceid) { $invoice = $LMS->GetInvoiceContent($invoiceid); - $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); foreach($which as $type) { @@ -139,7 +138,6 @@ foreach($ids as $idx => $invoiceid) { $invoice = $LMS->GetInvoiceContent($invoiceid); - $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); foreach($which as $type) { @@ -151,14 +149,12 @@ } elseif($invoice = $LMS->GetInvoiceContent($_GET['id'])) { - $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); - $which = array(); if(!empty($_GET['original'])) $which[] = trans('ORIGINAL'); if(!empty($_GET['copy'])) $which[] = trans('COPY'); if(!empty($_GET['duplicate'])) $which[] = trans('DUPLICATE'); - + if(!sizeof($which)) { $tmp = explode(',', $CONFIG['invoices']['default_printpage']); Index: lms/modules/nodeadd.php diff -u lms/modules/nodeadd.php:1.95 lms/modules/nodeadd.php:1.96 --- lms/modules/nodeadd.php:1.95 Thu Sep 16 14:04:55 2010 +++ lms/modules/nodeadd.php Fri Dec 17 09:39:08 2010 @@ -21,9 +21,56 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodeadd.php,v 1.95 2010/09/16 12:04:55 alec Exp $ + * $Id: nodeadd.php,v 1.96 2010/12/17 08:39:08 alec Exp $ */ +if(isset($_GET['ajax'])) +{ + header('Content-type: text/plain'); + $search = urldecode(trim($_GET['what'])); + + switch($_GET['mode']) + { + 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': + $mode='location_city'; + break; + } + + if (!isset($mode)) { print 'false;'; exit; } + + $candidates = $DB->GetAll('SELECT '.$mode.' as item, count(id) as entries + FROM nodes + WHERE '.$mode.' != \'\' AND lower('.$mode.') ?LIKE? lower(\'%'.$search.'%\') + GROUP BY item + ORDER BY entries desc, item asc + LIMIT 15'); + + $eglible=array(); $descriptions=array(); + if ($candidates) + foreach($candidates as $idx => $row) { + $eglible[$row['item']] = escape_js($row['item']); + $descriptions[$row['item']] = escape_js($row['entries'].' '.trans('entries')); + } + if ($eglible) { + print preg_replace('/$/',"\");\n","this.eligible = new Array(\"".implode('","',$eglible)); + print preg_replace('/$/',"\");\n","this.descriptions = new Array(\"".implode('","',$descriptions)); + } else { + print "false;\n"; + } + exit; +} + + $nodedata['access'] = 1; $nodedata['ownerid'] = 0; @@ -162,6 +209,11 @@ 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; @@ -180,10 +232,10 @@ { $SESSION->redirect('?m=nodeinfo&id='.$nodeid); } - + $ownerid = $nodedata['ownerid']; unset($nodedata); - + $nodedata['ownerid'] = $ownerid; $nodedata['reuse'] = '1'; } @@ -219,9 +271,11 @@ $SMARTY->assign('customers', $LMS->GetCustomerNames()); } +$SMARTY->assign('cstateslist',$LMS->GetCountryStates()); $SMARTY->assign('netdevices', $LMS->GetNetDevNames()); $SMARTY->assign('error', $error); $SMARTY->assign('nodedata', $nodedata); $SMARTY->display('nodeadd.html'); ?> + Index: lms/modules/nodeedit.php diff -u lms/modules/nodeedit.php:1.115 lms/modules/nodeedit.php:1.116 --- lms/modules/nodeedit.php:1.115 Thu Sep 16 14:04:55 2010 +++ lms/modules/nodeedit.php Fri Dec 17 09:39:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodeedit.php,v 1.115 2010/09/16 12:04:55 alec Exp $ + * $Id: nodeedit.php,v 1.116 2010/12/17 08:39:08 alec Exp $ */ $action = isset($_GET['action']) ? $_GET['action'] : ''; @@ -181,7 +181,7 @@ { if(!isset($ports)) $ports = $DB->GetOne('SELECT ports FROM netdevices WHERE id = ?', array($nodeedit['netdev'])); - + if(!preg_match('/^[0-9]+$/', $nodeedit['port']) || $nodeedit['port'] > $ports) { $error['port'] = trans('Incorrect port number!'); @@ -202,6 +202,12 @@ 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) { $LMS->NodeUpdate($nodeedit, ($customerid != $nodeedit['ownerid'])); @@ -218,6 +224,11 @@ $nodeinfo['chkmac'] = $nodeedit['chkmac']; $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_city'] = $nodeedit['location_city']; + $nodeinfo['stateid'] = $nodeedit['stateid']; if($nodeedit['ipaddr_pub']=='0.0.0.0') $nodeinfo['ipaddr_pub'] = ''; @@ -242,6 +253,7 @@ $SMARTY->assign('customers', $LMS->GetCustomerNames()); } +$SMARTY->assign('cstateslist',$LMS->GetCountryStates()); $SMARTY->assign('netdevices', $LMS->GetNetDevNames()); $SMARTY->assign('nodegroups', $LMS->GetNodeGroupNamesByNode($nodeid)); $SMARTY->assign('othernodegroups', $LMS->GetNodeGroupNamesWithoutNode($nodeid)); Index: lms/modules/note.php diff -u lms/modules/note.php:1.4 lms/modules/note.php:1.5 --- lms/modules/note.php:1.4 Thu Mar 11 14:07:47 2010 +++ lms/modules/note.php Fri Dec 17 09:39:08 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: note.php,v 1.4 2010/03/11 13:07:47 alec Exp $ + * $Id: note.php,v 1.5 2010/12/17 08:39:08 alec Exp $ */ /* @@ -70,14 +70,13 @@ sort($ids); - + $count = sizeof($ids); $i=0; foreach($ids as $idx => $noteid) { $note = $LMS->GetNoteContent($noteid); - $note['serviceaddr'] = $LMS->GetCustomerServiceAddress($note['customerid']); - + $i++; if($i == $count) $note['last'] = TRUE; $SMARTY->assign('note', $note); @@ -119,7 +118,6 @@ foreach($ids as $idx => $noteid) { $note = $LMS->GetNoteContent($noteid); - $note['serviceaddr'] = $LMS->GetCustomerServiceAddress($note['customerid']); $SMARTY->assign('note',$note); $SMARTY->display($CONFIG['notes']['template_file']); @@ -131,8 +129,6 @@ $number = docnumber($note['number'], $note['template'], $note['cdate']); $layout['pagetitle'] = trans('Debit Note No. $0', $number); - $note['serviceaddr'] = $LMS->GetCustomerServiceAddress($note['customerid']); - $SMARTY->display('noteheader.html'); $note['last'] = TRUE; From cvs w lms.org.pl Fri Dec 17 09:39:08 2010 From: cvs w lms.org.pl (LMS CVS) Date: Fri, 17 Dec 2010 09:39:08 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (8 files) Message-ID: <20101217083908.B6AEF30340FE@hydra.altec.pl> Date: Friday, December 17, 2010 @ 09:39:08 Author: alec Path: /cvsroot/lms/templates Modified: customeradd.html customereditbox.html customerinfobox.html customerinfoshort.html invoice.html nodeaddbox.html nodeeditbox.html nodeinfobox.html - customer service address split into separate fields: address, zip, city, country (alec) - node location address split into separate fields: address, zip, city Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/customeradd.html.diff?&r1=1.40&r2=1.41 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customereditbox.html.diff?&r1=1.37&r2=1.38 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfobox.html.diff?&r1=1.46&r2=1.47 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfoshort.html.diff?&r1=1.20&r2=1.21 http://cvs.lms.org.pl/viewvc/Development/lms/templates/invoice.html.diff?&r1=1.67&r2=1.68 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeaddbox.html.diff?&r1=1.83&r2=1.84 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.86&r2=1.87 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.73&r2=1.74 Index: lms/templates/customeradd.html diff -u lms/templates/customeradd.html:1.40 lms/templates/customeradd.html:1.41 --- lms/templates/customeradd.html:1.40 Wed Dec 15 13:10:15 2010 +++ lms/templates/customeradd.html Fri Dec 17 09:39:08 2010 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{literal}
+ + + + + + + + + + + + + + + {if $customeradd.post_zipwarning} + + {/if} + + {if $cstateslist} + + + + + {/if} + {if $countrieslist} + + + + + {/if} +
{t}Address:{/t}
{t}City:{/t}
{t}Zip:{/t}
{t}State:{/t} + +
{t}Country:{/t} + +
+ +
@@ -353,10 +408,6 @@ - - - - Index: lms/templates/customereditbox.html diff -u lms/templates/customereditbox.html:1.37 lms/templates/customereditbox.html:1.38 --- lms/templates/customereditbox.html:1.37 Wed Dec 15 13:10:15 2010 +++ lms/templates/customereditbox.html Fri Dec 17 09:39:08 2010 @@ -1,4 +1,4 @@ - + {literal} + + + {foreach from=$customerinfo.contacts item=item key=key}
+ + + + + + + + + + + + + + + {if $customerinfo.post_zipwarning} + + {/if} + + {if $cstateslist} + + + + + {/if} + {if $countrieslist} + + + + + {/if} +
{t}Address:{/t}
{t}City:{/t}
{t}Zip:{/t}
{t}State:{/t} + +
{t}Country:{/t} + +
+ +
@@ -349,14 +403,6 @@ - - - -
- - - -
Index: lms/templates/customerinfobox.html diff -u lms/templates/customerinfobox.html:1.46 lms/templates/customerinfobox.html:1.47 --- lms/templates/customerinfobox.html:1.46 Wed Dec 15 13:10:15 2010 +++ lms/templates/customerinfobox.html Fri Dec 17 09:39:08 2010 @@ -1,4 +1,4 @@ - + +{if $customerinfo.post_address neq ""} + + + + +{/if} {foreach from=$customerinfo.contacts item=item} {/foreach} -{if $customerinfo.serviceaddr neq ""} - - - - -{/if} {if $customerinfo.email neq ""} +{if $customerinfo.post_address neq ""} + + + + +{/if} {foreach from=$customerinfo.contacts item=item} {/foreach} -{if $customerinfo.serviceaddr neq ""} - - - - -{/if} {if $customerinfo.email neq ""}
@@ -54,6 +54,19 @@ {if $customerinfo.country}
{t}{$customerinfo.country}{/t}{/if}
+ + + {$customerinfo.post_address}
+ {$customerinfo.post_zip} {$customerinfo.post_city} + {if $customerinfo.post_cstate}
{$customerinfo.post_cstate}{/if} + {if $customerinfo.post_country}
{t}{$customerinfo.post_country}{/t}{/if} +
@@ -66,16 +79,6 @@
- - - {$customerinfo.serviceaddr|replace:"\n":"
"} -
Index: lms/templates/customerinfoshort.html diff -u lms/templates/customerinfoshort.html:1.20 lms/templates/customerinfoshort.html:1.21 --- lms/templates/customerinfoshort.html:1.20 Wed Dec 15 13:10:15 2010 +++ lms/templates/customerinfoshort.html Fri Dec 17 09:39:08 2010 @@ -1,5 +1,5 @@ - + @@ -36,10 +36,20 @@ {$customerinfo.address}
- {$customerinfo.zip} {$customerinfo.city}
- {t}{$customerinfo.country}{/t} + {$customerinfo.zip} {$customerinfo.city}
+ + + {$customerinfo.post_address}
+ {$customerinfo.post_zip} {$customerinfo.post_city} +
@@ -52,16 +62,6 @@
- - - {$customerinfo.serviceaddr|replace:"\n":"
"} -
Index: lms/templates/invoice.html diff -u lms/templates/invoice.html:1.67 lms/templates/invoice.html:1.68 --- lms/templates/invoice.html:1.67 Mon Jun 21 10:58:17 2010 +++ lms/templates/invoice.html Fri Dec 17 09:39:08 2010 @@ -1,4 +1,4 @@ - + @@ -55,11 +55,12 @@

{$invoice.name}
- {if $invoice.serviceaddr neq ""} - {$invoice.serviceaddr|replace:"\n":"
"}
+ {if $invoice.post_address} + {$invoice.post_address}
+ {$invoice.post_zip} {$invoice.post_city} {else} - {$invoice.address}
- {$invoice.zip} {$invoice.city}
+ {$invoice.address}
+ {$invoice.zip} {$invoice.city} {/if}
Index: lms/templates/nodeaddbox.html diff -u lms/templates/nodeaddbox.html:1.83 lms/templates/nodeaddbox.html:1.84 --- lms/templates/nodeaddbox.html:1.83 Thu Sep 16 14:05:28 2010 +++ lms/templates/nodeaddbox.html Fri Dec 17 09:39:08 2010 @@ -1,5 +1,5 @@ - - + +
@@ -59,6 +59,48 @@ + + + + - - - - - - - - - +
+ {t}Location:{/t} + + + + + + + + + + + + + + {if $nodedata.zipwarning} + + {/if} + + {if $cstateslist} + + + + + {/if} +
{t}Address:{/t}
{t}City:{/t}
{t}Zip:{/t}
{t}State:{/t} + +
+ +
{t}Node group:{/t} @@ -89,28 +131,6 @@ {/if}
- - - -
- - - -
{t}Customer:{/t} @@ -142,24 +162,32 @@ - - + - - + + +
- {t}Location:{/t} - - {t}Location:{/t} + {t}Description:{/t} - +
- {t}Description:{/t} + - {t}Description:{/t} + + - +
+ + +
@@ -175,7 +203,7 @@ {t}Cancel{/t}
{t}Display this form again, when this node is saved{/t}
{literal} {/literal} + Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.86 lms/templates/nodeeditbox.html:1.87 --- lms/templates/nodeeditbox.html:1.86 Mon Jul 5 14:54:41 2010 +++ lms/templates/nodeeditbox.html Fri Dec 17 09:39:08 2010 @@ -1,5 +1,5 @@ - -
+ + @@ -59,12 +59,56 @@ + + +{* + + +*} - - - - - - - -
+ {t}Location:{/t} + + + + + + + + + + + + + + {if $nodeinfo.zipwarning} + + {/if} + + {if $cstateslist} + + + + + {/if} +
{t}Address:{/t}
{t}City:{/t}
{t}Zip:{/t}
{t}State:{/t} + +
+ +
{t}Network:{/t} {$nodeinfo.netname}
{t}Net devices:{/t} @@ -82,28 +126,6 @@
- - - -
- - - -
{t}Customer:{/t} @@ -134,18 +156,32 @@ + + + + @@ -214,3 +250,4 @@ //--> {/literal} + Index: lms/templates/nodeinfobox.html diff -u lms/templates/nodeinfobox.html:1.73 lms/templates/nodeinfobox.html:1.74 --- lms/templates/nodeinfobox.html:1.73 Mon Jul 5 14:54:41 2010 +++ lms/templates/nodeinfobox.html Fri Dec 17 09:39:08 2010 @@ -1,4 +1,4 @@ - + - + {popup_init src="img/overlib.js"} {if !$layout.popup}
From cvs w lms.org.pl Wed Dec 22 14:02:08 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 22 Dec 2010 14:02:08 +0100 (CET) Subject: [lms-commits] CVS update of lmsweb (download.php) Message-ID: <20101222130208.322BD3027B20@hydra.altec.pl> Date: Wednesday, December 22, 2010 @ 14:02:08 Author: alec Path: /cvsroot/lmsweb Modified: download.php - Don't show stable/devel status Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lmsweb/download.php.diff?&r1=1.104&r2=1.105 Index: lmsweb/download.php diff -u lmsweb/download.php:1.104 lmsweb/download.php:1.105 --- lmsweb/download.php:1.104 Wed Dec 22 13:03:10 2010 +++ lmsweb/download.php Wed Dec 22 14:02:08 2010 @@ -22,9 +22,6 @@ Version:
- - ' .'' - .'' .'' .'' .'' From cvs w lms.org.pl Wed Dec 22 14:02:51 2010 From: cvs w lms.org.pl (LMS CVS) Date: Wed, 22 Dec 2010 14:02:51 +0100 (CET) Subject: [lms-commits] CVS update of lmsweb (download.php) Message-ID: <20101222130251.D31ED3027B20@hydra.altec.pl> Date: Wednesday, December 22, 2010 @ 14:02:51 Author: alec Path: /cvsroot/lmsweb Modified: download.php - Change order of releases (1.11 on top) Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lmsweb/download.php.diff?&r1=1.105&r2=1.106 Index: lmsweb/download.php diff -u lmsweb/download.php:1.105 lmsweb/download.php:1.106 --- lmsweb/download.php:1.105 Wed Dec 22 14:02:08 2010 +++ lmsweb/download.php Wed Dec 22 14:02:51 2010 @@ -9,8 +9,8 @@ return sprintf('%.' . $dec_places . 'f B', $kbytes); } -$ver[] = "2010/02/26:1.10/lms-1.10.7.tar.gz:1.10.7"; $ver[] = "2010/04/19:1.11/lms-1.11.10.tar.gz:1.11.10"; +$ver[] = "2010/02/26:1.10/lms-1.10.7.tar.gz:1.10.7"; switch($lang) { From cvs w lms.org.pl Thu Dec 23 13:35:14 2010 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 23 Dec 2010 13:35:14 +0100 (CET) Subject: [lms-commits] CVS update of lms/templates (9 files) Message-ID: <20101223123514.1B1093027B22@hydra.altec.pl> Date: Thursday, December 23, 2010 @ 13:35:14 Author: alec Path: /cvsroot/lms/templates Modified: calendar.html calendar_js.html customerassignmentinfoshort.html customerassignments.html customerinfoshort.html dynpopup.html netdevlistshort.html nodegrouplistshort.html nodelistshort.html - improved style of popups - calendar popups doesn't use a new window Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/calendar.html.diff?&r1=1.9&r2=1.10 http://cvs.lms.org.pl/viewvc/Development/lms/templates/calendar_js.html.diff?&r1=1.5&r2=1.6 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerassignmentinfoshort.html.diff?&r1=1.1&r2=1.2 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerassignments.html.diff?&r1=1.39&r2=1.40 http://cvs.lms.org.pl/viewvc/Development/lms/templates/customerinfoshort.html.diff?&r1=1.21&r2=1.22 http://cvs.lms.org.pl/viewvc/Development/lms/templates/dynpopup.html.diff?&r1=1.6&r2=1.7 http://cvs.lms.org.pl/viewvc/Development/lms/templates/netdevlistshort.html.diff?&r1=1.1&r2=1.2 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodegrouplistshort.html.diff?&r1=1.3&r2=1.4 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodelistshort.html.diff?&r1=1.18&r2=1.19 Index: lms/templates/calendar.html diff -u lms/templates/calendar.html:1.9 lms/templates/calendar.html:1.10 --- lms/templates/calendar.html:1.9 Mon May 24 09:43:17 2010 +++ lms/templates/calendar.html Thu Dec 23 13:35:13 2010 @@ -1,5 +1,5 @@ - + @@ -7,6 +7,7 @@ ::: LMS : {t}Select Date{/t} ::: {literal} + + - Index: lms/templates/calendar_js.html diff -u lms/templates/calendar_js.html:1.5 lms/templates/calendar_js.html:1.6 --- lms/templates/calendar_js.html:1.5 Sun Dec 28 20:03:25 2008 +++ lms/templates/calendar_js.html Thu Dec 23 13:35:13 2010 @@ -49,10 +49,10 @@ calendars[this.id] = this; } -function cal_popup1 (str_datetime) { +function cal_popup1 (str_datetime, obj) { this.dt_current = this.prs_tsmp(str_datetime ? str_datetime : this.target.value); if (!this.dt_current) return; - +/* var obj_calwindow = window.open( '?m=calendar&datetime=' + this.dt_current.valueOf()+ '&id=' + this.id, 'Calendar', 'width=210,height='+(this.time_comp ? 215 : 190)+ @@ -60,6 +60,15 @@ ); obj_calwindow.opener = window; obj_calwindow.focus(); +*/ + var src = '?m=calendar&datetime=' + this.dt_current.valueOf() + '&id=' + this.id; + + if (obj) { + document.getElementById('autoiframe').src = src; + } + else + overlib('
- {t}Location:{/t} + {t}Description:{/t} - +
- {t}Description:{/t} + - + +
+ + +
- Status: - Date: @@ -44,9 +41,6 @@ Wersja: - Status: - Data: @@ -68,7 +62,6 @@ $vers = explode('.', $ver); echo '
'.$ver.' '.''.($vers[1]%2 ? 'devel' : 'stable').''.$date.''.format_bytesize(filesize('download/'.$file)).''.md5_file('download/'.$file).'