From d951d337586bdde7153c726295430a30f9189c35 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 11 Apr 2008 03:45:49 +0000 Subject: [PATCH] merging admin interface from the dojo-admin branch git-svn-id: svn://svn.open-ils.org/ILS/trunk@9309 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/Makefile | 3 + Open-ILS/src/extras/autogen.sh | 3 + Open-ILS/web/conify/global/actor/org_unit.html | 811 +++++++++++++++++++++ Open-ILS/web/conify/global/actor/org_unit.js | 256 +++++++ .../web/conify/global/actor/org_unit_type.html | 412 +++++++++++ Open-ILS/web/conify/global/actor/org_unit_type.js | 81 ++ Open-ILS/web/conify/global/admin.html | 77 ++ Open-ILS/web/conify/global/config/copy_status.html | 275 +++++++ Open-ILS/web/conify/global/config/copy_status.js | 105 +++ .../web/conify/global/permission/grp_tree.html | 739 +++++++++++++++++++ Open-ILS/web/conify/global/permission/grp_tree.js | 145 ++++ .../web/conify/global/permission/perm_list.html | 252 +++++++ Open-ILS/web/conify/global/permission/perm_list.js | 107 +++ 13 files changed, 3266 insertions(+) create mode 100644 Open-ILS/web/conify/global/actor/org_unit.html create mode 100644 Open-ILS/web/conify/global/actor/org_unit.js create mode 100644 Open-ILS/web/conify/global/actor/org_unit_type.html create mode 100644 Open-ILS/web/conify/global/actor/org_unit_type.js create mode 100644 Open-ILS/web/conify/global/admin.html create mode 100644 Open-ILS/web/conify/global/config/copy_status.html create mode 100644 Open-ILS/web/conify/global/config/copy_status.js create mode 100644 Open-ILS/web/conify/global/permission/grp_tree.html create mode 100644 Open-ILS/web/conify/global/permission/grp_tree.js create mode 100644 Open-ILS/web/conify/global/permission/perm_list.html create mode 100644 Open-ILS/web/conify/global/permission/perm_list.js diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index 335f05a8c2..5abe16925d 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -72,6 +72,9 @@ webcore-install: mkdir -p $(WEBDIR)/opac/extras/xsl/ cp -r ../web/* $(WEBDIR) cp $(OPENSRF_LIBS)/javascript/* $(WEBDIR)/opac/common/js/ + # dojo-ified opensrf libs + cp $(OPENSRF_LIBS)/javascript/opensrf*js $(WEBDIR)/js/opensrf/ + cp $(OPENSRF_LIBS)/javascript/OpenSRF.js $(WEBDIR)/js/ ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml diff --git a/Open-ILS/src/extras/autogen.sh b/Open-ILS/src/extras/autogen.sh index 58f4530dfd..73e5bdbd28 100755 --- a/Open-ILS/src/extras/autogen.sh +++ b/Open-ILS/src/extras/autogen.sh @@ -70,6 +70,7 @@ done [ -z "$CONFIG" ] && usage; JSDIR="/openils/var/web/opac/common/js/"; +FMDOJODIR="/openils/var/web/js/dojo/fieldmapper/"; SLIMPACDIR="/openils/var/web/opac/extras/slimpac/"; echo "Updating fieldmapper"; @@ -83,9 +84,11 @@ perl org_tree_js.pl "$CONFIG" > "$JSDIR/OrgTree.js"; echo "Updating OrgTree HTML"; perl org_tree_html_options.pl "$CONFIG" "$SLIMPACDIR/lib_list.inc"; +cp "$JSDIR/OrgTree.js" "$FMDOJODIR/" echo "Updating Search Groups"; perl org_lasso_js.pl "$CONFIG" > "$JSDIR/OrgLasso.js"; +cp "$JSDIR/OrgLasso.js" "$FMDOJODIR/" if [ "$PROXIMITY" ] then diff --git a/Open-ILS/web/conify/global/actor/org_unit.html b/Open-ILS/web/conify/global/actor/org_unit.html new file mode 100644 index 0000000000..b250faa666 --- /dev/null +++ b/Open-ILS/web/conify/global/actor/org_unit.html @@ -0,0 +1,811 @@ + + + + Confiy :: Global :: Actor :: Org Units + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
+
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Org Unit Name + + + +
Org Unit Policy Code + + + +
Main Email Address + + + +
Main Phone Number + + + +
Org Unit Type +
+ +
+
Parent Org Unit +
+ +
+
OPAC Visible + +
+ +
+ + + + + +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Open timeClose time
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
+ + + +
+ +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + +
TypeValid + +
Street 1
Street 2
CityStateZip
CountryCounty
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
TypeValid + +
Street 1
Street 2
CityStateZip
CountryCounty
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
TypeValid + +
Street 1
Street 2
CityStateZip
CountryCounty
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
TypeValid + +
Street 1
Street 2
CityStateZip
CountryCounty
+ + +
+
+
+
+
+
+ +
Now editing:
+ + diff --git a/Open-ILS/web/conify/global/actor/org_unit.js b/Open-ILS/web/conify/global/actor/org_unit.js new file mode 100644 index 0000000000..fe5c2577da --- /dev/null +++ b/Open-ILS/web/conify/global/actor/org_unit.js @@ -0,0 +1,256 @@ +/* +# --------------------------------------------------------------------------- +# Copyright (C) 2008 Georgia Public Library Service / Equinox Software, Inc +# Mike Rylander +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# --------------------------------------------------------------------------- +*/ + +dojo.require('fieldmapper.dojoData'); +dojo.require('dojo.parser'); +dojo.require('dojo.data.ItemFileWriteStore'); +dojo.require('dojo.date.stamp'); +dojo.require('dijit.form.TextBox'); +dojo.require('dijit.form.TimeTextBox'); +dojo.require('dijit.form.ValidationTextBox'); +dojo.require('dijit.form.CheckBox'); +dojo.require('dijit.form.FilteringSelect'); +dojo.require('dijit.Tree'); +dojo.require('dijit.layout.ContentPane'); +dojo.require('dijit.layout.TabContainer'); +dojo.require('dijit.layout.LayoutContainer'); +dojo.require('dijit.layout.SplitContainer'); +dojo.require('dojox.widget.Toaster'); +dojo.require('dojox.fx'); + +// some handy globals +var cgi = new CGI(); +var cookieManager = new HTTP.Cookies(); +var ses = cookieManager.read('ses') || cgi.param('ses'); +var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); + +var current_ou, current_ou_hoo; +var virgin_ou_id = -1; + +//var ou_type_store = new dojo.data.ItemFileWriteStore({ data : aout.toStoreData( globalOrgTypes ) }); + +var highlighter = {}; + +function status_update (markup) { + if (parent !== window && parent.status_update) parent.status_update( markup ); +} + +function save_org () { + var modified_ou = new aou().fromStoreItem( current_ou ); + modified_ou.ischanged( 1 ); + + new_kid_button.disabled = false; + save_ou_button.disabled = false; + delete_ou_button.disabled = false; + + pCRUD.request({ + method : 'open-ils.permacrud.update.aou', + timeout : 10, + params : [ ses, modified_ou ], + onerror : function (r) { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving data for ' + ou_list_store.getValue( current_ou, 'name' ) ); + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + ou_list_store.setValue( current_ou, 'ischanged', 0 ); + highlighter.editor_pane.green.play(); + status_update( 'Saved changes to ' + ou_list_store.getValue( current_ou, 'name' ) ); + } else { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving data for ' + ou_list_store.getValue( current_ou, 'name' ) ); + } + }, + }).send(); +} + +function hoo_load () { + // empty result not coming through ... + current_ou_hoo = new aouhoo().fromHash({id:ou_list_store.getValue( current_ou, 'id' )}); + current_ou_hoo.isnew(1); + + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aouhoo', + params : [ ses, ou_list_store.getValue( current_ou, 'id' ) ], + onerror : function (r) { throw 'Problem fetching hours of operation for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_ou_hoo = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_ou_hoo = res.content(); + } + + if (!current_ou_hoo) { + current_ou_hoo = new aouhoo().fromHash({id:ou_list_store.getValue( current_ou, 'id' )}); + current_ou_hoo.isnew(1); + for (var i = 0; i < 7; i++) { + current_ou_hoo['dow_' + i + '_open']('09:00:00'); + current_ou_hoo['dow_' + i + '_close']('17:00:00'); + } + } + + for (var i = 0; i < 7; i++) { + window['dow_' + i + '_open'].setValue( + dojo.date.stamp.fromISOString( 'T' + current_ou_hoo['dow_' + i + '_open']() ) + ); + window['dow_' + i + '_close'].setValue( + dojo.date.stamp.fromISOString( 'T' + current_ou_hoo['dow_' + i + '_close']() ) + ); + } + + highlighter.hoo_pane.green.play(); + } + }).send(); + +} + +function addr_load () { + // empty result not coming through ... + + save_ill_address.disabled = false; + save_holds_address.disabled = false; + save_mailing_address.disabled = false; + save_billing_address.disabled = false; + + if (ou_list_store.getValue( current_ou, 'billing_address' )) { + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aoa', + params : [ ses, ou_list_store.getValue( current_ou, 'billing_address' ) ], + onerror : function (r) { throw 'Problem fetching Physical Address for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_billing_address = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_billing_address = res.content(); + } + + if (!current_billing_address) { + current_billing_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_billing_address.isnew(1); + } + + set_addr_inputs('billing'); + highlighter.addresses_pane.green.play(); + } + }).send(); + } else { + current_billing_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_billing_address.isnew(1); + set_addr_inputs('billing'); + } + + if (ou_list_store.getValue( current_ou, 'mailing_address' )) { + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aoa', + params : [ ses, ou_list_store.getValue( current_ou, 'mailing_address' ) ], + onerror : function (r) { throw 'Problem fetching Physical Address for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_mailing_address = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_mailing_address = res.content(); + } + + if (!current_mailing_address) { + current_mailing_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_mailing_address.isnew(1); + } + + set_addr_inputs('mailing'); + highlighter.addresses_pane.green.play(); + } + }).send(); + } else { + current_mailing_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_mailing_address.isnew(1); + set_addr_inputs('mailing'); + } + + if (ou_list_store.getValue( current_ou, 'holds_address' )) { + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aoa', + params : [ ses, ou_list_store.getValue( current_ou, 'holds_address' ) ], + onerror : function (r) { throw 'Problem fetching Physical Address for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_holds_address = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_holds_address = res.content(); + } + + if (!current_holds_address) { + current_holds_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_holds_address.isnew(1); + } + + set_addr_inputs('holds'); + highlighter.addresses_pane.green.play(); + } + }).send(); + } else { + current_holds_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_holds_address.isnew(1); + set_addr_inputs('holds'); + } + + if (ou_list_store.getValue( current_ou, 'ill_address' )) { + pCRUD.request({ + method : 'open-ils.permacrud.retrieve.aoa', + params : [ ses, ou_list_store.getValue( current_ou, 'ill_address' ) ], + onerror : function (r) { throw 'Problem fetching Physical Address for ' + ou_list_store.getValue( current_ou, 'name' );}, + oncomplete : function (r) { + current_ill_address = null; + + var res = r.recv(); + if (res) { + if (res.content()) current_ill_address = res.content(); + } + + if (!current_ill_address) { + current_ill_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_ill_address.isnew(1); + } + + set_addr_inputs('ill'); + highlighter.addresses_pane.green.play(); + } + }).send(); + } else { + current_ill_address = new aoa().fromHash({org_unit:ou_list_store.getValue( current_ou, 'id' )}); + current_ill_address.isnew(1); + set_addr_inputs('ill'); + } + +} + +function set_addr_inputs (type) { + window[type + '_addr_valid'].setChecked( window['current_' + type + '_address'].valid() == 't' ? true : false ); + window[type + '_addr_type'].setValue( window['current_' + type + '_address'].address_type() || '' ); + window[type + '_addr_street1'].setValue( window['current_' + type + '_address'].street1() || '' ); + window[type + '_addr_street2'].setValue( window['current_' + type + '_address'].street2() || '' ); + window[type + '_addr_city'].setValue( window['current_' + type + '_address'].city() || '' ); + window[type + '_addr_county'].setValue( window['current_' + type + '_address'].county() || '' ); + window[type + '_addr_country'].setValue( window['current_' + type + '_address'].country() || '' ); + window[type + '_addr_state'].setValue( window['current_' + type + '_address'].state() || '' ); + window[type + '_addr_post_code'].setValue( window['current_' + type + '_address'].post_code() || '' ); +} + diff --git a/Open-ILS/web/conify/global/actor/org_unit_type.html b/Open-ILS/web/conify/global/actor/org_unit_type.html new file mode 100644 index 0000000000..0818da7175 --- /dev/null +++ b/Open-ILS/web/conify/global/actor/org_unit_type.html @@ -0,0 +1,412 @@ + + + + Confiy :: Global :: Actor :: Org Unit Types + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Type Name + + + +
OPAC Label + + + +
Parent Type +
+ +
+
Can have Volumes/Copies + +
Can have Users + +
+ +
+ + + + + +
+ + + +
+
+
+ + + diff --git a/Open-ILS/web/conify/global/actor/org_unit_type.js b/Open-ILS/web/conify/global/actor/org_unit_type.js new file mode 100644 index 0000000000..e297c723a0 --- /dev/null +++ b/Open-ILS/web/conify/global/actor/org_unit_type.js @@ -0,0 +1,81 @@ +/* +# --------------------------------------------------------------------------- +# Copyright (C) 2008 Georgia Public Library Service / Equinox Software, Inc +# Mike Rylander +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# --------------------------------------------------------------------------- +*/ + +dojo.require('fieldmapper.dojoData'); +dojo.require('dojo.parser'); +dojo.require('dojo.data.ItemFileWriteStore'); +dojo.require('dojo.date.stamp'); +dojo.require('dijit.form.NumberSpinner'); +dojo.require('dijit.form.TextBox'); +dojo.require('dijit.form.TimeTextBox'); +dojo.require('dijit.form.ValidationTextBox'); +dojo.require('dijit.form.CheckBox'); +dojo.require('dijit.form.FilteringSelect'); +dojo.require('dijit.Tree'); +dojo.require('dijit.layout.ContentPane'); +dojo.require('dijit.layout.TabContainer'); +dojo.require('dijit.layout.LayoutContainer'); +dojo.require('dijit.layout.SplitContainer'); +dojo.require('dojox.widget.Toaster'); +dojo.require('dojox.fx'); + +// some handy globals +var cgi = new CGI(); +var cookieManager = new HTTP.Cookies(); +var ses = cookieManager.read('ses') || cgi.param('ses'); +var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); + +var current_type; +var virgin_out_id = -1; + +var highlighter = {}; + +function status_update (markup) { + if (parent !== window && parent.status_update) parent.status_update( markup ); +} + +function save_type () { + + var modified_aout = new aout().fromStoreItem( current_type ); + modified_aout.ischanged( 1 ); + + new_kid_button.disabled = false; + save_out_button.disabled = false; + delete_out_button.disabled = false; + + pCRUD.request({ + method : 'open-ils.permacrud.update.aout', + timeout : 10, + params : [ ses, modified_aout ], + onerror : function (r) { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving data for ' + ou_type_store.getValue( current_type, 'name' ) ); + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + ou_type_store.setValue( current_type, 'ischanged', 0 ); + highlighter.editor_pane.green.play(); + status_update( 'Saved changes to ' + ou_type_store.getValue( current_type, 'name' ) ); + } else { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving data for ' + ou_type_store.getValue( current_type, 'name' ) ); + } + }, + }).send(); +} + diff --git a/Open-ILS/web/conify/global/admin.html b/Open-ILS/web/conify/global/admin.html new file mode 100644 index 0000000000..8a4ff3f868 --- /dev/null +++ b/Open-ILS/web/conify/global/admin.html @@ -0,0 +1,77 @@ + + + + Conify :: Global :: Admin + + + + + + + + + + + + + +
+
+ + Configure your ILS +
+ +
+ +
+
+ +
+
+ + + diff --git a/Open-ILS/web/conify/global/config/copy_status.html b/Open-ILS/web/conify/global/config/copy_status.html new file mode 100644 index 0000000000..90e3b2fd5c --- /dev/null +++ b/Open-ILS/web/conify/global/config/copy_status.html @@ -0,0 +1,275 @@ + + + + Confiy :: Global :: Config :: Copy Status + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ New Status: +
+ +
+ +
+
+
+ +
+
+ +
+ + + + + +
+
+ + + diff --git a/Open-ILS/web/conify/global/config/copy_status.js b/Open-ILS/web/conify/global/config/copy_status.js new file mode 100644 index 0000000000..9fffc7a6d5 --- /dev/null +++ b/Open-ILS/web/conify/global/config/copy_status.js @@ -0,0 +1,105 @@ +/* +# --------------------------------------------------------------------------- +# Copyright (C) 2008 Georgia Public Library Service / Equinox Software, Inc +# Mike Rylander +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# --------------------------------------------------------------------------- +*/ + +dojo.require('fieldmapper.dojoData'); +dojo.require('dojo.parser'); +dojo.require('dojo.string'); +dojo.require('dojo.data.ItemFileWriteStore'); +dojo.require('dijit.form.TextBox'); +dojo.require('dijit.form.ValidationTextBox'); +dojo.require('dijit.form.Textarea'); +dojo.require('dijit.layout.ContentPane'); +dojo.require('dijit.layout.LayoutContainer'); +dojo.require('dijit.layout.BorderContainer'); +dojo.require('dojox.widget.Toaster'); +dojo.require('dojox.fx'); +dojo.require('dojox.grid.Grid'); +dojo.require('dojox.grid._data.model'); +dojo.require("dojox.grid.editors"); + +// some handy globals +var cgi = new CGI(); +var cookieManager = new HTTP.Cookies(); +var ses = cookieManager.read('ses') || cgi.param('ses'); +var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); + +var current_status; +var virgin_out_id = -1; + +var highlighter = {}; + +function status_update (markup) { + if (parent !== window && parent.status_update) parent.status_update( markup ); +} + +function save_status () { + + var modified_ccs = new ccs().fromStoreItem( current_status ); + modified_ccs.ischanged( 1 ); + + pCRUD.request({ + method : 'open-ils.permacrud.update.ccs', + timeout : 10, + params : [ ses, modified_ccs ], + onerror : function (r) { + highlighter.red.play(); + status_update( 'Problem saving ' + status_store.getValue( current_status, 'name' ) ); + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + status_store.setValue( current_status, 'ischanged', 0 ); + highlighter.green.play(); + status_update( 'Saved changes to ' + status_store.getValue( current_status, 'name' ) ); + } else { + highlighter.red.play(); + status_update( 'Problem saving ' + status_store.getValue( current_status, 'name' ) ); + } + }, + }).send(); +} + +function save_them_all (event) { + + status_store.fetch({ + query : { ischanged : 1 }, + onItem : function (item, req) { try { if (this.isItem( item )) window.dirtyStore.push( item ); } catch (e) { /* meh */ } }, + scope : status_store + }); + + var confirmation = true; + + + if (event && dirtyStore.length > 0) { + confirmation = confirm( + 'There are unsaved modified Statuses! '+ + 'OK to save these changes, Cancel to abandon them.' + ); + } + + if (confirmation) { + for (var i in window.dirtyStore) { + window.current_status = window.dirtyStore[i]; + save_status(true); + } + + window.dirtyStore = []; + } +} + +dojo.addOnUnload( save_them_all ); + diff --git a/Open-ILS/web/conify/global/permission/grp_tree.html b/Open-ILS/web/conify/global/permission/grp_tree.html new file mode 100644 index 0000000000..f8ea5ca092 --- /dev/null +++ b/Open-ILS/web/conify/global/permission/grp_tree.html @@ -0,0 +1,739 @@ + + + + Confiy :: Global :: Permission :: Group Tree + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
+
+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group Name + + + +
Description + +
Permission Interval + + + +
Editing Permission +
+ +
+
Parent Group +
+ +
+
User Group + +
+ +
+ + + + + +
+ + + +
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ New Mapping +
+ + + + + + + + + + + + + +
Permission: +
+
Depth: +
+
Grantable: + +
+ + +
+
+ +
+ + + +
+
+
+
+
+
+ + diff --git a/Open-ILS/web/conify/global/permission/grp_tree.js b/Open-ILS/web/conify/global/permission/grp_tree.js new file mode 100644 index 0000000000..05d3dbd34b --- /dev/null +++ b/Open-ILS/web/conify/global/permission/grp_tree.js @@ -0,0 +1,145 @@ +/* +# --------------------------------------------------------------------------- +# Copyright (C) 2008 Georgia Public Library Service / Equinox Software, Inc +# Mike Rylander +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# --------------------------------------------------------------------------- +*/ + +dojo.require('fieldmapper.dojoData'); +dojo.require('dojo.parser'); +dojo.require('dojo.data.ItemFileWriteStore'); +dojo.require('dojo.date.stamp'); +dojo.require('dijit.form.NumberSpinner'); +dojo.require('dijit.form.TextBox'); +dojo.require('dijit.form.TimeTextBox'); +dojo.require('dijit.form.ValidationTextBox'); +dojo.require('dijit.form.CheckBox'); +dojo.require('dijit.form.FilteringSelect'); +dojo.require('dijit.form.Textarea'); +dojo.require('dijit.form.Button'); +dojo.require('dijit.Dialog'); +dojo.require('dijit.Tree'); +dojo.require('dijit.layout.ContentPane'); +dojo.require('dijit.layout.TabContainer'); +dojo.require('dijit.layout.LayoutContainer'); +dojo.require('dijit.layout.SplitContainer'); +dojo.require('dojox.widget.Toaster'); +dojo.require('dojox.fx'); +dojo.require('dojox.grid.Grid'); +dojo.require('dojox.grid._data.model'); +dojo.require("dojox.grid.editors"); + +// some handy globals +var cgi = new CGI(); +var cookieManager = new HTTP.Cookies(); +var ses = cookieManager.read('ses') || cgi.param('ses'); +var server = {}; +server.pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); +server.actor = new OpenSRF.ClientSession('open-ils.actor'); + +var current_group; +var virgin_out_id = -1; + +var highlighter = {}; + +function status_update (markup) { + if (parent !== window && parent.status_update) parent.status_update( markup ); +} + +function save_group () { + + var modified_pgt = new pgt().fromStoreItem( current_group ); + modified_pgt.ischanged( 1 ); + + new_kid_button.disabled = false; + save_out_button.disabled = false; + delete_out_button.disabled = false; + + server.pCRUD.request({ + method : 'open-ils.permacrud.update.pgt', + timeout : 10, + params : [ ses, modified_pgt ], + onerror : function (r) { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving data for ' + group_store.getValue( current_group, 'name' ) ); + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + group_store.setValue( current_group, 'ischanged', 0 ); + highlighter.editor_pane.green.play(); + status_update( 'Saved changes to ' + group_store.getValue( current_group, 'name' ) ); + } else { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving data for ' + group_store.getValue( current_group, 'name' ) ); + } + }, + }).send(); +} + +function save_perm_map (storeItem) { + + var modified_pgpm = new pgpm().fromStoreItem( storeItem ); + modified_pgpm.ischanged( 1 ); + + server.pCRUD.request({ + method : 'open-ils.permacrud.update.pgpm', + timeout : 10, + params : [ ses, modified_pgpm ], + onerror : function (r) { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving permission data for ' + group_store.getValue( current_group, 'name' ) ); + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + perm_map_store.setValue( storeItem, 'ischanged', 0 ); + highlighter.editor_pane.green.play(); + status_update( 'Saved permission changes to ' + group_store.getValue( current_group, 'name' ) ); + } else { + highlighter.editor_pane.red.play(); + status_update( 'Problem saving permission data for ' + group_store.getValue( current_group, 'name' ) ); + } + }, + }).send(); +} + +function save_them_all (event) { + + var dirtyMaps = []; + + perm_map_store.fetch({ + query : { ischanged : 1 }, + onItem : function (item, req) { try { if (this.isItem( item )) dirtyMaps.push( item ); } catch (e) { /* meh */ } }, + scope : perm_map_store + }); + + var confirmation = true; + + + if (event && dirtyMaps.length > 0) { + confirmation = confirm( + 'There are unsaved modified Permission Maps! '+ + 'OK to save these changes, Cancel to abandon them.' + ); + } + + if (confirmation) { + for (var i in dirtyMaps) { + save_perm_map(dirtyMaps[i]); + } + } +} + +dojo.addOnUnload( save_them_all ); + diff --git a/Open-ILS/web/conify/global/permission/perm_list.html b/Open-ILS/web/conify/global/permission/perm_list.html new file mode 100644 index 0000000000..4fc1a05ae9 --- /dev/null +++ b/Open-ILS/web/conify/global/permission/perm_list.html @@ -0,0 +1,252 @@ + + + + Confiy :: Global :: Permission :: Permission List + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ New Permission: +
+ +
+ +
+
+
+ + + --> +
+
+ +
+ + + + + +
+
+ + + diff --git a/Open-ILS/web/conify/global/permission/perm_list.js b/Open-ILS/web/conify/global/permission/perm_list.js new file mode 100644 index 0000000000..4dc76cffbb --- /dev/null +++ b/Open-ILS/web/conify/global/permission/perm_list.js @@ -0,0 +1,107 @@ +/* +# --------------------------------------------------------------------------- +# Copyright (C) 2008 Georgia Public Library Service / Equinox Software, Inc +# Mike Rylander +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# --------------------------------------------------------------------------- +*/ + +dojo.require('fieldmapper.dojoData'); +dojo.require('dojo.parser'); +dojo.require('dojo.string'); +dojo.require('dojo.data.ItemFileWriteStore'); +dojo.require('dijit.form.TextBox'); +dojo.require('dijit.form.ValidationTextBox'); +dojo.require('dijit.form.Textarea'); +dojo.require('dijit.layout.ContentPane'); +dojo.require('dijit.layout.LayoutContainer'); +dojo.require('dijit.layout.BorderContainer'); +dojo.require('dojox.widget.Toaster'); +dojo.require('dojox.fx'); +dojo.require('dojox.grid.Grid'); +dojo.require('dojox.grid._data.model'); +dojo.require("dojox.grid.editors"); + +// some handy globals +var cgi = new CGI(); +var cookieManager = new HTTP.Cookies(); +var ses = cookieManager.read('ses') || cgi.param('ses'); +var pCRUD = new OpenSRF.ClientSession('open-ils.permacrud'); + +var current_perm; +var virgin_out_id = -1; + +var highlighter = {}; + +function status_update (markup) { + if (parent !== window && parent.status_update) parent.status_update( markup ); +} + +function save_perm () { + + var modified_ppl = new ppl().fromStoreItem( current_perm ); + modified_ppl.ischanged( 1 ); + modified_ppl.description( dojo.string.trim( modified_ppl.description() ) ); + modified_ppl.code( dojo.string.trim( modified_ppl.code() ) ); + + pCRUD.request({ + method : 'open-ils.permacrud.update.ppl', + timeout : 10, + params : [ ses, modified_ppl ], + onerror : function (r) { + highlighter.red.play(); + status_update( 'Problem saving data for ' + perm_store.getValue( current_perm, 'code' ) ); + }, + oncomplete : function (r) { + var res = r.recv(); + if ( res && res.content() ) { + perm_store.setValue( current_perm, 'ischanged', 0 ); + highlighter.green.play(); + status_update( 'Saved changes to ' + perm_store.getValue( current_perm, 'code' ) ); + } else { + highlighter.red.play(); + status_update( 'Problem saving data for ' + perm_store.getValue( current_perm, 'code' ) ); + } + }, + }).send(); +} + +function save_them_all (event) { + + perm_store.fetch({ + query : { ischanged : 1 }, + onItem : function (item, req) { try { if (this.isItem( item )) window.dirtyStore.push( item ); } catch (e) { /* meh */ } }, + scope : perm_store + }); + + var confirmation = true; + + + if (event && dirtyStore.length > 0) { + confirmation = confirm( + 'There are unsaved modified Permissions! '+ + 'OK to save these changes, Cancel to abandon them.' + ); + } + + if (confirmation) { + for (var i in window.dirtyStore) { + window.current_perm = window.dirtyStore[i]; + save_perm(true); + } + + window.dirtyStore = []; + } +} + +dojo.addOnUnload( save_them_all ); + -- 2.11.0