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

Return to bug 12365