[open-ils-commits] r14814 - trunk/Open-ILS/xul/staff_client/server/admin (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Nov 6 15:48:21 EST 2009
Author: phasefx
Date: 2009-11-06 15:48:16 -0500 (Fri, 06 Nov 2009)
New Revision: 14814
Modified:
trunk/Open-ILS/xul/staff_client/server/admin/work_log.js
trunk/Open-ILS/xul/staff_client/server/admin/work_log.xul
Log:
Tweak the Work/Activity Log interface in the staff client so that it has a sticky numberbox for how many log entries to retrieve (subject to an overall max cap configurable by org unit settings).
Some cosmetic tweaks as well.
Modified: trunk/Open-ILS/xul/staff_client/server/admin/work_log.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/work_log.js 2009-11-06 20:32:42 UTC (rev 14813)
+++ trunk/Open-ILS/xul/staff_client/server/admin/work_log.js 2009-11-06 20:48:16 UTC (rev 14814)
@@ -2,6 +2,8 @@
var list1; var selected1 = [];
var list2; var selected2 = [];
var data;
+var max_work_log_entries;
+var max_patron_log_entries;
function my_init() {
try {
@@ -14,6 +16,9 @@
JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.stash_retrieve();
+ max_work_log_entries = data.hash.aous['ui.admin.work_log.max_entries'] || 20;
+ max_patron_log_entries = data.hash.aous['ui.admin.patron_log.max_entries'] || 10;
+
init_lists();
set_behavior();
populate_lists();
@@ -83,13 +88,23 @@
list1.clear();
data.stash_retrieve();
if (data.work_log) {
- for (var i = 0; i < data.work_log.length; i++ ) {
+ var count = data.work_log.length;
+ var x = document.getElementById('desire_number_of_work_log_entries');
+ if (x) {
+ if (Number(x.value) < count) { count = Number(x.value); }
+ }
+ for (var i = 0; i < count; i++ ) {
list1.append( data.work_log[i] );
}
}
list2.clear();
if (data.patron_log) {
- for (var i = 0; i < data.patron_log.length; i++ ) {
+ var count = data.patron_log.length;
+ var y = document.getElementById('desire_number_of_patron_log_entries');
+ if (y) {
+ if (Number(y.value) < count) { count = Number(y.value); }
+ }
+ for (var i = 0; i < count; i++ ) {
list2.append( data.patron_log[i] );
}
}
@@ -100,6 +115,18 @@
function set_behavior() {
try {
+
+ var x = document.getElementById('desire_number_of_work_log_entries');
+ if (x) {
+ x.setAttribute('max',max_work_log_entries);
+ if (!x.value) { x.setAttribute('value',max_work_log_entries); x.value = max_work_log_entries; }
+ }
+ var y = document.getElementById('desire_number_of_patron_log_entries');
+ if (y) {
+ y.setAttribute('max',max_patron_log_entries);
+ if (!y.value) { y.setAttribute('value',max_patron_log_entries); y.value = max_patron_log_entries; }
+ }
+
var cmd_refresh = document.getElementById('cmd_refresh');
var cmd_retrieve_item = document.getElementById('cmd_retrieve_item');
var cmd_retrieve_patron1 = document.getElementById('cmd_retrieve_patron1');
Modified: trunk/Open-ILS/xul/staff_client/server/admin/work_log.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/work_log.xul 2009-11-06 20:32:42 UTC (rev 14813)
+++ trunk/Open-ILS/xul/staff_client/server/admin/work_log.xul 2009-11-06 20:48:16 UTC (rev 14814)
@@ -18,7 +18,7 @@
<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
<window id="work_log_win"
- onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
+ onload="try { font_helper(); persist_helper(); /* my_init depends on values that persist_helper may set */ my_init(); } catch(E) { alert(E); }"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
@@ -33,25 +33,27 @@
<script type="text/javascript" src="work_log.js"/>
<vbox flex="1">
- <toolbox>
- <toolbar>
- <label value="&staff.admin.work_log.list1.header;" />
+ <vbox flex="1">
+ <hbox>
+ <textbox id="desire_number_of_work_log_entries" type="number" oils_persist="value" />
+ <label value="&staff.admin.work_log.list1.header;" class="header1"/>
<spacer flex="1"/>
- <toolbarbutton id="refresh_btn" label="&staff.admin.work_log.refresh_btn.label;" accesskey="&staff.admin.work_log.refresh_btn.accesskey;" command="cmd_refresh" style="-moz-user-focus: normal" />
- <toolbarbutton label="&staff.admin.work_log.list1.retrieve_item_btn.label;" accesskey="&staff.admin.work_log.list1.retrieve_item_btn.accesskey;" command="cmd_retrieve_item" style="-moz-user-focus: normal" />
- <toolbarbutton label="&staff.admin.work_log.list1.retrieve_patron_btn.label;" accesskey="&staff.admin.work_log.list1.retrieve_patron_btn.accesskey;" command="cmd_retrieve_patron1" style="-moz-user-focus: normal" />
- </toolbar>
- </toolbox>
- <tree id="work_action_log" flex="1" enableColumnDrag="true" context="work_log_actions"/>
+ <button id="refresh_btn" label="&staff.admin.work_log.refresh_btn.label;" accesskey="&staff.admin.work_log.refresh_btn.accesskey;" command="cmd_refresh" style="-moz-user-focus: normal" />
+ <button label="&staff.admin.work_log.list1.retrieve_item_btn.label;" accesskey="&staff.admin.work_log.list1.retrieve_item_btn.accesskey;" command="cmd_retrieve_item" style="-moz-user-focus: normal" />
+ <button label="&staff.admin.work_log.list1.retrieve_patron_btn.label;" accesskey="&staff.admin.work_log.list1.retrieve_patron_btn.accesskey;" command="cmd_retrieve_patron1" style="-moz-user-focus: normal" />
+ </hbox>
+ <tree id="work_action_log" flex="1" enableColumnDrag="true" context="work_log_actions"/>
+ </vbox>
<splitter><grippy/></splitter>
- <toolbox>
- <toolbar>
- <label value="&staff.admin.work_log.list2.header;" />
+ <vbox flex="1">
+ <hbox>
+ <textbox id="desire_number_of_patron_log_entries" type="number" oils_persist="value" />
+ <label value="&staff.admin.work_log.list2.header;" class="header1"/>
<spacer flex="1"/>
- <toolbarbutton label="&staff.admin.work_log.list2.retrieve_patron_btn.label;" accesskey="&staff.admin.work_log.list2.retrieve_patron_btn.accesskey;" command="cmd_retrieve_patron2" style="-moz-user-focus: normal" />
- </toolbar>
- </toolbox>
- <tree id="work_patron_log" flex="1" enableColumnDrag="true" context="patron_actions"/>
+ <button label="&staff.admin.work_log.list2.retrieve_patron_btn.label;" accesskey="&staff.admin.work_log.list2.retrieve_patron_btn.accesskey;" command="cmd_retrieve_patron2" style="-moz-user-focus: normal" />
+ </hbox>
+ <tree id="work_patron_log" flex="1" enableColumnDrag="true" context="patron_actions"/>
+ </vbox>
</vbox>
<popupset>
More information about the open-ils-commits
mailing list