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

(-)a/C4/Circulation.pm (+2 lines)
Lines 2761-2766 sub CanBookBeRenewed { Link Here
2761
2761
2762
    my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber);
2762
    my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber);
2763
2763
2764
    $resfound = 0 if $resrec->{non_priority};
2765
2764
    # This item can fill one or more unfilled reserve, can those unfilled reserves
2766
    # This item can fill one or more unfilled reserve, can those unfilled reserves
2765
    # all be filled by other available items?
2767
    # all be filled by other available items?
2766
    if ( $resfound
2768
    if ( $resfound
(-)a/C4/Reserves.pm (-3 / +8 lines)
Lines 185-190 sub AddReserve { Link Here
185
    my $checkitem      = $params->{itemnumber};
185
    my $checkitem      = $params->{itemnumber};
186
    my $found          = $params->{found};
186
    my $found          = $params->{found};
187
    my $itemtype       = $params->{itemtype};
187
    my $itemtype       = $params->{itemtype};
188
    my $non_priority   = $params->{non_priority};
188
189
189
    $resdate = output_pref( { str => dt_from_string( $resdate ), dateonly => 1, dateformat => 'iso' })
190
    $resdate = output_pref( { str => dt_from_string( $resdate ), dateonly => 1, dateformat => 'iso' })
190
        or output_pref({ dt => dt_from_string, dateonly => 1, dateformat => 'iso' });
191
        or output_pref({ dt => dt_from_string, dateonly => 1, dateformat => 'iso' });
Lines 248-253 sub AddReserve { Link Here
248
            expirationdate => $expdate,
249
            expirationdate => $expdate,
249
            itemtype       => $itemtype,
250
            itemtype       => $itemtype,
250
            item_level_hold => $checkitem ? 1 : 0,
251
            item_level_hold => $checkitem ? 1 : 0,
252
            non_priority   => $non_priority ? 1 : 0,
251
        }
253
        }
252
    )->store();
254
    )->store();
253
    $hold->set_waiting() if $found && $found eq 'W';
255
    $hold->set_waiting() if $found && $found eq 'W';
Lines 1656-1662 sub _Findgroupreserve { Link Here
1656
               biblioitems.biblioitemnumber AS biblioitemnumber,
1658
               biblioitems.biblioitemnumber AS biblioitemnumber,
1657
               reserves.itemnumber          AS itemnumber,
1659
               reserves.itemnumber          AS itemnumber,
1658
               reserves.reserve_id          AS reserve_id,
1660
               reserves.reserve_id          AS reserve_id,
1659
               reserves.itemtype            AS itemtype
1661
               reserves.itemtype            AS itemtype,
1662
               reserves.non_priority        AS non_priority
1660
        FROM reserves
1663
        FROM reserves
1661
        JOIN biblioitems USING (biblionumber)
1664
        JOIN biblioitems USING (biblionumber)
1662
        JOIN hold_fill_targets USING (biblionumber, borrowernumber, itemnumber)
1665
        JOIN hold_fill_targets USING (biblionumber, borrowernumber, itemnumber)
Lines 1691-1697 sub _Findgroupreserve { Link Here
1691
               biblioitems.biblioitemnumber AS biblioitemnumber,
1694
               biblioitems.biblioitemnumber AS biblioitemnumber,
1692
               reserves.itemnumber          AS itemnumber,
1695
               reserves.itemnumber          AS itemnumber,
1693
               reserves.reserve_id          AS reserve_id,
1696
               reserves.reserve_id          AS reserve_id,
1694
               reserves.itemtype            AS itemtype
1697
               reserves.itemtype            AS itemtype,
1698
               reserves.non_priority        AS non_priority
1695
        FROM reserves
1699
        FROM reserves
1696
        JOIN biblioitems USING (biblionumber)
1700
        JOIN biblioitems USING (biblionumber)
1697
        JOIN hold_fill_targets USING (biblionumber, borrowernumber)
1701
        JOIN hold_fill_targets USING (biblionumber, borrowernumber)
Lines 1725-1731 sub _Findgroupreserve { Link Here
1725
               reserves.timestamp                  AS timestamp,
1729
               reserves.timestamp                  AS timestamp,
1726
               reserves.itemnumber                 AS itemnumber,
1730
               reserves.itemnumber                 AS itemnumber,
1727
               reserves.reserve_id                 AS reserve_id,
1731
               reserves.reserve_id                 AS reserve_id,
1728
               reserves.itemtype                   AS itemtype
1732
               reserves.itemtype                   AS itemtype,
1733
               reserves.non_priority        AS non_priority
1729
        FROM reserves
1734
        FROM reserves
1730
        WHERE reserves.biblionumber = ?
1735
        WHERE reserves.biblionumber = ?
1731
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1736
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
(-)a/Koha/REST/V1/Holds.pm (+2 lines)
Lines 74-79 sub add { Link Here
74
        my $expiration_date   = $body->{expiration_date};
74
        my $expiration_date   = $body->{expiration_date};
75
        my $notes             = $body->{notes};
75
        my $notes             = $body->{notes};
76
        my $hold_date         = $body->{hold_date};
76
        my $hold_date         = $body->{hold_date};
77
        my $non_priority      = $body->{non_priority};
77
78
78
        if(!C4::Context->preference( 'AllowHoldDateInFuture' ) && $hold_date) {
79
        if(!C4::Context->preference( 'AllowHoldDateInFuture' ) && $hold_date) {
79
            return $c->render(
80
            return $c->render(
Lines 174-179 sub add { Link Here
174
                itemnumber       => $item_id,
175
                itemnumber       => $item_id,
175
                found            => undef,                # TODO: Why not?
176
                found            => undef,                # TODO: Why not?
176
                itemtype         => $item_type,
177
                itemtype         => $item_type,
178
                non_priority     => $non_priority,
177
            }
179
            }
178
        );
180
        );
179
181
(-)a/api/v1/swagger/definitions/hold.json (+4 lines)
Lines 71-76 Link Here
71
      "format": "date-time",
71
      "format": "date-time",
72
      "description": "Date until which the hold has been suspended"
72
      "description": "Date until which the hold has been suspended"
73
    },
73
    },
74
    "non_priority": {
75
      "description": "Set this hold as non priority",
76
      "type": "boolean"
77
    },
74
    "item_type": {
78
    "item_type": {
75
      "type": ["string", "null"],
79
      "type": ["string", "null"],
76
      "description": "If record level hold, the optional itemtype of the item the patron is requesting"
80
      "description": "If record level hold, the optional itemtype of the item the patron is requesting"
(-)a/api/v1/swagger/paths/holds.json (+10 lines)
Lines 103-108 Link Here
103
          "description": "Suspended until",
103
          "description": "Suspended until",
104
          "type": "string"
104
          "type": "string"
105
        },
105
        },
106
        {
107
          "name": "non_priority",
108
          "in": "query",
109
          "description": "Non priority hold",
110
          "type": "boolean"
111
        },
106
        {
112
        {
107
            "$ref": "../parameters.json#/match"
113
            "$ref": "../parameters.json#/match"
108
        },
114
        },
Lines 201-206 Link Here
201
              "item_type": {
207
              "item_type": {
202
                "description": "Limit hold on one itemtype (ignored for item-level holds)",
208
                "description": "Limit hold on one itemtype (ignored for item-level holds)",
203
                "type": [ "string", "null" ]
209
                "type": [ "string", "null" ]
210
              },
211
              "non_priority": {
212
                "description": "Set this hold as non priority",
213
                "type": [ "boolean", "null" ]
204
              }
214
              }
205
            },
215
            },
206
            "required": [ "patron_id", "pickup_library_id" ]
216
            "required": [ "patron_id", "pickup_library_id" ]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+5 lines)
Lines 476-481 Link Here
476
                                    <input type="hidden" name="holds_to_place_count" value="1" />
476
                                    <input type="hidden" name="holds_to_place_count" value="1" />
477
                                [% END %]
477
                                [% END %]
478
                            [% END # /UNLESS multi_hold %]
478
                            [% END # /UNLESS multi_hold %]
479
480
                            <li>
481
                                <label for="non_priority">Non priority hold:</label>
482
                                <input name="non_priority" id="non_priority" type="checkbox" />
483
                            </li>
479
                        </ol>
484
                        </ol>
480
485
481
                        [% UNLESS ( multi_hold ) %]
486
                        [% UNLESS ( multi_hold ) %]
(-)a/reserve/placerequest.pl (-1 / +4 lines)
Lines 52-57 my $title = $input->param('title'); Link Here
52
my $checkitem      = $input->param('checkitem');
52
my $checkitem      = $input->param('checkitem');
53
my $expirationdate = $input->param('expiration_date');
53
my $expirationdate = $input->param('expiration_date');
54
my $itemtype       = $input->param('itemtype') || undef;
54
my $itemtype       = $input->param('itemtype') || undef;
55
my $non_priority   = $input->param('non_priority');
55
56
56
my $borrower = Koha::Patrons->find( $borrowernumber );
57
my $borrower = Koha::Patrons->find( $borrowernumber );
57
$borrower = $borrower->unblessed if $borrower;
58
$borrower = $borrower->unblessed if $borrower;
Lines 114-119 if ( $type eq 'str8' && $borrower ) { Link Here
114
                        itemnumber       => $checkitem,
115
                        itemnumber       => $checkitem,
115
                        found            => $found,
116
                        found            => $found,
116
                        itemtype         => $itemtype,
117
                        itemtype         => $itemtype,
118
                        non_priority     => $non_priority,
117
                    }
119
                    }
118
                );
120
                );
119
121
Lines 135-140 if ( $type eq 'str8' && $borrower ) { Link Here
135
                        itemnumber       => $checkitem,
137
                        itemnumber       => $checkitem,
136
                        found            => $found,
138
                        found            => $found,
137
                        itemtype         => $itemtype,
139
                        itemtype         => $itemtype,
140
                        non_priority     => $non_priority,
138
                    }
141
                    }
139
                );
142
                );
140
            }
143
            }
Lines 155-160 if ( $type eq 'str8' && $borrower ) { Link Here
155
                            itemnumber       => $checkitem,
158
                            itemnumber       => $checkitem,
156
                            found            => $found,
159
                            found            => $found,
157
                            itemtype         => $itemtype,
160
                            itemtype         => $itemtype,
161
                            non_priority     => $non_priority,
158
                        }
162
                        }
159
                    );
163
                    );
160
                }
164
                }
161
- 

Return to bug 22789