comanage-dev - [comanage-dev] r518 - in registry/trunk/app: Controller Lib View/CoPeople View/Layouts View/OrgIdentities webroot/css
Subject: COmanage Developers List
List archive
[comanage-dev] r518 - in registry/trunk/app: Controller Lib View/CoPeople View/Layouts View/OrgIdentities webroot/css
Chronological Thread
- From:
- To:
- Subject: [comanage-dev] r518 - in registry/trunk/app: Controller Lib View/CoPeople View/Layouts View/OrgIdentities webroot/css
- Date: Sat, 11 May 2013 06:42:44 -0400
- Authentication-results: sfpop-ironport04.merit.edu; dkim=neutral (message not signed) header.i=none
Author: marie
Date: 2013-05-11 06:42:44 -0400 (Sat, 11 May 2013)
New Revision: 518
Modified:
registry/trunk/app/Controller/CoPeopleController.php
registry/trunk/app/Controller/OrgIdentitiesController.php
registry/trunk/app/Lib/lang.php
registry/trunk/app/View/CoPeople/index.ctp
registry/trunk/app/View/Layouts/default.ctp
registry/trunk/app/View/OrgIdentities/index.ctp
registry/trunk/app/webroot/css/comanage.css
Log:
co139 Add advanced search into sidebars of CO People and Org Identities
Modified: registry/trunk/app/Controller/CoPeopleController.php
===================================================================
--- registry/trunk/app/Controller/CoPeopleController.php 2013-05-10
03:16:08 UTC (rev 517)
+++ registry/trunk/app/Controller/CoPeopleController.php 2013-05-11
10:42:44 UTC (rev 518)
@@ -479,6 +479,8 @@
// View all existing CO People (or a COU's worth)?
$p['index'] = ($roles['cmadmin'] || $roles['coadmin'] ||
$roles['couadmin']);
+ $p['search'] = $p['index'];
+
if($this->action == 'index' && $p['index']) {
// For rendering index, we currently assume that anyone who can view
the
@@ -585,6 +587,45 @@
}
/**
+ * Determine the conditions for pagination of the index view, when
rendered via the UI.
+ *
+ * @since COmanage Registry v0.8
+ * @return Array An array suitable for use in $this->paginate
+ */
+
+ function paginationConditions() {
+ $pagcond = array();
+
+ // Set page title
+ $this->set('title_for_layout', _txt('ct.co_people.se'));
+
+ // Use server side pagination
+
+ if($this->requires_co) {
+ $pagcond['Co.id'] = $this->cur_co['Co']['id'];
+ }
+
+ // Filter by given name
+ if(!empty($this->params['named']['Search.givenName'])) {
+ $searchterm = $this->params['named']['Search.givenName'];
+ $pagcond['Name.given LIKE'] = "%$searchterm%";
+ }
+
+ // Filter by Family name
+ if(!empty($this->params['named']['Search.familyName'])) {
+ $searchterm = $this->params['named']['Search.familyName'];
+ $pagcond['Name.family LIKE'] = "%$searchterm%";
+ }
+
+ // Filter by status
+ if(!empty($this->params['named']['Search.status'])) {
+ $searchterm = $this->params['named']['Search.status'];
+ $pagcond['CoPerson.status'] = $searchterm;
+ }
+
+ return($pagcond);
+ }
+ /**
* Perform a redirect back to the controller's default view.
* - postcondition: Redirect generated
*
@@ -646,4 +687,28 @@
return true;
}
+
+ /**
+ * Insert search parameters into URL for index.
+ * - postcondition: Redirect generated
+ *
+ * @since COmanage Registry v0.8
+ */
+ function search() {
+ // the page we will redirect to
+ $url['action'] = 'index';
+
+ // build a URL will all the search elements in it
+ // the resulting URL will be
+ //
example.com/registry/co_people/index/Search.givenName:albert/Search.familyName:einstein
+ foreach ($this->data['Search'] as $field=>$value){
+ if(!empty($value))
+ $url['Search.'.$field] = $value;
+ }
+ // Insert CO into URL
+ $url['co'] = $this->cur_co['Co']['id'];
+
+ // redirect the user to the url
+ $this->redirect($url, null, true);
+ }
}
Modified: registry/trunk/app/Controller/OrgIdentitiesController.php
===================================================================
--- registry/trunk/app/Controller/OrgIdentitiesController.php 2013-05-10
03:16:08 UTC (rev 517)
+++ registry/trunk/app/Controller/OrgIdentitiesController.php 2013-05-11
10:42:44 UTC (rev 518)
@@ -324,7 +324,7 @@
// View all existing Org People?
$p['index'] = ($roles['cmadmin'] || $roles['admin'] ||
$roles['subadmin']);
- $p['search'] = $p['find'];
+ $p['search'] = $p['index'];
// View an existing Org Person?
@@ -347,11 +347,11 @@
// Find an Org Person to add to a CO?
$p['find'] = ($roles['cmadmin'] || $roles['coadmin'] ||
$roles['couadmin']);
- $p['search'] = $p['find'];
// View all existing Org People?
$p['index'] = ($roles['cmadmin'] || $roles['coadmin'] ||
$roles['couadmin']);
-
+ $p['search'] = $p['index'];
+
if($this->action == 'index' && $p['index']) {
// For rendering index, we currently assume that anyone who can view
the
// index can manipulate all records. This is probably right.
@@ -450,6 +450,12 @@
parent::performRedirect();
}
+ /**
+ * Insert search parameters into URL for index.
+ * - postcondition: Redirect generated
+ *
+ * @since COmanage Registry v0.8
+ */
function search() {
// the page we will redirect to
$url['action'] = 'index';
Modified: registry/trunk/app/Lib/lang.php
===================================================================
--- registry/trunk/app/Lib/lang.php 2013-05-10 03:16:08 UTC (rev 517)
+++ registry/trunk/app/Lib/lang.php 2013-05-11 10:42:44 UTC (rev 518)
@@ -77,6 +77,7 @@
'ct.co_nsf_demographics.pl' => 'NSF Demographic Records',
'ct.co_people.1' => 'CO Person',
'ct.co_people.pl' => 'CO People',
+ 'ct.co_people.se' => 'CO People Search',
'ct.co_person_roles.1' => 'CO Person Role',
'ct.co_person_roles.pl' => 'CO Person Roles',
'ct.co_petitions.1' => 'CO Petition',
@@ -94,6 +95,7 @@
'ct.identifiers.1' => 'Identifier',
'ct.identifiers.pl' => 'Identifiers',
'ct.org_identities.1' => 'Organizational Identity',
+ 'ct.org_identities.se' => 'Organizational Identity Search',
'ct.org_identities.pl' => 'Organizational Identities',
'ct.organizations.1' => 'Organization',
'ct.organizations.pl' => 'Organizations',
@@ -217,6 +219,7 @@
'en.status' => array(StatusEnum::Active => 'Active',
StatusEnum::Approved => 'Approved',
StatusEnum::Declined => 'Declined',
+ StatusEnum::Deleted => 'Deleted',
StatusEnum::Denied => 'Denied',
StatusEnum::Invited => 'Invited',
StatusEnum::Pending => 'Pending',
Modified: registry/trunk/app/View/CoPeople/index.ctp
===================================================================
--- registry/trunk/app/View/CoPeople/index.ctp 2013-05-10 03:16:08 UTC (rev
517)
+++ registry/trunk/app/View/CoPeople/index.ctp 2013-05-11 10:42:44 UTC (rev
518)
@@ -22,6 +22,15 @@
* @version $Id$
*/
-->
+<script>
+ $(function() {
+ $( "#advancedSearch" ).accordion({
+ collapsible: true,
+ active : false
+ });
+ });
+</script>
+
<?php
$params = array('title' => _txt('fd.people',
array($cur_co['Co']['name'])));
print $this->element("pageTitle", $params);
Modified: registry/trunk/app/View/Layouts/default.ctp
===================================================================
--- registry/trunk/app/View/Layouts/default.ctp 2013-05-10 03:16:08 UTC (rev
517)
+++ registry/trunk/app/View/Layouts/default.ctp 2013-05-11 10:42:44 UTC (rev
518)
@@ -462,6 +462,20 @@
}
?>
</ul>
+
+ <?php // Advanced Search (CO-139)
+ // Get a pointer to our model
+ $model = $this->name;
+ if(!empty($this->plugin)) {
+ $fileLocation = APP . "Plugin/" . $this->plugin . "/View/" .
$model . "/search.inc";
+ if(file_exists($fileLocation))
+ include($fileLocation);
+ } else {
+ $fileLocation = APP . "View/" . $model . "/search.inc";
+ if(file_exists($fileLocation))
+ include($fileLocation);
+ }
+ ?>
</div>
<?php endif; ?>
</div>
Modified: registry/trunk/app/View/OrgIdentities/index.ctp
===================================================================
--- registry/trunk/app/View/OrgIdentities/index.ctp 2013-05-10 03:16:08
UTC (rev 517)
+++ registry/trunk/app/View/OrgIdentities/index.ctp 2013-05-11 10:42:44
UTC (rev 518)
@@ -21,18 +21,7 @@
* @license Apache License, Version 2.0
(http://www.apache.org/licenses/LICENSE-2.0)
* @version $Id$
*/
-?>
-<script>
- $(function() {
- $( "#accordion" ).accordion({
- collapsible: true,
- active : false
- });
- });
-</script>
-
-<?php
// Globals
global $cm_lang, $cm_texts;
@@ -56,33 +45,7 @@
$this->set('sidebarButtons', $sidebarButtons);
}
?>
-<div id="accordion">
- <h3>Search</h3>
- <div>
- <?php print
$this->Form->create('OrgIdentity',array('action'=>'search'));?>
- <fieldset>
- <legend><?php __('OrgIdentity Search');?></legend>
- <?php
- print $this->Form->input('Search.givenName');
- print $this->Form->input('Search.familyName');
-
- print $this->Form->input('Search.organization');
- print $this->Form->input('Search.department');
- print $this->Form->input('Search.title');
- $searchOptions = $cm_texts[ $cm_lang ]['en.affil'];
- $formParams = array('options' => $searchOptions,
- 'type' => 'select',
- 'empty' => '',
- 'label' => 'Affiliation');
- print $this->Form->input('Search.affiliation', $formParams);
-
- print $this->Form->submit('Search');
- ?>
- </fieldset>
- <?php print $this->Form->end();?>
- </div>
-</div>
<table id="org_identities" class="ui-widget" style=" width:100%;">
<thead>
Modified: registry/trunk/app/webroot/css/comanage.css
===================================================================
--- registry/trunk/app/webroot/css/comanage.css 2013-05-10 03:16:08 UTC (rev
517)
+++ registry/trunk/app/webroot/css/comanage.css 2013-05-11 10:42:44 UTC (rev
518)
@@ -135,7 +135,36 @@
border:0;
margin-top:25px;
}
+
+ /* For Advanced Search box */
+ #advancedSearch .ui-accordion-content{
+ padding: 0px;
+ }
+ #advancedSearch td{
+ border:none;
+ }
+
+ #advancedSearch td label{
+ top: 4px;
+ position: relative;
+ }
+
+ #advancedSearch input,
+ #advancedSearch select{
+ float: right;
+ clear: both;
+ width: 140px;
+ margin-left: 8px;
+ }
+
+ #advancedSearch select{
+ width: 146px;
+ }
+ #advancedSearch .submit{
+ float: right;
+ }
+
/* For enrollment form */
#formbox {
background-color: #F3F4F3;
- [comanage-dev] r518 - in registry/trunk/app: Controller Lib View/CoPeople View/Layouts View/OrgIdentities webroot/css, svnlog, 05/11/2013
Archive powered by MHonArc 2.6.16.