From: miker Date: Thu, 27 Sep 2007 18:28:12 +0000 (+0000) Subject: adding custom result source support to the report template UI; removing write-ish... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2f44138df044a5eee33a40a982e4666789183beb;p=Evergreen.git adding custom result source support to the report template UI; removing write-ish methods from method generation on readonly classes in cstore git-svn-id: svn://svn.open-ils.org/ILS/trunk@7848 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index 1851f1c3eb..10225c064f 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -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"); diff --git a/Open-ILS/web/reports/xul/template-config.js b/Open-ILS/web/reports/xul/template-config.js index d9e13f49ac..b112595536 100644 --- a/Open-ILS/web/reports/xul/template-config.js +++ b/Open-ILS/web/reports/xul/template-config.js @@ -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] );