</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <create permission="ADMIN_BOOKING_RESOURCE_TYPE" global_required='true'/>
- <retrieve />
- <update permission="ADMIN_BOOKING_RESOURCE_TYPE" global_required='true'/>
- <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" global_required='true'/>
+ <create permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
+ <retrieve permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
+ <update permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE_TYPE" context_field='owner'/>
</actions>
</permacrud>
</class>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <create permission="ADMIN_BOOKING_RESOURCE" global_required='true'/>
- <retrieve />
- <update permission="ADMIN_BOOKING_RESOURCE" global_required='true'/>
- <delete permission="ADMIN_BOOKING_RESOURCE" global_required='true'/>
+ <create permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
+ <retrieve permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
+ <update permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE" context_field='owner'/>
</actions>
</permacrud>
</class>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <create permission="ADMIN_BOOKING_RESOURCE_ATTR" global_required='true'/>
- <retrieve />
- <update permission="ADMIN_BOOKING_RESOURCE_ATTR" global_required='true'/>
- <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" global_required='true'/>
+ <create permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
+ <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
+ <update permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE_ATTR" context_field='owner'/>
</actions>
</permacrud>
</class>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" global_required='true'/>
- <retrieve />
- <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" global_required='true'/>
- <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" global_required='true'/>
+ <create permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
+ <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
+ <update permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
+ <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_VALUE" context_field='owner'/>
</actions>
</permacrud>
</class>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
- <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP" global_required='true'/>
- <retrieve />
- <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP" global_required='true'/>
- <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP" global_required='true'/>
+ <create permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
+ <context link="resource" field="owner" />
+ </create>
+ <retrieve permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
+ <context link="resource" field="owner" />
+ </retrieve>
+ <update permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
+ <context link="resource" field="owner" />
+ </update>
+ <delete permission="ADMIN_BOOKING_RESOURCE_ATTR_MAP">
+ <context link="resource" field="owner" />
+ </delete>
</actions>
</permacrud>
</class>
[% WRAPPER default/base.tt2 %]
[% ctx.page_title = 'Resources' %]
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
- <div>Resources</div>
- <div>
- <button dojoType='dijit.form.Button' onClick='brsrcGrid.showCreateDialog()'>New Resource</button>
- <button dojoType='dijit.form.Button' onClick='brsrcGrid.deleteSelected()'>Delete Selected</button>
- </div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
+ <div>Resources</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='brsrcGrid.showCreateDialog()'>New Resource</button>
+ <button dojoType='dijit.form.Button' onClick='brsrcGrid.deleteSelected()'>Delete Selected</button>
</div>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <span>Context Org Unit</span>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<table jsId="brsrcGrid"
dojoType="openils.widget.AutoGrid"
fieldOrder="['owner', 'type', 'barcode',
query="{id: '*'}"
fmClass='brsrc'
showPaginator='true'
+ autoHeight='true'
editOnEnter='true'>
</table>
</div>
-
<script type ="text/javascript">
dojo.require('dijit.form.FilteringSelect');
dojo.require('openils.widget.AutoGrid');
dojo.require("openils.widget.PCrudAutocompleteBox");
+ dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+ function filterGrid() {
+ brsrcGrid.resetStore();
+ var unit = contextOrgSelector.getValue();
+ var list = fieldmapper.aou.findOrgUnit(unit).orgNodeTrail().map( function (i) {return i.id() } );
+
+ if(unit){
+ brsrcGrid.loadAll({order_by:{brsrc : 'barcode'}}, { 'owner' : list });
+ } else {
+ brsrcGrid.loadAll({order_by:{brsrc : 'barcode'}});
+ }
+ }
openils.Util.addOnLoad(
function() {
- var search = {"id": {"!=": null}};
+ var org_id = openils.User.user.ws_ou();
+ var list = fieldmapper.aou.findOrgUnit(org_id).orgNodeTrail().map( function (i) {return i.id() } );
+
+ new openils.User().buildPermOrgSelector('ADMIN_BOOKING_RESOURCE', contextOrgSelector, null, function() {
+ dojo.connect(contextOrgSelector, 'onChange', filterGrid);});
+
+ var search = {'owner':list};
+
if (xulG && xulG.resultant_brsrc)
search = {id: xulG.resultant_brsrc};
[% WRAPPER default/base.tt2 %]
[% ctx.page_title = 'Resource Attributes' %]
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
- <div>Resource Attributes</div>
- <div>
- <button dojoType='dijit.form.Button' onClick='braGrid.showCreateDialog()'>New Resource Attribute</button>
- <button dojoType='dijit.form.Button' onClick='braGrid.deleteSelected()'>Delete Selected</button>
- </div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
+ <div>Resource Attributes</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='braGrid.showCreateDialog()'>New Resource Attribute</button>
+ <button dojoType='dijit.form.Button' onClick='braGrid.deleteSelected()'>Delete Selected</button>
</div>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <span>Context Org Unit</span>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<table jsId="braGrid"
dojoType="openils.widget.AutoGrid"
fieldOrder="['name', 'owner', 'resource_type', 'required']"
query="{id: '*'}"
fmClass='bra'
+ autoHeight='true'
showPaginator='true'
editOnEnter='true'>
</table>
<script type ="text/javascript">
dojo.require("openils.widget.PCrudAutocompleteBox");
dojo.require('openils.widget.AutoGrid');
+ dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+ function filterGrid() {
+ braGrid.resetStore();
+ var unit = contextOrgSelector.getValue();
+ var list = fieldmapper.aou.findOrgUnit(unit).orgNodeTrail().map( function (i) {return i.id() } );
+
+ if(unit){
+ braGrid.loadAll({order_by:{bra : 'name'}}, { 'owner' : list });
+ } else {
+ braGrid.loadAll({order_by:{bra : 'name'}});
+ }
+ }
openils.Util.addOnLoad(
function() {
"fmclass": "brt", "searchAttr": "name"
});
braGrid.overrideEditWidgets.resource_type.shove = {"create": ""};
- braGrid.loadAll({order_by:{bra : 'name'}}, {"id": {"!=": null}});
+ var org_id = openils.User.user.ws_ou();
+ var list = fieldmapper.aou.findOrgUnit(org_id).orgNodeTrail().map( function (i) {return i.id() } );
+
+ new openils.User().buildPermOrgSelector('ADMIN_BOOKING_RESOURCE_ATTR', contextOrgSelector, null, function() {
+ dojo.connect(contextOrgSelector, 'onChange', filterGrid);});
+ braGrid.loadAll({order_by:{bra : 'name'}}, { 'owner' : list });
}
);
</script>
[% WRAPPER default/base.tt2 %]
[% ctx.page_title = 'Resource Attribute Maps' %]
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
- <div>Resource Attribute Maps</div>
- <div>
- <button dojoType='dijit.form.Button' onClick='bramGrid.showCreateDialog()'>New Resource Attribute Map</button>
- <button dojoType='dijit.form.Button' onClick='bramGrid.deleteSelected()'>Delete Selected</button>
- </div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Resource Attribute Maps</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='bramGrid.showCreateDialog()'>New Resource Attribute Map</button>
+ <button dojoType='dijit.form.Button' onClick='bramGrid.deleteSelected()'>Delete Selected</button>
</div>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <span>Context Org Unit</span>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<table jsId="bramGrid"
dojoType="openils.widget.AutoGrid"
fieldOrder="['resource', 'resource_attr', 'value']"
query="{id: '*'}"
fmClass='bram'
+ autoHeight='true'
showPaginator='true'
editOnEnter='true'>
</table>
<script type ="text/javascript">
dojo.require("openils.widget.PCrudAutocompleteBox");
dojo.require('openils.widget.AutoGrid');
+ dojo.require('openils.widget.OrgUnitFilteringSelect');
+ function filterGrid() {
+ bramGrid.resetStore();
+ var unit = contextOrgSelector.getValue();
+ var list = fieldmapper.aou.findOrgUnit(unit).orgNodeTrail().map( function (i) {return i.id() } );
+
+ if(unit){
+ bramGrid.loadAll({"order_by":"resource_attr"}, {"resource_attr":{"in":{"select":{"bra":["id"]},"from":"bra","where":{"+bra":{"owner": list } } } } } );
+ } else {
+ bramGrid.loadAll({order_by:{bram : 'resource_attr'}});
+ }
+ }
openils.Util.addOnLoad(
function() {
+ var org_id = openils.User.user.ws_ou();
+ var list = fieldmapper.aou.findOrgUnit(org_id).orgNodeTrail().map( function (i) {return i.id() } );
+
+ new openils.User().buildPermOrgSelector('ADMIN_BOOKING_RESOURCE_TYPE', contextOrgSelector, null, function() {
+ dojo.connect(contextOrgSelector, 'onChange', filterGrid);});
+
bramGrid.overrideEditWidgets.resource =
new openils.widget.PCrudAutocompleteBox({
"fmclass": "brsrc", "searchAttr": "barcode"
});
bramGrid.overrideEditWidgets.resource.shove = {"create": ""};
- bramGrid.loadAll({"order_by": {"bram": "resource_attr"}});
+ bramGrid.loadAll({"order_by":"resource_attr"}, {"resource_attr":{"in":{"select":{"bra":["id"]},"from":"bra","where":{"+bra":{"owner": list } } } } } );
}
);
</script>
[% WRAPPER default/base.tt2 %]
[% ctx.page_title = 'Resource Attribute Values' %]
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
- <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
- <div>Resource Attribute Values</div>
- <div>
- <button dojoType='dijit.form.Button' onClick='bravGrid.showCreateDialog()'>New Resource Attribute Value</button>
- <button dojoType='dijit.form.Button' onClick='bravGrid.deleteSelected()'>Delete Selected</button>
- </div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Resource Attribute Values</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='bravGrid.showCreateDialog()'>New Resource Attribute Value</button>
+ <button dojoType='dijit.form.Button' onClick='bravGrid.deleteSelected()'>Delete Selected</button>
</div>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <span>Context Org Unit</span>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<table jsId="bravGrid"
dojoType="openils.widget.AutoGrid"
fieldOrder="['owner', 'attr', 'valid_value']"
query="{id: '*'}"
fmClass='brav'
+ autoHeight='true'
showPaginator='true'
editOnEnter='true'>
</table>
<script type ="text/javascript">
dojo.require('dijit.form.FilteringSelect');
dojo.require('openils.widget.AutoGrid');
+ dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+ function filterGrid() {
+ bravGrid.resetStore();
+ var unit = contextOrgSelector.getValue();
+ var list = fieldmapper.aou.findOrgUnit(unit).orgNodeTrail().map( function (i) {return i.id() } );
+
+ if(unit){
+ bravGrid.loadAll({order_by:{brav : 'attr'}}, { 'owner' : list });
+ } else {
+ bravGrid.loadAll({order_by:{brav : 'attr'}});
+ }
+ }
openils.Util.addOnLoad(
function() {
- bravGrid.loadAll({order_by:{brav : 'attr'}}, {"id": {"!=": null}});
+ var org_id = openils.User.user.ws_ou();
+ var list = fieldmapper.aou.findOrgUnit(org_id).orgNodeTrail().map( function (i) {return i.id() } );
+
+ new openils.User().buildPermOrgSelector('ADMIN_BOOKING_RESOURCE_ATTR_VALUE', contextOrgSelector, null, function() {
+ dojo.connect(contextOrgSelector, 'onChange', filterGrid);});
+
+ bravGrid.loadAll({order_by:{brav : 'attr'}}, { 'owner' : list });
}
);
</script>
[% WRAPPER default/base.tt2 %]
[% ctx.page_title = 'Resource Types' %]
-<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class="oils-header-panel">
<div>Resource Types</div>
<div>
<button dojoType='dijit.form.Button' onClick='brtGrid.deleteSelected()'>Delete Selected</button>
</div>
</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+ <span>Context Org Unit</span>
+ <select dojoType="openils.widget.OrgUnitFilteringSelect"
+ jsId='contextOrgSelector'
+ searchAttr='shortname'
+ labelAttr='shortname'>
+ </select>
+</div>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
<table jsId="brtGrid"
dojoType="openils.widget.AutoGrid"
fieldOrder="['name', 'fine_interval', 'fine_amount',
query="{id: '*'}"
fmClass='brt'
showPaginator='true'
+ autoHeight='true'
editOnEnter='true'>
</table>
</div>
<script type ="text/javascript">
dojo.require('dijit.form.FilteringSelect');
dojo.require('openils.widget.AutoGrid');
+ dojo.require('openils.widget.OrgUnitFilteringSelect');
+ function filterGrid() {
+ brtGrid.resetStore();
+ var unit = contextOrgSelector.getValue();
+ var list = fieldmapper.aou.findOrgUnit(unit).orgNodeTrail().map( function (i) {return i.id() } );
+
+ if(unit){
+ brtGrid.loadAll({order_by:{brt : 'name'}}, { 'owner' : list });
+ } else {
+ brtGrid.loadAll({order_by:{brt : 'name'}});
+ }
+ }
openils.Util.addOnLoad(
function() {
- brtGrid.loadAll({"order_by": {"brt": "name"}}, {"id": {"!=": null}});
+ var org_id = openils.User.user.ws_ou();
+ var list = fieldmapper.aou.findOrgUnit(org_id).orgNodeTrail().map( function (i) {return i.id() } );
+
+ new openils.User().buildPermOrgSelector('ADMIN_BOOKING_RESOURCE_TYPE', contextOrgSelector, null, function() {
+ dojo.connect(contextOrgSelector, 'onChange', filterGrid);});
+
+ brtGrid.loadAll({"order_by": {"brt": "name"}}, { 'owner' : list });
}
);
</script>