Merge branch 'bug_5790' into 3.12-master

This commit is contained in:
Jared Camins-Esakov 2013-02-07 07:33:30 -05:00
commit cfd3f7186b
8 changed files with 65 additions and 36 deletions

View File

@ -111,5 +111,9 @@ $template->param (
C4::Search::enabled_staff_search_views,
);
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
$template->param( holdcount => $holdcount, holds => $holds );
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -335,4 +335,7 @@ $template->param (
C4::Search::enabled_staff_search_views,
);
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
$template->param( holdcount => $holdcount, holds => $holds );
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -138,9 +138,6 @@ if (@hostitems){
my $dat = &GetBiblioData($biblionumber);
# get count of holds
my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1);
#coping with subscriptions
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
my @subscriptions = GetSubscriptions( $dat->{title}, $dat->{issn}, undef, $biblionumber );
@ -301,7 +298,6 @@ $template->param(
volinfo => $itemfields{enumchron},
itemdata_itemnotes => $itemfields{itemnotes},
z3950_search_params => C4::Search::z3950_search_args($dat),
holdcount => $holdcount,
hostrecords => $hostrecords,
analytics_flag => $analytics_flag,
C4::Search::enabled_staff_search_views,
@ -399,4 +395,7 @@ if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref
'sort'=>'-weight', limit=>$tag_quantity}));
}
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
$template->param( holdcount => $holdcount, holds => $holds );
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -78,4 +78,7 @@ $template->{VARS}->{'norequests'} = $norequests;
$template->param(C4::Search::enabled_staff_search_views);
$template->{VARS}->{'biblio'} = $biblio;
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
$template->param( holdcount => $holdcount, holds => $holds );
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -136,4 +136,7 @@ $template->param (
C4::Search::enabled_staff_search_views,
);
my ( $holdcount, $holds ) = C4::Reserves::GetReservesFromBiblionumber($biblionumber,1);
$template->param( holdcount => $holdcount, holds => $holds );
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -35,6 +35,7 @@ use C4::Circulation; # to use itemissues
use C4::Members; # to use GetMember
use C4::Search; # enabled_staff_search_views
use C4::Members qw/GetHideLostItemsPreference/;
use C4::Reserves qw(GetReservesFromBiblionumber);
use Koha::DateUtils;
my $query=new CGI;
@ -214,5 +215,9 @@ $template->param(
);
$template->param(ONLY_ONE => 1) if ( $itemnumber && $showncount != @items );
my ( $holdcount, $holds ) = GetReservesFromBiblionumber($biblionumber,1);
$template->param( holdcount => $holdcount, holds => $holds );
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -425,6 +425,9 @@ ul.toolbar button {
a.yuimenuitemlabel-disabled, #disabled a {
color: #999;
}
a.yuimenuitemlabel-disabled, #disabled2 a {
color: #999;
}
a.yuimenuitemlabel-disabled:hover, #disabled a:hover {
color : #999;
}

View File

@ -30,40 +30,49 @@
}
function printBiblio() {window.print(); }
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
function confirm_deletion() {
var count = [% count %];
var is_confirmed;
if (count>0){
is_confirmed= alert(count + " " +_("item(s) are attached to this record.\nYou must delete all items before deleting this record."));
} else{
is_confirmed= confirm(_("Are you sure you want to delete this record? "));
}
if (is_confirmed) {
if (count>0){
// window.location="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]";
} else {
window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]";
}
} else {
return false;
}
}
[% END %]
[% IF ( CAN_user_editcatalogue_edit_items ) %]
function confirm_items_deletion() {
function confirm_deletion() {
var count = [% count %];
if(count > 0){
if(confirm(_("Are you sure you want to delete the") + " " + count + " " + _("attached items?"))){
var holdcount = [% holdcount %];
var is_confirmed;
if (count > 0){
is_confirmed = alert( count + " " +_("item(s) are attached to this record.\nYou must delete all items before deleting this record.") );
} else if ( holdcount > 0 ) {
is_confirmed = confirm( holdcount + " " + _("holds(s) for this record \n Are you sure you want to delete this record?."));
} else {
is_confirmed = confirm(_("Are you sure you want to delete this record?"));
}
if (is_confirmed) {
if ( count > 0 || holdcount > 0 ){
return false;
} else {
window.location="/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=[% biblionumber %]";
}
} else {
return false;
}
}
[% END %]
[% IF ( CAN_user_editcatalogue_edit_items ) %]
function confirm_items_deletion() {
var count = [% count %];
var holdcount = [% holdcount %];
if ( holdcount > 0 ) {
alert( holdcount + " " + _("holds(s) for this record \n You must delete all holds before deleting all items.") );
} else if ( count > 0 ) {
if( confirm( _("Are you sure you want to delete the") + " " + count + " " + _("attached items?") ) ) {
window.location="/cgi-bin/koha/cataloguing/additem.pl?op=delallitems&biblionumber=[% biblionumber %]";
}else{
} else {
return false;
}
} else {
alert(_("This record has no items."));
return false;
}
}
} else {
alert(_("This record has no items."));
return false;
}
}
[% END %]
// prepare DOM for YUI Toolbar
@ -121,8 +130,8 @@ function confirm_items_deletion() {
[% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]{ text: _("Upload image"), url: "/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image" },[% END %][% END %]
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit as new (duplicate)"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=duplicate" },[% END %]
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Replace record via Z39.50"), onclick: {fn: PopupZ3950 } },[% END %]
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete record"), onclick: {fn: confirm_deletion }[% IF ( count ) %],id:'disabled'[% END %] },[% END %]
[% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Delete all items"), onclick: {fn: confirm_items_deletion }[% UNLESS ( count ) %],id:'disabled'[% END %] }[% END %]
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Delete record"), onclick: {fn: confirm_deletion }[% IF ( count || holdcount ) %],id:'disabled'[% END %] },[% END %]
[% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Delete all items"), onclick: {fn: confirm_items_deletion }[% IF ( count < 1 || holdcount ) %],id:'disabled2'[% END %] },[% END %]
];
if(editmenu.length){
new YAHOO.widget.Button({