[Koha-patches] [PATCH] [replace previous] (bug #2949) autofocus on "checkout" if focusoncheckout is set
Nahuel ANGELINETTI
nahuel.angelinetti at biblibre.com
Fri Apr 3 14:36:56 CEST 2009
this set the autofocus on "checkout" field in page where it's needed, this allow librarians to be mouseless.
---
circ/circulation-home.pl | 4 +++-
circ/circulation.pl | 1 +
.../prog/en/includes/patron-search-box.inc | 11 +++++++++--
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/circ/circulation-home.pl b/circ/circulation-home.pl
index 4ccb780..5ca469d 100755
--- a/circ/circulation-home.pl
+++ b/circ/circulation-home.pl
@@ -31,5 +31,7 @@ my ($template, $loggedinuser, $cookie)
authnotrequired => 0,
flagsrequired => {circulate => 1},
});
-
+$template->param(
+ focusoncheckout => 1,
+ );
output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/circ/circulation.pl b/circ/circulation.pl
index 631df50..7cb73c0 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -721,5 +721,6 @@ $template->param(
AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
dateformat => C4::Context->preference("dateformat"),
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+ focusoncheckout => 1 and not $borrowernumber,
);
output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc
index 558b4f6..a9b8d4c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc
@@ -1,5 +1,11 @@
-<!-- TMPL_IF NAME="CAN_user_circulate" --><!-- TMPL_IF NAME="CircAutocompl" --><script type="text/javascript">
+<!-- TMPL_IF NAME="CAN_user_circulate" --><script type="text/javascript">
//<![CDATA[
+<!-- TMPL_IF NAME="focusoncheckout" -->
+window.onload=function(){
+ document.getElementById('findborrower').focus();
+ };
+<!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="CircAutocompl" -->
YAHOO.util.Event.onContentReady("header_search", function() {
new function() {
// Define a custom formatter function
@@ -40,8 +46,9 @@ YAHOO.util.Event.onContentReady("header_search", function() {
this.oAutoComp.formatResult = this.fnCustomFormatter;
}
});
+<!-- /TMPL_IF -->
//]]>
-</script><!-- /TMPL_IF -->
+</script>
<div id="circ_search" class="residentsearch" style="display:none;">
<p class="tip">Enter patron card number or partial name:</p>
<form action="/cgi-bin/koha/circ/circulation.pl" method="post">
--
1.5.6.3
More information about the Koha-patches
mailing list