[open-ils-commits] r9582 - in
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb:
public/oils/media/ui_js/oils/default/acq/po
templates/oils/default/acq/po
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue May 13 12:44:15 EDT 2008
Author: erickson
Date: 2008-05-13 12:44:12 -0400 (Tue, 13 May 2008)
New Revision: 9582
Modified:
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js
branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/search.html
Log:
more date formatting. added link from search results to po details
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js 2008-05-13 16:34:07 UTC (rev 9581)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/public/oils/media/ui_js/oils/default/acq/po/search.js 2008-05-13 16:44:12 UTC (rev 9582)
@@ -5,6 +5,8 @@
dojo.require('dojox.grid.Grid');
dojo.require('openils.acq.Provider');
dojo.require('fieldmapper.OrgUtils');
+dojo.require('dojo.date.locale');
+dojo.require('dojo.date.stamp');
function getOrgInfo(rowIndex) {
data = poGrid.model.getRow(rowIndex);
@@ -24,6 +26,13 @@
return new openils.User({id:data.owner}).user.usrname();
}
+function getDateTimeField(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ var date = dojo.date.stamp.fromISOString(data[this.field]);
+ return dojo.date.locale.format(date, {formatLength:'medium'});
+}
+
function doSearch(fields) {
var itemList = [];
Modified: branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/search.html
===================================================================
--- branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/search.html 2008-05-13 16:34:07 UTC (rev 9581)
+++ branches/acq-experiment/Open-ILS/web/oilsweb/oilsweb/templates/oils/default/acq/po/search.html 2008-05-13 16:44:12 UTC (rev 9582)
@@ -10,7 +10,15 @@
<!-- load the page-specific JS -->
<script src='${c.oils.core.media_prefix.value}/ui_js/oils/default/acq/po/search.js'> </script>
+<script>
+ function getId(rowIndex) {
+ data = poGrid.model.getRow(rowIndex);
+ if(!data) return;
+ return '<a href="${c.oils.acq.prefix.value}/po/view/' + data.id + '">'+data.id;
+ }
+</script>
+
<form dojoType='dijit.form.Form' action='' method=''>
<script type="dojo/method" event="onSubmit">
fields = this.getValues();
@@ -31,12 +39,12 @@
<script>
var poGridStructure = [{
cells : [[
- {name: '${_("ID")}', field: 'id'},
+ {name: '${_("ID")}', field: 'id', get:getId},
{name: '${_("Owner")}', get:getPOOwner},
{name: '${_("Ordering Agency")}', get:getOrgInfo},
- {name: '${_("Create Time")}', field:'create_time'},
- {name: '${_("Edit Time")}', field: "edit_time"},
- {name: '${_("Provider")}', get:getProvider},
+ {name: '${_("Create Time")}', field:'create_time', get:getDateTimeField, width:'auto'},
+ {name: '${_("Edit Time")}', field: "edit_time", get:getDateTimeField, width:'auto'},
+ {name: '${_("Provider")}', get:getProvider, width:'auto'},
{name: '${_("State")}', field:'state'}
]]
}];
More information about the open-ils-commits
mailing list