Bugzilla – Attachment 11290 Details for
Bug 5357
Subscription search and displays
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5357: Adds a new page for searching subscriptions
Bug-5357-Adds-a-new-page-for-searching-subscriptio.patch (text/plain), 29.90 KB, created by
Paul Poulain
on 2012-08-02 09:57:30 UTC
(
hide
)
Description:
Bug 5357: Adds a new page for searching subscriptions
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2012-08-02 09:57:30 UTC
Size:
29.90 KB
patch
obsolete
>From ff9dc5ac905a8e09c2b0f55e5127e725dc43343e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 9 Mar 2012 10:05:38 +0100 >Subject: [PATCH] Bug 5357: Adds a new page for searching subscriptions > >Test plan: >- go on the serial module >- click on the 'Advanced search' link (right of subscriptions search in >the header) >- Search subscriptions (by ISSN, title, EAN, Publisher, Supplier and/or > Branch) >- Check results are correct > >Signed-off-by: Corinne HAYET <corinne.hayet@bulac.fr> >--- > C4/Serials.pm | 69 ++++++++ > .../prog/en/includes/biblio-view-menu.inc | 2 +- > .../prog/en/includes/serials-search.inc | 60 ++++---- > .../prog/en/modules/serials/serial-issues.tt | 2 +- > .../prog/en/modules/serials/serials-home.tt | 157 +----------------- > .../prog/en/modules/serials/serials-search.tt | 174 ++++++++++++++++++++ > serials/serials-home.pl | 71 +-------- > serials/serials-search.pl | 110 ++++++++++++ > 8 files changed, 402 insertions(+), 243 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt > create mode 100755 serials/serials-search.pl > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 58b6078..8ce74b2 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -36,6 +36,7 @@ BEGIN { > @EXPORT = qw( > &NewSubscription &ModSubscription &DelSubscription &GetSubscriptions > &GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber >+ &SearchSubscriptions > &GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory > &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire > >@@ -630,6 +631,74 @@ sub GetSubscriptions { > return @results; > } > >+=head2 SearchSubscriptions >+ >+@results = SearchSubscriptions($args); >+$args is a hashref. Its keys can be contained: title, issn, ean, publisher, bookseller and branchcode >+ >+this function gets all subscriptions which have title like $title, ISSN like $issn, EAN like $ean, publisher like $publisher, bookseller like $bookseller AND branchcode eq $branch. >+ >+return: >+a table of hashref. Each hash containt the subscription. >+ >+=cut >+ >+sub SearchSubscriptions { >+ my ( $args ) = @_; >+ >+ my $query = qq{ >+ SELECT subscription.*, subscriptionhistory.*, biblio.*, biblioitems.issn >+ FROM subscription >+ LEFT JOIN subscriptionhistory USING(subscriptionid) >+ LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber >+ LEFT JOIN biblioitems ON biblioitems.biblionumber = subscription.biblionumber >+ LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id >+ }; >+ my @where_strs; >+ my @where_args; >+ if( $args->{biblionumber} ) { >+ push @where_strs, "biblio.biblionumber = ?"; >+ push @where_args, $args->{biblionumber}; >+ } >+ if( $args->{title} ){ >+ push @where_strs, "biblio.title LIKE ?"; >+ push @where_args, "%$args->{title}%"; >+ } >+ if( $args->{issn} ){ >+ push @where_strs, "biblioitems.issn LIKE ?"; >+ push @where_args, "%$args->{issn}%"; >+ } >+ if( $args->{ean} ){ >+ push @where_strs, "biblioitems.ean LIKE ?"; >+ push @where_args, "%$args->{ean}%"; >+ } >+ if( $args->{publisher} ){ >+ push @where_strs, "biblioitems.publishercode LIKE ?"; >+ push @where_args, "%$args->{publisher}%"; >+ } >+ if( $args->{bookseller} ){ >+ push @where_strs, "aqbooksellers.name LIKE ?"; >+ push @where_args, "%$args->{bookseller}%"; >+ } >+ if( $args->{branch} ){ >+ push @where_strs, "subscription.branchcode = ?"; >+ push @where_args, "$args->{branch}"; >+ } >+ >+ if(@where_strs){ >+ $query .= " WHERE " . join(" AND ", @where_strs); >+ } >+ >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare($query); >+ $sth->execute(@where_args); >+ my $results = $sth->fetchall_arrayref( {} ); >+ $sth->finish; >+ >+ return @$results; >+} >+ >+ > =head2 GetSerials > > ($totalissues,@serials) = GetSerials($subscriptionid); >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 903cf3a..b2edbe6 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 >@@ -25,7 +25,7 @@ > [% END %] > [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% IF ( object ) %][% object %]&analyze=1[% ELSE %][% biblionumber %]&analyze=1[% END %]">Analytics</a></li>[% END %] > >- [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-home.pl?searched=1&biblionumber=[% biblionumber %]">Subscription(s)</a></li>[% END %] >+ [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&biblionumber=[% biblionumber %]">Subscription(s)</a></li>[% END %] > </ul> > <ul> > [% IF ( issuehistoryview ) %]<li class="active">[% ELSE %]<li>[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc >index dfb908f..beb309c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc >@@ -1,35 +1,37 @@ > <div class="gradient"> >-<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Serials Resident Search Box --> >-<div id="header_search"> >- <div id="subscription_search" class="residentsearch"> >+ <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Serials Resident Search Box --> >+ <div id="header_search"> >+ <div id="subscription_search" class="residentsearch"> > <p class="tip">Search subscriptions:</p> >- <form action="/cgi-bin/koha/serials/serials-home.pl" method="get"> >- [% IF ( routing ) %]<input type="hidden" name="routing" value="[% routing %]" />[% END %] >- <input type="hidden" name="searched" value="1" /> >- <label for="ISSN_filter">ISSN:</label> <input type="text" size="10" maxlength="11" name="ISSN_filter" id="ISSN_filter" value="[% ISSN_filter %]" /> >+ <form action="/cgi-bin/koha/serials/serials-search.pl" method="get"> >+ [% IF ( routing ) %] >+ <input type="hidden" name="routing" value="[% routing %]" /> >+ [% END %] >+ <input type="hidden" name="searched" value="1" /> >+ <label for="ISSN_filter">ISSN:</label> <input type="text" size="10" maxlength="11" name="ISSN_filter" id="ISSN_filter" value="[% ISSN_filter %]" /> > >- [% IF (UNIMARC) %] >- <label for="EAN_filter">EAN:</label> <input type="text" size="20" maxlength="40" name="EAN_filter" id="EAN_filter" value="[% EAN_filter %]" /> >- [% END %] >- <label for="title_filter">Title:</label> <input type="text" size="20" maxlength="40" name="title_filter" id="title_filter" value="[% title_filter %]" /> >- <input type="submit" value="Search" class="submit" /> >- </form> >- </div> >+ [% IF (UNIMARC) %] >+ <label for="EAN_filter">EAN:</label> <input type="text" size="20" maxlength="40" name="EAN_filter" id="EAN_filter" value="[% EAN_filter %]" /> >+ [% END %] >+ <label for="title_filter">Title:</label> <input type="text" size="20" maxlength="40" name="title_filter" id="title_filter" value="[% title_filter %]" /> >+ <input value="Submit" class="submit" type="submit" /> <a href="/cgi-bin/koha/serials/serials-search.pl">Advanced search</a> >+ </form> >+ </div> > [% INCLUDE 'patron-search-box.inc' %] >- [% IF ( CAN_user_catalogue ) %] >- <div id="catalog_search" class="residentsearch"> >- <p class="tip">Enter search keywords:</p> >- <form action="/cgi-bin/koha/catalogue/search.pl" method="get" id="cat-search-block"> >- <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" /> >- <input type="submit" value="Submit" class="submit" /> >- </form> >- </div> >- [% END %] >- <ul> >- <li><a href="#subscription_search">Search subscriptions</a></li> >- [% IF ( CAN_user_circulate ) %]<li><a href="#circ_search">Check out</a></li>[% END %] >- [% IF ( CAN_user_catalogue ) %]<li><a href="#catalog_search">Search the catalog</a></li>[% END %] >- </ul> >-</div><!-- /header_search --> >+ [% IF ( CAN_user_catalogue ) %] >+ <div id="catalog_search" class="residentsearch"> >+ <p class="tip">Enter search keywords:</p> >+ <form action="/cgi-bin/koha/catalogue/search.pl" method="get" id="cat-search-block"> >+ <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" /> >+ <input type="submit" value="Submit" class="submit" /> >+ </form> >+ </div> >+ [% END %] >+ <ul> >+ <li><a href="#subscription_search">Search subscriptions</a></li> >+ [% IF ( CAN_user_circulate ) %]<li><a href="#circ_search">Check out</a></li>[% END %] >+ [% IF ( CAN_user_catalogue ) %]<li><a href="#catalog_search">Search the catalog</a></li>[% END %] >+ </ul> >+ </div><!-- /header_search --> > </div><!-- /gradient --> > <!-- End Serials Resident Search Box --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues.tt >index a22b97b..7bc9feb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues.tt >@@ -16,7 +16,7 @@ > > <h1>Subscription information for <i>[% bibliotitle %]</i></h1> > <div id="action"> >- <a href="/cgi-bin/koha/serials/serials-home.pl?biblionumber=[% biblionumber %]">Subscriptions</a> >+ <a href="/cgi-bin/koha/serials/serials-search.pl?biblionumber=[% biblionumber %]">Subscriptions</a> > <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber %]">Back to biblio</a> > <a href="/cgi-bin/koha/serials/serial-issues.pl?biblionumber=[% biblionumber %]&selectview=full">Complete view</a> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >index 1fdf693..e396e1d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt >@@ -1,159 +1,22 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Serials [% biblionumber %]</title> >-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> >-<script type="text/javascript"> >-//<![CDATA[ >- $(document).ready(function() { >- var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumnDefs": [ >- { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false }, >- ], >- "sPaginationType": "four_button" >- } ) ); >- >- srlt.fnAddFilters("filter", 750); >- }); >- //]]> >-</script> > </head> > <body id="ser_serials-home" class="ser"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'serials-search.inc' %] > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Search results[% ELSE %]Serials [% END %] </div> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Serials </div> > > <div id="doc3" class="yui-t2"> >- >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >- [% INCLUDE 'serials-toolbar.inc' %] >- >-[% IF ( information ) %] >-Serials updated : >-<table> >- <tr> >- <th> >- Serialseq >- </th> >- <th> >- Status >- </th> >- <th> >- Published date >- </th> >- <th> >- Planned date >- </th> >- <th> >- Notes >- </th> >- </tr> >-[% FOREACH informatio IN information %] >- <tr> >- <td> >- [% informatio.serialseq %] >- </td> >- <td> >- [% informatio.status %] >- </td> >- <td> >- [% informatio.publisheddate %] >- </td> >- <td> >- [% informatio.planneddate %] >- </td> >- <td> >- [% informatio.notes %] >- </td> >- </tr> >-[% END %] >-</table> >-[% END %] >- [% IF ( done_searched ) %] >-<h2>Serials subscriptions</h2> >- >- <table id="srlt"> >- <thead> >- <tr> >- <th>ISSN</th> >- <th>Title</th> >- <th> Notes </th> >- <th> >- Library (callnumber) >- </th> >- [% IF ( routing && CAN_user_serials_routing ) %] >- <th>Routing list</th> >- [% END %] >- <th> </th> >- <th> </th> >- </tr> >- </thead> >- <tfoot> >- <tr> >- <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td> >- <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td> >- <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td> >- <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td> >- [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %] >- <td></td> >- <td></td> >- </tr> >- </tfoot> >- <tbody> >- [% FOREACH subscription IN subscriptions %] >- <tr> >- <td> >- [% IF ( subscription.issn ) %][% subscription.issn %] >- [% END %] >- </td> >- <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a> >- </td> >- <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %] >- [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] >- </td> >- <td> >- [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %] >- [% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %] >- </td> >- [% IF ( routing && CAN_user_serials_routing ) %] >- <td> >- [% IF ( subscription.cannotedit ) %] >- >- [% ELSE %] >- [% IF ( subscription.routingedit ) %] >- <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a> >- [% ELSE %] >- <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&op=new">New</a> >- [% END %] >- [% END %] >- </td> >- [% END %] >- <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a> >- </td> >- <td> >- [% IF ( subscription.cannotedit ) %] >- >- [% ELSE %] >- [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&serstatus=1,3,7">Serial receive</a>[% END %] >- [% END %] >- </td> >- </tr> >- [% END %] >- </tbody> >- </table> >- >- [% END %] >- >-</div> >-</div> >- >-<div class="yui-b"> >-[% INCLUDE 'serials-menu.inc' %] >-</div> >+<div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ [% INCLUDE 'serials-toolbar.inc' %] >+ </div> >+ </div> >+ <div class="yui-b"> >+ [% INCLUDE 'serials-menu.inc' %] >+ </div> > </div> > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >new file mode 100644 >index 0000000..6746d25 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >@@ -0,0 +1,174 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Serials [% biblionumber %]</title> >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'doc-head-close.inc' %] >+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> >+[% INCLUDE 'datatables-strings.inc' %] >+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> >+<script type="text/javascript"> >+//<![CDATA[ >+ $(document).ready(function() { >+ var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "sPaginationType": "four_button" >+ } ) ); >+ >+ srlt.fnAddFilters("filter", 750); >+ }); >+ //]]> >+</script> >+</head> >+<body id="ser_serials-home" class="ser"> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'serials-search.inc' %] >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Search results[% ELSE %]Serials [% END %] </div> >+ >+<div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ [% INCLUDE 'serials-toolbar.inc' %] >+ >+ <h2>Serials subscriptions</h2> >+ >+ <div id="advsearch"> >+ <form action="/cgi-bin/koha/serials/serials-search.pl" method="get"> >+ <fieldset class="brief"> >+ [% IF ( done_searched ) %] >+ <div onclick="$('#advsearch_form').slideToggle(400);" style="width:100%;"> >+ <a id="unfold_advsearch" style="cursor:pointer">Advanced search</a> >+ </div> >+ <div id="advsearch_form" style="display:none"> >+ [% ELSE %] >+ <div> >+ [% END %] >+ <ol> >+ <li> >+ <label for="issn">ISSN:</label> >+ <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" /> >+ </li> >+ <li> >+ <label for="title">Title:</label> >+ <input type="text" id="title" name="title_filter" value="[% title_filter %]" /> >+ </li> >+ <li> >+ <label for="ean">EAN:</label> >+ <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" /> >+ </li> >+ <li> >+ <label for="publisher">Publisher:</label> >+ <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" /> >+ </li> >+ <li> >+ <label for="bookseller">Bookseller:</label> >+ <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" /> >+ </li> >+ <li> >+ <label for="branch">Branch:</label> >+ <select id="branch" name="branch_filter"> >+ <option value="">All</option> >+ [% FOREACH branch IN branches_loop %] >+ [% IF ( branch.selected ) %] >+ <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option> >+ [% ELSE %] >+ <option value="[% branch.branchcode %]">[% branch.branchname %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ </ol> >+ <input type="hidden" name="searched" value="1" /> >+ <fieldset class="action"> >+ <input type="submit" value="Search" /> >+ </fieldset> >+ </div> >+ </fieldset> >+ </form> >+ </div> >+ >+ [% IF ( done_searched ) %] >+ [% IF ( subscriptions ) %] >+ <table id="srlt"> >+ <thead> >+ <tr> >+ <th>ISSN</th> >+ <th>Title</th> >+ <th> Notes </th> >+ <th> >+ Library (callnumber) >+ </th> >+ [% IF ( routing && CAN_user_serials_routing ) %] >+ <th>Routing list</th> >+ [% END %] >+ <th> </th> >+ <th> </th> >+ </tr> >+ </thead> >+ <tfoot> >+ <tr> >+ <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td> >+ <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td> >+ <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td> >+ <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td> >+ [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %] >+ <td></td> >+ <td></td> >+ </tr> >+ </tfoot> >+ <tbody> >+ [% FOREACH subscription IN subscriptions %] >+ <tr> >+ <td> >+ [% IF ( subscription.issn ) %][% subscription.issn %] >+ [% END %] >+ </td> >+ <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a> >+ </td> >+ <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %] >+ [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] >+ </td> >+ <td> >+ [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %] >+ [% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %] >+ </td> >+ [% IF ( routing && CAN_user_serials_routing ) %] >+ <td> >+ [% IF ( subscription.cannotedit ) %] >+ >+ [% ELSE %] >+ [% IF ( subscription.routingedit ) %] >+ <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&op=new">New</a> >+ [% END %] >+ [% END %] >+ </td> >+ [% END %] >+ <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a> >+ </td> >+ <td> >+ [% IF ( subscription.cannotedit ) %] >+ >+ [% ELSE %] >+ [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&serstatus=1,3,7">Serial receive</a>[% END %] >+ [% END %] >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ There is no subscription for your search. >+ [% END %] >+ [% END %] >+ </div> >+ </div> >+ >+ <div class="yui-b"> >+ [% INCLUDE 'serials-menu.inc' %] >+ </div> >+</div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/serials/serials-home.pl b/serials/serials-home.pl >index 21b76e0..9ec0336 100755 >--- a/serials/serials-home.pl >+++ b/serials/serials-home.pl >@@ -26,42 +26,18 @@ serials-home.pl > > this script is the main page for serials/ > >-=head1 PARAMETERS >- >-=over 4 >- >-=item title >- >-=item ISSN >- >-=item biblionumber >- >-=back >- > =cut > >-use strict; >-use warnings; >+use Modern::Perl; > use CGI; > use C4::Auth; >-use C4::Serials; >-use C4::Output; >-use C4::Context; > use C4::Branch; >+use C4::Context; >+use C4::Output; >+use C4::Serials; > >-my $query = new CGI; >-my $title = $query->param('title_filter'); >-my $ISSN = $query->param('ISSN_filter'); >-my $EAN = $query->param('EAN_filter'); >-my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials"); >-my $searched = $query->param('searched'); >-my $biblionumber = $query->param('biblionumber'); >- >-my @serialseqs = $query->param('serialseq'); >-my @planneddates = $query->param('planneddate'); >-my @publisheddates = $query->param('publisheddate'); >-my @status = $query->param('status'); >-my @notes = $query->param('notes'); >+my $query = new CGI; >+my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials"); > > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -74,42 +50,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >-if (@serialseqs){ >- my @information; >- my $index; >- foreach my $seq (@serialseqs){ >- if ($seq){ >- ### FIXME This limitation that a serial must be given a title may not be very efficient for some library who do not update serials titles. >- push @information, >- { serialseq=>$seq, >- publisheddate=>$publisheddates[$index], >- planneddate=>$planneddates[$index], >- notes=>$notes[$index], >- status=>$status[$index] >- } >- } >- $index++; >- } >- $template->param('information'=>\@information); >-} >-my @subscriptions; >-if ($searched) { >- @subscriptions = GetSubscriptions( $title, $ISSN, $EAN, $biblionumber ); >-} >- >-# to toggle between create or edit routing list options >-if ($routing) { >- for my $subscription ( @subscriptions) { >- $subscription->{routingedit} = check_routing( $subscription->{subscriptionid} ); >- $subscription->{branchname} = GetBranchName ( $subscription->{branchcode} ); >- } >-} >- > $template->param( >- subscriptions => \@subscriptions, >- title_filter => $title, >- ISSN_filter => $ISSN, >- done_searched => $searched, > routing => $routing, > (uc(C4::Context->preference("marcflavour"))) => 1 > ); >diff --git a/serials/serials-search.pl b/serials/serials-search.pl >new file mode 100755 >index 0000000..0da19d0 >--- /dev/null >+++ b/serials/serials-search.pl >@@ -0,0 +1,110 @@ >+#!/usr/bin/perl >+ >+# Copyright 2012 Koha Team >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+ >+=head1 NAME >+ >+serials-search.pl >+ >+=head1 DESCRIPTION >+ >+this script is the search page for serials >+ >+=cut >+ >+use Modern::Perl; >+use CGI; >+use C4::Auth; >+use C4::Branch; >+use C4::Context; >+use C4::Output; >+use C4::Serials; >+ >+my $query = new CGI; >+my $title = $query->param('title_filter') || ''; >+my $ISSN = $query->param('ISSN_filter') || ''; >+my $EAN = $query->param('EAN_filter') || ''; >+my $publisher = $query->param('publisher_filter') || ''; >+my $bookseller = $query->param('bookseller_filter') || ''; >+my $biblionumber = $query->param('biblionumber') || ''; >+my $branch = $query->param('branch_filter') || ''; >+my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials"); >+my $searched = $query->param('searched') || 0; >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "serials/serials-search.tmpl", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { serials => '*' }, >+ debug => 1, >+ } >+); >+ >+my @subscriptions; >+if ($searched){ >+ @subscriptions = SearchSubscriptions( >+ { >+ biblionumber => $biblionumber, >+ title => $title, >+ issn => $ISSN, >+ ean => $EAN, >+ publisher => $publisher, >+ bookseller => $bookseller, >+ branch => $branch, >+ } >+ ); >+} >+ >+# to toggle between create or edit routing list options >+if ($routing) { >+ for my $subscription ( @subscriptions) { >+ $subscription->{routingedit} = check_routing( $subscription->{subscriptionid} ); >+ $subscription->{branchname} = GetBranchName ( $subscription->{branchcode} ); >+ } >+} >+ >+my $branches = GetBranches(); >+my @branches_loop; >+foreach (sort keys %$branches){ >+ my $selected = 0; >+ $selected = 1 if( $branch eq $_ ); >+ push @branches_loop, { >+ branchcode => $_, >+ branchname => $branches->{$_}->{'branchname'}, >+ selected => $selected, >+ }; >+} >+ >+$template->param( >+ subscriptions => \@subscriptions, >+ title_filter => $title, >+ ISSN_filter => $ISSN, >+ EAN_filter => $EAN, >+ publisher_filter => $publisher, >+ bookseller_filter => $bookseller, >+ branch_filter => $branch, >+ branches_loop => \@branches_loop, >+ done_searched => $searched, >+ routing => $routing, >+ (uc(C4::Context->preference("marcflavour"))) => 1 >+); >+ >+output_html_with_http_headers $query, $cookie, $template->output; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5357
:
10433
|
11263
|
11264
|
11265
|
11266
|
11287
|
11290
|
11736
|
11831
|
11832
|
11839