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 164-169 elsif ($op eq 'add') { Link Here
164
    my $article_requests = $input->param('article_requests') || 'no';
164
    my $article_requests = $input->param('article_requests') || 'no';
165
    my $overduefinescap = $input->param('overduefinescap') || undef;
165
    my $overduefinescap = $input->param('overduefinescap') || undef;
166
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
166
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
167
    my $note = $input->param('note');
167
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
168
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
168
169
169
    my $params = {
170
    my $params = {
Lines 197-202 elsif ($op eq 'add') { Link Here
197
        overduefinescap               => $overduefinescap,
198
        overduefinescap               => $overduefinescap,
198
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
199
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
199
        article_requests              => $article_requests,
200
        article_requests              => $article_requests,
201
        note                          => $note,
200
    };
202
    };
201
203
202
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
204
    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 866-871 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
866
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
866
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
867
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
867
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
868
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
868
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
869
  `note` varchar(100) default NULL, -- description of rule, reason for setting rule
869
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
870
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
870
  KEY `categorycode` (`categorycode`),
871
  KEY `categorycode` (`categorycode`),
871
  KEY `itemtype` (`itemtype`)
872
  KEY `itemtype` (`itemtype`)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-2 / +5 lines)
Lines 93-98 Link Here
93
                <th>Item level holds</th>
93
                <th>Item level holds</th>
94
                <th>Article requests</th>
94
                <th>Article requests</th>
95
                <th>Rental discount (%)</th>
95
                <th>Rental discount (%)</th>
96
                <th>Note</th>
96
                <th>Actions</th>
97
                <th>Actions</th>
97
            </tr>
98
            </tr>
98
            </thead>
99
            </thead>
Lines 212-218 Link Here
212
                                                                <span>Item only</span>
213
                                                                <span>Item only</span>
213
                                                            [% END %]
214
                                                            [% END %]
214
                                                        </td>
215
                                                        </td>
215
							<td>[% rule.rentaldiscount | html %]</td>
216
                                                        <td>[% rule.rentaldiscount | html %]</td>
217
                                                        <td>[% rule.note | html %]</td>
216
                                                        <td class="actions">
218
                                                        <td class="actions">
217
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
219
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
218
                                                          <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>
220
                                                          <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 313-318 Link Here
313
                        </select>
315
                        </select>
314
                    </td>
316
                    </td>
315
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
317
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
318
                    <td><input type="text" name="note" id="note" size="15" value=""></td>
316
                    <td class="actions">
319
                    <td class="actions">
317
                        <input type="hidden" name="branch" value="[% current_branch | html %]"/>
320
                        <input type="hidden" name="branch" value="[% current_branch | html %]"/>
318
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
321
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
Lines 350-355 Link Here
350
                      <th>Item level holds</th>
353
                      <th>Item level holds</th>
351
                      <th>Article requests</th>
354
                      <th>Article requests</th>
352
                      <th>Rental discount (%)</th>
355
                      <th>Rental discount (%)</th>
356
                      <th>Note</th>
353
                      <th>&nbsp;</th>
357
                      <th>&nbsp;</th>
354
                    </tr>
358
                    </tr>
355
                  </tfoot>
359
                  </tfoot>
356
- 

Return to bug 12365