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

(-)a/Koha/Schema/Result/LibraryFloatLimit.pm (+123 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::LibraryFloatLimit;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::LibraryFloatLimit
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<library_float_limits>
19
20
=cut
21
22
__PACKAGE__->table("library_float_limits");
23
24
=head1 ACCESSORS
25
26
=head2 branchcode
27
28
  data_type: 'varchar'
29
  is_foreign_key: 1
30
  is_nullable: 0
31
  size: 10
32
33
=head2 itemtype
34
35
  data_type: 'varchar'
36
  is_foreign_key: 1
37
  is_nullable: 0
38
  size: 10
39
40
=head2 limit
41
42
  data_type: 'integer'
43
  is_nullable: 1
44
45
=cut
46
47
__PACKAGE__->add_columns(
48
  "branchcode",
49
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
50
  "itemtype",
51
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
52
  "limit",
53
  { data_type => "integer", is_nullable => 1 },
54
);
55
56
=head1 PRIMARY KEY
57
58
=over 4
59
60
=item * L</branchcode>
61
62
=item * L</itemtype>
63
64
=back
65
66
=cut
67
68
__PACKAGE__->set_primary_key("branchcode", "itemtype");
69
70
=head1 RELATIONS
71
72
=head2 branchcode
73
74
Type: belongs_to
75
76
Related object: L<Koha::Schema::Result::Branch>
77
78
=cut
79
80
__PACKAGE__->belongs_to(
81
  "branchcode",
82
  "Koha::Schema::Result::Branch",
83
  { branchcode => "branchcode" },
84
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
85
);
86
87
=head2 itemtype
88
89
Type: belongs_to
90
91
Related object: L<Koha::Schema::Result::Itemtype>
92
93
=cut
94
95
__PACKAGE__->belongs_to(
96
  "itemtype",
97
  "Koha::Schema::Result::Itemtype",
98
  { itemtype => "itemtype" },
99
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
100
);
101
102
103
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-12-18 13:53:43
104
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:XAvuO942Z7k3O/FrkZRXzw
105
106
=head2 koha_object_class
107
108
=cut
109
110
sub koha_object_class {
111
    'Koha::Library::FloatLimit';
112
}
113
114
=head2 koha_objects_class
115
116
=cut
117
118
sub koha_objects_class {
119
    'Koha::Library::FloatLimits';
120
}
121
122
# You can replace this text with custom code or comments, and it will be preserved on regeneration
123
1;
(-)a/installer/data/mysql/atomicupdate/bug_28530.pl (+40 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "28530",
5
    description => "Add library float limits",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(
11
            q{
12
            ALTER TABLE branchtransfers MODIFY COLUMN `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation', 'LibraryFloatLimit') DEFAULT NULL COMMENT 'what triggered the transfer'
13
        }
14
        );
15
16
        $dbh->do(
17
            q{
18
                INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
19
                ('UseLibraryFloatLimits', '0', '', 'Enables library float limits', 'YesNo'),
20
            }
21
        );
22
        say $out "Added new system preference 'UseLibraryFloatLimits'";
23
24
        unless ( TableExists('search_filters') ) {
25
            $dbh->do(
26
                q{
27
                CREATE TABLE `library_float_limits` (
28
                `branchcode` varchar(10) NOT NULL,
29
                `itemtype` varchar(10) NOT NULL,
30
                `limit` int(11) NULL DEFAULT NULL,
31
                PRIMARY KEY (`branchcode`,`itemtype`),
32
                CONSTRAINT `library_float_limits_ibfk_bc` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
33
                CONSTRAINT `library_float_limits_ibfk_it` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
34
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
35
            }
36
            );
37
        }
38
        say $out "Added new table 'library_float_limits'";
39
    },
40
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +14 lines)
Lines 1692-1698 CREATE TABLE `branchtransfers` ( Link Here
1692
  `datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled',
1692
  `datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled',
1693
  `tobranch` varchar(10) NOT NULL DEFAULT '' COMMENT 'the branch the transfer was going to',
1693
  `tobranch` varchar(10) NOT NULL DEFAULT '' COMMENT 'the branch the transfer was going to',
1694
  `comments` longtext DEFAULT NULL COMMENT 'any comments related to the transfer',
1694
  `comments` longtext DEFAULT NULL COMMENT 'any comments related to the transfer',
1695
  `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation') DEFAULT NULL COMMENT 'what triggered the transfer',
1695
  `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation','LibraryFloatLimit') DEFAULT NULL COMMENT 'what triggered the transfer',
1696
  `cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','RecallCancellation') DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
1696
  `cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','RecallCancellation') DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
1697
  PRIMARY KEY (`branchtransfer_id`),
1697
  PRIMARY KEY (`branchtransfer_id`),
1698
  KEY `frombranch` (`frombranch`),
1698
  KEY `frombranch` (`frombranch`),
Lines 6357-6362 CREATE TABLE `transport_cost` ( Link Here
6357
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6357
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6358
/*!40101 SET character_set_client = @saved_cs_client */;
6358
/*!40101 SET character_set_client = @saved_cs_client */;
6359
6359
6360
DROP TABLE IF EXISTS `library_float_limits`;
6361
/*!40101 SET @saved_cs_client     = @@character_set_client */;
6362
/*!40101 SET character_set_client = utf8 */;
6363
CREATE TABLE `library_float_limits` (
6364
  `branchcode` varchar(10) NOT NULL,
6365
  `itemtype` varchar(10) NOT NULL,
6366
  `limit` int(11) NULL DEFAULT NULL,
6367
  PRIMARY KEY (`branchcode`,`itemtype`),
6368
  CONSTRAINT `library_float_limits_ibfk_bc` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
6369
  CONSTRAINT `library_float_limits_ibfk_it` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
6370
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6371
/*!40101 SET character_set_client = @saved_cs_client */;
6372
6360
--
6373
--
6361
-- Table structure for table `uploaded_files`
6374
-- Table structure for table `uploaded_files`
6362
--
6375
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 803-808 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
803
('useDischarge','0','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
803
('useDischarge','0','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
804
('UseEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'),
804
('UseEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'),
805
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
805
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
806
('UseLibraryFloatLimits', '0', '', 'Enables library float limits', 'YesNo'),
806
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
807
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
807
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
808
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
808
('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'),
809
('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +6 lines)
Lines 261-266 Circulation: Link Here
261
                  1: Use
261
                  1: Use
262
                  0: "Don't use"
262
                  0: "Don't use"
263
            - the transport cost matrix for calculating optimal holds filling between libraries.
263
            - the transport cost matrix for calculating optimal holds filling between libraries.
264
        -
265
            - pref: UseLibraryFloatLimits
266
              choices:
267
                  1: Use
268
                  0: "Don't use"
269
            - library float limits to determine if an item should be transferred to another library.
264
        -
270
        -
265
            - Use the calendar and circulation rules of
271
            - Use the calendar and circulation rules of
266
            - pref: CircControl
272
            - pref: CircControl
267
- 

Return to bug 28530