fixing path-building code
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 16 May 2007 01:35:56 +0000 (01:35 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 16 May 2007 01:35:56 +0000 (01:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@7314 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/reports/xul/template-config.js

index c1d533d..04fc2ca 100644 (file)
@@ -840,10 +840,15 @@ function fleshFromPath ( template, rel ) {
                        current_obj.key = current_link.getAttribute('key');
 
                        if (
-                               current_link.getAttribute('reltype') != 'has_a' ||
-                               prev_type == 'left' ||
-                               rel.reltype != 'has_a'
-                       ) current_obj.type = 'left';
+                                       (
+                                               current_link.getAttribute('reltype') != 'has_a' ||
+                                               prev_type == 'left' ||
+                                               rel.reltype != 'has_a'
+                                       ) && (
+                                               !rel.fields.filter_tab &&
+                                               !rel.fields.aggfitler_tab
+                                       )
+                               ) current_obj.type = 'left';
 
                        prev_type = current_obj.type; 
                }
@@ -860,12 +865,14 @@ function fleshFromPath ( template, rel ) {
 
                        if (join_link.getAttribute('reltype') != 'has_a') {
                                var fields_el = current_class.getElementsByTagName('fields')[0];
-                               join_field = fields_el.getAttributeNS(persistNS, 'primary') + '-' + join_link.getAttribute('key');
+                               join_field =
+                                       fields_el.getAttributeNS(persistNS, 'primary') +
+                                       '-' + join_link.getAttribute('class') +
+                                       '-' + join_link.getAttribute('key');
                        }
 
-                       current_obj.alias = hex_md5( current_path ) ;
+                       if (!current_obj.alias) current_obj.alias = hex_md5( current_path ) ;
                        join_field += '-' + current_obj.alias;
-                       if (table_path.length == 1) join_field += '-' + rel.alias;
 
                        if (!current_obj.join) current_obj.join = {};
                        if (!current_obj.join[join_field]) current_obj.join[join_field] = {};