b8fe6d7a1b
When viewing the subscription details page of a bib that already has at least one subscription, clicking on the 'New Subscription' button in the toolbar will fill in the biblionumber and title in the new subscription form. Clicking on the 'New Subscription' button in other context (e.g., when viewing the results of a search) will leave the biblionumber and title fields unpopulated, as there is no specific bib to use. Signed-off-by: Joshua Ferraro <jmf@liblime.com>
70 lines
3.1 KiB
HTML
70 lines
3.1 KiB
HTML
<div id="toolbar"><script type="text/javascript">
|
|
//<![CDATA[
|
|
|
|
// prepare DOM for YUI Toolbar
|
|
|
|
$(document).ready(function() {
|
|
$("#editmenuc").empty();
|
|
$("#duplicate").parent().remove();
|
|
$("#delete").parent().remove();
|
|
$("#renewc").empty();
|
|
yuiToolbar();
|
|
});
|
|
|
|
// YUI Toolbar Functions
|
|
|
|
function yuiToolbar() {
|
|
|
|
<!-- TMPL_IF NAME="subscriptionid" -->
|
|
var editmenu = [
|
|
{ text: _("Edit Subscription"), <!-- TMPL_IF NAME="cannotedit" -->disabled: true, <!-- /TMPL_IF --> url: "/cgi-bin/koha/serials/subscription-add.pl?op=mod&subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" },
|
|
{ text: _("Edit as New (Duplicate)"), <!-- TMPL_IF NAME="cannotedit" -->disabled: true, <!-- /TMPL_IF --> url: "/cgi-bin/koha/serials/subscription-add.pl?op=dup&subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->" },
|
|
{ text: _("Delete Subscription"), <!-- TMPL_IF NAME="cannotedit" -->disabled: true, <!-- /TMPL_IF --> onclick: {fn: confirm_deletion }}
|
|
];
|
|
<!-- /TMPL_IF -->
|
|
new YAHOO.widget.Button("newsubscription");
|
|
<!-- TMPL_IF NAME="subscriptionid" -->
|
|
new YAHOO.widget.Button({
|
|
id: "renew",
|
|
type: "link",
|
|
href: "#",
|
|
label: _("Renew"),
|
|
container: "renewc",
|
|
onclick: {fn:function(){popup(<!--TMPL_VAR Name="subscriptionid"-->)}}
|
|
});
|
|
<!-- TMPL_IF NAME="subscriptionid" -->
|
|
new YAHOO.widget.Button({
|
|
type: "menu",
|
|
label: _("Edit"),
|
|
name: "editmenubutton",
|
|
menu: editmenu,
|
|
container: "editmenuc",
|
|
|
|
});
|
|
<!-- /TMPL_IF -->
|
|
new YAHOO.widget.Button("renew");
|
|
new YAHOO.widget.Button("receive");
|
|
<!-- /TMPL_IF -->
|
|
}
|
|
|
|
//]]>
|
|
</script>
|
|
<ul class="toolbar">
|
|
<!-- TMPL_IF NAME="biblionumber_for_new_subscription" -->
|
|
<li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=<!-- TMPL_VAR NAME="biblionumber_for_new_subscription" -->">New Subscription</a></li>
|
|
<!-- TMPL_ELSE -->
|
|
<li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl">New Subscription</a></li>
|
|
<!-- /TMPL_IF -->
|
|
<!-- TMPL_IF NAME="subscriptionid" -->
|
|
<!-- TMPL_UNLESS name="cannotedit" -->
|
|
<li id="editmenuc"><a id="edit" href="/cgi-bin/koha/serials/subscription-add.pl?op=mod&subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->">Edit</a></li>
|
|
<!-- /TMPL_UNLESS -->
|
|
<li><a id="duplicate" href="/cgi-bin/koha/serials/subscription-add.pl?op=dup&subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->">Duplicate </a></li>
|
|
<!-- TMPL_UNLESS name="cannotedit" -->
|
|
<li id="renewc"><a id="renew" href="#" onclick="popup(<!--TMPL_VAR Name="subscriptionid"-->)">Renew </a></li>
|
|
<li><a id="receive" href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=<!-- TMPL_VAR name="subscriptionid" -->&serstatus=1,3">Receive</a></li>
|
|
<li><a id="delete" href="javascript:confirm_deletion()">Delete</a></li>
|
|
<!-- /TMPL_UNLESS -->
|
|
<!-- /TMPL_IF -->
|
|
</ul>
|
|
</div>
|