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

(-)a/circ/pendingbookings.pl (-6 / +11 lines)
Lines 21-28 use Modern::Perl; Link Here
21
21
22
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
23
23
24
use C4::Context;
25
24
use C4::Output qw( output_html_with_http_headers );
26
use C4::Output qw( output_html_with_http_headers );
25
use C4::Auth qw( get_template_and_user );
27
use C4::Auth   qw( get_template_and_user );
26
28
27
use Koha::DateUtils qw(dt_from_string);
29
use Koha::DateUtils qw(dt_from_string);
28
30
Lines 36-49 my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( Link Here
36
    }
38
    }
37
);
39
);
38
40
39
my $today = dt_from_string();
41
my $today     = dt_from_string();
40
my $startdate = $today->truncate( to => 'day' );
42
my $startdate = $today->truncate( to => 'day' );
41
my $enddate = $startdate->clone->add( days => 7 );
43
my $enddate   = $startdate->clone->add( days => 7 );
44
my $branchcode =
45
    defined( $input->param('library') ) ? $input->param('library') : C4::Context->userenv->{'branch'};
42
46
43
$template->param(
47
$template->param(
44
    todaysdate          => $today,
48
    todaysdate => $today,
45
    from                => $startdate,
49
    from       => $startdate,
46
    to                  => $enddate
50
    to         => $enddate,
51
    branchcode => $branchcode
47
);
52
);
48
53
49
output_html_with_http_headers $input, $cookie, $template->output;
54
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingbookings.tt (-4 / +32 lines)
Lines 1-5 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Branches %]
3
[% USE Koha %]
4
[% USE Koha %]
4
[% USE KohaDates %]
5
[% USE KohaDates %]
5
[% USE TablesSettings %]
6
[% USE TablesSettings %]
Lines 50-56 Link Here
50
                </main>
51
                </main>
51
            </div>
52
            </div>
52
53
53
            <!-- Filters -->
54
            <!-- Filters & Navigation -->
54
            <div class="col-sm-2 col-sm-pull-10">
55
            <div class="col-sm-2 col-sm-pull-10">
55
                <aside>
56
                <aside>
56
                    <div id="filters">
57
                    <div id="filters">
Lines 58-63 Link Here
58
                            <fieldset class="brief">
59
                            <fieldset class="brief">
59
                                <h4>Refine results</h4>
60
                                <h4>Refine results</h4>
60
                                <ol>
61
                                <ol>
62
                                    <li>
63
                                        <label for="library">Library:</label>
64
                                        <select name="library" id="library">
65
                                            [% SET libraries = Branches.all( only_from_group => 1 ) %]
66
                                            [% IF libraries.size != 1 %]
67
                                                <option value="">Any</option>
68
                                            [% END %]
69
                                            [% FOREACH l IN libraries %]
70
                                                [% IF (l.branchcode == branchcode) %]
71
                                                    <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option>
72
                                                [% ELSE %]
73
                                                    <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
74
                                                [% END %]
75
                                            [% END %]
76
                                        </select>
77
                                    </li>
61
                                    <li>
78
                                    <li>
62
                                        <label for="from">Start date: </label>
79
                                        <label for="from">Start date: </label>
63
                                        <input type="text" size="10" id="from" name="from" value="[% from | html %]" class="flatpickr" data-date_to="to"/>
80
                                        <input type="text" size="10" id="from" name="from" value="[% from | html %]" class="flatpickr" data-date_to="to"/>
Lines 74-79 Link Here
74
                            </fieldset>
91
                            </fieldset>
75
                        </form>
92
                        </form>
76
                    </div>
93
                    </div>
94
                    [% INCLUDE 'circ-nav.inc' %]
77
                </aside>
95
                </aside>
78
            </div>
96
            </div>
79
        </div>
97
        </div>
Lines 106-112 Link Here
106
                       }
124
                       }
107
125
108
                       return { '>=': isoFrom, '<=': isoTo };
126
                       return { '>=': isoFrom, '<=': isoTo };
109
                    }
127
                    },
128
                    'item.holding_library_id': function() {
129
                       let library = $("#library").find(":selected").val();
130
                       return library;
131
                    },
110
                };
132
                };
111
133
112
                var bookings_table_url = '/api/v1/bookings?';
134
                var bookings_table_url = '/api/v1/bookings?';
Lines 117-123 Link Here
117
                    "embed": [
139
                    "embed": [
118
                        "biblio",
140
                        "biblio",
119
                        "item",
141
                        "item",
120
                        "patron"
142
                        "patron",
143
                        "pickup_library"
121
                    ],
144
                    ],
122
                    "order": [[ 1, "asc" ]],
145
                    "order": [[ 1, "asc" ]],
123
                    "columns": [{
146
                    "columns": [{
Lines 125-130 Link Here
125
                        "title": "Booking ID",
148
                        "title": "Booking ID",
126
                        "visible": false
149
                        "visible": false
127
                    },
150
                    },
151
                    {
152
                        "data": "pickup_library.name",
153
                        "title": "Pickup library",
154
                        "searchable": true,
155
                        "orderable": true,
156
                    },
128
                    {
157
                    {
129
                        "data": "biblio.title",
158
                        "data": "biblio.title",
130
                        "title": "Title",
159
                        "title": "Title",
131
- 

Return to bug 33736