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

(-)a/Koha/Schema/Result/Issuingrule.pm (+8 lines)
Lines 226-231 __PACKAGE__->table("issuingrules"); Link Here
226
  extra: {list => ["no","yes","bib_only","item_only"]}
226
  extra: {list => ["no","yes","bib_only","item_only"]}
227
  is_nullable: 0
227
  is_nullable: 0
228
228
229
=head2 note
230
231
  data_type: 'varchar'
232
  is_nullable: 1
233
  size: 100
234
229
=cut
235
=cut
230
236
231
__PACKAGE__->add_columns(
237
__PACKAGE__->add_columns(
Lines 309-314 __PACKAGE__->add_columns( Link Here
309
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
315
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
310
    is_nullable => 0,
316
    is_nullable => 0,
311
  },
317
  },
318
  "note",
319
  { data_type => "varchar", is_nullable => 1, size => 100 },
312
);
320
);
313
321
314
=head1 PRIMARY KEY
322
=head1 PRIMARY KEY
(-)a/admin/smart-rules.pl (+2 lines)
Lines 185-190 elsif ($op eq 'add') { Link Here
185
    my $article_requests = $input->param('article_requests') || 'no';
185
    my $article_requests = $input->param('article_requests') || 'no';
186
    my $overduefinescap = $input->param('overduefinescap') || undef;
186
    my $overduefinescap = $input->param('overduefinescap') || undef;
187
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
187
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
188
    my $note = $input->param('note');
188
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
189
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
189
190
190
    my $params = {
191
    my $params = {
Lines 219-224 elsif ($op eq 'add') { Link Here
219
        overduefinescap               => $overduefinescap,
220
        overduefinescap               => $overduefinescap,
220
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
221
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
221
        article_requests              => $article_requests,
222
        article_requests              => $article_requests,
223
        note                          => $note,
222
    };
224
    };
223
225
224
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
226
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
(-)a/installer/data/mysql/atomicupdate/bug_12365_-_add_note_column_to_issuingrules.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    unless( column_exists( 'issuingrules', 'note' ) ) {
4
        $dbh->do(q|ALTER TABLE issuingrules ADD note varchar(100) default NULL AFTER article_requests|);
5
    }
6
7
    SetVersion( $DBversion );
8
    print "Upgrade to $DBversion done (Bug 12365: Add column issuingrules.note)\n";
9
}
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 877-882 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
877
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
877
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
878
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
878
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
879
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
879
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
880
  `note` varchar(100) default NULL, -- description of rule, reason for setting rule
880
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
881
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
881
  KEY `categorycode` (`categorycode`),
882
  KEY `categorycode` (`categorycode`),
882
  KEY `itemtype` (`itemtype`)
883
  KEY `itemtype` (`itemtype`)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-2 / +5 lines)
Lines 97-102 Link Here
97
                <th>Item level holds</th>
97
                <th>Item level holds</th>
98
                <th>Article requests</th>
98
                <th>Article requests</th>
99
                <th>Rental discount (%)</th>
99
                <th>Rental discount (%)</th>
100
                <th>Note</th>
100
                <th>Actions</th>
101
                <th>Actions</th>
101
            </tr>
102
            </tr>
102
            </thead>
103
            </thead>
Lines 222-228 Link Here
222
                                                                <span>Item only</span>
223
                                                                <span>Item only</span>
223
                                                            [% END %]
224
                                                            [% END %]
224
                                                        </td>
225
                                                        </td>
225
							<td>[% rule.rentaldiscount | html %]</td>
226
                                                        <td>[% rule.rentaldiscount | html %]</td>
227
                                                        <td>[% rule.note | html %]</td>
226
                                                        <td class="actions">
228
                                                        <td class="actions">
227
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
229
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
228
                                                          <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype | html %]&amp;categorycode=[% rule.categorycode | html %]&amp;branch=[% rule.current_branch | html %]"><i class="fa fa-trash"></i> Delete</a>
230
                                                          <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=[% rule.itemtype | html %]&amp;categorycode=[% rule.categorycode | html %]&amp;branch=[% rule.current_branch | html %]"><i class="fa fa-trash"></i> Delete</a>
Lines 324-329 Link Here
324
                        </select>
326
                        </select>
325
                    </td>
327
                    </td>
326
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
328
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
329
                    <td><input type="text" name="note" id="note" size="15" value=""></td>
327
                    <td class="actions">
330
                    <td class="actions">
328
                        <input type="hidden" name="branch" value="[% current_branch | html %]"/>
331
                        <input type="hidden" name="branch" value="[% current_branch | html %]"/>
329
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
332
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
Lines 362-367 Link Here
362
                      <th>Item level holds</th>
365
                      <th>Item level holds</th>
363
                      <th>Article requests</th>
366
                      <th>Article requests</th>
364
                      <th>Rental discount (%)</th>
367
                      <th>Rental discount (%)</th>
368
                      <th>Note</th>
365
                      <th>&nbsp;</th>
369
                      <th>&nbsp;</th>
366
                    </tr>
370
                    </tr>
367
                  </tfoot>
371
                  </tfoot>
368
- 

Return to bug 12365