trying again
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 18 Jul 2006 00:48:51 +0000 (00:48 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 18 Jul 2006 00:48:51 +0000 (00:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5055 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/javascript/backend/circ/circ_lib.js
Open-ILS/src/perlmods/OpenILS/Application/Circ/ScriptBuilder.pm

index 19009b7..72ad052 100644 (file)
@@ -48,8 +48,7 @@ var groupList         = {};
 var groupIDList        = {};
 flattenGroupTree(groupTree);
 
-/* copy the org list into some other useful data structures */
-var orgList            = environment.orgList;
+
 
 
 
@@ -158,27 +157,8 @@ function getMARCItemType() {
        return (marcXMLDoc) ? extractFixedField(marcXMLDoc, 'Type') : "";
 }
 
-function __is_org_descendant( parent, child ) {
-       while( child = grep( function(x){ x.id == child.parent_ou }, orgList ) ) {
-               if (child[0].id == parent.id) return true;
-       }
-       return false;
-}
 
 function isOrgDescendent( parentName, childId ) {
-       var parent = grep( function(x){ x.shortname == parentName }, orgList );
-       var child = grep( function(x){ x.id == childId }, orgList );
-
-       if (parent) parent = parent[0];
-       if (child) child = child[0];
-
-       if (!child || !parent) return false;
-       if (child.id == parent.id) return true;
-
-       return __is_org_descendant( parent, child );
-}
-
-function old_isOrgDescendent( parentName, childId ) {
        var key = scratchKey();
        __OILS_FUNC_isOrgDescendent(scratchPad(key), parentName, childId);
        var val = getScratch(key);
index 28b0d9e..1c9c42e 100644 (file)
@@ -83,27 +83,12 @@ sub build_runner {
        $runner->insert( "$evt.patronOverdueCount", $ctx->{patronOverdue}, 1 );
        $runner->insert( "$evt.patronFines", $ctx->{patronFines}, 1 );
 
-       $runner->insert("$evt.$_", $ctx->{_direct}->{$_}) for keys %{$ctx->{_direct}};
-
-       if(!$ORG_TREE) {
-               $ORG_TREE = $editor->search_actor_org_unit(
-                       [
-                               {"parent_ou" => undef },
-                               {
-                                       flesh                           => 2,
-                                       flesh_fields    => { aou =>  ['children'] },
-                                       order_by                        => { aou => 'name'}
-                               }
-                       ]
-               )->[0];
-               flatten_org_tree($ORG_TREE);
-       }
-       #insert_org_methods( $editor, $ctx );
-
-       $runner->insert( "$evt.orgList", $ORG_TREE, 1 );
+       $runner->insert("$evt.$_", $ctx->{_direct}->{$_}, 1) for keys %{$ctx->{_direct}};
 
        $ctx->{runner} = $runner;
 
+       insert_org_methods( $editor, $ctx );
+
        return $runner;
 }