From: erickson Date: Wed, 5 Mar 2008 17:10:07 +0000 (+0000) Subject: updated picklist and financial controllers and templates to match new DB models.... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=28986aac1ecfdf10feeda97b3011d682dab1398d;p=Evergreen.git updated picklist and financial controllers and templates to match new DB models. repaired some other odds and ends bugs. moved from fund_source to funding_source for consistency git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@8867 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/oilsweb/oilsweb/config/middleware.py b/Open-ILS/web/oilsweb/oilsweb/config/middleware.py index fa98dec9f4..e413da1919 100644 --- a/Open-ILS/web/oilsweb/oilsweb/config/middleware.py +++ b/Open-ILS/web/oilsweb/oilsweb/config/middleware.py @@ -54,4 +54,9 @@ def make_app(global_conf, full_stack=True, **app_conf): javascripts_app = StaticJavascripts() static_app = StaticURLParser(config['pylons.paths']['static_files']) app = Cascade([static_app, javascripts_app, app]) + +# import oilsweb.middleware.xmllint +# app = oilsweb.middleware.xmllint.XMLLintMiddleware(app) + return app + diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py index 38f6344605..4baca915dc 100644 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py @@ -28,9 +28,9 @@ class AcqContext(SubContext): self.picklist = ContextItem() # picklist object self.picklist_list = ContextItem() # list of picklist objects self.picklist_id_list = ContextItem(cgi_name='acq.plil', multi=True) # list of picklist IDs - self.picklist_entry = ContextItem() # picklist_entry object + self.lineitem = ContextItem() # lineitem object self.picklist_name = ContextItem(cgi_name='acq.pln') - self.picklist_entry_id_list = ContextItem(cgi_name='acq.pleil', multi=True) + self.lineitem_id_list = ContextItem(cgi_name='acq.pleil', multi=True) self.picklist_action = ContextItem(cgi_name='acq.pla') self.picklist_source_id = ContextItem(cgi_name='acq.plsi') self.picklist_dest_id = ContextItem(cgi_name='acq.pldi') @@ -46,14 +46,14 @@ class AcqContext(SubContext): self.fund_currency_type = ContextItem(cgi_name='acq.fc') self.fund_summary = ContextItem() - self.fund_source = ContextItem() - self.fund_source_id = ContextItem(cgi_name='acq.fsi') - self.fund_source_list = ContextItem() - self.fund_source_name = ContextItem(cgi_name='acq.fsn') - self.fund_source_currency_type = ContextItem(cgi_name='acq.fsc') - self.fund_source_owner = ContextItem(cgi_name='acq.fso') - self.fund_source_credit_amount = ContextItem(cgi_name='acq.fsca') - self.fund_source_credit_note = ContextItem(cgi_name='acq.fscn') + self.funding_source = ContextItem() + self.funding_source_id = ContextItem(cgi_name='acq.fsi') + self.funding_source_list = ContextItem() + self.funding_source_name = ContextItem(cgi_name='acq.fsn') + self.funding_source_currency_type = ContextItem(cgi_name='acq.fsc') + self.funding_source_owner = ContextItem(cgi_name='acq.fso') + self.funding_source_credit_amount = ContextItem(cgi_name='acq.fsca') + self.funding_source_credit_note = ContextItem(cgi_name='acq.fscn') self.fund_allocation = ContextItem() self.fund_allocation_list = ContextItem() @@ -77,12 +77,7 @@ class AcqContext(SubContext): self.po_li = ContextItem() self.po_li_sum = ContextItem() - # ------------------------------------------------------------- - # utility functions - self.find_entry_attr = ContextItem( - default_value=oilsweb.lib.acq.picklist.PicklistMgr.find_entry_attr) - - self.picklist_entry_marc_html = ContextItem() + self.lineitem_marc_html = ContextItem() def postinit(self): self.prefix.value = "%s/acq" % Context.get_context().core.prefix.value diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py index 10837074ba..2c2d705e23 100644 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py @@ -97,7 +97,7 @@ class FundController(BaseController): Event.parse_and_raise(source_list) r.ctx.acq.fund.value = fund - r.ctx.acq.fund_source_list.value = source_list + r.ctx.acq.funding_source_list.value = source_list return r.render('acq/financial/create_fund_allocation.html') def _allocate(self, r, ses): diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund_source.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund_source.py deleted file mode 100644 index 9d7d913e6b..0000000000 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund_source.py +++ /dev/null @@ -1,93 +0,0 @@ -from oilsweb.lib.base import * -import pylons -from oilsweb.lib.request import RequestMgr -import oilsweb.lib.acq.fund -import osrf.net_obj -import oils.const -from osrf.ses import ClientSession -from oils.event import Event -from oils.org import OrgUtil - - -class FundSourceController(BaseController): - - def view(self, **kwargs): - r = RequestMgr() - ses = ClientSession(oils.const.OILS_APP_ACQ) - r.ctx.core.org_tree.value = OrgUtil.fetch_org_tree() - - source = ses.request( - 'open-ils.acq.funding_source.retrieve', - r.ctx.core.authtoken.value, kwargs.get('id'), {"flesh_summary":1}).recv().content() - Event.parse_and_raise(source) - - source.owner(OrgUtil.get_org_unit(source.owner())) # flesh the owner - r.ctx.acq.funding_source.value = source - return r.render('acq/financial/view_funding_source.html') - - def list(self): - r = RequestMgr() - ses = ClientSession(oils.const.OILS_APP_ACQ) - - sources = ses.request( - 'open-ils.acq.funding_source.org.retrieve', - r.ctx.core.authtoken.value, None, {"flesh_summary":1}).recv().content() - - Event.parse_and_raise(sources) - r.ctx.acq.funding_source_list.value = sources - - for source in sources: - source.owner(OrgUtil.get_org_unit(source.owner())) - return r.render('acq/financial/list_funding_sources.html') - - - def create(self): - r = RequestMgr() - fund_mgr = oilsweb.lib.acq.fund.FundMgr(r) - - if r.ctx.acq.funding_source_name.value: - source = osrf.net_obj.NetworkObject.acqfs() - source.name(r.ctx.acq.funding_source_name.value) - source.owner(r.ctx.acq.funding_source_owner.value) - source.currency_type(r.ctx.acq.funding_source_currency_type.value) - source_id = fund_mgr.create_funding_source(source) - return redirect_to(controller='acq/funding_source', action='view', id=source_id) - - perm_orgs = ClientSession.atomic_request( - 'open-ils.actor', - 'open-ils.actor.user.work_perm.highest_org_set', - r.ctx.core.authtoken.value, 'CREATE_FUNDING_SOURCE'); - - if len(perm_orgs) == 0: - return _("Insufficient Permissions") # XXX Return a perm failure template - - r.ctx.core.perm_tree.value['CREATE_FUNDING_SOURCE'] = OrgUtil.get_union_tree(perm_orgs) - r.ctx.core.high_perm_orgs.value['CREATE_FUNDING_SOURCE'] = perm_orgs - r.ctx.acq.currency_types.value = fund_mgr.fetch_currency_types() - return r.render('acq/financial/create_funding_source.html') - - - def create_credit(self): - r = RequestMgr() - ses = ClientSession(oils.const.OILS_APP_ACQ) - - if r.ctx.acq.funding_source_credit_amount.value: - - credit = osrf.net_obj.NetworkObject.acqfscred() - credit.funding_source(r.ctx.acq.funding_source_id.value) - credit.amount(r.ctx.acq.funding_source_credit_amount.value) - credit.note(r.ctx.acq.funding_source_credit_note.value) - - status = ses.request( - 'open-ils.acq.funding_source_credit.create', - r.ctx.core.authtoken.value, credit).recv().content() - status = Event.parse_and_raise(status) - return redirect_to(controller='acq/funding_source', action='view', id=r.ctx.acq.funding_source_id.value) - - source = ses.request('open-ils.acq.funding_source.retrieve', - r.ctx.core.authtoken.value, r.ctx.acq.funding_source_id.value, {"flesh_summary":1}).recv().content() - r.ctx.acq.funding_source.value = Event.parse_and_raise(source) - source.owner(OrgUtil.get_org_unit(source.owner())) - return r.render('acq/financial/create_funding_source_credit.html') - - diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/funding_source.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/funding_source.py new file mode 100644 index 0000000000..79de9b487c --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/funding_source.py @@ -0,0 +1,93 @@ +from oilsweb.lib.base import * +import pylons +from oilsweb.lib.request import RequestMgr +import oilsweb.lib.acq.fund +import osrf.net_obj +import oils.const +from osrf.ses import ClientSession +from oils.event import Event +from oils.org import OrgUtil + + +class FundingSourceController(BaseController): + + def view(self, **kwargs): + r = RequestMgr() + ses = ClientSession(oils.const.OILS_APP_ACQ) + r.ctx.core.org_tree.value = OrgUtil.fetch_org_tree() + + source = ses.request( + 'open-ils.acq.funding_source.retrieve', + r.ctx.core.authtoken.value, kwargs.get('id'), {"flesh_summary":1}).recv().content() + Event.parse_and_raise(source) + + source.owner(OrgUtil.get_org_unit(source.owner())) # flesh the owner + r.ctx.acq.funding_source.value = source + return r.render('acq/financial/view_funding_source.html') + + def list(self): + r = RequestMgr() + ses = ClientSession(oils.const.OILS_APP_ACQ) + + sources = ses.request( + 'open-ils.acq.funding_source.org.retrieve', + r.ctx.core.authtoken.value, None, {"flesh_summary":1}).recv().content() + + Event.parse_and_raise(sources) + r.ctx.acq.funding_source_list.value = sources + + for source in sources: + source.owner(OrgUtil.get_org_unit(source.owner())) + return r.render('acq/financial/list_funding_sources.html') + + + def create(self): + r = RequestMgr() + fund_mgr = oilsweb.lib.acq.fund.FundMgr(r) + + if r.ctx.acq.funding_source_name.value: + source = osrf.net_obj.NetworkObject.acqfs() + source.name(r.ctx.acq.funding_source_name.value) + source.owner(r.ctx.acq.funding_source_owner.value) + source.currency_type(r.ctx.acq.funding_source_currency_type.value) + source_id = fund_mgr.create_funding_source(source) + return redirect_to(controller='acq/funding_source', action='view', id=source_id) + + perm_orgs = ClientSession.atomic_request( + 'open-ils.actor', + 'open-ils.actor.user.work_perm.highest_org_set', + r.ctx.core.authtoken.value, 'CREATE_FUNDING_SOURCE'); + + if len(perm_orgs) == 0: + return _("Insufficient Permissions") # XXX Return a perm failure template + + r.ctx.core.perm_tree.value['CREATE_FUNDING_SOURCE'] = OrgUtil.get_union_tree(perm_orgs) + r.ctx.core.high_perm_orgs.value['CREATE_FUNDING_SOURCE'] = perm_orgs + r.ctx.acq.currency_types.value = fund_mgr.fetch_currency_types() + return r.render('acq/financial/create_funding_source.html') + + + def create_credit(self): + r = RequestMgr() + ses = ClientSession(oils.const.OILS_APP_ACQ) + + if r.ctx.acq.funding_source_credit_amount.value: + + credit = osrf.net_obj.NetworkObject.acqfscred() + credit.funding_source(r.ctx.acq.funding_source_id.value) + credit.amount(r.ctx.acq.funding_source_credit_amount.value) + credit.note(r.ctx.acq.funding_source_credit_note.value) + + status = ses.request( + 'open-ils.acq.funding_source_credit.create', + r.ctx.core.authtoken.value, credit).recv().content() + status = Event.parse_and_raise(status) + return redirect_to(controller='acq/funding_source', action='view', id=r.ctx.acq.funding_source_id.value) + + source = ses.request('open-ils.acq.funding_source.retrieve', + r.ctx.core.authtoken.value, r.ctx.acq.funding_source_id.value, {"flesh_summary":1}).recv().content() + r.ctx.acq.funding_source.value = Event.parse_and_raise(source) + source.owner(OrgUtil.get_org_unit(source.owner())) + return r.render('acq/financial/create_funding_source_credit.html') + + diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py index 6cdedb0141..ce9551e1cc 100644 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py @@ -17,7 +17,7 @@ class PicklistController(BaseController): r = RequestMgr() pl_manager = oilsweb.lib.acq.picklist.PicklistMgr(r, picklist_id=kwargs['id']) pl_manager.retrieve() - pl_manager.retrieve_entries(flesh_provider=True, offset=r.ctx.acq.offset.value, limit=r.ctx.acq.limit.value) + pl_manager.retrieve_lineitems(flesh_provider=True, offset=r.ctx.acq.offset.value, limit=r.ctx.acq.limit.value) r.ctx.acq.picklist.value = pl_manager.picklist r.ctx.acq.picklist_list.value = pl_manager.retrieve_list() return r.render('acq/picklist/view.html') @@ -35,16 +35,16 @@ class PicklistController(BaseController): return redirect_to(controller='acq/picklist', action='view', id=picklist_id) return r.render('acq/picklist/create.html') - def view_entry(self, **kwargs): + def view_lineitem(self, **kwargs): r = RequestMgr() pl_manager = oilsweb.lib.acq.picklist.PicklistMgr(r) - entry = pl_manager.retrieve_entry(kwargs.get('id'), flesh=1, flesh_provider=True) - pl_manager.id = entry.picklist() + lineitem = pl_manager.retrieve_lineitem(kwargs.get('id'), flesh=1, flesh_provider=True) + pl_manager.id = lineitem.picklist() picklist = pl_manager.retrieve() r.ctx.acq.picklist.value = pl_manager.picklist - r.ctx.acq.picklist_entry.value = entry - r.ctx.acq.picklist_entry_marc_html.value = oilsweb.lib.bib.marc_to_html(entry.marc()) - return r.render('acq/picklist/view_entry.html') + r.ctx.acq.lineitem.value = lineitem + r.ctx.acq.lineitem_marc_html.value = oilsweb.lib.bib.marc_to_html(lineitem.marc()) + return r.render('acq/picklist/view_lineitem.html') def list(self): r = RequestMgr() @@ -86,13 +86,13 @@ class PicklistController(BaseController): return redirect_to(controller='acq/picklist', action='list') - def delete_entry(self, **kwargs): + def delete_lineitem(self, **kwargs): r = RequestMgr() pl_manager = oilsweb.lib.acq.picklist.PicklistMgr(r) - entry_id = kwargs['id'] - entry = pl_manager.retrieve_entry(entry_id) - pl_manager.delete_entry(entry_id) - return redirect_to(controller='acq/picklist', action='view', id=entry.picklist()) + lineitem_id = kwargs['id'] + lineitem = pl_manager.retrieve_lineitem(lineitem_id) + pl_manager.delete_lineitem(lineitem_id) + return redirect_to(controller='acq/picklist', action='view', id=lineitem.picklist()) def update(self): r = RequestMgr() @@ -110,19 +110,19 @@ class PicklistController(BaseController): return page def _move_selected(self, r, ses): - ''' Moves the selected picklist entry's to the destination picklist ''' - for entry_id in r.ctx.acq.picklist_entry_id_list.value: + ''' Moves the selected picklist lineitem's to the destination picklist ''' + for lineitem_id in r.ctx.acq.lineitem_id_list.value: - entry = ses.request( - 'open-ils.acq.picklist_entry.retrieve', - r.ctx.core.authtoken.value, entry_id).recv().content() - entry = Event.parse_and_raise(entry) + lineitem = ses.request( + 'open-ils.acq.lineitem.retrieve', + r.ctx.core.authtoken.value, lineitem_id).recv().content() + lineitem = Event.parse_and_raise(lineitem) - entry.picklist(r.ctx.acq.picklist_dest_id.value) + lineitem.picklist(r.ctx.acq.picklist_dest_id.value) status = ses.request( - 'open-ils.acq.picklist_entry.update', - r.ctx.core.authtoken.value, entry).recv().content() + 'open-ils.acq.lineitem.update', + r.ctx.core.authtoken.value, lineitem).recv().content() Event.parse_and_raise(status) return redirect_to(controller='acq/picklist', action='view', id=r.ctx.acq.picklist_dest_id.value) diff --git a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/po.py b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/po.py index ec64558d9c..e64c27274c 100644 --- a/Open-ILS/web/oilsweb/oilsweb/controllers/acq/po.py +++ b/Open-ILS/web/oilsweb/oilsweb/controllers/acq/po.py @@ -64,7 +64,7 @@ class PoController(BaseController): plmgr = oilsweb.lib.acq.picklist.PicklistMgr(r, picklist_id=r.ctx.acq.picklist_source_id.value) plmgr.retrieve() - plmgr.retrieve_entries(idlist=1) + plmgr.retrieve_lineitems(idlist=1) for pl_item in plmgr.picklist.entries(): po_lineitem = osrf.net_obj.NetworkObject.acqpoli() diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/acq/fund.py b/Open-ILS/web/oilsweb/oilsweb/lib/acq/fund.py index af5a4c2801..f780c0a0a1 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/acq/fund.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/acq/fund.py @@ -36,14 +36,14 @@ class FundMgr(object): return fund_id - def retrieve_fund_source(self, source_id): + def retrieve_funding_source(self, source_id): source = self.ses.request( 'open-ils.acq.funding_source.retrieve', self.request_mgr.ctx.core.authtoken.value, source_id).recv().content() oils.event.Event.parse_and_raise(source) return source - def retrieve_org_fund_sources(self, options=None): + def retrieve_org_funding_sources(self, options=None): sources = self.ses.request( 'open-ils.acq.funding_source.org.retrieve', self.request_mgr.ctx.core.authtoken.value, None, options).recv().content() @@ -51,7 +51,7 @@ class FundMgr(object): return sources - def create_fund_source(self, source): + def create_funding_source(self, source): source_id = self.ses.request( 'open-ils.acq.funding_source.create', self.request_mgr.ctx.core.authtoken.value, source).recv().content() diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py b/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py index 2dc353990a..b9c14318fd 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py @@ -13,7 +13,7 @@ class PicklistMgr(object): def retrieve(self): picklist = self.ses.request( 'open-ils.acq.picklist.retrieve', - self.request_mgr.ctx.core.authtoken.value, self.id, {'flesh_entry_count':1, 'flesh_username':1}).recv().content() + self.request_mgr.ctx.core.authtoken.value, self.id, {'flesh_lineitem_count':1, 'flesh_username':1}).recv().content() oils.event.Event.parse_and_raise(picklist) self.picklist = picklist @@ -37,18 +37,18 @@ class PicklistMgr(object): oils.event.Event.parse_and_raise(status) return status - def delete_entry(self, entry_id): + def delete_lineitem(self, lineitem_id): status = self.ses.request( - 'open-ils.acq.picklist_entry.delete', - self.request_mgr.ctx.core.authtoken.value, entry_id).recv().content() + 'open-ils.acq.lineitem.delete', + self.request_mgr.ctx.core.authtoken.value, lineitem_id).recv().content() oils.event.Event.parse_and_raise(status) return status - def retrieve_entries(self, **kwargs): - # grab the picklist entries - entries = self.ses.request( - 'open-ils.acq.picklist_entry.picklist.retrieve', + def retrieve_lineitems(self, **kwargs): + # grab the lineitems + lineitems = self.ses.request( + 'open-ils.acq.lineitem.picklist.retrieve', self.request_mgr.ctx.core.authtoken.value, self.picklist.id(), { @@ -61,15 +61,15 @@ class PicklistMgr(object): ).recv().content() if kwargs.get('flesh_provider'): - for entry in entries: - if entry.provider(): + for lineitem in lineitems: + if lineitem.provider(): provider = self.ses.request( 'open-ils.acq.provider.retrieve', self.request_mgr.ctx.core.authtoken.value, - entry.provider()).recv().content() - entry.provider(provider) + lineitem.provider()).recv().content() + lineitem.provider(provider) - self.picklist.entries(entries) + self.picklist.entries(lineitems) def retrieve_list(self, all=False): ''' Returns my list of picklist objects ''' @@ -80,7 +80,7 @@ class PicklistMgr(object): list = self.ses.request(request, self.request_mgr.ctx.core.authtoken.value, - {'flesh_entry_count':1, 'flesh_username':1}).recv().content() + {'flesh_lineitem_count':1, 'flesh_username':1}).recv().content() oils.event.Event.parse_and_raise(list) usermgr = oilsweb.lib.user.User(self.request_mgr.ctx.core) @@ -97,21 +97,21 @@ class PicklistMgr(object): return list - def retrieve_entry(self, entry_id, **kwargs): + def retrieve_lineitem(self, lineitem_id, **kwargs): args = {'flesh': kwargs.get('flesh')} - entry = self.ses.request( - 'open-ils.acq.picklist_entry.retrieve', - self.request_mgr.ctx.core.authtoken.value, entry_id, args).recv().content() - oils.event.Event.parse_and_raise(entry) + lineitem = self.ses.request( + 'open-ils.acq.lineitem.retrieve', + self.request_mgr.ctx.core.authtoken.value, lineitem_id, args).recv().content() + oils.event.Event.parse_and_raise(lineitem) if kwargs.get('flesh_provider'): - if entry.provider(): + if lineitem.provider(): provider = self.ses.request( 'open-ils.acq.provider.retrieve', self.request_mgr.ctx.core.authtoken.value, - entry.provider()).recv().content() - entry.provider(provider) + lineitem.provider()).recv().content() + lineitem.provider(provider) - return entry + return lineitem def create_or_replace(self, pl_name): @@ -134,18 +134,18 @@ class PicklistMgr(object): return picklist - def create_entry(self, entry): + def create_lineitem(self, lineitem): status = self.ses.request( - 'open-ils.acq.picklist_entry.create', - self.request_mgr.ctx.core.authtoken.value, entry).recv().content() + 'open-ils.acq.lineitem.create', + self.request_mgr.ctx.core.authtoken.value, lineitem).recv().content() oils.event.Event.parse_and_raise(status) return status @staticmethod - def find_entry_attr(entry, attr_name, attr_type='picklist_marc_attr_definition'): - for entry_attr in entry.attributes(): - if entry_attr.attr_type() == attr_type and entry_attr.attr_name() == attr_name: - return entry_attr.attr_value() + def find_lineitem_attr(lineitem, attr_name, attr_type='lineitem_marc_attr_definition'): + for lineitem_attr in lineitem.attributes(): + if lineitem_attr.attr_type() == attr_type and lineitem_attr.attr_name() == attr_name: + return lineitem_attr.attr_value() return '' diff --git a/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py b/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py index 3421010a2a..8f9601f6a4 100644 --- a/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py +++ b/Open-ILS/web/oilsweb/oilsweb/lib/acq/search.py @@ -29,12 +29,12 @@ def multi_search(request_mgr, search): res = resp.content() for record in res['records']: - entry = osrf.net_obj.NetworkObject.acqple() - entry.picklist(picklist_id) - entry.source_label(res['service']) - entry.marc(record['marcxml']) - entry.eg_bib_id(record.get('bibid')) - pl_manager.create_entry(entry) + lineitem = osrf.net_obj.NetworkObject.jub() + lineitem.picklist(picklist_id) + lineitem.source_label(res['service']) + lineitem.marc(record['marcxml']) + lineitem.eg_bib_id(record.get('bibid')) + pl_manager.create_lineitem(lineitem) return picklist_id @@ -56,9 +56,12 @@ def compile_multi_search(request_mgr): search['password'].append("") # XXX config values? in-db? # collect the search classes + import oilsweb.middleware.hilite + oilsweb.middleware.hilite.terms = [] for cls in request_mgr.ctx.acq.search_class.value: if request_mgr.request.params[cls]: search['search'][cls] = request_mgr.request.params[cls] + oilsweb.middleware.hilite.terms.append(request_mgr.request.params[cls]) return search diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css index 599e7c0f6f..4fea54adfa 100644 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css @@ -76,14 +76,14 @@ .oils-acq-po-li-detail-row {} /* picklist entry page */ -#oils-acq-picklist-entry-header { padding: 4px; margin-bottom: 20px; } -#oils-acq-picklist-entry-summary {} -#oils-acq-picklist-entry-summary td {padding: 2px;} -.oils-acq-picklist-entry-attr {} -.oils-acq-picklist-entry-attr-type {} -.oils-acq-picklist-entry-attr-name {} -.oils-acq-picklist-entry-attr-value {} -#oils-acq-picklist-entry-marc-block { margin-top: 10px; padding: 6px; } +#oils-acq-lineitem-header { padding: 4px; margin-bottom: 20px; } +#oils-acq-lineitem-summary {} +#oils-acq-lineitem-summary td {padding: 2px;} +.oils-acq-lineitem-attr {} +.oils-acq-lineitem-attr-type {} +.oils-acq-lineitem-attr-name {} +.oils-acq-lineitem-attr-value {} +#oils-acq-lineitem-marc-block { margin-top: 10px; padding: 6px; } diff --git a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css index 8170127217..62557cb3e2 100644 --- a/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css +++ b/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css @@ -18,14 +18,14 @@ /* picklist display */ #oils-acq-picklist-table thead tr { border: 1px solid #A1A1A1; } #oils-acq-picklist-header {border: 1px solid #85C777;} -#oils-acq-picklist-entry-header {border: 1px solid #85C777;} +#oils-acq-lineitem-header {border: 1px solid #85C777;} #oils-acq-picklist-name { font-weight: bold; font-style: italic; } .oils-acq-picklist-attributes { font-size: 90%; margin-left: 15px;} -.oils-acq-picklist-entry-attributes { font-size: 90%; margin-left: 15px;} +.oils-acq-lineitem-attributes { font-size: 90%; margin-left: 15px;} .oils-acq-picklist-records-phys_desc-row { border-bottom: 1px solid #6BA160; } .oils-acq-picklist-picklist-td { border-style: solid; border-color: #A1A1A1; border-width: 0px 1px 0px 1px; } .oils-acq-picklist-records-service-td { font-size: 85%; } -.oils-acq-picklist-entry-delete-link { font-size: 85%; } +.oils-acq-lineitem-delete-link { font-size: 85%; } #oils-acq-picklist-header-subtable tr { border: none; } /* po display */ @@ -47,4 +47,4 @@ /* entry display */ -#oils-acq-picklist-entry-marc-block { border: 1px solid #6BA160; } +#oils-acq-lineitem-marc-block { border: 1px solid #6BA160; } diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_fund.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_fund.html index 546c20b914..c90ebce37b 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_fund.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_fund.html @@ -21,8 +21,8 @@ ${widget.org_select( c.oils.acq.fund_org.cgi_name, - c.oils.core.perm_tree.value['ADMIN_FUND'], c.oils.core.workstation.id(), - OrgUtil.get_min_depth.value(c.oils.core.high_perm_orgs['ADMIN_FUND']))} + c.oils.core.perm_tree.value['ADMIN_FUND'], c.oils.core.workstation.value.id(), + OrgUtil.get_min_depth(c.oils.core.high_perm_orgs.value['ADMIN_FUND']))} diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_fund_allocation.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_fund_allocation.html index a6e36d391a..be15a79058 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_fund_allocation.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_fund_allocation.html @@ -20,7 +20,7 @@ ${_('Funding Source')} - - - - ${_('Funding Source Owner')} - - ${widget.org_select( - c.oils.acq.fund_source_owner.cgi_name, - c.oils.core.perm_tree.value['CREATE_FUNDING_SOURCE'], c.oils.core.workstation.value.id(), - OrgUtil.get_min_depth(c.oils.core.high_perm_orgs.value['CREATE_FUNDING_SOURCE']))} - - - - ${_('Funding Source Currency Type')} - - - - - - - - - - - - - diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_funding_source.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_funding_source.html new file mode 100644 index 0000000000..bb70ae0ce7 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_funding_source.html @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- + +<%inherit file='../base.html'/> +<%namespace file='../../common/widgets.html' name='widget'/> +<%def name="page_title()">${_('Create Funding Source')} +<%def name="block_content()"> + +<% from oils.org import OrgUtil %> + +
+ + + + + + + + + + + + + + + + + + +
${_('Funding Source Name')} + +
${_('Funding Source Owner')} + ${widget.org_select( + c.oils.acq.funding_source_owner.cgi_name, + c.oils.core.perm_tree.value['CREATE_FUNDING_SOURCE'], c.oils.core.workstation.value.id(), + OrgUtil.get_min_depth(c.oils.core.high_perm_orgs.value['CREATE_FUNDING_SOURCE']))} +
${_('Funding Source Currency Type')} + +
+ +
+
+ diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_funding_source_credit.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_funding_source_credit.html index a2ca324136..366cba799c 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_funding_source_credit.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/create_funding_source_credit.html @@ -7,10 +7,10 @@ <%def name="page_title()">${_('Create Funding Source Credit')} <%def name="block_content()"> -<% source = c.oils.acq.fund_source.value %> +<% source = c.oils.acq.funding_source.value %> -
- + + @@ -22,12 +22,12 @@ - + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_fund_sources.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_fund_sources.html deleted file mode 100644 index 410ccb1e0c..0000000000 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_fund_sources.html +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -<%inherit file='../base.html'/> -<%namespace file='../../common/widgets.html' name='widget'/> -<%def name="page_title()">${_('Funding Sources')} -<%def name="block_content()"> - -
-
${_('Funding Sources')}
- -
- - -
${_('Amount')}
${_('Note')} - +
- - - - - - - - - - % for source in c.oils.acq.fund_source_list.value: - - - - - - - %endfor - -
${_('Funding Source Name')}${_('Funding Source Owner')}${_('Funding Source Currency Type')}${_('Funding Source Balance')}
${source.name()}${source.owner().name()}${source.currency_type()}${source.summary()['balance']}
- diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html new file mode 100644 index 0000000000..e496c7599e --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/list_funding_sources.html @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +<%inherit file='../base.html'/> +<%namespace file='../../common/widgets.html' name='widget'/> +<%def name="page_title()">${_('Funding Sources')} +<%def name="block_content()"> + +
+
${_('Funding Sources')}
+ +
+ + + + + + + + + + + + + % for source in c.oils.acq.funding_source_list.value: + + + + + + + %endfor + +
${_('Funding Source Name')}${_('Funding Source Owner')}${_('Funding Source Currency Type')}${_('Funding Source Balance')}
${source.name()}${source.owner().name()}${source.currency_type()}${source.summary()['balance']}
+ diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/navigate.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/navigate.html index aa5e2b3640..bd39c488a9 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/navigate.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/navigate.html @@ -3,7 +3,7 @@ ${_('Funds')}
${_('Providers')} diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_fund_source.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_fund_source.html deleted file mode 100644 index 705f2ce0fc..0000000000 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_fund_source.html +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -<%inherit file='../base.html'/> -<%namespace file='../../common/widgets.html' name='widget'/> -<%def name="page_title()">${_('View Funding Source')} -<%def name="block_content()"> - -<% source = c.oils.acq.fund_source.value %> - -
-
${source.name()}
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
${_('Funding Source Owner')}${source.owner().name()}
${_('Funding Source Currency Type')}${source.currency_type()}
${_('Funding Source Credit Total')}${source.summary()['credit_total']}
${_('Funding Source Allocation Total')}${source.summary()['allocation_total']}
${_('Funding Source Balance')}${source.summary()['balance']}
- diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_source.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_source.html new file mode 100644 index 0000000000..2a19d9f013 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_source.html @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +<%inherit file='../base.html'/> +<%namespace file='../../common/widgets.html' name='widget'/> +<%def name="page_title()">${_('View Funding Source')} +<%def name="block_content()"> + +<% source = c.oils.acq.funding_source.value %> + +
+
${source.name()}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + +
${_('Funding Source Owner')}${source.owner().name()}
${_('Funding Source Currency Type')}${source.currency_type()}
${_('Funding Source Credit Total')}${source.summary()['credit_total']}
${_('Funding Source Allocation Total')}${source.summary()['allocation_total']}
${_('Funding Source Balance')}${source.summary()['balance']}
+ diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_sources.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_sources.html deleted file mode 100644 index 2a19d9f013..0000000000 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/financial/view_funding_sources.html +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -<%inherit file='../base.html'/> -<%namespace file='../../common/widgets.html' name='widget'/> -<%def name="page_title()">${_('View Funding Source')} -<%def name="block_content()"> - -<% source = c.oils.acq.funding_source.value %> - -
-
${source.name()}
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
${_('Funding Source Owner')}${source.owner().name()}
${_('Funding Source Currency Type')}${source.currency_type()}
${_('Funding Source Credit Total')}${source.summary()['credit_total']}
${_('Funding Source Allocation Total')}${source.summary()['allocation_total']}
${_('Funding Source Balance')}${source.summary()['balance']}
- diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/lineitem_summary.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/lineitem_summary.html new file mode 100644 index 0000000000..168c9e87b4 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/lineitem_summary.html @@ -0,0 +1,20 @@ +
+ ${_('Picklist Entry')} +
+ <% + provider = c.oils.acq.lineitem.value.provider() or '' + if provider: provider.name() + meta = _("Source %(data)s") % {"data":c.oils.acq.lineitem.value.source_label()} + meta2 = _("Provider %(data)s") % {"data":provider} + meta3 = _("Create date %(data)s") % {"data":c.oils.acq.lineitem.value.create_time()} + meta4 = _("Last update time %(data)s") % {"data":c.oils.acq.lineitem.value.edit_time()} + %> +
${meta}
+
${meta2}
+
${meta3}
+
${meta4}
+
+
+ + + diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/picklist_entry_summary.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/picklist_entry_summary.html deleted file mode 100644 index be73cefaa2..0000000000 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/picklist_entry_summary.html +++ /dev/null @@ -1,20 +0,0 @@ -
- ${_('Picklist Entry')} -
- <% - provider = c.oils.acq.picklist_entry.value.provider() or '' - if provider: provider.name() - meta = _("Source %(data)s") % {"data":c.oils.acq.picklist_entry.value.source_label()} - meta2 = _("Provider %(data)s") % {"data":provider} - meta3 = _("Create date %(data)s") % {"data":c.oils.acq.picklist_entry.value.create_time()} - meta4 = _("Last update time %(data)s") % {"data":c.oils.acq.picklist_entry.value.edit_time()} - %> -
${meta}
-
${meta2}
-
${meta3}
-
${meta4}
-
-
- - - diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html index 6f944e676d..909883c2a3 100644 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html @@ -44,32 +44,32 @@ - % for entry in c.oils.acq.picklist.value.entries(): + % for lineitem in c.oils.acq.picklist.value.entries(): + src='${c.oils.core.ac_prefix.value}/jacket/small/${oilsweb.lib.bib.scrub_isbn(PicklistMgr.find_lineitem_attr(lineitem, "isbn"))}'/> - ${PicklistMgr.find_entry_attr(entry, "title")} + ${h.util.html_escape(PicklistMgr.find_lineitem_attr(lineitem, "title"))} - % if entry.provider(): - ${entry.provider().name()} + % if lineitem.provider(): + ${lineitem.provider().name()} % endif - + - ${PicklistMgr.find_entry_attr(entry, "author")} + ${PicklistMgr.find_lineitem_attr(lineitem, "author")} - ${PicklistMgr.find_entry_attr(entry, "isbn")} | - ${PicklistMgr.find_entry_attr(entry, "pubdate")} | - ${PicklistMgr.find_entry_attr(entry, "pagination")} - ${_('Delete')} + ${PicklistMgr.find_lineitem_attr(lineitem, "isbn")} | + ${PicklistMgr.find_lineitem_attr(lineitem, "pubdate")} | + ${PicklistMgr.find_lineitem_attr(lineitem, "pagination")} + ${_('Delete')} % endfor diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_entry.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_entry.html deleted file mode 100644 index 86265171d3..0000000000 --- a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_entry.html +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -<%inherit file='../base.html'/> -<%def name="page_title()">${_('Evergreen Picklist Entry')} -<%def name="block_content()"> - -<%include file='picklist_summary.html'/> -<%include file='picklist_entry_summary.html'/> - - % for attr in c.oils.acq.picklist_entry.value.attributes(): - - - - - % endfor -
- ${attr.attr_name()} - - ${attr.attr_value()} -
- -
-
- ${unicode(c.oils.acq.picklist_entry_marc_html.value, 'utf-8')} -
-
- - - diff --git a/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_lineitem.html b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_lineitem.html new file mode 100644 index 0000000000..4511f03896 --- /dev/null +++ b/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_lineitem.html @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +<%inherit file='../base.html'/> +<%def name="page_title()">${_('Evergreen Picklist Entry')} +<%def name="block_content()"> + +<%include file='picklist_summary.html'/> +<%include file='lineitem_summary.html'/> + + % for attr in c.oils.acq.lineitem.value.attributes(): + + + + + % endfor +
+ ${attr.attr_name()} + + ${attr.attr_value()} +
+ +
+
+ ${unicode(c.oils.acq.lineitem_marc_html.value, 'utf-8')} +
+
+ + +