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

(-)a/Koha/Hold.pm (-7 / +4 lines)
Lines 186-193 sub set_waiting { Link Here
186
        desk_id => $desk_id,
186
        desk_id => $desk_id,
187
    };
187
    };
188
188
189
    if (defined $desk_id) { $values->{'desk_id'} = $desk_id };
190
191
    my $requested_expiration;
189
    my $requested_expiration;
192
    if ($self->expirationdate) {
190
    if ($self->expirationdate) {
193
        $requested_expiration = dt_from_string($self->expirationdate);
191
        $requested_expiration = dt_from_string($self->expirationdate);
Lines 375-385 Returns the related Koha::Library object for this Hold Link Here
375
=cut
373
=cut
376
374
377
sub desk {
375
sub desk {
378
    my ($self) = @_;
376
    my $self = shift;
379
377
    my $desk_rs = $self->_result->desk;
380
    $self->{_desk} ||= Koha::Desks->find( $self->desk_id() );
378
    return unless $desk_rs;
381
379
    return Koha::Desk->_new_from_dbic($desk_rs);
382
    return $self->{_desk};
383
}
380
}
384
381
385
=head3 borrower
382
=head3 borrower
(-)a/Koha/Template/Plugin/Desks.pm (-14 lines)
Lines 36-55 got or the current one. Link Here
36
36
37
=head2 Methods
37
=head2 Methods
38
38
39
=head3 GetName
40
41
[% Desk.GetName(desk_id) %]
42
43
return desk name or empty string
44
45
=cut
46
47
sub GetName {
48
    my ( $self, $desk_id ) = @_;
49
    my $d = Koha::Desks->find( $desk_id );
50
    return (defined $d) ? $d->unblessed->{'desk_name'} : q{};
51
}
52
53
=head3 GetLoggedInDeskId
39
=head3 GetLoggedInDeskId
54
40
55
[% Desks.GetLoggedInDeskId %]
41
[% Desks.GetLoggedInDeskId %]
(-)a/installer/data/mysql/atomicupdate/bug_24412_Attach_waiting_reserve_to_desk.perl (-12 / +13 lines)
Lines 1-16 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
3
    if ( !column_exists( 'reserves', 'desk_id' ) ) {
4
    $dbh->do(q{
4
        $dbh->do(q{
5
ALTER TABLE reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
5
                 ALTER TABLE reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
6
  ADD KEY desk_id (`desk_id`),
6
                 ADD KEY desk_id (`desk_id`),
7
  ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE CASCADE ON UPDATE CASCADE ;
7
                 ADD CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`desk_id`) REFERENCES `desks` (`desk_id`) ON DELETE CASCADE ON UPDATE CASCADE ;
8
             });
8
                 });
9
    $dbh->do(q{
9
        $dbh->do(q{
10
ALTER TABLE old_reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
10
                 ALTER TABLE old_reserves ADD COLUMN desk_id INT(11) DEFAULT NULL AFTER branchcode,
11
  ADD KEY `old_desk_id` (`desk_id`);
11
                 ADD KEY `old_desk_id` (`desk_id`);
12
             });
12
                 });
13
13
14
    SetVersion( $DBversion );
14
        SetVersion( $DBversion );
15
    print "Upgrade to $DBversion done (Bug XXXXX - Attach waiting reserve to desk)\n";
15
        print "Upgrade to $DBversion done (Bug XXXXX - Attach waiting reserve to desk)\n";
16
    }
16
}
17
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc (-1 lines)
Lines 1-5 Link Here
1
[% USE ItemTypes %]
1
[% USE ItemTypes %]
2
[% USE Desks %]
3
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
4
<table id="[% table_name | html %]">
3
<table id="[% table_name | html %]">
5
    <thead>
4
    <thead>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +1 lines)
Lines 4-10 Link Here
4
[% USE KohaDates %]
4
[% USE KohaDates %]
5
[% USE AuthorisedValues %]
5
[% USE AuthorisedValues %]
6
[% USE Branches %]
6
[% USE Branches %]
7
[% USE Desks %]
8
[% USE Biblio %]
7
[% USE Biblio %]
9
[% USE TablesSettings %]
8
[% USE TablesSettings %]
10
[% PROCESS 'i18n.inc' %]
9
[% PROCESS 'i18n.inc' %]
Lines 461-467 Note that permanent location is a code, and location may be an authval. Link Here
461
                        [% SET hold = item.first_hold %]
460
                        [% SET hold = item.first_hold %]
462
                        [% IF hold %]
461
                        [% IF hold %]
463
                            [% IF hold.waitingdate %]
462
                            [% IF hold.waitingdate %]
464
                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% Desks.GetName ( hold.desk_id ) | html %][% END %] since [% hold.waitingdate | $KohaDates %].</span>
463
                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% hold.desk.desk_name | html %][% END %] since [% hold.waitingdate | $KohaDates %].</span>
465
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
464
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
466
                                    <span class="heldfor">Hold for:</span>
465
                                    <span class="heldfor">Hold for:</span>
467
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
466
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc (-2 lines)
Lines 1-5 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
[% USE Desks  %]
3
[% USE ItemTypes %]
2
[% USE ItemTypes %]
4
[% USE KohaDates %]
3
[% USE KohaDates %]
5
[% PROCESS 'i18n.inc' %]
4
[% PROCESS 'i18n.inc' %]
6
- 

Return to bug 24412