[open-ils-commits] r8728 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
controllers/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
Tue Feb 12 09:54:27 EST 2008
Author: erickson
Date: 2008-02-12 09:25:09 -0500 (Tue, 12 Feb 2008)
New Revision: 8728
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.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/picklist_summary.html
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html
Log:
added basic ability to move picklist entries from one pl to another
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-12 14:24:38 UTC (rev 8727)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/__init__.py 2008-02-12 14:25:09 UTC (rev 8728)
@@ -27,9 +27,13 @@
self.picklist = ContextItem() # picklist object
self.picklist_list = ContextItem() # list of picklist objects
- self.picklist_id_list = ContextItem(cgi_name='acq.pli') # list of picklist IDs
+ self.picklist_id_list = ContextItem(cgi_name='acq.plil', multi=True) # list of picklist IDs
self.picklist_entry = ContextItem() # picklist_entry object
self.picklist_name = ContextItem(cgi_name='acq.pln')
+ self.picklist_entry_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')
self.currency_types = ContextItem()
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-12 14:24:38 UTC (rev 8727)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/controllers/acq/picklist.py 2008-02-12 14:25:09 UTC (rev 8728)
@@ -15,6 +15,7 @@
pl_manager.retrieve()
pl_manager.retrieve_entries(flesh_provider=True, offset=r.ctx.acq.offset, limit=r.ctx.acq.limit)
r.ctx.acq.picklist = pl_manager.picklist
+ r.ctx.acq.picklist_list = pl_manager.retrieve_list()
return r.render('acq/picklist/view.html')
def create(self, **kwargs):
@@ -83,3 +84,26 @@
entry = pl_manager.retrieve_entry(entry_id)
pl_manager.delete_entry(entry_id)
return redirect_to(controller='acq/picklist', action='view', id=entry.picklist())
+
+ def update(self):
+ r = RequestMgr()
+ ses = osrf.ses.ClientSession(oils.const.OILS_APP_ACQ)
+ ses.connect()
+
+ if r.ctx.acq.picklist_action == 'move_selected':
+ for entry_id in r.ctx.acq.picklist_entry_id_list:
+
+ entry = ses.request(
+ 'open-ils.acq.picklist_entry.retrieve',
+ r.ctx.core.authtoken, entry_id).recv().content()
+ entry = oils.event.Event.parse_and_raise(entry)
+
+ entry.picklist(r.ctx.acq.picklist_dest_id)
+
+ status = ses.request(
+ 'open-ils.acq.picklist_entry.update',
+ r.ctx.core.authtoken, entry).recv().content()
+ status = oils.event.Event.parse_and_raise(status)
+
+ ses.disconnect()
+ return redirect_to(controller='acq/picklist', action='list')
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-12 14:24:38 UTC (rev 8727)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/skin/default/acq.css 2008-02-12 14:25:09 UTC (rev 8728)
@@ -37,6 +37,10 @@
.oils-acq-picklist-records-phys_desc-row td { padding-left: 30px; }
.oils-acq-picklist-records-phys_desc-row {}
+#oils-acq-picklist-paging-block { width: 50%; text-align: left;}
+#oils-acq-picklist-actions-block { width: 50%; text-align: right;}
+#oils-acq-pikclist-header-subtable { width: 100%; }
+
#oils-acq-list-header { margin: 10px; width: 98%;}
#oils-acq-list-header-label { float: left; }
#oils-acq-list-header-create { float: right; }
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-12 14:24:38 UTC (rev 8727)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/css/theme/default/acq.css 2008-02-12 14:25:09 UTC (rev 8728)
@@ -26,6 +26,7 @@
.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-pikclist-header-subtable tr { border: none; }
#oils-acq-list-header {border-bottom: 1px solid #6BA160;}
#oils-acq-list-header-label { font-weight: bold; font-size: 110%; }
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/picklist_summary.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/picklist_summary.html 2008-02-12 14:24:38 UTC (rev 8727)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/picklist_summary.html 2008-02-12 14:25:09 UTC (rev 8728)
@@ -3,7 +3,7 @@
<div class='oils-acq-picklist-attributes'>
<%
meta = _("Create date %(date)s") % {"date":c.oils.acq.picklist.create_time()}
- meta2 = _("Last update time %(date)s") % {"date":c.oils.acq.picklist.edit_time()}
+ meta2 = _("Last updated %(date)s") % {"date":c.oils.acq.picklist.edit_time()}
%>
<div>${meta}</div>
<div>${meta2}</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-12 14:24:38 UTC (rev 8727)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/picklist/view.html 2008-02-12 14:25:09 UTC (rev 8728)
@@ -8,24 +8,42 @@
<%include file='picklist_summary.html'/>
+<form method='POST' action='${c.oils.acq.prefix}/picklist/update'>
+<input type='hidden' name='${c.oils.acq.picklist_source_id_.cgi_name}' value='${c.oils.acq.picklist.id()}'/>
<table id='oils-acq-picklist-table'>
<thead>
<tr>
- <td colspan='4'>
- <%
- c.oils.acq.offset = int(c.oils.acq.offset)
- c.oils.acq.limit = int(c.oils.acq.limit)
- # set up the paging info
- paging = _('Entries %(offset)s - %(limit)s') % {
- 'offset': c.oils.acq.offset + 1,
- 'limit': c.oils.acq.limit + c.oils.acq.offset
- }
- %>
- ${paging}
- % if c.oils.acq.offset > 0:
- <a href='?${c.oils.acq.offset_.cgi_name}=${c.oils.acq.offset - c.oils.acq.limit}'>«</a>
- % endif
- <a href='?${c.oils.acq.offset_.cgi_name}=${c.oils.acq.offset + c.oils.acq.limit}'>»</a>
+ <td colspan='3' id='oils-acq-picklist-header-block'>
+ <table id='oils-acq-pikclist-header-subtable'><tr>
+ <td id='oils-acq-picklist-paging-block'>
+ <%
+ c.oils.acq.offset = int(c.oils.acq.offset)
+ c.oils.acq.limit = int(c.oils.acq.limit)
+ # set up the paging info
+ paging = _('Entries %(offset)s - %(limit)s') % {
+ 'offset': c.oils.acq.offset + 1,
+ 'limit': c.oils.acq.limit + c.oils.acq.offset
+ }
+ %>
+ ${paging}
+ % if c.oils.acq.offset > 0:
+ <a href='?${c.oils.acq.offset_.cgi_name}=${c.oils.acq.offset - c.oils.acq.limit}'>«</a>
+ % endif
+ <a href='?${c.oils.acq.offset_.cgi_name}=${c.oils.acq.offset + c.oils.acq.limit}'>»</a>
+ </td>
+ <td id='oils-acq-picklist-actions-block'>
+ <select name='${c.oils.acq.picklist_action_.cgi_name}'>
+ <option value='move_selected'>${_('Move Selected to Picklist...')}</option>
+ </select>
+ <select name='${c.oils.acq.picklist_dest_id_.cgi_name}'>
+ <option selected='selected' value=''>${_('-- Select A Picklist --')}</option>
+ % for list in c.oils.acq.picklist_list:
+ <option value='${list.id()}'>${list.name()}</option>
+ % endfor
+ </select>
+ <input type='submit' value='${_("Submit")}'/>
+ </td>
+ </tr></table>
</td>
</tr>
</thead>
@@ -44,7 +62,7 @@
${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>
+ <td><input type='checkbox' name='${c.oils.acq.picklist_entry_id_list_.cgi_name}' value='${entry.id()}'/></td>
</tr>
<tr class='oils-acq-picklist-records-author-row'>
@@ -61,4 +79,5 @@
% endfor
</tbody>
</table>
+</form>
</%def>
More information about the open-ils-commits
mailing list