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

(-)a/C4/Circulation.pm (+2 lines)
Lines 2903-2908 sub CanBookBeRenewed { Link Here
2903
2903
2904
    my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber);
2904
    my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber);
2905
2905
2906
    $resfound = 0 if $resrec->{non_priority};
2907
2906
    # This item can fill one or more unfilled reserve, can those unfilled reserves
2908
    # This item can fill one or more unfilled reserve, can those unfilled reserves
2907
    # all be filled by other available items?
2909
    # all be filled by other available items?
2908
    if ( $resfound
2910
    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 1649-1655 sub _Findgroupreserve { Link Here
1649
               biblioitems.biblioitemnumber AS biblioitemnumber,
1651
               biblioitems.biblioitemnumber AS biblioitemnumber,
1650
               reserves.itemnumber          AS itemnumber,
1652
               reserves.itemnumber          AS itemnumber,
1651
               reserves.reserve_id          AS reserve_id,
1653
               reserves.reserve_id          AS reserve_id,
1652
               reserves.itemtype            AS itemtype
1654
               reserves.itemtype            AS itemtype,
1655
               reserves.non_priority        AS non_priority
1653
        FROM reserves
1656
        FROM reserves
1654
        JOIN biblioitems USING (biblionumber)
1657
        JOIN biblioitems USING (biblionumber)
1655
        JOIN hold_fill_targets USING (biblionumber, borrowernumber, itemnumber)
1658
        JOIN hold_fill_targets USING (biblionumber, borrowernumber, itemnumber)
Lines 1684-1690 sub _Findgroupreserve { Link Here
1684
               biblioitems.biblioitemnumber AS biblioitemnumber,
1687
               biblioitems.biblioitemnumber AS biblioitemnumber,
1685
               reserves.itemnumber          AS itemnumber,
1688
               reserves.itemnumber          AS itemnumber,
1686
               reserves.reserve_id          AS reserve_id,
1689
               reserves.reserve_id          AS reserve_id,
1687
               reserves.itemtype            AS itemtype
1690
               reserves.itemtype            AS itemtype,
1691
               reserves.non_priority        AS non_priority
1688
        FROM reserves
1692
        FROM reserves
1689
        JOIN biblioitems USING (biblionumber)
1693
        JOIN biblioitems USING (biblionumber)
1690
        JOIN hold_fill_targets USING (biblionumber, borrowernumber)
1694
        JOIN hold_fill_targets USING (biblionumber, borrowernumber)
Lines 1718-1724 sub _Findgroupreserve { Link Here
1718
               reserves.timestamp                  AS timestamp,
1722
               reserves.timestamp                  AS timestamp,
1719
               reserves.itemnumber                 AS itemnumber,
1723
               reserves.itemnumber                 AS itemnumber,
1720
               reserves.reserve_id                 AS reserve_id,
1724
               reserves.reserve_id                 AS reserve_id,
1721
               reserves.itemtype                   AS itemtype
1725
               reserves.itemtype                   AS itemtype,
1726
               reserves.non_priority        AS non_priority
1722
        FROM reserves
1727
        FROM reserves
1723
        WHERE reserves.biblionumber = ?
1728
        WHERE reserves.biblionumber = ?
1724
          AND (reserves.itemnumber IS NULL OR reserves.itemnumber = ?)
1729
          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 162-167 sub add { Link Here
162
                itemnumber       => $item_id,
163
                itemnumber       => $item_id,
163
                found            => undef,                # TODO: Why not?
164
                found            => undef,                # TODO: Why not?
164
                itemtype         => $item_type,
165
                itemtype         => $item_type,
166
                non_priority     => $non_priority,
165
            }
167
            }
166
        );
168
        );
167
169
(-)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