Bugzilla – Attachment 14928 Details for
Bug 9420
Work on Bootstrap for Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9420 - Work on Bootstrap for Koha: Circ toolbar
Bug-9420---Work-on-Bootstrap-for-Koha-Circ-toolbar.patch (text/plain), 14.76 KB, created by
Owen Leonard
on 2013-01-30 01:17:35 UTC
(
hide
)
Description:
Bug 9420 - Work on Bootstrap for Koha: Circ toolbar
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-01-30 01:17:35 UTC
Size:
14.76 KB
patch
obsolete
>From ae180f2caa0bd3c9a6bb777b398396d9956d331c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 29 Jan 2013 20:08:29 -0500 >Subject: [PATCH] Bug 9420 - Work on Bootstrap for Koha: Circ toolbar >Content-Type: text/plain; charset="utf-8" > >This patch converts the toolbar include file used by Circ and >Patron pages to Bootstrap, replacing YUI button and menu code >with Bootstrap markup. > >To test, view any page in circ/ or members/ which uses >members-toolbar.inc (circulation.pl, moremember.pl, etc). >Buttons and menus should look correct and work correctly. > >This patch is preliminary. This patch does not include final >styling of the buttons, which lack icons to match the YUI >version. Some icons have been chosen from the default Bootstrap >set to demonstrate the functionality. > >Comments welcome. >--- > .../intranet-tmpl/prog/en/css/staff-global.css | 2 +- > .../prog/en/includes/members-toolbar.inc | 196 ++++++++++---------- > 2 files changed, 104 insertions(+), 94 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >index 4d3d013..735efbb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >@@ -2415,7 +2415,7 @@ a.btn:visited{ > .dropdown-menu li { > list-style: none outside none; > } >-[class^="icon-"],[class*=" icon-"]{background-image:url("../../img/glyphicons-halflings.png");} >+[class^="icon-"],[class*=" icon-"]{background-image:url("../../../lib/bootstrap/img/glyphicons-halflings.png");} > .icon-white,.nav-tabs>.active>a>[class^="icon-"],.nav-tabs>.active>a>[class*=" icon-"],.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"]{background-image:url("../../img/glyphicons-halflings-white.png");} > a.disabled { > color : #999999; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >index 91d179e..4acd035 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc >@@ -1,7 +1,39 @@ >-<div id="toolbar"> >- <script type="text/javascript"> >- //<![CDATA[ >-[% IF ( CAN_user_borrowers ) %] >+<script type="text/javascript"> >+//<![CDATA[ >+$(document).ready(function(){ >+ [% IF ( CAN_user_borrowers ) %]$("#deletepatron").click(function(){ >+ confirm_deletion(); >+ return false; >+ }); >+ $("#renewpatron").click(function(){ >+ confirm_reregistration(); >+ return false; >+ }); >+ [% IF ( is_child ) %]$("#updatechild").click(function(){ >+ confirm_updatechild(); >+ return false; >+ });[% END %][% END %] >+ $("#exportcheckins").click(function(){ >+ export_barcodes(); >+ return false; >+ }); >+ $("#printsummary").click(function(){ >+ printx_window("page") >+ return false; >+ }); >+ $("#printslip").click(function(){ >+ printx_window("slip") >+ return false; >+ }); >+ $("#printquickslip").click(function(){ >+ printx_window("qslip") >+ return false; >+ }); >+ $("#searchtohold").click(function(){ >+ searchToHold(); >+ return false; >+ }) >+}); > function confirm_deletion() { > var is_confirmed = window.confirm(_('Are you sure you want to delete this patron? This cannot be undone.')); > if (is_confirmed) { >@@ -22,115 +54,93 @@ function update_child() { > [% ELSE %] > confirm_updatechild(); > [% END %] >-}[% ELSE %][% END %] >+}[% END %] > > function confirm_reregistration() { > var is_confirmed = window.confirm(_("Are you sure you want to renew this patron's registration?")); > if (is_confirmed) { >- window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&destination=[% destination %]&reregistration=y'; >+ window.location = '/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% borrowernumber %]&cardnumber=[% cardnumber %]&desintation=[% destination %]&reregistration=y'; > } > } > function export_barcodes() { > window.open('/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]&op=export_barcodes'); > } >-[% END %] >- >- // prepare DOM for YUI Toolbar >- >- $(document).ready(function() { >- $("#printslip,#patronflags,#deletepatron").parent().remove(); >- $("#moremenuc,#printmenuc,#searchtoholdc").empty(); >- yuiToolbar(); >- }); >- >- // YUI Toolbar Functions >- var slip_re = /slip/; >- function printx_window(print_type) { >- var handler = print_type.match(slip_re) ? "printslip" : "moremember"; >- window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow"); >- return false; >- } >- function searchToHold(){ >- var date = new Date(); >- date.setTime(date.getTime() + (10 * 60 * 1000)); >- $.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date }); >- location.href="/cgi-bin/koha/catalogue/search.pl"; >- } >- function yuiToolbar() { >- var printmenu = [ >- { text: _("Print summary"), onclick: {fn: function(){printx_window("page")}} }, >- { text: _("Print slip"), onclick: {fn: function(){printx_window("slip")}} }, >- { text: _("Print quick slip"), onclick: {fn: function(){printx_window("qslip")}} } >- ]; >- >- var moremenu = [ >- { text: _("Renew patron"), [% UNLESS CAN_user_borrowers %]disabled: true, [% END %] onclick: { fn: confirm_reregistration } }, >- { text: _("Set permissions"), url: "/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]"[% UNLESS CAN_user_permissions %], disabled: true[% END %]}, >- { text: _("Delete"), [% UNLESS CAN_user_borrowers %]disabled: true, [% END %] onclick: { fn: confirm_deletion } }, >- { text: _("Update child to adult patron")[% IF is_child && CAN_user_borrowers %], onclick: { fn: update_child }[% ELSE %], disabled: true[% END %]}, >- { text: _("Export today's checked in barcodes"), [% UNLESS CAN_user_borrowers %]disabled: true, [% END %] onclick: { fn: export_barcodes }} >- ]; >- >- new YAHOO.widget.Button({ >- type: "menu", >- label: _("Print"), >- name: "printmenubutton", >- menu: printmenu, >- container: "printmenuc" >- }); >- new YAHOO.widget.Button({ >- id: "searchtohold", >- type: "button", >- label: _("Search to hold"), >- container: "searchtoholdc", >- onclick: {fn: searchToHold } >- }); >- new YAHOO.widget.Button({ >- type: "menu", >- label: _("More"), >- name: "moremenubutton", >- menu: moremenu, >- container: "moremenuc" >- }); >- >- [% IF ( CAN_user_borrowers ) %][% IF ( adultborrower ) %]new YAHOO.widget.Button("addchild");[% END %] >- new YAHOO.widget.Button("editpatron"); >- new YAHOO.widget.Button("changepassword"); >- new YAHOO.widget.Button("duplicate");[% END %] >- new YAHOO.widget.Button("printslip"); >- new YAHOO.widget.Button("printpage"); >- } >+var slip_re = /slip/; >+function printx_window(print_type) { >+ var handler = print_type.match(slip_re) ? "printslip" : "moremember"; >+ window.open("/cgi-bin/koha/members/" + handler + ".pl?borrowernumber=[% borrowernumber %]&print=" + print_type, "printwindow"); >+ return false; >+} >+function searchToHold(){ >+ var date = new Date(); >+ date.setTime(date.getTime() + (10 * 60 * 1000)); >+ $.cookie("holdfor", "[% borrowernumber %]", { path: "/", expires: date }); >+ location.href="/cgi-bin/koha/catalogue/search.pl"; >+} >+//]]> >+</script> > >- //]]> >- </script> >- <ul class="toolbar"> >+<div id="toolbar" class="btn-toolbar"> > [% IF ( CAN_user_borrowers ) %] > [% IF ( category_type ) %] > [% IF ( guarantor ) %] >- <li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=[% destination %]&borrowernumber=[% borrowernumber %]&guarantorid=[% guarantorborrowernumber %]&category_type=[% category_type %]"> >+ <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&guarantorid=[% guarantorborrowernumber %]&category_type=[% category_type %]"> > [% ELSE %] >- <li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=[% destination %]&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]"> >- [% END %]Edit</a></li> >+ <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]"> >+ [% END %] >+ <i class="icon-pencil"></i> Edit</a> > [% ELSE %] <!-- try with categorycode if no category_type --> > [% IF ( categorycode ) %] >- <li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=[% destination %]&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]">Edit</a></li> >+ <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&categorycode=[% categorycode %]"><i class="icon-pencil"></i> Edit</a> > [% ELSE %] <!-- if no categorycode, set category_type to A by default --> >- <li><a id="editpatron" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=[% destination %]&borrowernumber=[% borrowernumber %]&category_type=A">Edit</a></li> >+ <a id="editpatron" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=modify&destination=circ&borrowernumber=[% borrowernumber %]&category_type=A"><i class="icon-pencil"></i> Edit</a> > [% END %] > [% END %] >- [% IF ( adultborrower AND activeBorrowerRelationship ) %]<li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C">Add child</a></li>[% END %] >- <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]">Change password</a></li> >- <li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]">Duplicate</a></li> > [% END %] >- <li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=page">Print summary</a></li> >- <li><a id="printslip" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]&print=slip">Print slip</a></li> >- <li id="searchtoholdc"><a id="searchtohold" href="#">Search to hold</a></li> >- [% IF ( CAN_user_borrowers ) %]<li id="moremenuc"><a id="renewpatron" href="/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber=[% borrowernumber %]">Renew account</a></li>[% END %] >- [% IF ( CAN_user_permissions ) %] >- [% IF ( CAN_user_staffaccess ) %] >- <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li> >+ >+ [% IF ( CAN_user_borrowers ) %] >+ [% IF ( adultborrower AND activeBorrowerRelationship ) %] >+ <a id="addchild" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=add&guarantorid=[% borrowernumber %]&category_type=C">Add child</a> >+ [% END %] >+ [% IF ( CAN_user_borrowers ) %] >+ <a id="changepassword" class="btn btn-small" href="/cgi-bin/koha/members/member-password.pl?member=[% borrowernumber %]"><i class="icon-lock"></i> Change password</a> > [% END %] > [% END %] >- [% IF ( CAN_user_staffaccess ) %]<li><a id="deletepatron" href="#" onclick="confirm_deletion();">Delete</a></li>[% END %] > >-</ul></div> >+ <a id="duplicate" class="btn btn-small" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&borrowernumber=[% borrowernumber %]&category_type=[% category_type %]">Duplicate</a> >+ <div class="btn-group"> >+ <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-print"></i> Print <span class="caret"></span></button> >+ <ul class="dropdown-menu"> >+ [% IF ( CAN_user_borrowers ) %]<li><a id="printsummary" href="#">Print summary</a></li>[% END %] >+ <li><a id="printslip" href="#">Print slip</a></li> >+ <li><a id="printquickslip" href="#">Print quick slip</a></li> >+ </ul> >+ </div> >+ <a id="searchtohold" class="btn btn-small" href="#">Search to hold</a> >+ <div class="btn-group"> >+ <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">More <span class="caret"></span></button> >+ <ul class="dropdown-menu"> >+ [% IF ( CAN_user_borrowers ) %] >+ <li><a id="renewpatron" href="/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber=[% borrowernumber %]">Renew patron</a></li> >+ [% ELSE %] >+ <li class="disabled"><a id="renewpatron" href="#">Renew patron</a></li> >+ [% END %] >+ [% IF ( CAN_user_permissions ) %] >+ <li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=[% borrowernumber %]">Set permissions</a></li> >+ [% ELSE %] >+ <li class="disabled"><a id="patronflags" href="#">Set permissions</a></li> >+ [% END %] >+ [% IF ( CAN_user_borrowers ) %] >+ <li><a id="deletepatron" href="#">Delete</a></li> >+ [% ELSE %] >+ <li class="disabled"><a id="deletepatron" href="#">Delete</a></li> >+ [% END %] >+ [% IF ( is_child ) %] >+ <li><a id="updatechild" href="#">Update child to adult patron</a></li> >+ [% ELSE %] >+ <li class="disabled"><a id="updatechild" href="#">Update child to adult patron</a></li></li> >+ [% END %] >+ <li><a id="exportcheckins" href="#">Export today's checked in barcodes</a></li> >+ </ul> >+ </div> >+</div> >\ No newline at end of file >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9420
:
14691
|
14905
|
14906
|
14910
|
14916
|
14927
|
14928
|
14982
|
14987
|
15192
|
15194
|
15323
|
15324