Bug 9649 - Replace YUI buttons on cataloging home page with Bootstrap

This patch converts the buttons on the cataloging home page to
Bootstrap, replacing the YUI button and menu code with Bootstrap markup.

This patch moves the functionality of cataloging-toolbar.inc
into addbooks.tt since it is the only place where the include
was used. cataloging-toolbar.inc is removed.

To test, view the cataloging home page. Buttons and menus should look
correct and work correctly.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Buttons look and work well. No errors.

Please sign Bug 3549

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, no problems found.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Owen Leonard 2013-02-19 16:14:52 -05:00 committed by Jared Camins-Esakov
parent 8854a560ae
commit ba3c748181
2 changed files with 39 additions and 82 deletions

View file

@ -1,78 +0,0 @@
<div id="toolbar">
<script type="text/javascript">
//<![CDATA[
// prepare DOM for YUI Toolbar
$(document).ready(function() {
$("#newmenuc").empty();
yuiToolbar();
yuiZ3950button();
});
// YUI Toolbar Functions
function yuiToolbar() {
var newmenu = [
{ text: _("Default Framework"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=" },
[% FOREACH frameworkcodeloo IN frameworkcodeloop %]{ text: "[% frameworkcodeloo.frameworktext %]", url: "/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% frameworkcodeloo.value %]"},
[% END %]
]
new YAHOO.widget.Button({
type: "menu",
label: _("New record"),
name: "newmenubutton",
menu: newmenu,
container: "newmenuc"
});
}
/* this function open a popup to search on z3950 server. */
function PopupZ3950() {
var strQuery = GetZ3950Terms();
if(strQuery){
window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]"+strQuery,"z3950search",'width=760,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
}
}
/* provide Z3950 search points */
function GetZ3950Terms(){
var strQuery="&frameworkcode=";
[% FOREACH z3950_search_param IN z3950_search_params %]
strQuery += "&" + "[% z3950_search_param.name %]" + "=" + "[% z3950_search_param.encvalue %]";
[% END %]
return strQuery;
}
/* prepare DOM for Z39.50 Search Button */
function yuiZ3950button() {
new YAHOO.widget.Button({
id: "z3950search",
type: "button",
label: _("Z39.50 search"),
container: "newmenuc",
onclick: {fn:function(){PopupZ3950()}}
});
}
//]]>
</script>
<div id="newmenuc">
<form name="f" action="addbiblio.pl" method="post">
<label for="frameworkcode">New record with framework:</label>
<select name="frameworkcode" id="frameworkcode">
<option value="">Default</option>
[% FOREACH frameworkcodeloo IN frameworkcodeloop %]
<option value="[% frameworkcodeloo.value %]">
[% frameworkcodeloo.frameworktext %]
</option>
[% END %]
</select>
<input type="submit" value="Add Record Without Search" />
</form>
<a id="z3950search" onclick="PopupZ3950(); return false;">Z39.50 search</a>
</div>
</div>

View file

@ -3,9 +3,31 @@
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript">
$(document).ready(function() {
$('#header_search').tabs();
});
//<![CDATA[
$(document).ready(function() {
$("#z3950search").click(function(){
PopupZ3950();
return false;
});
});
/* this function open a popup to search on z3950 server. */
function PopupZ3950() {
var strQuery = GetZ3950Terms();
if(strQuery){
window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]"+strQuery,"z3950search",'width=760,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes');
}
}
/* provide Z3950 search points */
function GetZ3950Terms(){
var strQuery="&frameworkcode=";
[% FOREACH z3950_search_param IN z3950_search_params %]
strQuery += "&" + "[% z3950_search_param.name %]" + "=" + "[% z3950_search_param.encvalue %]";
[% END %]
return strQuery;
}
//]]>
</script>
</head>
<body id="cat_addbooks" class="cat">
@ -19,7 +41,20 @@
<div id="bd">
<div id="yui-main">
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %][% INCLUDE 'cataloging-toolbar.inc' %][% END %]
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
<div id="newmenuc" class="btn-toolbar">
<div class="btn-group">
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-plus"></i> New record <span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Default framework</a></li>
[% FOREACH frameworkcodeloo IN frameworkcodeloop %]
<li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=[% frameworkcodeloo.value %]">[% frameworkcodeloo.frameworktext %]</a></li>
[% END %]
</ul>
</div>
<div class="btn-group"><a id="z3950search" class="btn btn-small" href="/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=[% biblionumber %]&amp;frameworkcode=[% FOREACH z3950_search_param IN z3950_search_params %]&amp;[% z3950_search_param.name %]=[% z3950_search_param.encvalue %][% END %]"><i class="icon-search"></i> Z39.50 search</a></div>
</div>
[% END %]
[% IF ( noitemsfound ) %]
No results found