Index: lib/LMS.class.php =================================================================== RCS file: /cvsroot/lms/lib/LMS.class.php,v retrieving revision 1.1089 diff -u -r1.1089 LMS.class.php --- lib/LMS.class.php 6 Dec 2011 14:23:06 -0000 1.1089 +++ lib/LMS.class.php 13 Dec 2011 21:54:42 -0000 @@ -720,7 +720,7 @@ return FALSE; } - function GetCustomerList($order='customername,asc', $state=NULL, $network=NULL, $customergroup=NULL, $search=NULL, $time=NULL, $sqlskey='AND', $nodegroup=NULL, $division=NULL) + function GetCustomerList($order='customername,asc', $state=NULL, $network=NULL, $customergroup=NULL, $search=NULL, $time=NULL, $sqlskey='AND', $nodegroup=NULL, $division=NULL, $tariff=NULL) { list($order,$direction) = sscanf($order, '%[^,],%s'); @@ -927,6 +927,11 @@ AND (datefrom <= ?NOW? OR datefrom = 0) AND (dateto >= ?NOW? OR dateto = 0) AND (tariffid != 0 OR liabilityid != 0))' : '') + .($tariff ? ' AND EXISTS (SELECT 1 FROM assignments a + WHERE a.customerid = c.id + AND (datefrom <= ?NOW? OR datefrom = 0) + AND (dateto >= ?NOW? OR dateto = 0) + AND (tariffid = '.$tariff.'))' : '') .($suspended ? ' AND EXISTS (SELECT 1 FROM assignments a WHERE a.customerid = c.id AND ( (tariffid = 0 AND liabilityid = 0 Index: lib/locale/pl/strings.php =================================================================== RCS file: /cvsroot/lms/lib/locale/pl/strings.php,v retrieving revision 1.408 diff -u -r1.408 strings.php --- lib/locale/pl/strings.php 6 Dec 2011 21:34:54 -0000 1.408 +++ lib/locale/pl/strings.php 13 Dec 2011 21:54:42 -0000 @@ -55,6 +55,7 @@ $_LANG['Account with that login name already exists in that domain!'] = 'Konto o podanej nazwie już istnieje w tej domenie!'; $_LANG['Account with that login name exists!'] = 'Konto o podanej nazwie istnieje!'; $_LANG['active'] = 'aktywne'; +$_LANG['Active tariff:'] = 'Aktywna taryfa:'; $_LANG['Add'] = 'Dodaj'; $_LANG['Add:'] = 'Dodaj:'; $_LANG['Add customer to group'] = 'Dodaj klienta do grupy'; @@ -98,6 +99,7 @@ $_LANG['- all hosts -'] = '- wszystkie -'; $_LANG['- all liabilities suspended -'] = '- zawieszenie wszystkich zobowiązań -'; $_LANG['- all networks -'] = '- wszystkie -'; +$_LANG['- all tariffs -'] = '- wszystkie -'; $_LANG['Allowed hosts:'] = 'Dozwolone hosty:'; $_LANG['- all owners -'] = '- wszyscy -'; $_LANG['Allows you to add new customer'] = 'Dodanie nowego klienta'; Index: modules/customersearch.php =================================================================== RCS file: /cvsroot/lms/modules/customersearch.php,v retrieving revision 1.20 diff -u -r1.20 customersearch.php --- modules/customersearch.php 18 Jan 2011 08:12:21 -0000 1.20 +++ modules/customersearch.php 13 Dec 2011 21:54:42 -0000 @@ -93,10 +93,16 @@ $ng = $_POST['ng']; $SESSION->save('cslng', $ng); +if(!isset($_POST['t'])) + $SESSION->restore('cst', $t); +else + $t = $_POST['t']; +$SESSION->save('cst', $t); + if(isset($_GET['search'])) { $layout['pagetitle'] = trans('Customer Search Results'); - $customerlist = $LMS->GetCustomerList($o, $s, $n, $g, $customersearch, NULL, $k, $ng); + $customerlist = $LMS->GetCustomerList($o, $s, $n, $g, $customersearch, NULL, $k, $ng, NULL, $t); $listdata['total'] = $customerlist['total']; $listdata['direction'] = $customerlist['direction']; @@ -153,6 +159,7 @@ $SMARTY->assign('networks', $LMS->GetNetworks()); $SMARTY->assign('customergroups', $LMS->CustomergroupGetAll()); $SMARTY->assign('nodegroups', $LMS->GetNodeGroupNames()); + $SMARTY->assign('tariffs', $LMS->GetTariffs()); $SMARTY->assign('cstateslist', $LMS->GetCountryStates()); $SMARTY->assign('k', $k); $SMARTY->display('customersearch.html'); Index: templates/customersearch.html =================================================================== RCS file: /cvsroot/lms/templates/customersearch.html,v retrieving revision 1.26 diff -u -r1.26 customersearch.html --- templates/customersearch.html 6 Dec 2011 20:56:44 -0000 1.26 +++ templates/customersearch.html 13 Dec 2011 21:54:42 -0000 @@ -254,12 +254,26 @@ + + + {t}Active tariff:{/t} + + + + + + {t}Search{/t}