From b9ac3ffdb68cfb48469d49e09c6165513402aedb Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 5 Apr 2011 12:06:35 +0200 Subject: suche in Client & Bootos --- .../modules/user/controllers/BootosController.php | 14 ++++++++++++ .../modules/user/controllers/ClientController.php | 7 +++--- .../modules/user/views/scripts/bootos/index.phtml | 25 +++++++++++----------- .../modules/user/views/scripts/client/index.phtml | 4 ++-- 4 files changed, 33 insertions(+), 17 deletions(-) (limited to 'application/modules') diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php index 8f602fe..e1b4f7b 100644 --- a/application/modules/user/controllers/BootosController.php +++ b/application/modules/user/controllers/BootosController.php @@ -66,6 +66,17 @@ class user_BootosController extends Zend_Controller_Action $this->view->bootoslist = $this->bootosMapper->findBy(array("groupID" => $groupID)); $this->view->update = array(); + // Search + $search = $this->_request->getParam('search'); + $mySearch = new Pbs_Search(); + $mySearch->setSearchTerm($search); + $mySearch->setModule('bootos'); + $this->view->searchform = $mySearch->searchForm(); + if($search != ''){ + $this->view->search = $mySearch->getSearchTerm(); + $this->view->bootoslist = $mySearch->search($this->view->bootoslist); + } + // Pagination $pagination = new Pbs_Pagination(); $pagination->setPerPage(5); @@ -92,6 +103,9 @@ class user_BootosController extends Zend_Controller_Action } } + public function searchAction(){ + $this->_redirect('/user/bootos/index/search/'.($_GET['search'])); + } public function createbootosAction() { diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php index 87e764d..9fe4b03 100644 --- a/application/modules/user/controllers/ClientController.php +++ b/application/modules/user/controllers/ClientController.php @@ -53,15 +53,16 @@ class User_ClientController extends Zend_Controller_Action $search = $this->_request->getParam('search'); $mySearch = new Pbs_Search(); $mySearch->setSearchTerm($search); + $mySearch->setModule('client'); $this->view->searchform = $mySearch->searchForm(); if($search != ''){ - $this->view->search = $search; + $this->view->search = $mySearch->getSearchTerm(); $clientsInGroup = $mySearch->search($clientsInGroup); } // Pagination $pagination = new Pbs_Pagination(); - $pagination->setPerPage(10); + $pagination->setPerPage(10); $pagination->setElement($clientsInGroup); $pagination->setRequestPage($this->_request->getParam('page')); $pagination->setPageUrl('/user/client/index'.((isset($this->view->search))?'/search/'.$this->view->search:'')); @@ -73,7 +74,7 @@ class User_ClientController extends Zend_Controller_Action } public function searchAction(){ - $this->_redirect('/user/client/index/search/'.$_GET['search']); + $this->_redirect('/user/client/index/search/'.($_GET['search'])); } public function addclientAction() diff --git a/application/modules/user/views/scripts/bootos/index.phtml b/application/modules/user/views/scripts/bootos/index.phtml index 8982fb2..a678cef 100644 --- a/application/modules/user/views/scripts/bootos/index.phtml +++ b/application/modules/user/views/scripts/bootos/index.phtml @@ -1,5 +1,6 @@

BootOS

notification != ''){echo $this->notification;} ?> +searchform; ?> formButton('checkupdate', 'Check for Updates', array( 'onclick' => 'self.location="/user/bootos/index/page/'.$this->page.'/checkupdate/true"', 'class' => 'updatebutton', @@ -10,18 +11,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + bootoslist)==0) diff --git a/application/modules/user/views/scripts/client/index.phtml b/application/modules/user/views/scripts/client/index.phtml index 051ea90..95bf7a2 100644 --- a/application/modules/user/views/scripts/client/index.phtml +++ b/application/modules/user/views/scripts/client/index.phtml @@ -8,8 +8,8 @@ clients): ?>
IDTitleGroupIDMembershipIDConfigIDInitKernelKclDescriptionChangedExpiresPublicID bootosIDTitle titleGroupID groupIDMembershipID membershipIDConfigID configIDInit initKernel kernelKcl kclDescription descriptionChanged ChangedExpires expiresPublic public Actions
- - + + clients as $client): ?> -- cgit v1.2.3-55-g7522 From 52c631ecd01be520fa424362ae34ae0068ba0dfb Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 5 Apr 2011 12:25:36 +0200 Subject: Suche in Bootmenu & Bootiso --- .../modules/user/controllers/BootisoController.php | 14 ++++++++++++++ .../modules/user/controllers/BootmenuController.php | 15 +++++++++++++++ application/modules/user/forms/Filter.php | 2 +- .../modules/user/views/scripts/bootiso/index.phtml | 19 ++++++++++--------- .../modules/user/views/scripts/bootmenu/index.phtml | 7 ++++--- 5 files changed, 44 insertions(+), 13 deletions(-) (limited to 'application/modules') diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php index a6fbe9e..877cb65 100644 --- a/application/modules/user/controllers/BootisoController.php +++ b/application/modules/user/controllers/BootisoController.php @@ -79,6 +79,16 @@ class user_BootisoController extends Zend_Controller_Action $this->view->bootisolist = array_reverse($this->view->bootisolist); + // Search + $search = $this->_request->getParam('search'); + $mySearch = new Pbs_Search(); + $mySearch->setSearchTerm($search); + $mySearch->setModule('bootiso'); + $this->view->searchform = $mySearch->searchForm(); + if($search != ''){ + $this->view->search = $mySearch->getSearchTerm(); + $this->view->bootisolist = $mySearch->search($this->view->bootisolist); + } // Pagination $pagination = new Pbs_Pagination(); @@ -105,6 +115,10 @@ class user_BootisoController extends Zend_Controller_Action } + public function searchAction(){ + $this->_redirect('/user/bootiso/index/search/'.($_GET['search'])); + } + public function downloadbootisoAction() { $this->_helper->layout->disableLayout(); diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index 7843b3f..dfe9f20 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -88,6 +88,17 @@ class user_BootmenuController extends Zend_Controller_Action } } + // Search + $search = $this->_request->getParam('search'); + $mySearch = new Pbs_Search(); + $mySearch->setSearchTerm($search); + $mySearch->setModule('bootmenu'); + $this->view->searchform = $mySearch->searchForm(); + if($search != ''){ + $this->view->search = $mySearch->getSearchTerm(); + $bootmenu = $mySearch->search($bootmenu); + } + // Pagination $pagination = new Pbs_Pagination(); $pagination->setPerPage(2); @@ -103,6 +114,10 @@ class user_BootmenuController extends Zend_Controller_Action $this->view->bootmenuentrylist = $bootmenuentries; } + + public function searchAction(){ + $this->_redirect('/user/bootmenu/index/search/'.($_GET['search'])); + } public function createbootmenuAction() diff --git a/application/modules/user/forms/Filter.php b/application/modules/user/forms/Filter.php index 0676ba8..76cf3f8 100644 --- a/application/modules/user/forms/Filter.php +++ b/application/modules/user/forms/Filter.php @@ -10,7 +10,7 @@ class user_Form_Filter extends Zend_Form $this->setName("Add Filter"); $this->setMethod('post'); - if(Pbs_Acl::checkRight('fefp')){ + if(Pbs_Acl::checkRight('fefp') || Pbs_Acl::checkRight('fa')){ $edit = 'true'; } else{ diff --git a/application/modules/user/views/scripts/bootiso/index.phtml b/application/modules/user/views/scripts/bootiso/index.phtml index f43949d..23f7780 100644 --- a/application/modules/user/views/scripts/bootiso/index.phtml +++ b/application/modules/user/views/scripts/bootiso/index.phtml @@ -1,19 +1,20 @@

BootMedien

notification != ''){echo $this->notification;} ?> +searchform; ?> formButton('createbootiso', 'Create BootISO', array( 'onclick' => 'self.location="/user/bootiso/createbootiso/page/'.$this->page.'"', 'class' => 'addbutton'))?>
MAC [macadress]Hardwarehash [hardwarehash]MAC macadressHardwarehash hardwarehash Actions
- - - - - - - - - + + + + + + + + + bootisolist)==0) diff --git a/application/modules/user/views/scripts/bootmenu/index.phtml b/application/modules/user/views/scripts/bootmenu/index.phtml index a43a058..cd82bb7 100644 --- a/application/modules/user/views/scripts/bootmenu/index.phtml +++ b/application/modules/user/views/scripts/bootmenu/index.phtml @@ -1,14 +1,15 @@

BootMenu

notification != ''){echo $this->notification;} ?> +searchform; ?> formButton('createbootmenu', 'Create BootMenu', array( 'onclick' => 'self.location="/user/bootmenu/createbootmenu/page/'.$this->page.'"', 'class' => 'addbutton'))?>
IDTitleGroupIDMembershipIDPrebootIDSerialnumberCreatedExpiresPublicID bootosIDTitle titleGroupID groupIDMembershipID membershipIDPrebootID prebootIDSerialnumber serialnumberCreated createdExpires expiresPublic public Actions
- - - + + + bootmenulist)==0) -- cgit v1.2.3-55-g7522 From cbd4bc81de03189d3c774e71223478cf5d0ce401 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 5 Apr 2011 12:50:50 +0200 Subject: suche in Config, Filter, Pool und Preboot --- .../modules/user/controllers/ConfigController.php | 15 +++++++++++ .../modules/user/controllers/FilterController.php | 15 +++++++++++ .../modules/user/controllers/PoolController.php | 15 +++++++++++ .../modules/user/controllers/PrebootController.php | 15 +++++++++++ .../user/views/scripts/bootmenu/index.phtml | 2 +- .../modules/user/views/scripts/config/index.phtml | 11 ++++---- .../modules/user/views/scripts/filter/index.phtml | 11 ++++---- .../modules/user/views/scripts/pool/index.phtml | 9 ++++--- .../modules/user/views/scripts/preboot/index.phtml | 11 ++++---- library/Pbs/Search.php | 30 +++++++++++----------- 10 files changed, 99 insertions(+), 35 deletions(-) (limited to 'application/modules') diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php index 83ff804..4bc2526 100644 --- a/application/modules/user/controllers/ConfigController.php +++ b/application/modules/user/controllers/ConfigController.php @@ -66,6 +66,17 @@ class user_ConfigController extends Zend_Controller_Action $config->setGroupID("[".$config->getGroupID()."] ".$groupMapper->find($config->getGroupID())->getTitle()); } + // Search + $search = $this->_request->getParam('search'); + $mySearch = new Pbs_Search(); + $mySearch->setSearchTerm($search); + $mySearch->setModule('config'); + $this->view->searchform = $mySearch->searchForm(); + if($search != ''){ + $this->view->search = $mySearch->getSearchTerm(); + $this->view->configlist = $mySearch->search($this->view->configlist); + } + // Pagination $pagination = new Pbs_Pagination(); $pagination->setPerPage(2); @@ -79,6 +90,10 @@ class user_ConfigController extends Zend_Controller_Action $this->view->configlist = $this->view->configlist; } + + public function searchAction(){ + $this->_redirect('/user/config/index/search/'.($_GET['search'])); + } public function createconfigAction() { diff --git a/application/modules/user/controllers/FilterController.php b/application/modules/user/controllers/FilterController.php index 4ab3ad6..f84f501 100644 --- a/application/modules/user/controllers/FilterController.php +++ b/application/modules/user/controllers/FilterController.php @@ -55,6 +55,17 @@ class User_FilterController extends Zend_Controller_Action $ff->setID($filter['filterID']); $allFilter[] = $ff; } + + // Search + $search = $this->_request->getParam('search'); + $mySearch = new Pbs_Search(); + $mySearch->setSearchTerm($search); + $mySearch->setModule('filter'); + $this->view->searchform = $mySearch->searchForm(); + if($search != ''){ + $this->view->search = $mySearch->getSearchTerm(); + $allFilter = $mySearch->search($allFilter); + } // Pagination $pagination = new Pbs_Pagination(); @@ -69,6 +80,10 @@ class User_FilterController extends Zend_Controller_Action $this->view->filters = $allFilter; } + + public function searchAction(){ + $this->_redirect('/user/filter/index/search/'.($_GET['search'])); + } public function addfilterAction() { diff --git a/application/modules/user/controllers/PoolController.php b/application/modules/user/controllers/PoolController.php index e5fea8c..7800c7a 100644 --- a/application/modules/user/controllers/PoolController.php +++ b/application/modules/user/controllers/PoolController.php @@ -64,6 +64,17 @@ class User_PoolController extends Zend_Controller_Action $ff->setID($pool['poolID']); $yourpools[] = $ff; } + + // Search + $search = $this->_request->getParam('search'); + $mySearch = new Pbs_Search(); + $mySearch->setSearchTerm($search); + $mySearch->setModule('pool'); + $this->view->searchform = $mySearch->searchForm(); + if($search != ''){ + $this->view->search = $mySearch->getSearchTerm(); + $yourpools = $mySearch->search($yourpools); + } // Pagination $pagination = new Pbs_Pagination(); @@ -95,6 +106,10 @@ class User_PoolController extends Zend_Controller_Action if(Pbs_Acl::checkRight('posuc')) $this->view->freeclients = $freeclients; } + + public function searchAction(){ + $this->_redirect('/user/pool/index/search/'.($_GET['search'])); + } public function createpoolAction() { diff --git a/application/modules/user/controllers/PrebootController.php b/application/modules/user/controllers/PrebootController.php index 6944e27..43cbf8a 100644 --- a/application/modules/user/controllers/PrebootController.php +++ b/application/modules/user/controllers/PrebootController.php @@ -64,6 +64,17 @@ class User_PrebootController extends Zend_Controller_Action $this->view->prebootlist = $this->prebootMapper->findBy(array("groupID" => $groupID)); + // Search + $search = $this->_request->getParam('search'); + $mySearch = new Pbs_Search(); + $mySearch->setSearchTerm($search); + $mySearch->setModule('preboot'); + $this->view->searchform = $mySearch->searchForm(); + if($search != ''){ + $this->view->search = $mySearch->getSearchTerm(); + $this->view->prebootlist = $mySearch->search($this->view->prebootlist); + } + // Pagination $pagination = new Pbs_Pagination(); $pagination->setPerPage(2); @@ -89,6 +100,10 @@ class User_PrebootController extends Zend_Controller_Action } } + public function searchAction(){ + $this->_redirect('/user/preboot/index/search/'.($_GET['search'])); + } + public function createprebootAction() { diff --git a/application/modules/user/views/scripts/bootmenu/index.phtml b/application/modules/user/views/scripts/bootmenu/index.phtml index cd82bb7..b580237 100644 --- a/application/modules/user/views/scripts/bootmenu/index.phtml +++ b/application/modules/user/views/scripts/bootmenu/index.phtml @@ -9,7 +9,7 @@ - + bootmenulist)==0) diff --git a/application/modules/user/views/scripts/config/index.phtml b/application/modules/user/views/scripts/config/index.phtml index 478a12d..91177f4 100644 --- a/application/modules/user/views/scripts/config/index.phtml +++ b/application/modules/user/views/scripts/config/index.phtml @@ -1,16 +1,17 @@

Config

notification != ''){echo $this->notification;} ?> +searchform; ?> formButton('createconfig', 'Create Config', array( 'onclick' => 'self.location="/user/config/createconfig/page/'.$this->page.'"', 'class' => 'addbutton'))?>
IDTitleChangedID bootmenuIDTitle titleChanged changed Actions
ID bootmenuID Title titleChanged changedChanged created Actions
- - - - - + + + + + configlist)==0) diff --git a/application/modules/user/views/scripts/filter/index.phtml b/application/modules/user/views/scripts/filter/index.phtml index 9800d42..7f8bad8 100644 --- a/application/modules/user/views/scripts/filter/index.phtml +++ b/application/modules/user/views/scripts/filter/index.phtml @@ -1,5 +1,6 @@

Filters

notification != ''){echo $this->notification;} ?> +searchform; ?> formButton('createconfig', 'Create Filter', array( 'onclick' => 'self.location="/user/filter/addfilter/page/'.$this->page.'"', 'class' => 'addbutton'))?> @@ -7,11 +8,11 @@ filters): ?>
IDTitleGroupIDShellscriptChangedID configIDTitle titleGroupID groupIDShellscript shellscriptChanged created Actions
- - - - - + + + + + filters as $filter): ?> diff --git a/application/modules/user/views/scripts/pool/index.phtml b/application/modules/user/views/scripts/pool/index.phtml index 80053f2..f7d04e2 100644 --- a/application/modules/user/views/scripts/pool/index.phtml +++ b/application/modules/user/views/scripts/pool/index.phtml @@ -1,5 +1,6 @@

Pools

notification != ''){echo $this->notification;} ?> +searchform; ?> formButton('createconfig', 'Create Pool', array( 'onclick' => 'self.location="/user/pool/createpool/page/'.$this->page.'"', 'class' => 'addbutton'))?> @@ -7,10 +8,10 @@ pools): ?>
IDTitleDescriptionPriorityTargetBootMenuID filterIDTitle titleDescription descriptionPriority priorityTargetBootMenu bootmenuID Actions
- - - - + + + + pools as $pool): ?> diff --git a/application/modules/user/views/scripts/preboot/index.phtml b/application/modules/user/views/scripts/preboot/index.phtml index 9e73de1..295f1ca 100644 --- a/application/modules/user/views/scripts/preboot/index.phtml +++ b/application/modules/user/views/scripts/preboot/index.phtml @@ -1,5 +1,6 @@

Preboot

notification != ''){echo $this->notification;} ?> +searchform; ?> formButton('checkupdate', 'Check for Updates', array( 'onclick' => 'self.location="/user/preboot/index/checkupdate/true"', 'class' => 'updatebutton', @@ -9,11 +10,11 @@ 'class' => 'addbutton'))?>
TitleDescriptionLocationTitle titleDescription descriptionLocation location Actions
- - - - - + + + + + prebootlist)==0) diff --git a/library/Pbs/Search.php b/library/Pbs/Search.php index 709651a..b041c3b 100644 --- a/library/Pbs/Search.php +++ b/library/Pbs/Search.php @@ -13,7 +13,7 @@ class Pbs_Search{ "; $highlight = array(); if($this->searchTerm != ''){ - $str .= "Delete Client + $str .= "Delete Client"; foreach($this->getSearchTerms() as $term){ $highlight[] = "$('table').highlight('".$term."');"; @@ -24,14 +24,14 @@ class Pbs_Search{ $(document).ready(function(){"; $str .= implode("\n",$highlight); $str .= "$('#search') - .focus(function() { - $('table th .code').show(); - }).focusout(function() { - $('table th .code').hide(); - }); - $('table th').click(function(){ - $('#search').val($('#search').val()+' '+$(this).find('.code').text()+':'); - });"; + .focus(function() { + $('table th .code').show(); + }).focusout(function() { + $('table th .code').hide(); + }); + $('table th').click(function(){ + $('#search').val($('#search').val()+' '+$(this).find('.code').text()+':'); + });"; $str .= "}); "; $str .= ""; @@ -44,10 +44,10 @@ class Pbs_Search{ $this->searchTerm = trim($search); $parts = explode(" ",$this->searchTerm); - foreach($parts as $this->searchTerm){ - if(stristr($this->searchTerm,":") && ctype_alpha(substr($this->searchTerm,0,strpos($this->searchTerm,":")))){ - $key = substr($this->searchTerm,0,strpos($this->searchTerm,":")); - $value = substr($this->searchTerm,strpos($this->searchTerm,":")+1); + foreach($parts as $search){ + if(stristr($search,":") && ctype_alpha(substr($search,0,strpos($search,":")))){ + $key = substr($search,0,strpos($search,":")); + $value = substr($search,strpos($search,":")+1); $searcha[$key] = $value; } else{ @@ -64,7 +64,7 @@ class Pbs_Search{ $beta = $this->searcha; foreach($this->searchb as $b) $beta[] = $b; - return $beta; + return $beta; } public function search($array){ @@ -102,7 +102,7 @@ class Pbs_Search{ } if (count($this->searcha) > 0 && count($this->searchb) > 0){ $data = array_intersect($com1,$com2); - } + } $data = array_unique($data); foreach( $data as $c) $ges[] = $array[$c]; -- cgit v1.2.3-55-g7522
IDTitleGroupIDMembershipIDPreboot PathID prebootIDTitle titleGroupID groupIDMembershipID membershipIDPreboot Path path_preboot Actions