From c499c00df8bee64f4c869ba57284f5b1c4af8c70 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 13 Dec 2011 14:19:29 -0500 Subject: [PATCH 5/5] =?UTF-8?q?Bug=201633=20-=20[SIGNED-OFF]=C2=A0Interface=20revisions=20for=20the=20staff=20client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" 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 --- catalogue/image.pl | 2 +- catalogue/imageviewer.pl | 30 ++++++- .../intranet-tmpl/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 2af1246..98725a2 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 395e4b7..caa793e 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 30334ef..4d18ac6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2133,6 +2133,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 a944dc5..903cf3a 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 1038b48..9720390 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -515,7 +515,7 @@ function verify_images() { @@ -524,16 +524,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 c5ab657..0ec6011 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' %] -- 1.7.2.5