Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Refactoring. Add GrouperLiteActASPerson model
Showing
8 changed files
with
218 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
/** | ||
* COmanage Registry Grouper Lite GrouperLiteActAsPerson Model | ||
* | ||
* Portions licensed to the University Corporation for Advanced Internet | ||
* Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
* See the NOTICE file distributed with this work for additional information | ||
* regarding copyright ownership. | ||
* | ||
* UCAID licenses this file to you under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with the | ||
* License. You may obtain a copy of the License at: | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* @link http://www.internet2.edu/comanage COmanage Project | ||
* @package registry-plugin | ||
* @since COmanage Registry v4.4.0 | ||
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
*/ | ||
|
||
class GrouperLiteActAsPerson extends AppModel | ||
{ | ||
public $name = 'GrouperLiteActAsPerson'; | ||
|
||
|
||
// Association rules from this model to other models | ||
public $belongsTo = [ | ||
'GrouperLiteWidget', | ||
'ActAsCoPerson' => [ | ||
'className' => 'CoPerson', | ||
'foreignKey' => 'act_as_co_person_id' | ||
], | ||
'ActorCoPerson' => [ | ||
'className' => 'CoPerson', | ||
'foreignKey' => 'actor_co_person_id' | ||
] | ||
]; | ||
|
||
// Validation rules for table elements | ||
public $validate = [ | ||
'co_grouper_lite_widget_id' => [ | ||
'rule' => 'numeric', | ||
'required' => true, | ||
'allowEmpty' => false | ||
], | ||
'act_as_co_person_id' => [ | ||
'rule' => 'numeric', | ||
'required' => true, | ||
'allowEmpty' => false | ||
], | ||
'actor_co_person_id' => [ | ||
'rule' => 'numeric', | ||
'required' => true, | ||
'allowEmpty' => false | ||
], | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
<?php | ||
|
||
echo $this->Html->meta( | ||
array('http-equiv' => 'Cache-Control', 'content' => 'no-cache, no-store, must-revalidate'), | ||
null, | ||
array('inline' => false) | ||
print $this->Html->meta( | ||
['http-equiv' => 'Cache-Control', 'content' => 'no-cache, no-store, must-revalidate'], | ||
null, | ||
['inline' => false] | ||
); | ||
echo $this->Html->meta( | ||
array('http-equiv' => 'Pragma', 'content' => 'no-cache'), | ||
null, | ||
array('inline' => false) | ||
print $this->Html->meta( | ||
['http-equiv' => 'Pragma', 'content' => 'no-cache'], | ||
null, | ||
['inline' => false] | ||
); | ||
echo $this->Html->meta( | ||
array('http-equiv' => 'Expires', 'content' => '0'), | ||
null, | ||
array('inline' => false) | ||
print $this->Html->meta( | ||
['http-equiv' => 'Expires', 'content' => '0'], | ||
null, | ||
['inline' => false] | ||
); | ||
|
||
print $this->Html->script('GrouperLiteWidget.autocomplete.grouperplugin') . PHP_EOL; | ||
print $this->element('GrouperLiteWidget.base-styles'); | ||
print $this->Html->css('GrouperLiteWidget.co-grouper-plugin') . PHP_EOL; | ||
|
||
|
||
?> | ||
|
||
<?php | ||
$this->Html->addCrumb(_txt('pl.grouperlite.crumb.root'), | ||
array( | ||
[ | ||
'controller' => 'grouper_groups', | ||
'action' => 'groupmember' | ||
), | ||
array('prepend' => true)); | ||
], | ||
['prepend' => true] | ||
); | ||
?> | ||
|
||
<!-- Load JavaScript --> | ||
|
||
<div id="grouper-plugin" class="grouper pt-2"> | ||
<?php echo $this->fetch('content'); ?> | ||
<?= $this->fetch('content') ?> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import PageCount from '../pagecount.js'; | ||
import Pagination from '../pagination.js'; | ||
import GroupsTable from '../groups-table.js'; | ||
import Members from '../members.js'; | ||
import Autocomplete from '../autocomplete.js'; | ||
import Loader from '../loader.js'; | ||
export default { | ||
components: { | ||
Autocomplete, | ||
Loader | ||
}, | ||
data() { | ||
return { | ||
loading: false, | ||
subscribers: [], | ||
user: {}, | ||
rowLoading: false, | ||
searched: false | ||
} | ||
}, | ||
inject: ['api', 'txt'], | ||
computed: { | ||
preInfoTxt() { | ||
return '<em class="material-icons lg" aria-hidden="true">search</em><span class="ml-1">' + this.txt.search + ':</span>' | ||
} | ||
}, | ||
methods: { | ||
reset() { | ||
this.searched = false | ||
// If you are in the middle of a row action we do not want to clear | ||
// the results because we are breaking the user experience | ||
if(!this.rowLoading) { | ||
this.subscribers = [] | ||
} | ||
}, | ||
async disableActAs() { | ||
|
||
}, | ||
async findUsersIManage(user) { | ||
} | ||
}, | ||
template: /*html*/` | ||
<autocomplete @callback="(item) => findGroupsForManagedUser(item)" | ||
icon="search" | ||
action="findGroupsForManagedUser" | ||
:renderBtn="false" | ||
:preInfo="this.preInfoTxt" | ||
/> | ||
<loader :active="loading"></loader> | ||
<div v-if="!loading"> | ||
<div v-if="error"> | ||
<span v-if="error.status === 403">{{ txt.noaccess }}</span> | ||
<span v-else>{{ txt.empty }}</span> | ||
</div> | ||
<div v-else> | ||
<table v-if="subscribers.length > 0" class="table table-striped"> | ||
<tbody id="sub-body"> | ||
<tr v-for="subscriber in subscribers"> | ||
<td> | ||
{{ subscriber.name }} | ||
</td> | ||
<td :colspan="remove ? 1 : 2"> | ||
{{ subscriber.id }} | ||
</td> | ||
<td v-if="remove"> | ||
<button :disabled="disabled.indexOf(subscriber.id) > -1" | ||
@click="" | ||
class="btn btn-grouper btn-block btn-primary btn-sm m-1 text-nowrap member-del-btn"> | ||
{{ txt.remove }} | ||
</button> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<span v-else> | ||
{{ txt.empty }} | ||
</span> | ||
</div> | ||
</div> | ||
` | ||
} |