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
3
package Koha::Schema::Result::LibraryFloatLimit;
4
5
# Created by DBIx::Class::Schema::Loader
6
# DO NOT MODIFY THE FIRST PART OF THIS FILE
7
8
=head1 NAME
9
10
Koha::Schema::Result::LibraryFloatLimit
11
12
=cut
13
14
use strict;
15
use warnings;
16
17
use base 'DBIx::Class::Core';
18
19
=head1 TABLE: C<library_float_limits>
20
21
=cut
22
23
__PACKAGE__->table("library_float_limits");
24
25
=head1 ACCESSORS
26
27
=head2 branchcode
28
29
  data_type: 'varchar'
30
  is_foreign_key: 1
31
  is_nullable: 0
32
  size: 10
33
34
=head2 itemtype
35
36
  data_type: 'varchar'
37
  is_foreign_key: 1
38
  is_nullable: 0
39
  size: 10
40
41
=head2 float_limit
42
43
  data_type: 'integer'
44
  is_nullable: 1
45
46
=cut
47
48
__PACKAGE__->add_columns(
49
    "branchcode",
50
    { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
51
    "itemtype",
52
    { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
53
    "float_limit",
54
    { data_type => "integer", is_nullable => 1 },
55
);
56
57
=head1 PRIMARY KEY
58
59
=over 4
60
61
=item * L</branchcode>
62
63
=item * L</itemtype>
64
65
=back
66
67
=cut
68
69
__PACKAGE__->set_primary_key( "branchcode", "itemtype" );
70
71
=head1 RELATIONS
72
73
=head2 branchcode
74
75
Type: belongs_to
76
77
Related object: L<Koha::Schema::Result::Branch>
78
79
=cut
80
81
__PACKAGE__->belongs_to(
82
    "branchcode",
83
    "Koha::Schema::Result::Branch",
84
    { branchcode    => "branchcode" },
85
    { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
86
);
87
88
=head2 itemtype
89
90
Type: belongs_to
91
92
Related object: L<Koha::Schema::Result::Itemtype>
93
94
=cut
95
96
__PACKAGE__->belongs_to(
97
    "itemtype",
98
    "Koha::Schema::Result::Itemtype",
99
    { itemtype      => "itemtype" },
100
    { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
101
);
102
103
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-12-19 18:47:35
104
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:AnpZIyNq9oO1vmDSXmQEMQ
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('library_float_limits') ) {
25
            $dbh->do(
26
                q{
27
                CREATE TABLE `library_float_limits` (
28
                `branchcode` varchar(10) NOT NULL,
29
                `itemtype` varchar(10) NOT NULL,
30
                `float_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 1713-1719 CREATE TABLE `branchtransfers` ( Link Here
1713
  `datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled',
1713
  `datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled',
1714
  `tobranch` varchar(10) NOT NULL DEFAULT '' COMMENT 'the branch the transfer was going to',
1714
  `tobranch` varchar(10) NOT NULL DEFAULT '' COMMENT 'the branch the transfer was going to',
1715
  `comments` longtext DEFAULT NULL COMMENT 'any comments related to the transfer',
1715
  `comments` longtext DEFAULT NULL COMMENT 'any comments related to the transfer',
1716
  `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation') DEFAULT NULL COMMENT 'what triggered the transfer',
1716
  `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation','LibraryFloatLimit') DEFAULT NULL COMMENT 'what triggered the transfer',
1717
  `cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','RecallCancellation') DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
1717
  `cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','RecallCancellation') DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
1718
  PRIMARY KEY (`branchtransfer_id`),
1718
  PRIMARY KEY (`branchtransfer_id`),
1719
  KEY `frombranch` (`frombranch`),
1719
  KEY `frombranch` (`frombranch`),
Lines 6576-6581 CREATE TABLE `transport_cost` ( Link Here
6576
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6576
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6577
/*!40101 SET character_set_client = @saved_cs_client */;
6577
/*!40101 SET character_set_client = @saved_cs_client */;
6578
6578
6579
DROP TABLE IF EXISTS `library_float_limits`;
6580
/*!40101 SET @saved_cs_client     = @@character_set_client */;
6581
/*!40101 SET character_set_client = utf8 */;
6582
CREATE TABLE `library_float_limits` (
6583
  `branchcode` varchar(10) NOT NULL,
6584
  `itemtype` varchar(10) NOT NULL,
6585
  `float_limit` int(11) NULL DEFAULT NULL,
6586
  PRIMARY KEY (`branchcode`,`itemtype`),
6587
  CONSTRAINT `library_float_limits_ibfk_bc` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
6588
  CONSTRAINT `library_float_limits_ibfk_it` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE
6589
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6590
/*!40101 SET character_set_client = @saved_cs_client */;
6591
6579
--
6592
--
6580
-- Table structure for table `uploaded_files`
6593
-- Table structure for table `uploaded_files`
6581
--
6594
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +2 lines)
Lines 856-861 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
856
('useDischarge','0','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
856
('useDischarge','0','','Allows librarians to discharge borrowers and borrowers to request a discharge','YesNo'),
857
('UseEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'),
857
('UseEmailReceipts','0','','Send email receipts for payments and write-offs','YesNo'),
858
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
858
('UseICUStyleQuotes','0','1','Tell Koha whether to use ICU style quotes ({) or default (") when tracing subjects .','YesNo'),
859
('UseLibraryFloatLimits', '0', '', 'Enables library float limits', 'YesNo'),
859
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
860
('UseLocationAsAQInSIP', '0', '', 'Use permanent_location instead of homebranch for AQ in SIP response', 'YesNo'),
860
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
861
('UseOCLCEncodingLevels','0',NULL,'If enabled, include OCLC encoding levels in leader value builder dropdown for position 17.','YesNo'),
861
('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'),
862
('UseRecalls','0',NULL,'Enable or disable recalls','YesNo'),
Lines 876-879 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
876
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
877
('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'),
877
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
878
('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'),
878
('z3950Status','','','This syspref allows to define custom YAML based rules for marking items unavailable in z3950 results.','Textarea')
879
('z3950Status','','','This syspref allows to define custom YAML based rules for marking items unavailable in z3950 results.','Textarea')
879
;
880
;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +7 lines)
Lines 286-291 Circulation: Link Here
286
                  1: Use
286
                  1: Use
287
                  0: "Don't use"
287
                  0: "Don't use"
288
            - the transport cost matrix for calculating optimal holds filling between libraries.
288
            - the transport cost matrix for calculating optimal holds filling between libraries.
289
        -
290
            - pref: UseLibraryFloatLimits
291
              choices:
292
                  1: Use
293
                  0: "Don't use"
294
            - library float limits to determine if an item should be transferred to another library.
289
        -
295
        -
290
            - Use the calendar and circulation rules of
296
            - Use the calendar and circulation rules of
291
            - pref: CircControl
297
            - pref: CircControl
Lines 1523-1526 Circulation: Link Here
1523
              choices:
1529
              choices:
1524
                  1: Enable
1530
                  1: Enable
1525
                  0: Disable
1531
                  0: Disable
1526
            - "the curbside pickup module."
1532
            - "the curbside pickup module."
1527
- 

Return to bug 28530