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

(-)a/C4/Reserves.pm (-33 / +33 lines)
Lines 148-156 BEGIN { Link Here
148
148
149
        GetMaxPatronHoldsForRecord
149
        GetMaxPatronHoldsForRecord
150
150
151
        &AddReserveGroup
151
        &AddHoldGroup
152
        &DeleteReserveGroup
152
        &DeleteHoldGroup
153
        &GetReserveGroupReserves
153
        &GetHoldGroupHolds
154
    );
154
    );
155
    @EXPORT_OK = qw( MergeHolds );
155
    @EXPORT_OK = qw( MergeHolds );
156
}
156
}
Lines 176-182 sub AddReserve { Link Here
176
        $branch,   $borrowernumber, $biblionumber, $bibitems,
176
        $branch,   $borrowernumber, $biblionumber, $bibitems,
177
        $priority, $resdate,        $expdate,      $notes,
177
        $priority, $resdate,        $expdate,      $notes,
178
        $title,    $checkitem,      $found,        $itemtype,
178
        $title,    $checkitem,      $found,        $itemtype,
179
        $reserve_group_id
179
        $hold_group_id
180
    ) = @_;
180
    ) = @_;
181
181
182
    my $dbh = C4::Context->dbh;
182
    my $dbh = C4::Context->dbh;
Lines 216-222 sub AddReserve { Link Here
216
            waitingdate    => $waitingdate,
216
            waitingdate    => $waitingdate,
217
            expirationdate => $expdate,
217
            expirationdate => $expdate,
218
            itemtype       => $itemtype,
218
            itemtype       => $itemtype,
219
            reserve_group_id => $reserve_group_id,
219
            hold_group_id  => $hold_group_id,
220
        }
220
        }
221
    )->store();
221
    )->store();
222
222
Lines 640-646 sub GetReserveCount { Link Here
640
        SELECT COUNT(*) AS counter
640
        SELECT COUNT(*) AS counter
641
        FROM reserves
641
        FROM reserves
642
        WHERE borrowernumber = ?
642
        WHERE borrowernumber = ?
643
        AND reserve_group_id is NULL
643
        AND hold_group_id is NULL
644
    ";
644
    ";
645
    my $sth = $dbh->prepare($query);
645
    my $sth = $dbh->prepare($query);
646
    $sth->execute($borrowernumber);
646
    $sth->execute($borrowernumber);
Lines 648-657 sub GetReserveCount { Link Here
648
    $count += $row->{counter};
648
    $count += $row->{counter};
649
649
650
    $query = "
650
    $query = "
651
        SELECT COUNT(DISTINCT reserve_group_id) AS counter
651
        SELECT COUNT(DISTINCT hold_group_id) AS counter
652
        FROM reserves
652
        FROM reserves
653
        WHERE borrowernumber = ?
653
        WHERE borrowernumber = ?
654
        AND reserve_group_id is not NULL
654
        AND hold_group_id is not NULL
655
    ";
655
    ";
656
    $sth = $dbh->prepare($query);
656
    $sth = $dbh->prepare($query);
657
    $sth->execute($borrowernumber);
657
    $sth->execute($borrowernumber);
Lines 1373-1386 sub ModReserveAffect { Link Here
1373
    }
1373
    }
1374
    $hold->store();
1374
    $hold->store();
1375
1375
1376
    if ($hold->reserve_group_id) {
1376
    if ($hold->hold_group_id) {
1377
        # Delete other reserves from same group
1377
        # Delete other reserves from same group
1378
        $dbh->do(q{
1378
        $dbh->do(q{
1379
            DELETE FROM reserves
1379
            DELETE FROM reserves
1380
            WHERE reserve_group_id = ?
1380
            WHERE hold_group_id = ?
1381
              AND reserve_id != ?
1381
              AND reserve_id != ?
1382
        }, undef, $hold->reserve_group_id, $hold->reserve_id);
1382
        }, undef, $hold->hold_group_id, $hold->reserve_id);
1383
        DeleteReserveGroup($hold->reserve_group_id);
1383
        DeleteReserveGroup($hold->hold_group_id);
1384
    }
1384
    }
1385
1385
1386
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber )
1386
    _koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber )
Lines 1465-1471 sub GetReserveInfo { Link Here
1465
                   reminderdate,
1465
                   reminderdate,
1466
                   priority,
1466
                   priority,
1467
                   found,
1467
                   found,
1468
                   reserve_group_id,
1468
                   hold_group_id,
1469
                   firstname,
1469
                   firstname,
1470
                   surname,
1470
                   surname,
1471
                   phone,
1471
                   phone,
Lines 2580-2633 sub GetHoldRule { Link Here
2580
    return $sth->fetchrow_hashref();
2580
    return $sth->fetchrow_hashref();
2581
}
2581
}
2582
2582
2583
=head2 AddReserveGroup
2583
=head2 AddHoldGroup
2584
2584
2585
    my $reserve_group_id = AddReserveGroup();
2585
    my $hold_group_id = AddHoldGroup();
2586
2586
2587
Creates a new reserve group and returns its ID
2587
Creates a new hold group and returns its ID
2588
2588
2589
=cut
2589
=cut
2590
2590
2591
sub AddReserveGroup {
2591
sub AddHoldGroup {
2592
    my $dbh = C4::Context->dbh;
2592
    my $dbh = C4::Context->dbh;
2593
2593
2594
    $dbh->do('INSERT INTO reserve_group VALUES ()');
2594
    $dbh->do('INSERT INTO hold_group VALUES ()');
2595
    return $dbh->last_insert_id(undef, undef, 'reserve_group', undef);
2595
    return $dbh->last_insert_id(undef, undef, 'hold_group', undef);
2596
}
2596
}
2597
2597
2598
=head2 DeleteReserveGroup
2598
=head2 DeleteHoldGroup
2599
2599
2600
    DeleteReserveGroup($reserve_group_id);
2600
    DeleteHoldGroup($hold_group_id);
2601
2601
2602
Delete a reserve group. Reserves that belong to this group are not removed.
2602
Delete a hold group. Holds that belong to this group are not removed.
2603
2603
2604
=cut
2604
=cut
2605
2605
2606
sub DeleteReserveGroup {
2606
sub DeleteHoldGroup {
2607
    my ($reserve_group_id) = @_;
2607
    my ($hold_group_id) = @_;
2608
2608
2609
    my $dbh = C4::Context->dbh;
2609
    my $dbh = C4::Context->dbh;
2610
    my $query = 'DELETE FROM reserve_group WHERE reserve_group_id = ?';
2610
    my $query = 'DELETE FROM hold_group WHERE hold_group_id = ?';
2611
    $dbh->do($query, undef, $reserve_group_id);
2611
    $dbh->do($query, undef, $hold_group_id);
2612
}
2612
}
2613
2613
2614
=head2 GetReserveGroupReserves
2614
=head2 GetHoldGroupHolds
2615
2615
2616
    my @reserves = GetReserveGroupReserves($reserve_group_id);
2616
    my @holds = GetHoldGroupHolds($hold_group_id);
2617
2617
2618
Fetch all reserve from a reserve group.
2618
Fetch all holds from a hold group.
2619
2619
2620
=cut
2620
=cut
2621
2621
2622
sub GetReserveGroupReserves {
2622
sub GetHoldGroupHolds {
2623
    my ($reserve_group_id) = @_;
2623
    my ($hold_group_id) = @_;
2624
2624
2625
    my $dbh = C4::Context->dbh;
2625
    my $dbh = C4::Context->dbh;
2626
2626
2627
    my $reserves = $dbh->selectall_arrayref(q{
2627
    my $reserves = $dbh->selectall_arrayref(q{
2628
        SELECT * FROM reserves
2628
        SELECT * FROM reserves
2629
        WHERE reserve_group_id = ?
2629
        WHERE hold_group_id = ?
2630
    }, { Slice => {} }, $reserve_group_id);
2630
    }, { Slice => {} }, $hold_group_id);
2631
2631
2632
    return () unless defined $reserves;
2632
    return () unless defined $reserves;
2633
2633
(-)a/circ/pendingreserves.pl (-2 / +2 lines)
Lines 118-124 if ( $run_report ) { Link Here
118
            reminderdate,
118
            reminderdate,
119
            max(priority) as priority,
119
            max(priority) as priority,
120
            reserves.found,
120
            reserves.found,
121
            reserves.reserve_group_id,
121
            reserves.hold_group_id,
122
            biblio.title,
122
            biblio.title,
123
            biblio.author,
123
            biblio.author,
124
            count(DISTINCT items.itemnumber) as icount,
124
            count(DISTINCT items.itemnumber) as icount,
Lines 168-174 if ( $run_report ) { Link Here
168
                biblionumber    => $data->{biblionumber},
168
                biblionumber    => $data->{biblionumber},
169
                statusw         => ( $data->{found} eq "W" ),
169
                statusw         => ( $data->{found} eq "W" ),
170
                statusf         => ( $data->{found} eq "F" ),
170
                statusf         => ( $data->{found} eq "F" ),
171
                reserve_group_id => $data->{reserve_group_id},
171
                hold_group_id   => $data->{hold_group_id},
172
                holdingbranches => [split('\|', $data->{l_holdingbranch})],
172
                holdingbranches => [split('\|', $data->{l_holdingbranch})],
173
                branch          => $data->{l_branch},
173
                branch          => $data->{l_branch},
174
                itemcallnumber  => $data->{l_itemcallnumber},
174
                itemcallnumber  => $data->{l_itemcallnumber},
(-)a/installer/data/mysql/atomicupdate/bug_15516.sql (-8 / +8 lines)
Lines 1-11 Link Here
1
DROP TABLE IF EXISTS reserve_group;
1
DROP TABLE IF EXISTS hold_group;
2
CREATE TABLE reserve_group (
2
CREATE TABLE hold_group (
3
  reserve_group_id int unsigned NOT NULL AUTO_INCREMENT,
3
  hold_group_id int unsigned NOT NULL AUTO_INCREMENT,
4
  PRIMARY KEY (reserve_group_id)
4
  PRIMARY KEY (hold_group_id)
5
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
5
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
6
6
7
ALTER TABLE reserves ADD COLUMN reserve_group_id int unsigned NULL DEFAULT NULL;
7
ALTER TABLE reserves ADD COLUMN hold_group_id int unsigned NULL DEFAULT NULL;
8
ALTER TABLE reserves ADD CONSTRAINT reserves_ibfk_6 FOREIGN KEY (reserve_group_id) REFERENCES reserve_group (reserve_group_id) ON DELETE SET NULL ON UPDATE CASCADE;
8
ALTER TABLE reserves ADD CONSTRAINT reserves_ibfk_6 FOREIGN KEY (hold_group_id) REFERENCES hold_group (hold_group_id) ON DELETE SET NULL ON UPDATE CASCADE;
9
9
10
ALTER TABLE old_reserves ADD COLUMN reserve_group_id int unsigned NULL DEFAULT NULL;
10
ALTER TABLE old_reserves ADD COLUMN hold_group_id int unsigned NULL DEFAULT NULL;
11
ALTER TABLE old_reserves ADD CONSTRAINT old_reserves_ibfk_5 FOREIGN KEY (reserve_group_id) REFERENCES reserve_group (reserve_group_id) ON DELETE SET NULL ON UPDATE CASCADE;
11
ALTER TABLE old_reserves ADD CONSTRAINT old_reserves_ibfk_5 FOREIGN KEY (hold_group_id) REFERENCES hold_group (hold_group_id) ON DELETE SET NULL ON UPDATE CASCADE;
(-)a/installer/data/mysql/kohastructure.sql (-9 / +9 lines)
Lines 1767-1773 CREATE TABLE `old_issues` ( -- lists items that were checked out and have been r Link Here
1767
    ON DELETE SET NULL ON UPDATE SET NULL,
1767
    ON DELETE SET NULL ON UPDATE SET NULL,
1768
  CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1768
  CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
1769
    ON DELETE SET NULL ON UPDATE SET NULL
1769
    ON DELETE SET NULL ON UPDATE SET NULL
1770
  CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (reserve_group_id) REFERENCES reserve_group (reserve_group_id)
1770
  CONSTRAINT `old_reserves_ibfk_5` FOREIGN KEY (hold_group_id) REFERENCES hold_group (hold_group_id)
1771
    ON DELETE SET NULL ON UPDATE CASCADE
1771
    ON DELETE SET NULL ON UPDATE CASCADE
1772
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1772
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1773
1773
Lines 1870-1876 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1870
  `suspend` BOOLEAN NOT NULL DEFAULT 0,
1870
  `suspend` BOOLEAN NOT NULL DEFAULT 0,
1871
  `suspend_until` DATETIME NULL DEFAULT NULL,
1871
  `suspend_until` DATETIME NULL DEFAULT NULL,
1872
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1872
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1873
  `reserve_group_id` int unsigned NULL DEFAULT NULL,  -- Id used on reservations spanning multiple titles
1873
  `hold_group_id` int unsigned NULL DEFAULT NULL,  -- Id used on reservations spanning multiple titles
1874
  PRIMARY KEY (`reserve_id`),
1874
  PRIMARY KEY (`reserve_id`),
1875
  KEY priorityfoundidx (priority,found),
1875
  KEY priorityfoundidx (priority,found),
1876
  KEY `borrowernumber` (`borrowernumber`),
1876
  KEY `borrowernumber` (`borrowernumber`),
Lines 1883-1899 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1883
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1883
  CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1884
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1884
  CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
1885
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
1885
  CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE,
1886
  CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`reserve_group_id`) REFERENCES `reserve_group` (`reserve_group_id`) ON DELETE SET NULL ON UPDATE CASCADE
1886
  CONSTRAINT `reserves_ibfk_6` FOREIGN KEY (`hold_group_id`) REFERENCES `hold_group` (`hold_group_id`) ON DELETE SET NULL ON UPDATE CASCADE
1887
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1887
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1888
1888
1889
--
1889
--
1890
-- Table structure for table reserve_group
1890
-- Table structure for table hold_group
1891
--
1891
--
1892
1892
1893
DROP TABLE IF EXISTS `reserve_group`;
1893
DROP TABLE IF EXISTS `hold_group`;
1894
CREATE TABLE `reserve_group` (
1894
CREATE TABLE `hold_group` (
1895
  `reserve_group_id` int unsigned NOT NULL AUTO_INCREMENT,
1895
  `hold_group_id` int unsigned NOT NULL AUTO_INCREMENT,
1896
  PRIMARY KEY(`reserve_group_id`)
1896
  PRIMARY KEY(`hold_group_id`)
1897
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1897
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
1898
1898
1899
--
1899
--
Lines 1921-1927 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1921
  `suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no)
1921
  `suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no)
1922
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1922
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1923
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1923
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1924
  `reserve_group_id` int unsigned NULL DEFAULT NULL,  -- The id of a group of titles reservations fulfilled when one title is picked
1924
  `hold_group_id` int unsigned NULL DEFAULT NULL,  -- The id of a group of titles reservations fulfilled when one title is picked
1925
  PRIMARY KEY (`reserve_id`),
1925
  PRIMARY KEY (`reserve_id`),
1926
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1926
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1927
  KEY `old_reserves_biblionumber` (`biblionumber`),
1927
  KEY `old_reserves_biblionumber` (`biblionumber`),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/hold-group-modal.inc (+27 lines)
Line 0 Link Here
1
<div id="hold-group-modal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="hold-group-modal-label" aria-hidden="true">
2
    <div class="modal-header">
3
        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
4
        <h3 id="hold-group-modal-label">Hold group</h3>
5
    </div>
6
    <div class="modal-body">
7
        <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
8
    </div>
9
    <div class="modal-footer">
10
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
11
    </div>
12
</div>
13
14
<script>
15
  $(document).ready(function() {
16
    $('body').on('click', 'a.hold-group', function() {
17
      var href = $(this).attr('href');
18
      $('#hold-group-modal .modal-body').load(href + " #main");
19
      $('#hold-group-modal').modal('show');
20
      return false;
21
    })
22
23
    $('#hold-group-modal').on('hidden', function(){
24
        $('#hold-group-modal .modal-body').html('<div id="loading"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> ' + _('Loading') + '</div>');
25
    });
26
  });
27
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/reserve-group-modal.inc (-27 lines)
Lines 1-27 Link Here
1
<div id="reserve-group-modal" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="reserve-group-modal-label" aria-hidden="true">
2
    <div class="modal-header">
3
        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
4
        <h3 id="reserve-group-modal-label">Reserve group</h3>
5
    </div>
6
    <div class="modal-body">
7
        <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
8
    </div>
9
    <div class="modal-footer">
10
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
11
    </div>
12
</div>
13
14
<script>
15
  $(document).ready(function() {
16
    $('body').on('click', 'a.reserve-group', function() {
17
      var href = $(this).attr('href');
18
      $('#reserve-group-modal .modal-body').load(href + " #main");
19
      $('#reserve-group-modal').modal('show');
20
      return false;
21
    })
22
23
    $('#reserve-group-modal').on('hidden', function(){
24
        $('#reserve-group-modal .modal-body').html('<div id="loading"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> ' + _('Loading') + '</div>');
25
    });
26
  });
27
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc (-1 / +1 lines)
Lines 41-46 Link Here
41
    var RESUME_HOLD_ERROR_NOT_FOUND = _("Unable to resume, hold not found");
41
    var RESUME_HOLD_ERROR_NOT_FOUND = _("Unable to resume, hold not found");
42
    var CURRENT = _(" (current) ");
42
    var CURRENT = _(" (current) ");
43
    var PART_OF_A = _("(part of a %s)");
43
    var PART_OF_A = _("(part of a %s)");
44
    var RESERVE_GROUP = _("reserve group");
44
    var HOLD_GROUP = _("hold group");
45
//]]>
45
//]]>
46
</script>
46
</script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-1 / +1 lines)
Lines 1002-1006 No patron matched <span class="ex">[% message | html %]</span> Link Here
1002
        <p>You have already submitted a barcode, please wait for the checkout to process...</p>
1002
        <p>You have already submitted a barcode, please wait for the checkout to process...</p>
1003
    </div>
1003
    </div>
1004
</div>
1004
</div>
1005
[% INCLUDE 'reserve-group-modal.inc' %]
1005
[% INCLUDE 'hold-group-modal.inc' %]
1006
[% INCLUDE 'intranet-bottom.inc' %]
1006
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-3 / +3 lines)
Lines 119-126 $(document).ready(function() { Link Here
119
                [% IF ( reserveloo.author ) %]
119
                [% IF ( reserveloo.author ) %]
120
                    <p> by [% reserveloo.author %]</p>
120
                    <p> by [% reserveloo.author %]</p>
121
                [% END %]
121
                [% END %]
122
                [% IF reserveloo.reserve_group_id %]
122
                [% IF reserveloo.hold_group_id %]
123
                    <p>(part of a <a class="reserve-group" href="/cgi-bin/koha/reserve/reserve-group.pl?reserve_group_id=[% reserveloo.reserve_group_id %]">reserve group</a>)</p>
123
                    <p>(part of a <a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% reserveloo.hold_group_id %]">hold group</a>)</p>
124
                [% END %]
124
                [% END %]
125
            </td>
125
            </td>
126
        [% ELSE %]
126
        [% ELSE %]
Lines 205-209 $(document).ready(function() { Link Here
205
</div>
205
</div>
206
</div>
206
</div>
207
</div>
207
</div>
208
[% INCLUDE 'reserve-group-modal.inc' %]
208
[% INCLUDE 'hold-group-modal.inc' %]
209
[% INCLUDE 'intranet-bottom.inc' %]
209
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-1 / +1 lines)
Lines 585-589 function validate1(date) { Link Here
585
[% INCLUDE 'circ-menu.inc' %]
585
[% INCLUDE 'circ-menu.inc' %]
586
</div>
586
</div>
587
</div>
587
</div>
588
[% INCLUDE 'reserve-group-modal.inc' %]
588
[% INCLUDE 'hold-group-modal.inc' %]
589
[% INCLUDE 'intranet-bottom.inc' %]
589
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/reserve-group.tt (-8 / +8 lines)
Lines 1-12 Link Here
1
[% USE Biblio %]
1
[% USE Biblio %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
  <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Holds group ([% reserve_group_id %])</title>
3
  <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Holds group ([% hold_group_id %])</title>
4
  [% INCLUDE 'doc-head-close.inc' %]
4
  [% INCLUDE 'doc-head-close.inc' %]
5
</head>
5
</head>
6
<body id="reserve-reserve-group">
6
<body id="reserve-hold-group">
7
  <h1>Holds group ([% reserve_group_id %])</h1>
7
  <h1>Holds group ([% hold_group_id %])</h1>
8
  <div id="main">
8
  <div id="main">
9
    [% IF reserves.size %]
9
    [% IF holds.size %]
10
      <table>
10
      <table>
11
        <thead>
11
        <thead>
12
          <tr>
12
          <tr>
Lines 16-27 Link Here
16
          </tr>
16
          </tr>
17
        </thead>
17
        </thead>
18
        <tbody>
18
        <tbody>
19
          [% FOREACH reserve IN reserves %]
19
          [% FOREACH hold IN holds %]
20
            [% biblio = Biblio.Get(reserve.biblionumber) %]
20
            [% biblio = Biblio.Get(hold.biblionumber) %]
21
            <tr>
21
            <tr>
22
              <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</a></td>
22
              <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber %]">[% biblio.title %]</a></td>
23
              <td>[% reserve.priority %]</td>
23
              <td>[% hold.priority %]</td>
24
              <td>[% reserve.reservenotes %]</td>
24
              <td>[% hold.reservenotes %]</td>
25
            </tr>
25
            </tr>
26
          [% END %]
26
          [% END %]
27
        </tbody>
27
        </tbody>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-3 / +3 lines)
Lines 844-851 function checkMultiHold() { Link Here
844
                 <input type="hidden" name="itemnumber" value="" />
844
                 <input type="hidden" name="itemnumber" value="" />
845
            [% END %]
845
            [% END %]
846
    [% END %]
846
    [% END %]
847
            [% IF reserveloo.reserve_group_id %]
847
            [% IF reserveloo.hold_group_id %]
848
                <div>(part of a <a href="/cgi-bin/koha/reserve/reserve-group.pl?reserve_group_id=[% reserveloo.reserve_group_id %]" class="reserve-group">reserve group</a>)</div>
848
                <div>(part of a <a href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=[% reserveloo.hold_group_id %]" class="hold-group">hold group</a>)</div>
849
            [% END %]
849
            [% END %]
850
        </td>
850
        </td>
851
851
Lines 910-915 function checkMultiHold() { Link Here
910
</div>
910
</div>
911
</div>
911
</div>
912
912
913
[% INCLUDE 'reserve-group-modal.inc' %]
913
[% INCLUDE 'hold-group-modal.inc' %]
914
914
915
[% INCLUDE 'intranet-bottom.inc' %]
915
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (-2 / +2 lines)
Lines 42-50 $(document).ready(function() { Link Here
42
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
42
                                title += " - <span class='" + span_class + "'>" + oObj.itemnotes + "</span>"
43
                            }
43
                            }
44
44
45
                            if (oObj.reserve_group_id) {
45
                            if (oObj.hold_group_id) {
46
                              title += '<br>';
46
                              title += '<br>';
47
                              var link = '<a class="reserve-group" href="/cgi-bin/koha/reserve/reserve-group.pl?reserve_group_id=' + oObj.reserve_group_id + '">' + RESERVE_GROUP +'</a>'
47
                              var link = '<a class="hold-group" href="/cgi-bin/koha/reserve/hold-group.pl?hold_group_id=' + oObj.hold_group_id + '">' + HOLD_GROUP +'</a>'
48
                              title += '<span>' + PART_OF_A.format(link) + '</span>';
48
                              title += '<span>' + PART_OF_A.format(link) + '</span>';
49
                            }
49
                            }
50
50
(-)a/reserve/reserve-group.pl (-5 / +5 lines)
Lines 24-42 use C4::Reserves; Link Here
24
24
25
my $cgi = new CGI;
25
my $cgi = new CGI;
26
my ($template, $loggedinuser, $cookie) = get_template_and_user({
26
my ($template, $loggedinuser, $cookie) = get_template_and_user({
27
    template_name   => "reserve/reserve-group.tt",
27
    template_name   => "reserve/hold-group.tt",
28
    query           => $cgi,
28
    query           => $cgi,
29
    type            => "intranet",
29
    type            => "intranet",
30
    authnotrequired => 0,
30
    authnotrequired => 0,
31
    flagsrequired   => { circulate => 'circulate_remaining_permissions' },
31
    flagsrequired   => { circulate => 'circulate_remaining_permissions' },
32
});
32
});
33
33
34
my $reserve_group_id = $cgi->param('reserve_group_id');
34
my $hold_group_id = $cgi->param('hold_group_id');
35
my @reserves = GetReserveGroupReserves($reserve_group_id);
35
my @holds = GetHoldGroupHolds($hold_group_id);
36
36
37
$template->param(
37
$template->param(
38
    reserve_group_id => $reserve_group_id,
38
    hold_group_id => $hold_group_id,
39
    reserves => \@reserves,
39
    holds => \@holds,
40
);
40
);
41
41
42
output_html_with_http_headers $cgi, $cookie, $template->output;
42
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/reserve/placerequest.pl (-3 / +3 lines)
Lines 84-92 if (defined $checkitem && $checkitem ne ''){ Link Here
84
84
85
if ( $type eq 'str8' && $borrower ) {
85
if ( $type eq 'str8' && $borrower ) {
86
86
87
    my $reserve_group_id;
87
    my $hold_group_id;
88
    if ($multi_hold && $requestany) {
88
    if ($multi_hold && $requestany) {
89
        $reserve_group_id = AddReserveGroup();
89
        $hold_group_id = AddHoldGroup();
90
    }
90
    }
91
91
92
    foreach my $biblionumber ( keys %bibinfos ) {
92
    foreach my $biblionumber ( keys %bibinfos ) {
Lines 115-121 if ( $type eq 'str8' && $borrower ) { Link Here
115
            AddReserve($branch, $borrower->{'borrowernumber'}, $biblionumber,
115
            AddReserve($branch, $borrower->{'borrowernumber'}, $biblionumber,
116
                [$biblionumber], $bibinfo->{rank}, $startdate, $expirationdate,
116
                [$biblionumber], $bibinfo->{rank}, $startdate, $expirationdate,
117
                $notes, $bibinfo->{title}, $checkitem, $found, $itemtype,
117
                $notes, $bibinfo->{title}, $checkitem, $found, $itemtype,
118
                $reserve_group_id);
118
                $hold_group_id);
119
        } else {
119
        } else {
120
            # place a request on 1st available
120
            # place a request on 1st available
121
            for ( my $i = 0 ; $i < $holds_to_place_count ; $i++ ) {
121
            for ( my $i = 0 ; $i < $holds_to_place_count ; $i++ ) {
(-)a/reserve/request.pl (-1 / +1 lines)
Lines 578-584 foreach my $biblionumber (@biblionumbers) { Link Here
578
        $reserve{'reserve_id'}     = $res->reserve_id();
578
        $reserve{'reserve_id'}     = $res->reserve_id();
579
        $reserve{itemtype}         = $res->itemtype();
579
        $reserve{itemtype}         = $res->itemtype();
580
        $reserve{branchcode}       = $res->branchcode();
580
        $reserve{branchcode}       = $res->branchcode();
581
        $reserve{'reserve_group_id'} = $res->reserve_group_id;
581
        $reserve{'hold_group_id'}  = $res->hold_group_id;
582
582
583
        push( @reserveloop, \%reserve );
583
        push( @reserveloop, \%reserve );
584
    }
584
    }
(-)a/svc/holds (-1 / +1 lines)
Lines 101-107 while ( my $h = $holds_rs->next() ) { Link Here
101
        waiting_here   => $h->branch()->branchcode() eq $branch,
101
        waiting_here   => $h->branch()->branchcode() eq $branch,
102
        priority       => $h->priority(),
102
        priority       => $h->priority(),
103
        itemtype_limit => $itemtype_limit,
103
        itemtype_limit => $itemtype_limit,
104
        reserve_group_id => $h->reserve_group_id,
104
        hold_group_id  => $h->hold_group_id,
105
        subtitle       => GetRecordValue(
105
        subtitle       => GetRecordValue(
106
            'subtitle', GetMarcBiblio($biblionumber),
106
            'subtitle', GetMarcBiblio($biblionumber),
107
            GetFrameworkCode($biblionumber)
107
            GetFrameworkCode($biblionumber)
(-)a/t/db_dependent/Reserves/ReserveCount.t (-14 / +13 lines)
Lines 50-66 my $biblio = $builder->build( { source => 'Biblio', } ); Link Here
50
my $biblionumber = $biblio->{biblionumber};
50
my $biblionumber = $biblio->{biblionumber};
51
51
52
# Use AddReserve instead of TestBuilder because i don't manage
52
# Use AddReserve instead of TestBuilder because i don't manage
53
# to make TestBuilder set reserve_group_id to null. Idea ?
53
# to make TestBuilder set hold_group_id to null. Idea ?
54
my $reserve_id = AddReserve($branchcode, $borrowernumber,
54
my $reserve_id = AddReserve($branchcode, $borrowernumber,
55
$biblionumber, $biblionumber, 1, undef, undef, undef
55
$biblionumber, $biblionumber, 1, undef, undef, undef
56
$biblio->{title}, undef, undef, undef);
56
$biblio->{title}, undef, undef, undef);
57
57
58
is(GetReserveCount($borrowernumber), 1, 'Test borrower has 1 reserve.');
58
is(GetReserveCount($borrowernumber), 1, 'Test borrower has 1 reserve.');
59
59
60
my $reserves_group = $builder->build({
60
my $holds_group = $builder->build({
61
    source => 'ReserveGroup',
61
    source => 'HoldGroup',
62
    value => {
62
    value => {
63
        reserve_group_id => 1
63
        hold_group_id => 1
64
    }
64
    }
65
});
65
});
66
66
Lines 68-113 my $reserve2 = $builder->build({ Link Here
68
    source => 'Reserve',
68
    source => 'Reserve',
69
    value => {
69
    value => {
70
        borrowernumber => $borrowernumber,
70
        borrowernumber => $borrowernumber,
71
        reserve_group_id => 1
71
        hold_group_id => 1
72
    }
72
    }
73
});
73
});
74
my $reserve3 = $builder->build({
74
my $reserve3 = $builder->build({
75
    source => 'Reserve',
75
    source => 'Reserve',
76
    value => {
76
    value => {
77
        borrowernumber => $borrowernumber,
77
        borrowernumber => $borrowernumber,
78
        reserve_group_id => 1
78
        hold_group_id => 1
79
    }
79
    }
80
});
80
});
81
81
82
is(GetReserveCount($borrowernumber), 2, 'Test borrower has 2 reserve.');
82
is(GetReserveCount($borrowernumber), 2, 'Test borrower has 2 reserve.');
83
83
84
my $reserves_group2 = $builder->build({
84
my $holds_group2 = $builder->build({
85
    source => 'ReserveGroup',
85
    source => 'HoldGroup',
86
    value => {
86
    value => {
87
        reserve_group_id => 2
87
        hold_group_id => 2
88
    }
88
    }
89
});
89
});
90
my $reserve_group_id2 = $reserves_group2->{reserve_group_id};
90
my $hold_group_id2 = $holds_group2->{hold_group_id};
91
91
92
my $reserve4 = $builder->build({
92
my $reserve4 = $builder->build({
93
    source => 'Reserve',
93
    source => 'Reserve',
94
    value => {
94
    value => {
95
        borrowernumber => $borrowernumber,
95
        borrowernumber => $borrowernumber,
96
        reserve_group_id => 2
96
        hold_group_id => 2
97
    }
97
    }
98
});
98
});
99
my $reserve5 = $builder->build({
99
my $reserve5 = $builder->build({
100
    source => 'Reserve',
100
    source => 'Reserve',
101
    value => {
101
    value => {
102
        borrowernumber => $borrowernumber,
102
        borrowernumber => $borrowernumber,
103
        reserve_group_id => 2
103
        hold_group_id => 2
104
    }
104
    }
105
});
105
});
106
my $reserve6 = $builder->build({
106
my $reserve6 = $builder->build({
107
    source => 'Reserve',
107
    source => 'Reserve',
108
    value => {
108
    value => {
109
        borrowernumber => $borrowernumber,
109
        borrowernumber => $borrowernumber,
110
        reserve_group_id => 2
110
        hold_group_id => 2
111
    }
111
    }
112
});
112
});
113
113
114
- 

Return to bug 15516