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

(-)a/Koha/Schema/Result/Issuingrule.pm (+8 lines)
Lines 221-226 __PACKAGE__->table("issuingrules"); Link Here
221
  extra: {list => ["no","yes","bib_only","item_only"]}
221
  extra: {list => ["no","yes","bib_only","item_only"]}
222
  is_nullable: 0
222
  is_nullable: 0
223
223
224
=head2 note
225
226
  data_type: 'varchar'
227
  is_nullable: 1
228
  size: 100
229
224
=cut
230
=cut
225
231
226
__PACKAGE__->add_columns(
232
__PACKAGE__->add_columns(
Lines 302-307 __PACKAGE__->add_columns( Link Here
302
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
308
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
303
    is_nullable => 0,
309
    is_nullable => 0,
304
  },
310
  },
311
  "note",
312
  { data_type => "varchar", is_nullable => 1, size => 100 },
305
);
313
);
306
314
307
=head1 PRIMARY KEY
315
=head1 PRIMARY KEY
(-)a/admin/smart-rules.pl (+2 lines)
Lines 182-187 elsif ($op eq 'add') { Link Here
182
    my $article_requests = $input->param('article_requests') || 'no';
182
    my $article_requests = $input->param('article_requests') || 'no';
183
    my $overduefinescap = $input->param('overduefinescap') || undef;
183
    my $overduefinescap = $input->param('overduefinescap') || undef;
184
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
184
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
185
    my $note = $input->param('note');
185
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
186
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
186
187
187
    my $params = {
188
    my $params = {
Lines 215-220 elsif ($op eq 'add') { Link Here
215
        overduefinescap               => $overduefinescap,
216
        overduefinescap               => $overduefinescap,
216
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
217
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
217
        article_requests              => $article_requests,
218
        article_requests              => $article_requests,
219
        note                          => $note,
218
    };
220
    };
219
221
220
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
222
    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 876-881 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
876
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
876
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
877
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
877
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
878
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
878
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
879
  `note` varchar(100) default NULL, -- description of rule, reason for setting rule
879
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
880
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
880
  KEY `categorycode` (`categorycode`),
881
  KEY `categorycode` (`categorycode`),
881
  KEY `itemtype` (`itemtype`)
882
  KEY `itemtype` (`itemtype`)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-2 / +5 lines)
Lines 96-101 Link Here
96
                <th>Item level holds</th>
96
                <th>Item level holds</th>
97
                <th>Article requests</th>
97
                <th>Article requests</th>
98
                <th>Rental discount (%)</th>
98
                <th>Rental discount (%)</th>
99
                <th>Note</th>
99
                <th>Actions</th>
100
                <th>Actions</th>
100
            </tr>
101
            </tr>
101
            </thead>
102
            </thead>
Lines 215-221 Link Here
215
                                                                <span>Item only</span>
216
                                                                <span>Item only</span>
216
                                                            [% END %]
217
                                                            [% END %]
217
                                                        </td>
218
                                                        </td>
218
							<td>[% rule.rentaldiscount | html %]</td>
219
                                                        <td>[% rule.rentaldiscount | html %]</td>
220
                                                        <td>[% rule.note | html %]</td>
219
                                                        <td class="actions">
221
                                                        <td class="actions">
220
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
222
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
221
                                                          <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>
223
                                                          <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 316-321 Link Here
316
                        </select>
318
                        </select>
317
                    </td>
319
                    </td>
318
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
320
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
321
                    <td><input type="text" name="note" id="note" size="15" value=""></td>
319
                    <td class="actions">
322
                    <td class="actions">
320
                        <input type="hidden" name="branch" value="[% current_branch | html %]"/>
323
                        <input type="hidden" name="branch" value="[% current_branch | html %]"/>
321
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
324
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
Lines 353-358 Link Here
353
                      <th>Item level holds</th>
356
                      <th>Item level holds</th>
354
                      <th>Article requests</th>
357
                      <th>Article requests</th>
355
                      <th>Rental discount (%)</th>
358
                      <th>Rental discount (%)</th>
359
                      <th>Note</th>
356
                      <th>&nbsp;</th>
360
                      <th>&nbsp;</th>
357
                    </tr>
361
                    </tr>
358
                  </tfoot>
362
                  </tfoot>
359
- 

Return to bug 12365