Skip to content

Commit

Permalink
work to be tested for search
Browse files Browse the repository at this point in the history
  • Loading branch information
axel committed Dec 24, 2020
1 parent b7485ec commit 0506072
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Model/GrouperGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,12 @@ public function getSearchedGroups($userId, $searchCriteria, $page) {

$returnResults = array();


//Now we can do a search on the fields
//will search on friendly name, group, stem,


foreach($pageResults as $result) {
$match = preg_grep("/$searchCriteria/i", $result);
if (!empty($match)) {
$returnResults[] = $result;
}
}

return $returnResults;
}
Expand Down
3 changes: 2 additions & 1 deletion View/Elements/Components/search.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ $(function() {
<div>
<div class="d-flex">
<div class="input-group input-group-search">
<input type="text" name="search" class="form-control" value="<?php echo isset($searchcriteria) ? $searchcriteria : ''; ?>" />
<?php echo $this->Form->input("search", array('class' => 'form-control', 'value' => isset($searchcriteria) ? $searchcriteria : '')) ?>
<!--<input type="text" name="search" class="form-control" value="<?php echo isset($searchcriteria) ? $searchcriteria : ''; ?>" /> -->
<div class="input-group-append">
<button class="btn btn-outline-secondary px-4" type="submit" value="Submit">
<i class="fa fa-search"></i>
Expand Down

0 comments on commit 0506072

Please sign in to comment.