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

(-)a/C4/Serials.pm (+12 lines)
Lines 682-687 sub SearchSubscriptions { Link Here
682
        push @where_strs, "biblioitems.ean LIKE ?";
682
        push @where_strs, "biblioitems.ean LIKE ?";
683
        push @where_args, "%$args->{ean}%";
683
        push @where_args, "%$args->{ean}%";
684
    }
684
    }
685
    if ( $args->{callnumber} ) {
686
        push @where_strs, "subscription.callnumber LIKE ?";
687
        push @where_args, "%$args->{callnumber}%";
688
    }
685
    if( $args->{publisher} ){
689
    if( $args->{publisher} ){
686
        push @where_strs, "biblioitems.publishercode LIKE ?";
690
        push @where_strs, "biblioitems.publishercode LIKE ?";
687
        push @where_args, "%$args->{publisher}%";
691
        push @where_args, "%$args->{publisher}%";
Lines 694-699 sub SearchSubscriptions { Link Here
694
        push @where_strs, "subscription.branchcode = ?";
698
        push @where_strs, "subscription.branchcode = ?";
695
        push @where_args, "$args->{branch}";
699
        push @where_args, "$args->{branch}";
696
    }
700
    }
701
    if ( $args->{location} ) {
702
        push @where_strs, "subscription.location = ?";
703
        push @where_args, "$args->{location}";
704
    }
705
    if ( $args->{expiration_date} ) {
706
        push @where_strs, "subscription.enddate <= ?";
707
        push @where_args, "$args->{expiration_date}";
708
    }
697
    if( defined $args->{closed} ){
709
    if( defined $args->{closed} ){
698
        push @where_strs, "subscription.closed = ?";
710
        push @where_strs, "subscription.closed = ?";
699
        push @where_args, "$args->{closed}";
711
        push @where_args, "$args->{closed}";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-3 / +62 lines)
Lines 1-9 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% USE KohaDates %]
3
[% USE KohaDates %]
4
[% USE KohaAuthorisedValues %]
4
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
5
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'calendar.inc' %]
7
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
9
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
8
[% INCLUDE 'datatables-strings.inc' %]
10
[% INCLUDE 'datatables-strings.inc' %]
9
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
11
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
Lines 73-78 Link Here
73
                </li>
75
                </li>
74
                [% END %]
76
                [% END %]
75
                <li>
77
                <li>
78
                  <label for="callnumber">Callnumber:</label>
79
                  <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter %]" />
80
                </li>
81
                <li>
76
                  <label for="publisher">Publisher:</label>
82
                  <label for="publisher">Publisher:</label>
77
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
83
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
78
                </li>
84
                </li>
Lines 93-98 Link Here
93
                    [% END %]
99
                    [% END %]
94
                  </select>
100
                  </select>
95
                </li>
101
                </li>
102
                [% IF locations %]
103
                  <li>
104
                    <label for="location">Location:</label>
105
                    <select name="location_filter">
106
                      <option value="">All</option>
107
                      [% FOR loc IN locations %]
108
                        [% IF loc.selected %]
109
                          <option value="[% loc.authorised_value %]" selected="selected">[% loc.lib %]</option>
110
                        [% ELSE %]
111
                          <option value="[% loc.authorised_value %]">[% loc.lib %]</option>
112
                        [% END %]
113
                      [% END %]
114
                    </select>
115
                  </li>
116
                [% END %]
117
                <li>
118
                  <label for="to">Expiration date:</label>
119
                  <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
120
                </li>
96
              </ol>
121
              </ol>
97
              <input type="hidden" name="searched" value="1" />
122
              <input type="hidden" name="searched" value="1" />
98
              <fieldset class="action">
123
              <fieldset class="action">
Lines 118-123 Link Here
118
                        <th>Title</th>
143
                        <th>Title</th>
119
                        <th> Notes </th>
144
                        <th> Notes </th>
120
                        <th>Library</th>
145
                        <th>Library</th>
146
                        <th>Location</th>
121
                        <th>Call number</th>
147
                        <th>Call number</th>
122
                        <th>Expiration date</th>
148
                        <th>Expiration date</th>
123
                        [% IF ( routing && CAN_user_serials_routing ) %]
149
                        [% IF ( routing && CAN_user_serials_routing ) %]
Lines 133-140 Link Here
133
                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
159
                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
134
                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
160
                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
135
                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
161
                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
136
                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
162
                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search location" /></td>
137
                      <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
163
                      <td><input type="text" class="filter" data-column_num="5" placeholder="Search callnumber" /></td>
164
                      <td><input type="text" class="filter" data-column_num="6" placeholder="Search expiration date" /></td>
138
                      [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
165
                      [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
139
                      <td></td>
166
                      <td></td>
140
                      <td></td>
167
                      <td></td>
Lines 157-162 Link Here
157
                          [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
184
                          [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
158
                        </td>
185
                        </td>
159
                        <td>
186
                        <td>
187
                          [% IF ( subscription.location ) %][% KohaAuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
188
                        </td>
189
                        <td>
160
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
190
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
161
                        </td>
191
                        </td>
162
                        <td>
192
                        <td>
Lines 203-208 Link Here
203
                        <th>Title</th>
233
                        <th>Title</th>
204
                        <th> Notes </th>
234
                        <th> Notes </th>
205
                        <th>Library</th>
235
                        <th>Library</th>
236
                        <th>Location</th>
206
                        <th>Call number</th>
237
                        <th>Call number</th>
207
                        <th>&nbsp;</th>
238
                        <th>&nbsp;</th>
208
                        <th>&nbsp;</th>
239
                        <th>&nbsp;</th>
Lines 214-220 Link Here
214
                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
245
                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
215
                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
246
                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
216
                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
247
                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
217
                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
248
                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search location" /></td>
249
                      <td><input type="text" class="filter" data-column_num="5" placeholder="Search callnumber" /></td>
218
                      <td></td>
250
                      <td></td>
219
                      <td></td>
251
                      <td></td>
220
                    </tr>
252
                    </tr>
Lines 239-244 Link Here
239
                          [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
271
                          [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %]
240
                        </td>
272
                        </td>
241
                        <td>
273
                        <td>
274
                          [% IF ( subscription.location ) %][% KohaAuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
275
                        </td>
276
                        <td>
242
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
277
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
243
                        </td>
278
                        </td>
244
                        <td>
279
                        <td>
Lines 295-300 Link Here
295
                </li>
330
                </li>
296
                [% END %]
331
                [% END %]
297
                <li>
332
                <li>
333
                  <label for="callnumber">Callnumber:</label>
334
                  <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter %]" />
335
                </li>
336
                <li>
298
                  <label for="publisher">Publisher:</label>
337
                  <label for="publisher">Publisher:</label>
299
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
338
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
300
                </li>
339
                </li>
Lines 315-320 Link Here
315
                    [% END %]
354
                    [% END %]
316
                  </select>
355
                  </select>
317
                </li>
356
                </li>
357
                [% IF locations %]
358
                  <li>
359
                    <label for="location">Location:</label>
360
                    <select name="location_filter">
361
                      <option value="">All</option>
362
                      [% FOR loc IN locations %]
363
                        [% IF loc.selected %]
364
                          <option value="[% loc.authorised_value %]" selected="selected">[% loc.lib %]</option>
365
                        [% ELSE %]
366
                          <option value="[% loc.authorised_value %]">[% loc.lib %]</option>
367
                        [% END %]
368
                      [% END %]
369
                    </select>
370
                  </li>
371
                [% END %]
372
                <li>
373
                  <label for="to">Expiration date:</label>
374
                  <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
375
                </li>
376
318
              </ol>
377
              </ol>
319
              <input type="hidden" name="searched" value="1" />
378
              <input type="hidden" name="searched" value="1" />
320
              <fieldset class="action">
379
              <fieldset class="action">
(-)a/serials/serials-search.pl (-2 / +14 lines)
Lines 36-49 use C4::Context; Link Here
36
use C4::Output;
36
use C4::Output;
37
use C4::Serials;
37
use C4::Serials;
38
38
39
use Koha::DateUtils;
40
39
my $query         = new CGI;
41
my $query         = new CGI;
40
my $title         = $query->param('title_filter') || '';
42
my $title         = $query->param('title_filter') || '';
41
my $ISSN          = $query->param('ISSN_filter') || '';
43
my $ISSN          = $query->param('ISSN_filter') || '';
42
my $EAN           = $query->param('EAN_filter') || '';
44
my $EAN           = $query->param('EAN_filter') || '';
45
my $callnumber    = $query->param('callnumber_filter') || '';
43
my $publisher     = $query->param('publisher_filter') || '';
46
my $publisher     = $query->param('publisher_filter') || '';
44
my $bookseller    = $query->param('bookseller_filter') || '';
47
my $bookseller    = $query->param('bookseller_filter') || '';
45
my $biblionumber  = $query->param('biblionumber') || '';
48
my $biblionumber  = $query->param('biblionumber') || '';
46
my $branch        = $query->param('branch_filter') || '';
49
my $branch        = $query->param('branch_filter') || '';
50
my $location      = $query->param('location_filter') || '';
51
my $expiration_date = $query->param('expiration_date_filter') || '';
47
my $routing       = $query->param('routing') || C4::Context->preference("RoutingSerials");
52
my $routing       = $query->param('routing') || C4::Context->preference("RoutingSerials");
48
my $searched      = $query->param('searched') || 0;
53
my $searched      = $query->param('searched') || 0;
49
my @subscriptionids = $query ->param('subscriptionid');
54
my @subscriptionids = $query ->param('subscriptionid');
Lines 51-57 my $op = $query->param('op'); Link Here
51
56
52
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
57
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
53
    {
58
    {
54
        template_name   => "serials/serials-search.tmpl",
59
        template_name   => "serials/serials-search.tt",
55
        query           => $query,
60
        query           => $query,
56
        type            => "intranet",
61
        type            => "intranet",
57
        authnotrequired => 0,
62
        authnotrequired => 0,
Lines 70-75 if ( $op and $op eq "close" ) { Link Here
70
    }
75
    }
71
}
76
}
72
77
78
my $expiration_date_dt = $expiration_date ? dt_from_string( $expiration_date ) : undef;
73
my @subscriptions;
79
my @subscriptions;
74
if ($searched){
80
if ($searched){
75
    @subscriptions = SearchSubscriptions(
81
    @subscriptions = SearchSubscriptions(
Lines 78-86 if ($searched){ Link Here
78
            title        => $title,
84
            title        => $title,
79
            issn         => $ISSN,
85
            issn         => $ISSN,
80
            ean          => $EAN,
86
            ean          => $EAN,
87
            callnumber   => $callnumber,
81
            publisher    => $publisher,
88
            publisher    => $publisher,
82
            bookseller   => $bookseller,
89
            bookseller   => $bookseller,
83
            branch       => $branch,
90
            branch       => $branch,
91
            location     => $location,
92
            expiration_date => $expiration_date_dt,
84
        }
93
        }
85
    );
94
    );
86
}
95
}
Lines 115-120 foreach (sort keys %$branches){ Link Here
115
    };
124
    };
116
}
125
}
117
126
127
118
$template->param(
128
$template->param(
119
    openedsubscriptions => \@openedsubscriptions,
129
    openedsubscriptions => \@openedsubscriptions,
120
    closedsubscriptions => \@closedsubscriptions,
130
    closedsubscriptions => \@closedsubscriptions,
Lines 122-130 $template->param( Link Here
122
    title_filter  => $title,
132
    title_filter  => $title,
123
    ISSN_filter   => $ISSN,
133
    ISSN_filter   => $ISSN,
124
    EAN_filter    => $EAN,
134
    EAN_filter    => $EAN,
135
    callnumber_filter => $callnumber,
125
    publisher_filter => $publisher,
136
    publisher_filter => $publisher,
126
    bookseller_filter  => $bookseller,
137
    bookseller_filter  => $bookseller,
127
    branch_filter => $branch,
138
    branch_filter => $branch,
139
    locations     => C4::Koha::GetAuthorisedValues('LOC', $location),
140
    expiration_date_filter => $expiration_date_dt,
128
    branches_loop => \@branches_loop,
141
    branches_loop => \@branches_loop,
129
    done_searched => $searched,
142
    done_searched => $searched,
130
    routing       => $routing,
143
    routing       => $routing,
131
- 

Return to bug 10852