[open-ils-commits] r7848 - in trunk/Open-ILS: src/c-apps web/reports/xul

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Sep 27 14:38:11 EDT 2007


Author: miker
Date: 2007-09-27 14:28:12 -0400 (Thu, 27 Sep 2007)
New Revision: 7848

Modified:
   trunk/Open-ILS/src/c-apps/oils_cstore.c
   trunk/Open-ILS/web/reports/xul/template-config.js
Log:
adding custom result source support to the report template UI; removing write-ish methods from method generation on readonly classes in cstore

Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c	2007-09-26 23:52:29 UTC (rev 7847)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c	2007-09-27 18:28:12 UTC (rev 7848)
@@ -169,6 +169,12 @@
 
 			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");
 

Modified: trunk/Open-ILS/web/reports/xul/template-config.js
===================================================================
--- trunk/Open-ILS/web/reports/xul/template-config.js	2007-09-26 23:52:29 UTC (rev 7847)
+++ trunk/Open-ILS/web/reports/xul/template-config.js	2007-09-27 18:28:12 UTC (rev 7848)
@@ -39,6 +39,11 @@
 	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 @@
 		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 @@
 		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] );



More information about the open-ils-commits mailing list