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-16 07:12:03
200
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Edd8K7ANL49fG7FKjwyRVQ
253
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0HtqQpArwFtGrsivukyG1Q
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 869-874 __PACKAGE__->has_many( Link Here
869
  { cascade_copy => 0, cascade_delete => 0 },
869
  { cascade_copy => 0, cascade_delete => 0 },
870
);
870
);
871
871
872
=head2 additional_contents
873
874
Type: has_many
875
876
Related object: L<Koha::Schema::Result::AdditionalContent>
877
878
=cut
879
880
__PACKAGE__->has_many(
881
  "additional_contents",
882
  "Koha::Schema::Result::AdditionalContent",
883
  { "foreign.borrowernumber" => "self.borrowernumber" },
884
  { cascade_copy => 0, cascade_delete => 0 },
885
);
886
872
=head2 advanced_editor_macros
887
=head2 advanced_editor_macros
873
888
874
Type: has_many
889
Type: has_many
Lines 1439-1459 __PACKAGE__->has_many( Link Here
1439
  { cascade_copy => 0, cascade_delete => 0 },
1454
  { cascade_copy => 0, cascade_delete => 0 },
1440
);
1455
);
1441
1456
1442
=head2 opac_news
1443
1444
Type: has_many
1445
1446
Related object: L<Koha::Schema::Result::OpacNews>
1447
1448
=cut
1449
1450
__PACKAGE__->has_many(
1451
  "opac_news",
1452
  "Koha::Schema::Result::OpacNews",
1453
  { "foreign.borrowernumber" => "self.borrowernumber" },
1454
  { cascade_copy => 0, cascade_delete => 0 },
1455
);
1456
1457
=head2 patron_consents
1457
=head2 patron_consents
1458
1458
1459
Type: has_many
1459
Type: has_many
Lines 1875-1882 Composing rels: L</aqorder_users> -> ordernumber Link Here
1875
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1875
__PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber");
1876
1876
1877
1877
1878
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-12 13:40:00
1878
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-07-16 07:12:03
1879
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IKPb4912o8oCHtmFAi6FPQ
1879
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SWOGE6/WDsjzXcgfxmVQ4A
1880
1880
1881
__PACKAGE__->add_columns(
1881
__PACKAGE__->add_columns(
1882
    '+anonymized'    => { is_boolean => 1 },
1882
    '+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-16 07:12:03
891
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Uu8m3hyDhM50oTSeNTJbdg
891
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EZYvCbpv41QSEhHRPVFImA
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