View | Details | Raw Unified | Return to bug 5357
Collapse All | Expand All

(-)a/C4/Serials.pm (+69 lines)
Lines 36-41 BEGIN { Link Here
36
    @EXPORT = qw(
36
    @EXPORT = qw(
37
      &NewSubscription    &ModSubscription    &DelSubscription    &GetSubscriptions
37
      &NewSubscription    &ModSubscription    &DelSubscription    &GetSubscriptions
38
      &GetSubscription    &CountSubscriptionFromBiblionumber      &GetSubscriptionsFromBiblionumber
38
      &GetSubscription    &CountSubscriptionFromBiblionumber      &GetSubscriptionsFromBiblionumber
39
      &SearchSubscriptions
39
      &GetFullSubscriptionsFromBiblionumber   &GetFullSubscription &ModSubscriptionHistory
40
      &GetFullSubscriptionsFromBiblionumber   &GetFullSubscription &ModSubscriptionHistory
40
      &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
41
      &HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
41
42
Lines 631-636 sub GetSubscriptions { Link Here
631
    return @results;
632
    return @results;
632
}
633
}
633
634
635
=head2 SearchSubscriptions
636
637
@results = SearchSubscriptions($args);
638
$args is a hashref. Its keys can be contained: title, issn, ean, publisher, bookseller and branchcode
639
640
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.
641
642
return:
643
a table of hashref. Each hash containt the subscription.
644
645
=cut
646
647
sub SearchSubscriptions {
648
    my ( $args ) = @_;
649
650
    my $query = qq{
651
        SELECT subscription.*, subscriptionhistory.*, biblio.*, biblioitems.issn
652
        FROM subscription
653
            LEFT JOIN subscriptionhistory USING(subscriptionid)
654
            LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
655
            LEFT JOIN biblioitems ON biblioitems.biblionumber = subscription.biblionumber
656
            LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
657
    };
658
    my @where_strs;
659
    my @where_args;
660
    if( $args->{biblionumber} ) {
661
        push @where_strs, "biblio.biblionumber = ?";
662
        push @where_args, $args->{biblionumber};
663
    }
664
    if( $args->{title} ){
665
        push @where_strs, "biblio.title LIKE ?";
666
        push @where_args, "%$args->{title}%";
667
    }
668
    if( $args->{issn} ){
669
        push @where_strs, "biblioitems.issn LIKE ?";
670
        push @where_args, "%$args->{issn}%";
671
    }
672
    if( $args->{ean} ){
673
        push @where_strs, "biblioitems.ean LIKE ?";
674
        push @where_args, "%$args->{ean}%";
675
    }
676
    if( $args->{publisher} ){
677
        push @where_strs, "biblioitems.publishercode LIKE ?";
678
        push @where_args, "%$args->{publisher}%";
679
    }
680
    if( $args->{bookseller} ){
681
        push @where_strs, "aqbooksellers.name LIKE ?";
682
        push @where_args, "%$args->{bookseller}%";
683
    }
684
    if( $args->{branch} ){
685
        push @where_strs, "subscription.branchcode = ?";
686
        push @where_args, "$args->{branch}";
687
    }
688
689
    if(@where_strs){
690
        $query .= " WHERE " . join(" AND ", @where_strs);
691
    }
692
693
    my $dbh = C4::Context->dbh;
694
    my $sth = $dbh->prepare($query);
695
    $sth->execute(@where_args);
696
    my $results = $sth->fetchall_arrayref( {} );
697
    $sth->finish;
698
699
    return @$results;
700
}
701
702
634
=head2 GetSerials
703
=head2 GetSerials
635
704
636
($totalissues,@serials) = GetSerials($subscriptionid);
705
($totalissues,@serials) = GetSerials($subscriptionid);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (-1 / +1 lines)
Lines 25-31 Link Here
25
    [% END %]
25
    [% END %]
26
    [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% IF ( object ) %][% object %]&amp;analyze=1[% ELSE %][% biblionumber %]&amp;analyze=1[% END %]">Analytics</a></li>[% END %]
26
    [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% IF ( object ) %][% object %]&amp;analyze=1[% ELSE %][% biblionumber %]&amp;analyze=1[% END %]">Analytics</a></li>[% END %]
27
27
28
    [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-home.pl?searched=1&amp;biblionumber=[% biblionumber %]">Subscription(s)</a></li>[% END %]
28
    [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&amp;biblionumber=[% biblionumber %]">Subscription(s)</a></li>[% END %]
29
</ul>
29
</ul>
30
<ul>
30
<ul>
31
[% IF ( issuehistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]
31
[% IF ( issuehistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-search.inc (-29 / +31 lines)
Lines 1-35 Link Here
1
<div class="gradient">
1
<div class="gradient">
2
<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Serials Resident Search Box -->
2
  <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Serials Resident Search Box -->
3
<div id="header_search">
3
  <div id="header_search">
4
	<div id="subscription_search" class="residentsearch">
4
    <div id="subscription_search" class="residentsearch">
5
    <p class="tip">Search subscriptions:</p>
5
    <p class="tip">Search subscriptions:</p>
6
 <form action="/cgi-bin/koha/serials/serials-home.pl" method="get">
6
    <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
7
 [% IF ( routing ) %]<input type="hidden" name="routing" value="[% routing %]" />[% END %]
7
      [% IF ( routing ) %]
8
 <input type="hidden" name="searched" value="1" />
8
        <input type="hidden" name="routing" value="[% routing %]" />
9
 <label for="ISSN_filter">ISSN:</label> <input type="text" size="10" maxlength="11" name="ISSN_filter" id="ISSN_filter" value="[% ISSN_filter %]" />
9
      [% END %]
10
      <input type="hidden" name="searched" value="1" />
11
      <label for="ISSN_filter">ISSN:</label> <input type="text" size="10" maxlength="11" name="ISSN_filter" id="ISSN_filter" value="[% ISSN_filter %]" />
10
12
11
 [% IF (UNIMARC) %]
13
      [% IF (UNIMARC) %]
12
 <label for="EAN_filter">EAN:</label> <input type="text" size="20" maxlength="40" name="EAN_filter" id="EAN_filter" value="[% EAN_filter %]" />
14
        <label for="EAN_filter">EAN:</label> <input type="text" size="20" maxlength="40" name="EAN_filter" id="EAN_filter" value="[% EAN_filter %]" />
13
 [% END %]
15
      [% END %]
14
 <label for="title_filter">Title:</label> <input type="text" size="20" maxlength="40" name="title_filter" id="title_filter" value="[% title_filter %]" />
16
      <label for="title_filter">Title:</label> <input type="text" size="20" maxlength="40" name="title_filter" id="title_filter" value="[% title_filter %]" />
15
 <input type="submit" value="Search" class="submit" />
17
      <input value="Submit" class="submit" type="submit" /> <a href="/cgi-bin/koha/serials/serials-search.pl">Advanced search</a>
16
 </form>
18
    </form>
17
	</div>
19
    </div>
18
    [% INCLUDE 'patron-search-box.inc' %]
20
    [% INCLUDE 'patron-search-box.inc' %]
19
	[% IF ( CAN_user_catalogue ) %]
21
    [% IF ( CAN_user_catalogue ) %]
20
    <div id="catalog_search" class="residentsearch">
22
      <div id="catalog_search" class="residentsearch">
21
	<p class="tip">Enter search keywords:</p>
23
        <p class="tip">Enter search keywords:</p>
22
		<form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
24
        <form action="/cgi-bin/koha/catalogue/search.pl"  method="get" id="cat-search-block">
23
			 <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" />
25
          <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" />
24
				<input type="submit" value="Submit"  class="submit" />
26
          <input type="submit" value="Submit"  class="submit" />
25
		</form>
27
        </form>
26
	</div>
28
      </div>
27
	[% END %]
29
    [% END %]
28
			<ul>
30
    <ul>
29
            <li><a href="#subscription_search">Search subscriptions</a></li>
31
      <li><a href="#subscription_search">Search subscriptions</a></li>
30
            [% IF ( CAN_user_circulate ) %]<li><a href="#circ_search">Check out</a></li>[% END %]
32
      [% IF ( CAN_user_circulate ) %]<li><a href="#circ_search">Check out</a></li>[% END %]
31
            [% IF ( CAN_user_catalogue ) %]<li><a href="#catalog_search">Search the catalog</a></li>[% END %]
33
      [% IF ( CAN_user_catalogue ) %]<li><a href="#catalog_search">Search the catalog</a></li>[% END %]
32
			</ul>	
34
    </ul>
33
</div><!-- /header_search -->
35
  </div><!-- /header_search -->
34
</div><!-- /gradient -->
36
</div><!-- /gradient -->
35
<!-- End Serials Resident Search Box -->
37
<!-- End Serials Resident Search Box -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues.tt (-1 / +1 lines)
Lines 16-22 Link Here
16
16
17
<h1>Subscription information for <i>[% bibliotitle %]</i></h1>
17
<h1>Subscription information for <i>[% bibliotitle %]</i></h1>
18
<div id="action">
18
<div id="action">
19
    <a href="/cgi-bin/koha/serials/serials-home.pl?biblionumber=[% biblionumber %]">Subscriptions</a>
19
    <a href="/cgi-bin/koha/serials/serials-search.pl?biblionumber=[% biblionumber %]">Subscriptions</a>
20
    <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber %]">Back to biblio</a>
20
    <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber %]">Back to biblio</a>
21
    <a href="/cgi-bin/koha/serials/serial-issues.pl?biblionumber=[% biblionumber %]&amp;selectview=full">Complete view</a>
21
    <a href="/cgi-bin/koha/serials/serial-issues.pl?biblionumber=[% biblionumber %]&amp;selectview=full">Complete view</a>
22
</div>
22
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt (-155 / +10 lines)
Lines 1-168 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
3
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7
[% INCLUDE 'datatables-strings.inc' %]
8
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9
<script type="text/javascript">
10
//<![CDATA[
11
 $(document).ready(function() {
12
    var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
13
        "aoColumnDefs": [
14
            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
15
        ],
16
        "sPaginationType": "four_button"
17
    } ) );
18
19
    srlt.fnAddFilters("filter", 750);
20
 });
21
 //]]>
22
</script>
23
</head>
5
</head>
24
<body id="ser_serials-home" class="ser">
6
<body id="ser_serials-home" class="ser">
25
[% INCLUDE 'header.inc' %]
7
[% INCLUDE 'header.inc' %]
26
[% INCLUDE 'serials-search.inc' %]
8
[% INCLUDE 'serials-search.inc' %]
27
9
28
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Search results[% ELSE %]Serials [% END %] </div>
10
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; Serials </div>
29
11
30
<div id="doc3" class="yui-t2">
12
<div id="doc3" class="yui-t2">
31
   
13
<div id="bd">
32
   <div id="bd">
14
  <div id="yui-main">
33
	<div id="yui-main">
15
    <div class="yui-b">
34
	<div class="yui-b">
16
      [% INCLUDE 'serials-toolbar.inc' %]
35
	[% INCLUDE 'serials-toolbar.inc' %]
17
    </div>
36
	
18
  </div>
37
[% IF ( information ) %]
19
  <div class="yui-b">
38
Serials updated :
20
    [% INCLUDE 'serials-menu.inc' %]
39
<table>
21
  </div>
40
  <tr>
41
    <th>
42
      Serialseq
43
    </th>
44
    <th>
45
      Status
46
    </th>
47
    <th>
48
      Published date
49
    </th>
50
    <th>
51
      Planned date
52
    </th>
53
    <th>
54
      Notes
55
    </th>
56
  </tr>  
57
[% FOREACH informatio IN information %]
58
  <tr>
59
    <td>
60
      [% informatio.serialseq %]
61
    </td>
62
    <td>
63
      [% informatio.status %]
64
    </td>
65
    <td>
66
      [% informatio.publisheddate %]
67
    </td>
68
    <td>
69
      [% informatio.planneddate %]
70
    </td>
71
    <td>
72
      [% informatio.notes %]
73
    </td>
74
  </tr>  
75
[% END %]
76
</table>
77
[% END %]
78
        [% IF ( done_searched ) %]
79
<h2>Serials subscriptions</h2>
80
81
    <table id="srlt">
82
	<thead>
83
        <tr>
84
            <th>ISSN</th>
85
            <th>Title</th>
86
            <th> Notes </th>
87
            <th>Library</th>
88
            <th>Call number</th>
89
            <th>Expiration date</th>
90
            [% IF ( routing && CAN_user_serials_routing ) %]
91
              <th>Routing list</th>
92
            [% END %]        
93
            <th>&nbsp;</th>
94
            <th>&nbsp;</th>
95
        </tr>
96
	</thead>
97
    <tfoot>
98
        <tr>
99
            <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
100
            <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
101
            <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
102
            <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
103
            <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
104
            <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
105
            [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
106
            <td></td>
107
            <td></td>
108
        </tr>
109
    </tfoot>
110
	<tbody> 
111
        [% FOREACH subscription IN subscriptions %]
112
            <tr>
113
                <td>
114
                [% IF ( subscription.issn ) %][% subscription.issn %]
115
                [% END %]
116
                </td>
117
                <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
118
                </td>
119
                <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
120
                [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
121
                </td>
122
                <td>
123
                  [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
124
                </td>
125
                <td>
126
                  [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
127
                </td>
128
                <td>
129
                  [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
130
                </td>
131
                [% IF ( routing && CAN_user_serials_routing ) %]
132
                <td>
133
                    [% IF ( subscription.cannotedit ) %]
134
                        &nbsp;
135
                    [% ELSE %]
136
                        [% IF ( subscription.routingedit ) %]
137
                            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
138
                            ([% subscription.routingedit %])
139
                        [% ELSE %]
140
                            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
141
                        [% END %]
142
                    [% END %]
143
                </td>
144
                [% END %]
145
                <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
146
                </td>
147
                <td>
148
                [% IF ( subscription.cannotedit ) %]
149
                  &nbsp;        
150
                [% ELSE %]
151
                  [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>[% END %]
152
                [% END %]
153
                </td>
154
            </tr>
155
        [% END %]
156
	</tbody>
157
    </table>
158
    
159
        [% END %]
160
161
</div>
162
</div>
163
164
<div class="yui-b">
165
[% INCLUDE 'serials-menu.inc' %]
166
</div>
167
</div>
22
</div>
168
[% INCLUDE 'intranet-bottom.inc' %]
23
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (+183 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% USE KohaDates %]
3
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
[% INCLUDE 'doc-head-close.inc' %]
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7
[% INCLUDE 'datatables-strings.inc' %]
8
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
9
<script type="text/javascript">
10
//<![CDATA[
11
 $(document).ready(function() {
12
    var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
13
        "aoColumnDefs": [
14
            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
15
        ],
16
        "sPaginationType": "four_button"
17
    } ) );
18
19
    srlt.fnAddFilters("filter", 750);
20
 });
21
 //]]>
22
</script>
23
</head>
24
<body id="ser_serials-home" class="ser">
25
[% INCLUDE 'header.inc' %]
26
[% INCLUDE 'serials-search.inc' %]
27
28
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Search results[% ELSE %]Serials [% END %] </div>
29
30
<div id="doc3" class="yui-t2">
31
  <div id="bd">
32
    <div id="yui-main">
33
      <div class="yui-b">
34
      [% INCLUDE 'serials-toolbar.inc' %]
35
36
      <h2>Serials subscriptions</h2>
37
38
      <div id="advsearch">
39
        <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
40
          <fieldset class="brief">
41
            [% IF ( done_searched ) %]
42
              <div onclick="$('#advsearch_form').slideToggle(400);" style="width:100%;">
43
                <a id="unfold_advsearch" style="cursor:pointer">Advanced search</a>
44
              </div>
45
              <div id="advsearch_form" style="display:none">
46
            [% ELSE %]
47
              <div>
48
            [% END %]
49
              <ol>
50
                <li>
51
                  <label for="issn">ISSN:</label>
52
                  <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
53
                </li>
54
                <li>
55
                  <label for="title">Title:</label>
56
                  <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
57
                </li>
58
                <li>
59
                  <label for="ean">EAN:</label>
60
                  <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
61
                </li>
62
                <li>
63
                  <label for="publisher">Publisher:</label>
64
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
65
                </li>
66
                <li>
67
                  <label for="bookseller">Bookseller:</label>
68
                  <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
69
                </li>
70
                <li>
71
                  <label for="branch">Branch:</label>
72
                  <select id="branch" name="branch_filter">
73
                    <option value="">All</option>
74
                    [% FOREACH branch IN branches_loop %]
75
                      [% IF ( branch.selected ) %]
76
                        <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
77
                      [% ELSE %]
78
                        <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
79
                      [% END %]
80
                    [% END %]
81
                  </select>
82
                </li>
83
              </ol>
84
              <input type="hidden" name="searched" value="1" />
85
              <fieldset class="action">
86
                <input type="submit" value="Search" />
87
              </fieldset>
88
            </div>
89
          </fieldset>
90
        </form>
91
      </div>
92
93
      [% IF ( done_searched ) %]
94
        [% IF ( subscriptions ) %]
95
          <table id="srlt">
96
            <thead>
97
              <tr>
98
                  <th>ISSN</th>
99
                  <th>Title</th>
100
                  <th> Notes </th>
101
                  <th>Library</th>
102
                  <th>Call number</th>
103
                  <th>Expiration date</th>
104
                  [% IF ( routing && CAN_user_serials_routing ) %]
105
                    <th>Routing list</th>
106
                  [% END %]
107
                  <th>&nbsp;</th>
108
                  <th>&nbsp;</th>
109
              </tr>
110
            </thead>
111
            <tfoot>
112
              <tr>
113
                <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
114
                <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
115
                <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
116
                <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
117
                <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
118
                <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
119
                [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
120
                <td></td>
121
                <td></td>
122
              </tr>
123
            </tfoot>
124
            <tbody>
125
              [% FOREACH subscription IN subscriptions %]
126
                <tr>
127
                  <td>
128
                  [% IF ( subscription.issn ) %][% subscription.issn %]
129
                  [% END %]
130
                  </td>
131
                  <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
132
                  </td>
133
                  <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
134
                  [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
135
                  </td>
136
                  <td>
137
                    [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
138
                  </td>
139
                  <td>
140
                    [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
141
                  </td>
142
                  <td>
143
                    [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
144
                  </td>
145
                  [% IF ( routing && CAN_user_serials_routing ) %]
146
                  <td>
147
                    [% IF ( subscription.cannotedit ) %]
148
                      &nbsp;
149
                    [% ELSE %]
150
                      [% IF ( subscription.routingedit ) %]
151
                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
152
                        ([% subscription.routingedit %])
153
                      [% ELSE %]
154
                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
155
                      [% END %]
156
                    [% END %]
157
                  </td>
158
                  [% END %]
159
                  <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
160
                  </td>
161
                  <td>
162
                  [% IF ( subscription.cannotedit ) %]
163
                    &nbsp;
164
                  [% ELSE %]
165
                    [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>[% END %]
166
                  [% END %]
167
                  </td>
168
                </tr>
169
              [% END %]
170
            </tbody>
171
          </table>
172
        [% ELSE %]
173
          There is no subscription for your search.
174
        [% END %]
175
      [% END %]
176
    </div>
177
  </div>
178
179
  <div class="yui-b">
180
    [% INCLUDE 'serials-menu.inc' %]
181
  </div>
182
</div>
183
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/serials/serials-home.pl (-65 / +6 lines)
Lines 26-67 serials-home.pl Link Here
26
26
27
this script is the main page for serials/
27
this script is the main page for serials/
28
28
29
=head1 PARAMETERS
30
31
=over 4
32
33
=item title
34
35
=item ISSN
36
37
=item biblionumber
38
39
=back
40
41
=cut
29
=cut
42
30
43
use strict;
31
use Modern::Perl;
44
use warnings;
45
use CGI;
32
use CGI;
46
use C4::Auth;
33
use C4::Auth;
47
use C4::Serials;
48
use C4::Output;
49
use C4::Context;
50
use C4::Branch;
34
use C4::Branch;
35
use C4::Context;
36
use C4::Output;
37
use C4::Serials;
51
38
52
my $query        = new CGI;
39
my $query   = new CGI;
53
my $title        = $query->param('title_filter');
40
my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials");
54
my $ISSN         = $query->param('ISSN_filter');
55
my $EAN          = $query->param('EAN_filter');
56
my $routing      = $query->param('routing') || C4::Context->preference("RoutingSerials");
57
my $searched     = $query->param('searched');
58
my $biblionumber = $query->param('biblionumber');
59
60
my @serialseqs = $query->param('serialseq');
61
my @planneddates = $query->param('planneddate');
62
my @publisheddates = $query->param('publisheddate');
63
my @status = $query->param('status');
64
my @notes = $query->param('notes');
65
41
66
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
42
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
67
    {
43
    {
Lines 74-115 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
74
    }
50
    }
75
);
51
);
76
52
77
if (@serialseqs){
78
  my @information;
79
  my $index;
80
  foreach my $seq (@serialseqs){
81
    if ($seq){
82
      ### 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.
83
      push @information,
84
        { serialseq=>$seq,
85
          publisheddate=>$publisheddates[$index],
86
          planneddate=>$planneddates[$index],
87
          notes=>$notes[$index],
88
          status=>$status[$index]
89
        }
90
    }
91
    $index++;
92
  }
93
  $template->param('information'=>\@information);
94
}
95
my @subscriptions;
96
if ($searched) {
97
    @subscriptions = GetSubscriptions( $title, $ISSN, $EAN, $biblionumber );
98
}
99
100
# to toggle between create or edit routing list options
101
if ($routing) {
102
    for my $subscription ( @subscriptions) {
103
        $subscription->{routingedit} = check_routing( $subscription->{subscriptionid} );
104
        $subscription->{branchname} = GetBranchName ( $subscription->{branchcode} );
105
    }
106
}
107
108
$template->param(
53
$template->param(
109
    subscriptions => \@subscriptions,
110
    title_filter  => $title,
111
    ISSN_filter   => $ISSN,
112
    done_searched => $searched,
113
    routing       => $routing,
54
    routing       => $routing,
114
    (uc(C4::Context->preference("marcflavour"))) => 1
55
    (uc(C4::Context->preference("marcflavour"))) => 1
115
);
56
);
(-)a/serials/serials-search.pl (-1 / +110 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright 2012 Koha Team
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
21
=head1 NAME
22
23
serials-search.pl
24
25
=head1 DESCRIPTION
26
27
this script is the search page for serials
28
29
=cut
30
31
use Modern::Perl;
32
use CGI;
33
use C4::Auth;
34
use C4::Branch;
35
use C4::Context;
36
use C4::Output;
37
use C4::Serials;
38
39
my $query         = new CGI;
40
my $title         = $query->param('title_filter') || '';
41
my $ISSN          = $query->param('ISSN_filter') || '';
42
my $EAN           = $query->param('EAN_filter') || '';
43
my $publisher     = $query->param('publisher_filter') || '';
44
my $bookseller    = $query->param('bookseller_filter') || '';
45
my $biblionumber  = $query->param('biblionumber') || '';
46
my $branch        = $query->param('branch_filter') || '';
47
my $routing       = $query->param('routing') || C4::Context->preference("RoutingSerials");
48
my $searched      = $query->param('searched') || 0;
49
50
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
51
    {
52
        template_name   => "serials/serials-search.tmpl",
53
        query           => $query,
54
        type            => "intranet",
55
        authnotrequired => 0,
56
        flagsrequired   => { serials => '*' },
57
        debug           => 1,
58
    }
59
);
60
61
my @subscriptions;
62
if ($searched){
63
    @subscriptions = SearchSubscriptions(
64
        {
65
            biblionumber => $biblionumber,
66
            title        => $title,
67
            issn         => $ISSN,
68
            ean          => $EAN,
69
            publisher    => $publisher,
70
            bookseller   => $bookseller,
71
            branch       => $branch,
72
        }
73
    );
74
}
75
76
# to toggle between create or edit routing list options
77
if ($routing) {
78
    for my $subscription ( @subscriptions) {
79
        $subscription->{routingedit} = check_routing( $subscription->{subscriptionid} );
80
        $subscription->{branchname} = GetBranchName ( $subscription->{branchcode} );
81
    }
82
}
83
84
my $branches = GetBranches();
85
my @branches_loop;
86
foreach (sort keys %$branches){
87
    my $selected = 0;
88
    $selected = 1 if( $branch eq $_ );
89
    push @branches_loop, {
90
        branchcode  => $_,
91
        branchname  => $branches->{$_}->{'branchname'},
92
        selected    => $selected,
93
    };
94
}
95
96
$template->param(
97
    subscriptions => \@subscriptions,
98
    title_filter  => $title,
99
    ISSN_filter   => $ISSN,
100
    EAN_filter    => $EAN,
101
    publisher_filter => $publisher,
102
    bookseller_filter  => $bookseller,
103
    branch_filter => $branch,
104
    branches_loop => \@branches_loop,
105
    done_searched => $searched,
106
    routing       => $routing,
107
    (uc(C4::Context->preference("marcflavour"))) => 1
108
);
109
110
output_html_with_http_headers $query, $cookie, $template->output;

Return to bug 5357