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

(-)a/Koha/Schema/Result/Issuingrule.pm (-2 / +10 lines)
Lines 209-214 __PACKAGE__->table("issuingrules"); Link Here
209
  extra: {list => ["no","yes","bib_only","item_only"]}
209
  extra: {list => ["no","yes","bib_only","item_only"]}
210
  is_nullable: 0
210
  is_nullable: 0
211
211
212
=head2 note
213
214
  data_type: 'varchar'
215
  is_nullable: 1
216
  size: 100
217
212
=cut
218
=cut
213
219
214
__PACKAGE__->add_columns(
220
__PACKAGE__->add_columns(
Lines 286-291 __PACKAGE__->add_columns( Link Here
286
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
292
    extra => { list => ["no", "yes", "bib_only", "item_only"] },
287
    is_nullable => 0,
293
    is_nullable => 0,
288
  },
294
  },
295
  "note",
296
  { data_type => "varchar", is_nullable => 1, size => 100 },
289
);
297
);
290
298
291
=head1 PRIMARY KEY
299
=head1 PRIMARY KEY
Lines 305-312 __PACKAGE__->add_columns( Link Here
305
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
313
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
306
314
307
315
308
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-11-02 10:33:37
316
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-04-05 05:08:10
309
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t9AhZLbm4SE7mx25LAyhGA
317
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Tiy5b9/0Jg3UZ42OZlSNGw
310
318
311
319
312
# You can replace this text with custom code or comments, and it will be preserved on regeneration
320
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/admin/smart-rules.pl (+2 lines)
Lines 157-162 elsif ($op eq 'add') { Link Here
157
    my $article_requests = $input->param('article_requests') || 'no';
157
    my $article_requests = $input->param('article_requests') || 'no';
158
    my $overduefinescap = $input->param('overduefinescap') || undef;
158
    my $overduefinescap = $input->param('overduefinescap') || undef;
159
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
159
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
160
    my $note = $input->param('note');
160
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
161
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
161
162
162
    my $params = {
163
    my $params = {
Lines 188-193 elsif ($op eq 'add') { Link Here
188
        overduefinescap               => $overduefinescap,
189
        overduefinescap               => $overduefinescap,
189
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
190
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
190
        article_requests              => $article_requests,
191
        article_requests              => $article_requests,
192
        note                          => $note,
191
    };
193
    };
192
194
193
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
195
    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 879-884 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
879
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
879
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
880
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
880
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
881
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
881
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
882
  `note` varchar(100) default NULL, -- description of rule, reason for setting rule
882
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
883
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
883
  KEY `categorycode` (`categorycode`),
884
  KEY `categorycode` (`categorycode`),
884
  KEY `itemtype` (`itemtype`)
885
  KEY `itemtype` (`itemtype`)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-1 / +4 lines)
Lines 192-197 $(document).ready(function() { Link Here
192
                <th>Item level holds</th>
192
                <th>Item level holds</th>
193
                <th>Article requests</th>
193
                <th>Article requests</th>
194
                <th>Rental discount (%)</th>
194
                <th>Rental discount (%)</th>
195
                <th>Note</th>
195
                <th>Actions</th>
196
                <th>Actions</th>
196
            </tr>
197
            </tr>
197
            </thead>
198
            </thead>
Lines 290-295 $(document).ready(function() { Link Here
290
                                                            [% END %]
291
                                                            [% END %]
291
                                                        </td>
292
                                                        </td>
292
							<td>[% rule.rentaldiscount %]</td>
293
							<td>[% rule.rentaldiscount %]</td>
294
            <td>[% rule.note %]</td>
293
                                                        <td class="actions">
295
                                                        <td class="actions">
294
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
296
                                                          <a href="#" class="editrule btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
295
                                                          <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>
297
                                                          <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 379-384 $(document).ready(function() { Link Here
379
                        </select>
381
                        </select>
380
                    </td>
382
                    </td>
381
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
383
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
384
                    <td><input type="text" name="note" id="note" size="15" value="[% rule.note %]"></td>
382
                    <td class="actions">
385
                    <td class="actions">
383
                        <input type="hidden" name="branch" value="[% current_branch %]"/>
386
                        <input type="hidden" name="branch" value="[% current_branch %]"/>
384
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
387
                        <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
Lines 413-418 $(document).ready(function() { Link Here
413
                      <th>Item level holds</th>
416
                      <th>Item level holds</th>
414
                      <th>Article requests</th>
417
                      <th>Article requests</th>
415
                      <th>Rental discount (%)</th>
418
                      <th>Rental discount (%)</th>
419
                      <th>Note</th>
416
                      <th colspan="2">&nbsp;</th>
420
                      <th colspan="2">&nbsp;</th>
417
                    </tr>
421
                    </tr>
418
                  </tfoot>
422
                  </tfoot>
419
- 

Return to bug 12365