From e901c4f24cc7d53b7f879ba9b5c467b10ae30e88 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 13 Dec 2011 14:19:29 -0500 Subject: [PATCH] Bug 1633 - Interface revisions for the staff client This patch revises the image viewer page to match other biblio detail pages: a toolbar, a sidebar menu, etc. Additional data is now pulled by imageviewer.pl in order to provide information necessary for the proper functioning of the toolbar and menus: item counts, hold availability, biblio view options. Other changes have been made to match the changes in the OPAC interface like styling of the images and no-javascript compatibility Signed-off-by: Jared Camins-Esakov Signed-off-by: Magnus Enger Patch failed to apply because of multiple Content-Type lines in the patch. Corrected the same with this new patch. http://bugs.koha-community.org/show_bug.cgi?id=6473 --- catalogue/image.pl | 2 +- catalogue/imageviewer.pl | 30 +++++- .../prog/en/css/staff-global.css | 9 +- .../prog/en/includes/biblio-view-menu.inc | 2 +- .../prog/en/modules/catalogue/detail.tt | 10 +- .../prog/en/modules/catalogue/imageviewer.tt | 102 ++++++++++++++---- 6 files changed, 122 insertions(+), 33 deletions(-) diff --git a/catalogue/image.pl b/catalogue/image.pl index 2af1246580..98725a2254 100755 --- a/catalogue/image.pl +++ b/catalogue/image.pl @@ -29,7 +29,7 @@ use C4::Images; $|=1; -my $DEBUG = 1; +my $DEBUG = 0; my $data = new CGI; my $imagenumber; diff --git a/catalogue/imageviewer.pl b/catalogue/imageviewer.pl index 395e4b7769..caa793e0e6 100755 --- a/catalogue/imageviewer.pl +++ b/catalogue/imageviewer.pl @@ -23,8 +23,10 @@ use warnings; use CGI; use C4::Auth; use C4::Biblio; +use C4::Items; use C4::Output; use C4::Images; +use C4::Search; my $query = new CGI; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( @@ -38,14 +40,38 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $biblionumber = $query->param('biblionumber') || $query->param('bib'); +my $imagenumber = $query ->param('imagenumber'); my ($count, $biblio) = GetBiblio($biblionumber); +my $itemcount = GetItemsCount($biblionumber); + +my @items = GetItemsInfo( $biblionumber ); + +my $norequests = 1; +foreach my $item (@items) { + # can place holds defaults to yes + $norequests = 0 unless ( ( $item->{'notforloan_per_itemtype'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) ); +} + +if($query->cookie("holdfor")){ + my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); + $template->param( + holdfor => $query->cookie("holdfor"), + holdfor_surname => $holdfor_patron->{'surname'}, + holdfor_firstname => $holdfor_patron->{'firstname'}, + holdfor_cardnumber => $holdfor_patron->{'cardnumber'}, + ); +} if (C4::Context->preference("LocalCoverImages")) { my @images = ListImagesForBiblio($biblionumber); $template->{VARS}->{'LocalCoverImages'} = 1; $template->{VARS}->{'images'} = \@images; + $template->{VARS}->{'imagenumber'} = $imagenumber || $images[0] || ''; } - -$template->{VARS}->{'biblio'} = $biblio; + $template->{VARS}->{'count'} = $itemcount; + $template->{VARS}->{'biblionumber'} = $biblionumber; + $template->{VARS}->{'norequests'} = $norequests; + $template->param( C4::Search::enabled_staff_search_views ); + $template->{VARS}->{'biblio'} = $biblio; output_html_with_http_headers $query, $cookie, $template->output; 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 1d818b9db7..17305d2963 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2137,6 +2137,9 @@ div.pager input.pagedisplay { font-weight: bold; text-align : center; } -.localimage { - padding: .3em; -} + +a.localimage img { + border : 1px solid #0000CC; + margin : 0 .5em; + padding : .3em; +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc index a944dc544c..903cf3a758 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc @@ -23,7 +23,7 @@ [% IF ( CAN_user_reserveforothers ) %] [% IF ( holdsview ) %]
  • [% ELSE %]
  • [% END %]Holds
  • [% END %] - [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]
  • [% ELSE %]
  • [% END %]Analytics
  • [% END %] + [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]
  • [% ELSE %]
  • [% END %]Analytics
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscription(s)
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 3d308958fe..38a26c9528 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -518,7 +518,7 @@ function verify_images() { @@ -527,16 +527,16 @@ function verify_images() { [% IF ( LocalCoverImages ) %]
    -[% IF ( localimages ) %] -
    Click on an image to view it in the image viewer
    +[% IF ( localimages.0 ) %] +

    Click on an image to view it in the image viewer

    [% FOREACH image IN localimages %] [% IF image %] -img + [% END %] [% END %] [% ELSE %] [% IF ( CAN_user_tools_upload_local_cover_images ) %] -

    No images have been uploaded for this bibliographic record yet. Please upload one.

    +

    No images have been uploaded for this bibliographic record yet. Please upload one.

    [% END %] [% END %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt index c5ab657002..0ec60111ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt @@ -1,11 +1,12 @@ [% INCLUDE 'doc-head-open.inc' %] -[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Images for: [% biblio.title |html %] +Koha › Catalog › Details for [% biblio.title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %] [% INCLUDE 'doc-head-close.inc' %] - - - -
    Large view
    -[% IF LocalCoverImages == 1 %] -[% FOREACH img IN images %] -[% IF img %] -Image -[% END %] -[% END %] -[% biblio.title %] [% biblio.author %] +[% END %] + + + + +[% INCLUDE 'header.inc' %] +[% INCLUDE 'cat-search.inc' %] + + + +
    + +
    +
    +
    +
    + +[% INCLUDE 'cat-toolbar.inc' %] + +

    Images for [% biblio.title |html %]

    +

    [% biblio.author %]

    + +[% IF ( LocalCoverImages == 1 ) %] + [% IF ( images.size > 0 ) %] +
    +
    + +
    + +
    + + [% FOREACH img IN images %] + [% IF img %] + + [% IF ( imagenumber == img ) %] + Thumbnail + [% ELSE %] + Thumbnail + [% END %] + + [% END %] + [% END %] +
    + + [% ELSE %] +
    There are no images for this record.
    + [% END %] [% ELSE %] -Unfortunately, images are not enabled for this catalog at this time. +
    Local images have not been enabled by your system administrator.
    [% END %] - - + +
    +
    +
    +
    +[% INCLUDE 'biblio-view-menu.inc' %] +
    +
    +[% INCLUDE 'intranet-bottom.inc' %] -- 2.39.5