adding custom result source support to the report template UI; removing write-ish...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 27 Sep 2007 18:28:12 +0000 (18:28 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 27 Sep 2007 18:28:12 +0000 (18:28 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7848 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_cstore.c
Open-ILS/web/reports/xul/template-config.js

index 1851f1c..10225c0 100644 (file)
@@ -169,6 +169,12 @@ int osrfAppInitialize() {
 
                        if (!osrfHashGet(idlClass, "fieldmapper")) continue;
 
+                       char* readonly = osrfHashGet(idlClass, "readonly");
+                       if (    readonly &&
+                               !strncasecmp( "true", readonly, 4) &&
+                               ( *method_type == 's' || *method_type == 'r' || *method_type == 'i')
+                       ) continue;
+
                        method_meta = osrfNewHash();
                        osrfHashSet(method_meta, idlClass, "class");
 
index d9e13f4..b112595 100644 (file)
@@ -39,6 +39,11 @@ function removeReportAtom (args) {
        return true;
 }
 
+function getSourceDefinition(class) {
+       var class_obj = getIDLClass(class);
+       return class_obj.getAttributeNS(persistNS,'tablename') || '(' + class_obj.getElementsByTagNameNS(persistNS,'source_definition')[0].nodeValue + ')';
+}
+
 function addReportAtoms () {
        var nope = $( 'source-add' ).getAttribute('disabled');
        if (nope == 'true') return false;
@@ -70,7 +75,7 @@ function addReportAtoms () {
                var colname = item.getAttribute('idlfield');
                var field_label = item.firstChild.firstChild.getAttribute('label');
 
-               var table_name = getIDLClass(field_class).getAttributeNS(persistNS,'tablename');
+               var table_name = getSourceDefinition(field_class);
 
                if ( !rpt_rel_cache[relation_alias] ) {
                        rpt_rel_cache[relation_alias] =
@@ -830,7 +835,7 @@ function fleshFromPath ( template, rel ) {
                var leaf = table_path.length == 0 ? true : false;
 
                current_obj.path = current_path;
-               current_obj.table = getIDLClass( link.split(/-/)[0] ).getAttributeNS( persistNS, 'tablename' );
+               current_obj.table = getSourceDefinition( link.split(/-/)[0] );
 
                if (prev_link != '') {
                        var prev_class = getIDLClass( prev_link.split(/-/)[0] );