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

(-)a/Koha/Schema/Result/OpacNews.pm (-22 / +70 lines)
Lines 1-12 Link Here
1
use utf8;
1
use utf8;
2
package Koha::Schema::Result::OpacNews;
2
package Koha::Schema::Result::AdditionalContent;
3
3
4
# Created by DBIx::Class::Schema::Loader
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
6
7
=head1 NAME
7
=head1 NAME
8
8
9
Koha::Schema::Result::OpacNews
9
Koha::Schema::Result::AdditionalContent
10
10
11
=cut
11
=cut
12
12
Lines 15-25 use warnings; Link Here
15
15
16
use base 'DBIx::Class::Core';
16
use base 'DBIx::Class::Core';
17
17
18
=head1 TABLE: C<opac_news>
18
=head1 TABLE: C<additional_contents>
19
19
20
=cut
20
=cut
21
21
22
__PACKAGE__->table("opac_news");
22
__PACKAGE__->table("additional_contents");
23
23
24
=head1 ACCESSORS
24
=head1 ACCESSORS
25
25
Lines 30-36 __PACKAGE__->table("opac_news"); Link Here
30
  is_auto_increment: 1
30
  is_auto_increment: 1
31
  is_nullable: 0
31
  is_nullable: 0
32
32
33
unique identifier for the news article
33
unique identifier for the additional content
34
35
=head2 category
36
37
  data_type: 'varchar'
38
  is_nullable: 0
39
  size: 20
40
41
category for the additional content
42
43
=head2 code
44
45
  data_type: 'varchar'
46
  is_nullable: 0
47
  size: 20
48
49
code to group content per lang
50
51
=head2 location
52
53
  data_type: 'varchar'
54
  is_nullable: 0
55
  size: 255
56
57
location of the additional content
34
58
35
=head2 branchcode
59
=head2 branchcode
36
60
Lines 39-45 unique identifier for the news article Link Here
39
  is_nullable: 1
63
  is_nullable: 1
40
  size: 10
64
  size: 10
41
65
42
branch code users to create branch specific news, NULL is every branch.
66
branch code users to create branch specific additional content, NULL is every branch.
43
67
44
=head2 title
68
=head2 title
45
69
Lines 48-70 branch code users to create branch specific news, NULL is every branch. Link Here
48
  is_nullable: 0
72
  is_nullable: 0
49
  size: 250
73
  size: 250
50
74
51
title of the news article
75
title of the additional content
52
76
53
=head2 content
77
=head2 content
54
78
55
  data_type: 'mediumtext'
79
  data_type: 'mediumtext'
56
  is_nullable: 0
80
  is_nullable: 0
57
81
58
the body of your news article
82
the body of your additional content
59
83
60
=head2 lang
84
=head2 lang
61
85
62
  data_type: 'varchar'
86
  data_type: 'varchar'
63
  default_value: (empty string)
87
  default_value: (empty string)
64
  is_nullable: 0
88
  is_nullable: 0
65
  size: 50
89
  size: 25
66
90
67
location for the article (koha is the staff interface, slip is the circulation receipt and language codes are for the opac)
91
location for the additional content(koha is the staff interface, slip is the circulation receipt and language codes are for the opac)
68
92
69
=head2 published_on
93
=head2 published_on
70
94
Lines 89-102 last modification Link Here
89
  datetime_undef_if_invalid: 1
113
  datetime_undef_if_invalid: 1
90
  is_nullable: 1
114
  is_nullable: 1
91
115
92
date the article is set to expire or no longer be visible
116
date the additional content is set to expire or no longer be visible
93
117
94
=head2 number
118
=head2 number
95
119
96
  data_type: 'integer'
120
  data_type: 'integer'
97
  is_nullable: 1
121
  is_nullable: 1
98
122
99
the order in which this article appears in that specific location
123
the order in which this additional content appears in that specific location
100
124
101
=head2 borrowernumber
125
=head2 borrowernumber
102
126
Lines 104-110 the order in which this article appears in that specific location Link Here
104
  is_foreign_key: 1
128
  is_foreign_key: 1
105
  is_nullable: 1
129
  is_nullable: 1
106
130
107
The user who created the news article
131
The user who created the additional content
108
132
109
=cut
133
=cut
110
134
Lines 116-121 __PACKAGE__->add_columns( Link Here
116
    is_auto_increment => 1,
140
    is_auto_increment => 1,
117
    is_nullable => 0,
141
    is_nullable => 0,
118
  },
142
  },
143
  "category",
144
  { data_type => "varchar", is_nullable => 0, size => 20 },
145
  "code",
146
  { data_type => "varchar", is_nullable => 0, size => 20 },
147
  "location",
148
  { data_type => "varchar", is_nullable => 0, size => 255 },
119
  "branchcode",
149
  "branchcode",
120
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
150
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
121
  "title",
151
  "title",
Lines 123-129 __PACKAGE__->add_columns( Link Here
123
  "content",
153
  "content",
124
  { data_type => "mediumtext", is_nullable => 0 },
154
  { data_type => "mediumtext", is_nullable => 0 },
125
  "lang",
155
  "lang",
126
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 50 },
156
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 25 },
127
  "published_on",
157
  "published_on",
128
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
158
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
129
  "updated_on",
159
  "updated_on",
Lines 153-158 __PACKAGE__->add_columns( Link Here
153
183
154
__PACKAGE__->set_primary_key("idnew");
184
__PACKAGE__->set_primary_key("idnew");
155
185
186
=head1 UNIQUE CONSTRAINTS
187
188
=head2 C<additional_contents_uniq>
189
190
=over 4
191
192
=item * L</category>
193
194
=item * L</code>
195
196
=item * L</branchcode>
197
198
=item * L</lang>
199
200
=back
201
202
=cut
203
204
__PACKAGE__->add_unique_constraint(
205
  "additional_contents_uniq",
206
  ["category", "code", "branchcode", "lang"],
207
);
208
156
=head1 RELATIONS
209
=head1 RELATIONS
157
210
158
=head2 borrowernumber
211
=head2 borrowernumber
Lines 196-209 __PACKAGE__->belongs_to( Link Here
196
);
249
);
197
250
198
251
199
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
252
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-07 13:15:32
200
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Edd8K7ANL49fG7FKjwyRVQ
253
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rq0r36nBQ3k0EfbpjzpVUw
201
254
202
sub koha_object_class {
203
    'Koha::NewsItem';
204
}
205
sub koha_objects_class {
206
    'Koha::News';
207
}
208
255
256
# You can replace this text with custom code or comments, and it will be preserved on regeneration
209
1;
257
1;
(-)a/Koha/Schema/Result/Borrower.pm (-17 / +17 lines)
Lines 859-864 __PACKAGE__->has_many( Link Here
859
  { cascade_copy => 0, cascade_delete => 0 },
859
  { cascade_copy => 0, cascade_delete => 0 },
860
);
860
);
861
861
862
=head2 additional_contents
863
864
Type: has_many
865
866
Related object: L<Koha::Schema::Result::AdditionalContent>
867
868
=cut
869
870
__PACKAGE__->has_many(
871
  "additional_contents",
872
  "Koha::Schema::Result::AdditionalContent",
873
  { "foreign.borrowernumber" => "self.borrowernumber" },
874
  { cascade_copy => 0, cascade_delete => 0 },
875
);
876
862
=head2 advanced_editor_macros
877
=head2 advanced_editor_macros
863
878
864
Type: has_many
879
Type: has_many
Lines 1429-1449 __PACKAGE__->has_many( Link Here
1429
  { cascade_copy => 0, cascade_delete => 0 },
1444
  { cascade_copy => 0, cascade_delete => 0 },
1430
);
1445
);
1431
1446
1432
=head2 opac_news
1433
1434
Type: has_many
1435
1436
Related object: L<Koha::Schema::Result::OpacNews>
1437
1438
=cut
1439
1440
__PACKAGE__->has_many(
1441
  "opac_news",
1442
  "Koha::Schema::Result::OpacNews",
1443
  { "foreign.borrowernumber" => "self.borrowernumber" },
1444
  { cascade_copy => 0, cascade_delete => 0 },
1445
);
1446
1447
=head2 patron_consents
1447
=head2 patron_consents
1448
1448
1449
Type: has_many
1449
Type: has_many
Lines 1865-1872 Composing rels: L</aqorder_users> -> ordernumber Link Here
1865
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1865
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1866
1866
1867
1867
1868
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-06-07 05:28:03
1868
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-06 14:16:12
1869
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CgLzd4URQdNSXTgd7QnFFg
1869
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aw/BqmMVAZcjclAdp625Uw
1870
1870
1871
__PACKAGE__->add_columns(
1871
__PACKAGE__->add_columns(
1872
    '+anonymized'    => { is_boolean => 1 },
1872
    '+anonymized'    => { is_boolean => 1 },
(-)a/Koha/Schema/Result/Branch.pm (-18 / +17 lines)
Lines 301-306 __PACKAGE__->has_many( Link Here
301
  { cascade_copy => 0, cascade_delete => 0 },
301
  { cascade_copy => 0, cascade_delete => 0 },
302
);
302
);
303
303
304
=head2 additional_contents
305
306
Type: has_many
307
308
Related object: L<Koha::Schema::Result::AdditionalContent>
309
310
=cut
311
312
__PACKAGE__->has_many(
313
  "additional_contents",
314
  "Koha::Schema::Result::AdditionalContent",
315
  { "foreign.branchcode" => "self.branchcode" },
316
  { cascade_copy => 0, cascade_delete => 0 },
317
);
318
304
=head2 aqbaskets
319
=head2 aqbaskets
305
320
306
Type: has_many
321
Type: has_many
Lines 721-741 __PACKAGE__->might_have( Link Here
721
  { cascade_copy => 0, cascade_delete => 0 },
736
  { cascade_copy => 0, cascade_delete => 0 },
722
);
737
);
723
738
724
=head2 opac_news
725
726
Type: has_many
727
728
Related object: L<Koha::Schema::Result::OpacNews>
729
730
=cut
731
732
__PACKAGE__->has_many(
733
  "opac_news",
734
  "Koha::Schema::Result::OpacNews",
735
  { "foreign.branchcode" => "self.branchcode" },
736
  { cascade_copy => 0, cascade_delete => 0 },
737
);
738
739
=head2 problem_reports
739
=head2 problem_reports
740
740
741
Type: has_many
741
Type: has_many
Lines 887-894 __PACKAGE__->has_many( Link Here
887
);
887
);
888
888
889
889
890
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
890
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-06 14:16:12
891
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uu8m3hyDhM50oTSeNTJbdg
891
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mbEasDISDPIbNM1EXWq/Xg
892
892
893
__PACKAGE__->add_columns(
893
__PACKAGE__->add_columns(
894
    '+pickup_location' => { is_boolean => 1 }
894
    '+pickup_location' => { is_boolean => 1 }
895
- 

Return to bug 24387