[open-ils-commits] r8485 - in branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb: controllers/acq lib/acq

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jan 23 14:51:12 EST 2008


Author: erickson
Date: 2008-01-23 14:24:35 -0500 (Wed, 23 Jan 2008)
New Revision: 8485

Modified:
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py
   branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/fund.py
Log:
implemented baseline my-funds interface

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py	2008-01-23 19:14:40 UTC (rev 8484)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py	2008-01-23 19:24:35 UTC (rev 8485)
@@ -32,6 +32,7 @@
 
         self.currency_types = ContextItem()
         self.fund = ContextItem()
+        self.fund_list = ContextItem()
         self.fund_name = ContextItem(cgi_name='acq.fn')
         self.fund_currency_type = ContextItem(cgi_name='acq.fc')
         self.fund_owner = ContextItem(cgi_name='acq.fo')

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py	2008-01-23 19:14:40 UTC (rev 8484)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py	2008-01-23 19:24:35 UTC (rev 8485)
@@ -17,7 +17,13 @@
         return r.render('acq/financial/view_fund.html')
 
     def list(self):
-        pass
+        r = RequestMgr()
+        fund_mgr = oilsweb.lib.acq.fund.FundMgr(r)
+        r.ctx.acq.fund_list = fund_mgr.retrieve_org_funds()
+        for f in r.ctx.acq.fund_list:
+            f.owner(oils.org.OrgUtil.get_org_unit(f.owner()))
+        return r.render('acq/financial/list_funds.html')
+            
 
     def create(self):
         r = RequestMgr()

Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/fund.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/fund.py	2008-01-23 19:14:40 UTC (rev 8484)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/fund.py	2008-01-23 19:24:35 UTC (rev 8485)
@@ -1,5 +1,5 @@
 import osrf.ses, osrf.net_obj
-import oils.const, oils.utils.utils, oils.event
+import oils.const, oils.utils.utils, oils.event, oils.org
 
 class FundMgr(object):
     ''' Fund utility class '''
@@ -15,12 +15,22 @@
         return types
 
     def retrieve(self, fund_id):
-        status = self.ses.request(
+        fund = self.ses.request(
             'open-ils.acq.fund.retrieve', 
             self.request_mgr.ctx.core.authtoken, fund_id).recv().content()
-        oils.event.Event.parse_and_raise(status)
-        return status
+        oils.event.Event.parse_and_raise(fund)
+        return fund
 
+    def retrieve_org_funds(self):
+        funds = self.ses.request(
+            'open-ils.acq.fund.org.retrieve', 
+            self.request_mgr.ctx.core.authtoken, 
+            self.request_mgr.ctx.core.workstation.owning_lib(),
+            {"full_path":1}).recv().content()
+        oils.event.Event.parse_and_raise(funds)
+        return funds
+
+
     def create_fund(self, fund):
         fund_id = self.ses.request(
             'open-ils.acq.fund.create', 



More information about the open-ils-commits mailing list