[open-ils-commits] r15173 - in trunk/Open-ILS: examples xul/staff_client/chrome/content/main xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 16 02:48:15 EST 2009


Author: phasefx
Date: 2009-12-16 02:48:10 -0500 (Wed, 16 Dec 2009)
New Revision: 15173

Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
   trunk/Open-ILS/xul/staff_client/server/patron/summary.js
   trunk/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul
Log:
Stat Cats (where usr_summary is true) in horizontal patron summary pane.  Give pcrud access to actsc



Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2009-12-16 07:43:31 UTC (rev 15172)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2009-12-16 07:48:10 UTC (rev 15173)
@@ -3181,7 +3181,7 @@
 			<link field="usr" reltype="has_a" key="id" map="" class="au"/>
 		</links>
 	</class>
-	<class id="actsc" controller="open-ils.cstore" oils_obj:fieldmapper="actor::stat_cat" oils_persist:tablename="actor.stat_cat" reporter:label="User Statistical Category">
+	<class id="actsc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::stat_cat" oils_persist:tablename="actor.stat_cat" reporter:label="User Statistical Category">
 		<fields oils_persist:primary="id" oils_persist:sequence="actor.stat_cat_id_seq">
 			<field reporter:label="Entries" name="entries" oils_persist:virtual="true" reporter:datatype="link"/>
 			<field reporter:label="Stat Cat ID" name="id" reporter:datatype="id" reporter:selector="name"/>
@@ -3194,6 +3194,14 @@
 			<link field="owner" reltype="has_a" key="id" map="" class="aou"/>
 			<link field="entries" reltype="has_many" key="stat_cat" map="" class="actsce"/>
 		</links>
+        <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+            <actions>
+                <create permission="CREATE_PATRON_STAT_CAT" context_field="owner"/>
+                <retrieve />
+                <update permission="UPDATE_PATRON_STAT_CAT" context_field="owner"/>
+                <delete permission="DELETE_PATRON_STAT_CAT" context_field="owner"/>
+            </actions>
+        </permacrud>
 	</class>
 	<class id="msefe" controller="open-ils.cstore" oils_obj:fieldmapper="metabib::series_field_entry" oils_persist:tablename="metabib.series_field_entry" reporter:label="Series Field Entry">
 		<fields oils_persist:primary="id" oils_persist:sequence="metabib.series_field_entry_id_seq">

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js	2009-12-16 07:43:31 UTC (rev 15172)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js	2009-12-16 07:48:10 UTC (rev 15173)
@@ -92,6 +92,7 @@
     'FM_ACPN_DELETE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.copy_note.delete', 'secure' : false },
     'FM_ACTSC_RETRIEVE_BATCH' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.stat_cat.actor.retrieve.batch', 'secure' : false },
     'FM_ACTSC_RETRIEVE_VIA_AOU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.stat_cat.actor.retrieve.all', 'secure' : false },
+    'FM_ACTSC_RETRIEVE_VIA_PCRUD' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.actsc.atomic', 'secure' : false },
     'FM_AHRN_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_note.create' },
     'FM_AHN_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.create' },
     'FM_AHN_RETRIEVE_VIA_AHR' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold_notification.retrieve_by_hold' },

Modified: trunk/Open-ILS/xul/staff_client/server/patron/summary.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/summary.js	2009-12-16 07:43:31 UTC (rev 15172)
+++ trunk/Open-ILS/xul/staff_client/server/patron/summary.js	2009-12-16 07:48:10 UTC (rev 15173)
@@ -30,7 +30,9 @@
         obj.OpenILS.data = new OpenILS.data(); obj.OpenILS.data.init({'via':'stash'});
         var obscure_dob = String( obj.OpenILS.data.hash.aous['circ.obscure_dob'] ) == 'true';
 
-        JSAN.use('util.functional'); JSAN.use('patron.util'); JSAN.use('util.list'); obj.group_list = new util.list('group_list');
+        JSAN.use('util.functional'); JSAN.use('patron.util'); JSAN.use('util.list'); 
+
+        obj.group_list = new util.list('group_list');
         obj.group_list.init( {
             'columns' : [
                 { 'id' : 'gl_family_name', 'flex' : 1, 
@@ -63,6 +65,23 @@
         $('group_list_actions').appendChild( obj.group_list.render_list_actions() );
         obj.group_list.set_list_actions();
 
+        obj.stat_cat_list = new util.list('stat_cat_list');
+        obj.stat_cat_list.init( {
+            'columns' : [].concat(
+                obj.stat_cat_list.fm_columns( 'actsc', {
+                    'actsc_id' : { 'hidden' : true },
+                    'actsc_opac_visible' : { 'hidden' : true },
+                    'actsc_usr_summary' : { 'hidden' : true }
+                } )
+            ).concat(
+                obj.stat_cat_list.fm_columns( 'actscecm', {
+                    'actscecm_id' : { 'hidden' : true }
+                } )
+            )
+        } );
+        $('stat_cat_list_actions').appendChild( obj.stat_cat_list.render_list_actions() );
+        obj.stat_cat_list.set_list_actions();
+
         JSAN.use('util.controller'); obj.controller = new util.controller();
         obj.controller.init(
             {
@@ -92,6 +111,42 @@
                             }
                         }
                     ],
+                    'stat_cat_tab' : [
+                        ['command'],
+                        function() {
+                            try {
+                                obj.stat_cat_list.clear();
+                                var entries = obj.patron.stat_cat_entries();
+                                for (var i = 0; i < entries.length; i++) {
+                                    var stat_cat = obj.OpenILS.data.hash.my_actsc[ entries[i].stat_cat() ];
+                                    if (!stat_cat) {
+                                        stat_cat = obj.OpenILS.data.hash.actsc[ entries[i].stat_cat() ];
+                                    }
+                                    if (!stat_cat) {
+                                        var robj = obj.network.simple_request('FM_ACTSC_RETRIEVE_VIA_PCRUD',[ ses(), { 'id' : { '=' : entries[i].stat_cat() } }]);
+                                        if (typeof robj == 'object' && typeof robj.ilsevent != 'undefined') {
+                                            obj.OpenILS.data.hash.actsc[ entries[i].stat_cat() ] = robj;
+                                            obj.OpenILS.data.stash( 'hash' );
+                                            stat_cat = robj;
+                                        }
+                                    }
+                                    if (!stat_cat) { continue; }
+                                    if (get_bool( stat_cat.usr_summary() )) {
+                                        obj.stat_cat_list.append( {
+                                            'row' : {
+                                                'my' : {
+                                                    'actsc' : stat_cat,
+                                                    'actscecm' : entries[i],
+                                                }
+                                            }
+                                        } );
+                                    }
+                                }
+                            } catch(E) {
+                                alert('Error in summary.js, stat_cat_tab: ' + E);
+                            }
+                        }
+                    ],
                     'group_tab_retrieve_patron' : [
                         ['command'],
                         function() {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul	2009-12-16 07:43:31 UTC (rev 15172)
+++ trunk/Open-ILS/xul/staff_client/server/patron/summary_overlay_horiz.xul	2009-12-16 07:48:10 UTC (rev 15173)
@@ -37,7 +37,7 @@
                 <tab label="&staff.patron_display.tab.account_info.label;" accesskey="&staff.patron_display.tab.account_info.accesskey;"/>
                 <tab label="&staff.patron_display.tab.identification.label;" accesskey="&staff.patron_display.tab.identification.accesskey;"/>
                 <tab id="group_tab" label="&staff.patron_display.tab.group.label;" accesskey="&staff.patron_display.tab.group.accesskey;"/>
-                <tab label="&staff.patron_display.tab.stat_cats.label;" accesskey="&staff.patron_display.tab.stat_cats.accesskey;"/>
+                <tab id="stat_cat_tab" label="&staff.patron_display.tab.stat_cats.label;" accesskey="&staff.patron_display.tab.stat_cats.accesskey;"/>
             </tabs>
             <tabpanels flex="1">
                 <tabpanel><vbox id="account_info" flex="1" /></tabpanel>
@@ -52,9 +52,12 @@
                             accesskey="&staff.patron.summary_overlay.group_tab.retrieve_patron.accesskey;" />
                     </hbox>
                 </tabpanel>
-                <tabpanel>
-                    <vbox>
-                    </vbox>
+                <tabpanel orient="vertical">
+                    <tree id="stat_cat_list" flex="1" enableColumnDrag="true" seltype="multiple" />
+                    <hbox>
+                        <hbox id="stat_cat_list_actions" />
+                        <spacer flex="1" />
+                    </hbox>
                 </tabpanel>
                 <tabpanel hidden="true"><grid id="PatronSummaryStatus_grid" flex="1"/></tabpanel>
             </tabpanels>



More information about the open-ils-commits mailing list