[open-ils-commits] r8694 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
controllers/acq lib lib/acq public/oils/media/css/skin/default
public/oils/media/css/theme/default
templates/oils/default/acq/picklist
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Feb 7 17:33:53 EST 2008
Author: erickson
Date: 2008-02-07 17:05:14 -0500 (Thu, 07 Feb 2008)
New Revision: 8694
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/controllers/acq/picklist.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/user.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/navigate.html
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_list.html
Log:
added simple picklist create interface, repaired some bugs in the fund retrievel/update code
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-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py 2008-02-07 22:05:14 UTC (rev 8694)
@@ -27,8 +27,9 @@
self.picklist = ContextItem() # picklist object
self.picklist_list = ContextItem() # list of picklist objects
- self.picklist_id_list = ContextItem() # list of picklist objects
+ self.picklist_id_list = ContextItem(cgi_name='acq.pli') # list of picklist IDs
self.picklist_entry = ContextItem() # picklist_entry object
+ self.picklist_name = ContextItem(cgi_name='acq.pln')
self.currency_types = ContextItem()
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-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/fund.py 2008-02-07 22:05:14 UTC (rev 8694)
@@ -72,12 +72,12 @@
if r.ctx.acq.fund_allocation_source:
return self._allocate(r, ses)
- fund = self._retrieve_fund(r, ses, fund_id)
+ fund = self._retrieve_fund(r, ses, r.ctx.acq.fund_id)
- source_list = self.ses.request(
+ source_list = ses.request(
'open-ils.acq.funding_source.org.retrieve',
- self.request_mgr.ctx.core.authtoken, None, 'MANAGE_FUNDING_SOURCE').recv().content()
- oils.event.Event.parse_and_raise(sources)
+ r.ctx.core.authtoken, None, 'MANAGE_FUNDING_SOURCE').recv().content()
+ oils.event.Event.parse_and_raise(source_list)
r.ctx.acq.fund = fund
r.ctx.acq.fund_source_list = source_list
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py 2008-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py 2008-02-07 22:05:14 UTC (rev 8694)
@@ -17,6 +17,19 @@
r.ctx.acq.picklist = pl_manager.picklist
return r.render('acq/picklist/view.html')
+ def create(self, **kwargs):
+ r = RequestMgr()
+ if r.ctx.acq.picklist_name:
+ picklist = osrf.net_obj.NetworkObject.acqpl()
+ picklist.name(r.ctx.acq.picklist_name)
+ picklist.owner(r.ctx.core.user.id())
+ picklist_id = osrf.ses.ClientSession.atomic_request(
+ oils.const.OILS_APP_ACQ,
+ 'open-ils.acq.picklist.create', r.ctx.core.authtoken, picklist)
+ oils.event.Event.parse_and_raise(picklist_id)
+ return redirect_to(controller='acq/picklist', action='view', id=picklist_id)
+ return r.render('acq/picklist/create.html')
+
def view_entry(self, **kwargs):
r = RequestMgr()
pl_manager = oilsweb.lib.acq.picklist.PicklistMgr(r)
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py 2008-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/acq/picklist.py 2008-02-07 22:05:14 UTC (rev 8694)
@@ -1,5 +1,7 @@
import osrf.cache, osrf.json, osrf.ses, osrf.net_obj
import oils.const, oils.utils.utils, oils.event
+import oilsweb.lib.user
+import mx.DateTime.ISO
class PicklistMgr(object):
def __init__(self, request_mgr, **kwargs):
@@ -16,6 +18,17 @@
oils.event.Event.parse_and_raise(picklist)
self.picklist = picklist
+ usermgr = oilsweb.lib.user.User(self.request_mgr.ctx.core)
+
+ picklist.create_time(
+ mx.DateTime.ISO.ParseAny(
+ picklist.create_time()).strftime(usermgr.get_date_format()))
+
+ picklist.edit_time(
+ mx.DateTime.ISO.ParseAny(
+ picklist.edit_time()).strftime(usermgr.get_date_format()))
+
+
def delete(self, picklist_id=None):
picklist_id = picklist_id or self.id
status = self.ses.request(
@@ -63,6 +76,18 @@
'open-ils.acq.picklist.user.retrieve',
self.request_mgr.ctx.core.authtoken).recv().content()
oils.event.Event.parse_and_raise(list)
+
+ usermgr = oilsweb.lib.user.User(self.request_mgr.ctx.core)
+
+ for picklist in list:
+ picklist.create_time(
+ mx.DateTime.ISO.ParseAny(
+ picklist.create_time()).strftime(usermgr.get_date_format()))
+
+ picklist.edit_time(
+ mx.DateTime.ISO.ParseAny(
+ picklist.edit_time()).strftime(usermgr.get_date_format()))
+
return list
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/user.py
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/user.py 2008-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/lib/user.py 2008-02-07 22:05:14 UTC (rev 8694)
@@ -1,4 +1,4 @@
-import osrf.ses, oils.utils.csedit, pylons.config, oils.utils.utils, oils.event
+import osrf.ses, oils.utils.csedit, pylons.config, oils.utils.utils, oils.event, oils.const
from gettext import gettext as _
class AuthException(Exception):
@@ -73,4 +73,24 @@
self.ctx.perm_tree[perm] = oils.org.OrgUtil.get_union_tree(perm_orgs)
return self.ctx.perm_tree[perm]
+ def fetch_user_setting(self, setting):
+ setting = osrf.ses.ClientSession.atomic_request(
+ oils.const.OILS_APP_ACTOR,
+ 'open-ils.actor.patron.settings.retrieve',
+ self.ctx.authtoken, self.ctx.user.id(), setting)
+ oils.event.Event.parse_and_raise(setting)
+ return setting
+ def get_date_format(self):
+ setting = self.fetch_user_setting('common.date_format')
+ if not setting:
+ return '%Y-%m-%d'
+ return setting
+
+ def get_datetime_format(self):
+ setting = self.fetch_user_setting('common.datetime_format')
+ if not setting:
+ return '%Y-%m-%d %H:%M'
+ return setting
+
+
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css 2008-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css 2008-02-07 22:05:14 UTC (rev 8694)
@@ -36,6 +36,9 @@
.oils-acq-picklist-records-author-row td { padding-left: 30px; }
.oils-acq-picklist-records-phys_desc-row td { padding-left: 30px; }
.oils-acq-picklist-records-phys_desc-row {}
+#oils-acq-picklist-list-header { margin: 10px; width: 98%;}
+#oils-acq-picklist-list-header-label { float: left; }
+#oils-acq-picklist-list-header-create { float: right; }
/* picklist entry page */
#oils-acq-picklist-entry-header { padding: 4px; margin-bottom: 20px; }
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css 2008-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css 2008-02-07 22:05:14 UTC (rev 8694)
@@ -26,6 +26,10 @@
.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-picklist-list-header {border-bottom: 1px solid #6BA160;}
+#oils-acq-picklist-list-header-label { font-weight: bold; font-size: 110%; }
+#oils-acq-picklist-list-header-create { font-weight: bold; }
+
/* entry display */
#oils-acq-picklist-entry-marc-block { border: 1px solid #6BA160; }
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/navigate.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/navigate.html 2008-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/navigate.html 2008-02-07 22:05:14 UTC (rev 8694)
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
<div class='oils-base-navigate-item'>
- <a href='${c.oils.core.prefix}/acq/picklist/list'>${_('My Picklists')}</a>
+ <a href='${c.oils.core.prefix}/acq/picklist/list'>${_('Manage')}</a>
</div>
<div class='oils-base-navigate-item'>
- <a href='${c.oils.core.prefix}/acq/picklist/search'>${_('Bib Search')}</a>
+ <a href='${c.oils.core.prefix}/acq/picklist/search'>${_('Title Search')}</a>
</div>
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html 2008-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html 2008-02-07 22:05:14 UTC (rev 8694)
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
<%inherit file='../base.html'/>
-<%def name="page_title()">${_('Evergreen ACQ Picklist')}</%def>
+<%def name="page_title()">${_('Picklist')}</%def>
<%def name="block_content()">
<%include file='picklist_summary.html'/>
@@ -41,9 +41,9 @@
${entry.provider().name()}
% endif
</td>
+ <td><input type='checkbox' name='${c.oils.acq.picklist_id_list_.cgi_name}' value='${c.oils.acq.picklist.id()}'/></td>
</tr>
- </tr>
<tr class='oils-acq-picklist-records-author-row'>
<td colspan='4'>${c.oils.acq.find_entry_attr(entry, "author")}
</tr>
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_list.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_list.html 2008-02-07 21:41:17 UTC (rev 8693)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view_list.html 2008-02-07 22:05:14 UTC (rev 8694)
@@ -3,14 +3,19 @@
<%def name="page_title()">${_('Evergreen My Picklists')}</%def>
<%def name="block_content()">
-<h3>${_('My Picklists')}</h3>
+<div id='oils-acq-picklist-list-header' class='container'>
+ <div id='oils-acq-picklist-list-header-label'>${_('My Picklists')}</div>
+ <div id='oils-acq-picklist-list-header-create'>
+ <a href='${c.oils.acq.prefix}/picklist/create'>${_('New Picklist')}</a>
+ </div>
+</div>
<table id='oils-acq-picklist-list-table'>
<thead>
<tr>
<td>${_('Name')}</td>
- <td>${_('Create Time')}</td>
- <td>${_('Edit Time')}</td>
+ <td>${_('Creation Date')}</td>
+ <td>${_('Edit Date')}</td>
<td/>
<td/>
</tr>
More information about the open-ils-commits
mailing list