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

(-)a/C4/Serials.pm (+12 lines)
Lines 687-692 sub SearchSubscriptions { Link Here
687
        push @where_strs, "biblioitems.ean LIKE ?";
687
        push @where_strs, "biblioitems.ean LIKE ?";
688
        push @where_args, "%$args->{ean}%";
688
        push @where_args, "%$args->{ean}%";
689
    }
689
    }
690
    if ( $args->{callnumber} ) {
691
        push @where_strs, "subscription.callnumber LIKE ?";
692
        push @where_args, "%$args->{callnumber}%";
693
    }
690
    if( $args->{publisher} ){
694
    if( $args->{publisher} ){
691
        push @where_strs, "biblioitems.publishercode LIKE ?";
695
        push @where_strs, "biblioitems.publishercode LIKE ?";
692
        push @where_args, "%$args->{publisher}%";
696
        push @where_args, "%$args->{publisher}%";
Lines 699-704 sub SearchSubscriptions { Link Here
699
        push @where_strs, "subscription.branchcode = ?";
703
        push @where_strs, "subscription.branchcode = ?";
700
        push @where_args, "$args->{branch}";
704
        push @where_args, "$args->{branch}";
701
    }
705
    }
706
    if ( $args->{location} ) {
707
        push @where_strs, "subscription.location = ?";
708
        push @where_args, "$args->{location}";
709
    }
710
    if ( $args->{expiration_date} ) {
711
        push @where_strs, "subscription.enddate <= ?";
712
        push @where_args, "$args->{expiration_date}";
713
    }
702
    if( defined $args->{closed} ){
714
    if( defined $args->{closed} ){
703
        push @where_strs, "subscription.closed = ?";
715
        push @where_strs, "subscription.closed = ?";
704
        push @where_args, "$args->{closed}";
716
        push @where_args, "$args->{closed}";
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-3 / +62 lines)
Lines 1-8 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE KohaAuthorisedValues %]
3
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
4
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'calendar.inc' %]
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
8
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7
[% INCLUDE 'datatables-strings.inc' %]
9
[% INCLUDE 'datatables-strings.inc' %]
8
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
10
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
Lines 72-77 Link Here
72
                </li>
74
                </li>
73
                [% END %]
75
                [% END %]
74
                <li>
76
                <li>
77
                  <label for="callnumber">Callnumber:</label>
78
                  <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter %]" />
79
                </li>
80
                <li>
75
                  <label for="publisher">Publisher:</label>
81
                  <label for="publisher">Publisher:</label>
76
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
82
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
77
                </li>
83
                </li>
Lines 92-97 Link Here
92
                    [% END %]
98
                    [% END %]
93
                  </select>
99
                  </select>
94
                </li>
100
                </li>
101
                [% IF locations %]
102
                  <li>
103
                    <label for="location">Location:</label>
104
                    <select name="location_filter">
105
                      <option value="">All</option>
106
                      [% FOR loc IN locations %]
107
                        [% IF loc.selected %]
108
                          <option value="[% loc.authorised_value %]" selected="selected">[% loc.lib %]</option>
109
                        [% ELSE %]
110
                          <option value="[% loc.authorised_value %]">[% loc.lib %]</option>
111
                        [% END %]
112
                      [% END %]
113
                    </select>
114
                  </li>
115
                [% END %]
116
                <li>
117
                  <label for="to">Expiration date:</label>
118
                  <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
119
                </li>
95
              </ol>
120
              </ol>
96
              <input type="hidden" name="searched" value="1" />
121
              <input type="hidden" name="searched" value="1" />
97
              <fieldset class="action">
122
              <fieldset class="action">
Lines 117-122 Link Here
117
                        <th>Title</th>
142
                        <th>Title</th>
118
                        <th> Notes </th>
143
                        <th> Notes </th>
119
                        <th>Library</th>
144
                        <th>Library</th>
145
                        <th>Location</th>
120
                        <th>Call number</th>
146
                        <th>Call number</th>
121
                        <th>Expiration date</th>
147
                        <th>Expiration date</th>
122
                        [% IF ( routing && CAN_user_serials_routing ) %]
148
                        [% IF ( routing && CAN_user_serials_routing ) %]
Lines 132-139 Link Here
132
                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
158
                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
133
                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
159
                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
134
                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
160
                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
135
                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
161
                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search location" /></td>
136
                      <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
162
                      <td><input type="text" class="filter" data-column_num="5" placeholder="Search callnumber" /></td>
163
                      <td><input type="text" class="filter" data-column_num="6" placeholder="Search expiration date" /></td>
137
                      [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
164
                      [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
138
                      <td></td>
165
                      <td></td>
139
                      <td></td>
166
                      <td></td>
Lines 155-160 Link Here
155
                          [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
182
                          [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
156
                        </td>
183
                        </td>
157
                        <td>
184
                        <td>
185
                          [% IF ( subscription.location ) %][% KohaAuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
186
                        </td>
187
                        <td>
158
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
188
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
159
                        </td>
189
                        </td>
160
                        <td>
190
                        <td>
Lines 202-207 Link Here
202
                        <th>Title</th>
232
                        <th>Title</th>
203
                        <th> Notes </th>
233
                        <th> Notes </th>
204
                        <th>Library</th>
234
                        <th>Library</th>
235
                        <th>Location</th>
205
                        <th>Call number</th>
236
                        <th>Call number</th>
206
                        <th>&nbsp;</th>
237
                        <th>&nbsp;</th>
207
                        <th>&nbsp;</th>
238
                        <th>&nbsp;</th>
Lines 213-219 Link Here
213
                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
244
                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
214
                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
245
                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
215
                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
246
                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
216
                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
247
                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search location" /></td>
248
                      <td><input type="text" class="filter" data-column_num="5" placeholder="Search callnumber" /></td>
217
                      <td></td>
249
                      <td></td>
218
                      <td></td>
250
                      <td></td>
219
                    </tr>
251
                    </tr>
Lines 237-242 Link Here
237
                          [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
269
                          [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
238
                        </td>
270
                        </td>
239
                        <td>
271
                        <td>
272
                          [% IF ( subscription.location ) %][% KohaAuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %]
273
                        </td>
274
                        <td>
240
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
275
                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
241
                        </td>
276
                        </td>
242
                        <td>
277
                        <td>
Lines 292-297 Link Here
292
                </li>
327
                </li>
293
                [% END %]
328
                [% END %]
294
                <li>
329
                <li>
330
                  <label for="callnumber">Callnumber:</label>
331
                  <input type="text" id="callnumber" name="callnumber_filter" value="[% callnumber_filter %]" />
332
                </li>
333
                <li>
295
                  <label for="publisher">Publisher:</label>
334
                  <label for="publisher">Publisher:</label>
296
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
335
                  <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
297
                </li>
336
                </li>
Lines 312-317 Link Here
312
                    [% END %]
351
                    [% END %]
313
                  </select>
352
                  </select>
314
                </li>
353
                </li>
354
                [% IF locations %]
355
                  <li>
356
                    <label for="location">Location:</label>
357
                    <select name="location_filter">
358
                      <option value="">All</option>
359
                      [% FOR loc IN locations %]
360
                        [% IF loc.selected %]
361
                          <option value="[% loc.authorised_value %]" selected="selected">[% loc.lib %]</option>
362
                        [% ELSE %]
363
                          <option value="[% loc.authorised_value %]">[% loc.lib %]</option>
364
                        [% END %]
365
                      [% END %]
366
                    </select>
367
                  </li>
368
                [% END %]
369
                <li>
370
                  <label for="to">Expiration date:</label>
371
                  <input type="text" id="to" name="expiration_date_filter" value="[% expiration_date_filter | $KohaDates %]" size="10" maxlength="10" class="datepickerto" />
372
                </li>
373
315
              </ol>
374
              </ol>
316
              <input type="hidden" name="searched" value="1" />
375
              <input type="hidden" name="searched" value="1" />
317
              <fieldset class="action">
376
              <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 114-119 foreach (sort keys %$branches){ Link Here
114
    };
123
    };
115
}
124
}
116
125
126
117
$template->param(
127
$template->param(
118
    openedsubscriptions => \@openedsubscriptions,
128
    openedsubscriptions => \@openedsubscriptions,
119
    closedsubscriptions => \@closedsubscriptions,
129
    closedsubscriptions => \@closedsubscriptions,
Lines 121-129 $template->param( Link Here
121
    title_filter  => $title,
131
    title_filter  => $title,
122
    ISSN_filter   => $ISSN,
132
    ISSN_filter   => $ISSN,
123
    EAN_filter    => $EAN,
133
    EAN_filter    => $EAN,
134
    callnumber_filter => $callnumber,
124
    publisher_filter => $publisher,
135
    publisher_filter => $publisher,
125
    bookseller_filter  => $bookseller,
136
    bookseller_filter  => $bookseller,
126
    branch_filter => $branch,
137
    branch_filter => $branch,
138
    locations     => C4::Koha::GetAuthorisedValues('LOC', $location),
139
    expiration_date_filter => $expiration_date_dt,
127
    branches_loop => \@branches_loop,
140
    branches_loop => \@branches_loop,
128
    done_searched => $searched,
141
    done_searched => $searched,
129
    routing       => $routing,
142
    routing       => $routing,
130
- 

Return to bug 10852