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

(-)a/C4/Serials.pm (+65 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 630-635 sub GetSubscriptions { Link Here
630
    return @results;
631
    return @results;
631
}
632
}
632
633
634
=head2 SearchSubscriptions
635
636
@results = SearchSubscriptions($args);
637
$args is a hashref. Its keys can be contained: title, issn, ean, publisher, bookseller and branchcode
638
639
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.
640
641
return:
642
a table of hashref. Each hash containt the subscription.
643
644
=cut
645
646
sub SearchSubscriptions {
647
    my ( $args ) = @_;
648
649
    my $query = qq{
650
        SELECT subscription.*, subscriptionhistory.*, biblio.*, biblioitems.issn
651
        FROM subscription
652
            LEFT JOIN subscriptionhistory USING(subscriptionid)
653
            LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
654
            LEFT JOIN biblioitems ON biblioitems.biblionumber = subscription.biblionumber
655
            LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
656
    };
657
    my @where_strs;
658
    my @where_args;
659
    if( $args->{title} ){
660
        push @where_strs, "biblio.title LIKE ?";
661
        push @where_args, "%$args->{title}%";
662
    }
663
    if( $args->{issn} ){
664
        push @where_strs, "biblioitems.issn LIKE ?";
665
        push @where_args, "%$args->{issn}issn%";
666
    }
667
    if( $args->{ean} ){
668
        push @where_strs, "biblioitems.ean LIKE ?";
669
        push @where_args, "%$args->{ean}%";
670
    }
671
    if( $args->{publisher} ){
672
        push @where_strs, "biblioitems.publishercode LIKE ?";
673
        push @where_args, "%$args->{publisher}%";
674
    }
675
    if( $args->{bookseller} ){
676
        push @where_strs, "aqbooksellers.name LIKE ?";
677
        push @where_args, "%$args->bookseller}%";
678
    }
679
    if( $args->{branch} ){
680
        push @where_strs, "subscription.branchcode = ?";
681
        push @where_args, "$args->{branch}";
682
    }
683
684
    if(@where_strs){
685
        $query .= " WHERE " . join(" AND ", @where_strs);
686
    }
687
688
    my $dbh = C4::Context->dbh;
689
    my $sth = $dbh->prepare($query);
690
    $sth->execute(@where_args);
691
    my $results = $sth->fetchall_arrayref( {} );
692
    $sth->finish;
693
694
    return @$results;
695
}
696
697
633
=head2 GetSerials
698
=head2 GetSerials
634
699
635
($totalissues,@serials) = GetSerials($subscriptionid);
700
($totalissues,@serials) = GetSerials($subscriptionid);
(-)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/serials-home.tt (-144 / +32 lines)
Lines 1-24 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
2
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
3
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
6
[% INCLUDE 'datatables-strings.inc' %]
7
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
8
<script type="text/javascript">
9
//<![CDATA[
10
 $(document).ready(function() {
11
    var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
12
        "aoColumnDefs": [
13
            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
14
        ],
15
        "sPaginationType": "four_button"
16
    } ) );
17
18
    srlt.fnAddFilters("filter", 750);
19
 });
20
 //]]>
21
</script>
22
</head>
4
</head>
23
<body id="ser_serials-home" class="ser">
5
<body id="ser_serials-home" class="ser">
24
[% INCLUDE 'header.inc' %]
6
[% INCLUDE 'header.inc' %]
Lines 27-159 Link Here
27
<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>
9
<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>
28
10
29
<div id="doc3" class="yui-t2">
11
<div id="doc3" class="yui-t2">
30
   
12
<div id="bd">
31
   <div id="bd">
13
  <div id="yui-main">
32
	<div id="yui-main">
14
    <div class="yui-b">
33
	<div class="yui-b">
15
      [% INCLUDE 'serials-toolbar.inc' %]
34
	[% INCLUDE 'serials-toolbar.inc' %]
16
      [% IF ( information ) %]
35
	
17
        Serials updated :
36
[% IF ( information ) %]
18
        <table>
37
Serials updated :
19
          <thead>
38
<table>
39
  <tr>
40
    <th>
41
      Serialseq
42
    </th>
43
    <th>
44
      Status
45
    </th>
46
    <th>
47
      Published date
48
    </th>
49
    <th>
50
      Planned date
51
    </th>
52
    <th>
53
      Notes
54
    </th>
55
  </tr>  
56
[% FOREACH informatio IN information %]
57
  <tr>
58
    <td>
59
      [% informatio.serialseq %]
60
    </td>
61
    <td>
62
      [% informatio.status %]
63
    </td>
64
    <td>
65
      [% informatio.publisheddate %]
66
    </td>
67
    <td>
68
      [% informatio.planneddate %]
69
    </td>
70
    <td>
71
      [% informatio.notes %]
72
    </td>
73
  </tr>  
74
[% END %]
75
</table>
76
[% END %]
77
        [% IF ( done_searched ) %]
78
<h2>Serials subscriptions</h2>
79
80
    <table id="srlt">
81
	<thead>
82
        <tr>
83
            <th>ISSN</th>
84
            <th>Title</th>
85
            <th> Notes </th>
86
            <th>
87
                Library (callnumber)
88
            </th>
89
            [% IF ( routing && CAN_user_serials_routing ) %]
90
              <th>Routing list</th>
91
            [% END %]        
92
            <th>&nbsp;</th>
93
            <th>&nbsp;</th>
94
        </tr>
95
	</thead>
96
    <tfoot>
97
        <tr>
98
            <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
99
            <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
100
            <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
101
            <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
102
            [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
103
            <td></td>
104
            <td></td>
105
        </tr>
106
    </tfoot>
107
	<tbody> 
108
        [% FOREACH subscription IN subscriptions %]
109
            <tr>
20
            <tr>
110
                <td>
21
              <th>Serialseq</th>
111
                [% IF ( subscription.issn ) %][% subscription.issn %]
22
              <th>Status</th>
112
                [% END %]
23
              <th>Published date</th>
113
                </td>
24
              <th>Planned date</th>
114
                <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
25
              <th>Notes</th>
115
                </td>
116
                <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
117
                [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
118
                </td>
119
                <td>
120
                [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
121
                [% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %]
122
                </td>
123
                [% IF ( routing && CAN_user_serials_routing ) %]
124
                <td>
125
                    [% IF ( subscription.cannotedit ) %]
126
                        &nbsp;
127
                    [% ELSE %]
128
                        [% IF ( subscription.routingedit ) %]
129
                            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
130
                        [% ELSE %]
131
                            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
132
                        [% END %]
133
                    [% END %]
134
                </td>
135
                [% END %]
136
                <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
137
                </td>
138
                <td>
139
                [% IF ( subscription.cannotedit ) %]
140
                  &nbsp;        
141
                [% ELSE %]
142
                  [% 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 %]
143
                [% END %]
144
                </td>
145
            </tr>
26
            </tr>
146
        [% END %]
27
          </thead>
147
	</tbody>
28
          <tbody>
148
    </table>
29
            [% FOREACH informatio IN information %]
149
    
30
              <tr>
150
        [% END %]
31
                <td>[% informatio.serialseq %]</td>
151
32
                <td>[% informatio.status %]</td>
152
</div>
33
                <td>[% informatio.publisheddate %]</td>
153
</div>
34
                <td>[% informatio.planneddate %]</td>
154
35
                <td>[% informatio.notes %]</td>
155
<div class="yui-b">
36
              </tr>
156
[% INCLUDE 'serials-menu.inc' %]
37
            [% END %]
157
</div>
38
          </tbody>
39
        </table>
40
      [% END %]
41
    </div>
42
  </div>
43
  <div class="yui-b">
44
    [% INCLUDE 'serials-menu.inc' %]
45
  </div>
158
</div>
46
</div>
159
[% INCLUDE 'intranet-bottom.inc' %]
47
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (+172 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
3
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4
[% INCLUDE 'doc-head-close.inc' %]
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
6
[% INCLUDE 'datatables-strings.inc' %]
7
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
8
<script type="text/javascript">
9
//<![CDATA[
10
 $(document).ready(function() {
11
    var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
12
        "aoColumnDefs": [
13
            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
14
        ],
15
        "sPaginationType": "four_button"
16
    } ) );
17
18
    srlt.fnAddFilters("filter", 750);
19
 });
20
 //]]>
21
</script>
22
</head>
23
<body id="ser_serials-home" class="ser">
24
[% INCLUDE 'header.inc' %]
25
[% INCLUDE 'serials-search.inc' %]
26
27
<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>
28
29
<div id="doc3" class="yui-t2">
30
  <div id="bd">
31
    <div id="yui-main">
32
      <div class="yui-b">
33
      [% INCLUDE 'serials-toolbar.inc' %]
34
35
      <h2>Serials subscriptions</h2>
36
37
      <div id="advsearch">
38
        <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
39
          <fieldset class="brief">
40
            [% IF ( done_searched ) %]
41
              <a id="unfold_advsearch" style="cursor:pointer" onclick="$('#advsearch_form').slideToggle(400);">Advanced search</a>
42
              <div id="advsearch_form" style="display:none">
43
            [% ELSE %]
44
              <div>
45
            [% END %]
46
              <ol>
47
                <li>
48
                  <label for="issn">ISSN:</label>
49
                  <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
50
                </li>
51
                <li>
52
                  <label for="title">Title:</label>
53
                  <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
54
                </li>
55
                <li>
56
                  <label for="ean">EAN:</label>
57
                  <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
58
                </li>
59
                <li>
60
                  <label for="publisher">Publisher:</label>
61
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
62
                </li>
63
                <li>
64
                  <label for="bookseller">Bookseller:</label>
65
                  <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
66
                </li>
67
                <li>
68
                  <label for="branch">Branch:</label>
69
                  <select id="branch" name="branch_filter">
70
                    <option value="">All</option>
71
                    [% FOREACH branch IN branches_loop %]
72
                      [% IF ( branch.selected ) %]
73
                        <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
74
                      [% ELSE %]
75
                        <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
76
                      [% END %]
77
                    [% END %]
78
                  </select>
79
                </li>
80
              </ol>
81
              <input type="hidden" name="searched" value="1" />
82
              <fieldset class="action">
83
                <input type="submit" value="Search" />
84
              </fieldset>
85
            </div>
86
          </fieldset>
87
        </form>
88
      </div>
89
90
      [% IF ( done_searched ) %]
91
        [% IF ( subscriptions ) %]
92
          <table id="srlt">
93
            <thead>
94
              <tr>
95
                  <th>ISSN</th>
96
                  <th>Title</th>
97
                  <th> Notes </th>
98
                  <th>
99
                      Library (callnumber)
100
                  </th>
101
                  [% IF ( routing && CAN_user_serials_routing ) %]
102
                    <th>Routing list</th>
103
                  [% END %]        
104
                  <th>&nbsp;</th>
105
                  <th>&nbsp;</th>
106
              </tr>
107
            </thead>
108
            <tfoot>
109
              <tr>
110
                <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
111
                <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
112
                <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
113
                <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
114
                [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
115
                <td></td>
116
                <td></td>
117
              </tr>
118
            </tfoot>
119
            <tbody>
120
              [% FOREACH subscription IN subscriptions %]
121
                <tr>
122
                  <td>
123
                  [% IF ( subscription.issn ) %][% subscription.issn %]
124
                  [% END %]
125
                  </td>
126
                  <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
127
                  </td>
128
                  <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
129
                  [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
130
                  </td>
131
                  <td>
132
                  [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
133
                  [% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %]
134
                  </td>
135
                  [% IF ( routing && CAN_user_serials_routing ) %]
136
                  <td>
137
                    [% IF ( subscription.cannotedit ) %]
138
                      &nbsp;
139
                    [% ELSE %]
140
                      [% IF ( subscription.routingedit ) %]
141
                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
142
                      [% ELSE %]
143
                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
144
                      [% END %]
145
                    [% END %]
146
                  </td>
147
                  [% END %]
148
                  <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
149
                  </td>
150
                  <td>
151
                  [% IF ( subscription.cannotedit ) %]
152
                    &nbsp;        
153
                  [% ELSE %]
154
                    [% 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 %]
155
                  [% END %]
156
                  </td>
157
                </tr>
158
              [% END %]
159
            </tbody>
160
          </table>
161
        [% ELSE %]
162
          There is no subscription for your search.
163
        [% END %]
164
      [% END %]
165
    </div>
166
  </div>
167
168
  <div class="yui-b">
169
    [% INCLUDE 'serials-menu.inc' %]
170
  </div>
171
</div>
172
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/serials/serials-home.pl (-12 / +32 lines)
Lines 44-61 use strict; Link Here
44
use warnings;
44
use warnings;
45
use CGI;
45
use CGI;
46
use C4::Auth;
46
use C4::Auth;
47
use C4::Serials;
48
use C4::Output;
49
use C4::Context;
50
use C4::Branch;
47
use C4::Branch;
48
use C4::Context;
49
use C4::Output;
50
use C4::Serials;
51
51
52
my $query        = new CGI;
52
my $query         = new CGI;
53
my $title        = $query->param('title_filter');
53
my $title         = $query->param('title_filter');
54
my $ISSN         = $query->param('ISSN_filter');
54
my $ISSN          = $query->param('ISSN_filter');
55
my $EAN          = $query->param('EAN_filter');
55
my $EAN           = $query->param('EAN_filter');
56
my $routing      = $query->param('routing') || C4::Context->preference("RoutingSerials");
56
my $publisher     = $query->param('publisher_filter');
57
my $searched     = $query->param('searched');
57
my $supplier      = $query->param('supplier_filter');
58
my $biblionumber = $query->param('biblionumber');
58
my $branch        = $query->param('branch_filter');
59
my $routing       = $query->param('routing') || C4::Context->preference("RoutingSerials");
60
my $searched      = $query->param('searched');
61
my $biblionumber  = $query->param('biblionumber');
59
62
60
my @serialseqs = $query->param('serialseq');
63
my @serialseqs = $query->param('serialseq');
61
my @planneddates = $query->param('planneddate');
64
my @planneddates = $query->param('planneddate');
Lines 93-100 if (@serialseqs){ Link Here
93
  $template->param('information'=>\@information);
96
  $template->param('information'=>\@information);
94
}
97
}
95
my @subscriptions;
98
my @subscriptions;
96
if ($searched) {
99
if ($searched){
97
    @subscriptions = GetSubscriptions( $title, $ISSN, $EAN, $biblionumber );
100
    @subscriptions = SearchSubscriptions( $title, $ISSN, $EAN, $publisher, $supplier, $branch );
98
}
101
}
99
102
100
# to toggle between create or edit routing list options
103
# to toggle between create or edit routing list options
Lines 105-114 if ($routing) { Link Here
105
    }
108
    }
106
}
109
}
107
110
111
my $branches = GetBranches();
112
my @branches_loop;
113
foreach (sort keys %$branches){
114
    my $selected = 0;
115
    $selected = 1 if( $branch eq $_ );
116
    push @branches_loop, {
117
        branchcode  => $_,
118
        branchname  => $branches->{$_}->{'branchname'},
119
        selected    => $selected,
120
    };
121
}
122
108
$template->param(
123
$template->param(
109
    subscriptions => \@subscriptions,
124
    subscriptions => \@subscriptions,
110
    title_filter  => $title,
125
    title_filter  => $title,
111
    ISSN_filter   => $ISSN,
126
    ISSN_filter   => $ISSN,
127
    EAN_filter    => $EAN,
128
    publisher_filter => $publisher,
129
    supplier_filter  => $supplier,
130
    branch_filter => $branch,
131
    branches_loop => \@branches_loop,
112
    done_searched => $searched,
132
    done_searched => $searched,
113
    routing       => $routing,
133
    routing       => $routing,
114
    (uc(C4::Context->preference("marcflavour"))) => 1
134
    (uc(C4::Context->preference("marcflavour"))) => 1
(-)a/serials/serials-search.pl (-1 / +114 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 $branch        = $query->param('branch_filter') || '';
46
my $routing       = $query->param('routing') || C4::Context->preference("RoutingSerials");
47
my $searched      = $query->param('searched') || 0;
48
49
my @serialseqs = $query->param('serialseq');
50
my @planneddates = $query->param('planneddate');
51
my @publisheddates = $query->param('publisheddate');
52
my @status = $query->param('status');
53
my @notes = $query->param('notes');
54
55
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
56
    {
57
        template_name   => "serials/serials-search.tmpl",
58
        query           => $query,
59
        type            => "intranet",
60
        authnotrequired => 0,
61
        flagsrequired   => { serials => '*' },
62
        debug           => 1,
63
    }
64
);
65
66
my @subscriptions;
67
if ($searched){
68
    @subscriptions = SearchSubscriptions(
69
        {
70
            title =>$title,
71
            isbn => $ISSN,
72
            ean => $EAN,
73
            publisher => $publisher,
74
            bookseller => $bookseller,
75
            branch => $branch
76
        }
77
    );
78
}
79
80
# to toggle between create or edit routing list options
81
if ($routing) {
82
    for my $subscription ( @subscriptions) {
83
        $subscription->{routingedit} = check_routing( $subscription->{subscriptionid} );
84
        $subscription->{branchname} = GetBranchName ( $subscription->{branchcode} );
85
    }
86
}
87
88
my $branches = GetBranches();
89
my @branches_loop;
90
foreach (sort keys %$branches){
91
    my $selected = 0;
92
    $selected = 1 if( $branch eq $_ );
93
    push @branches_loop, {
94
        branchcode  => $_,
95
        branchname  => $branches->{$_}->{'branchname'},
96
        selected    => $selected,
97
    };
98
}
99
100
$template->param(
101
    subscriptions => \@subscriptions,
102
    title_filter  => $title,
103
    ISSN_filter   => $ISSN,
104
    EAN_filter    => $EAN,
105
    publisher_filter => $publisher,
106
    bookseller_filter  => $bookseller,
107
    branch_filter => $branch,
108
    branches_loop => \@branches_loop,
109
    done_searched => $searched,
110
    routing       => $routing,
111
    (uc(C4::Context->preference("marcflavour"))) => 1
112
);
113
114
output_html_with_http_headers $query, $cookie, $template->output;

Return to bug 5357