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

(-)a/Koha/AuthSubfieldStructure.pm (-46 lines)
Lines 1-46 Link Here
1
package Koha::AuthSubfieldStructure;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use base qw(Koha::Object);
25
26
=head1 NAME
27
28
Koha::AuthSubfieldStructure - Koha AuthSubfieldStructure Object class
29
30
=head1 API
31
32
=head2 Class methods
33
34
=cut
35
36
=head2 Internal methods
37
38
=head3 _type
39
40
=cut
41
42
sub _type {
43
    return 'AuthSubfieldStructure';
44
}
45
46
1;
(-)a/Koha/AuthSubfieldStructures.pm (-58 lines)
Lines 1-58 Link Here
1
package Koha::AuthSubfieldStructures;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Carp;
21
22
use Koha::Database;
23
24
use Koha::AuthSubfieldStructure;
25
26
use base qw(Koha::Objects);
27
28
=head1 NAME
29
30
Koha::AuthSubfieldStructures - Koha AuthSubfieldStructure Object set class
31
32
=head1 API
33
34
=head2 Class methods
35
36
=cut
37
38
=head2 Internal methods
39
40
=cut
41
42
=head3 _type
43
44
=cut
45
46
sub _type {
47
    return 'AuthSubfieldStructure';
48
}
49
50
=head3 object_class
51
52
=cut
53
54
sub object_class {
55
    return 'Koha::AuthSubfieldStructure';
56
}
57
58
1;
(-)a/admin/auth_subfields_structure.pl (-8 / +7 lines)
Lines 26-32 use C4::Koha; Link Here
26
26
27
use Koha::Authority::Types;
27
use Koha::Authority::Types;
28
use Koha::AuthorisedValues;
28
use Koha::AuthorisedValues;
29
use Koha::AuthSubfieldStructures;
29
use Koha::Authority::Subfields;
30
30
31
use List::MoreUtils qw( uniq );
31
use List::MoreUtils qw( uniq );
32
32
Lines 104-110 if ($op eq 'add_form') { Link Here
104
	closedir DIR;
104
	closedir DIR;
105
105
106
    my @loop_data;
106
    my @loop_data;
107
    my $asses = Koha::AuthSubfieldStructures->search({ tagfield => $tagfield, authtypecode => $authtypecode}, {order_by => 'display_order'})->unblessed;
107
    my $asses = Koha::Authority::Subfields->search({ tagfield => $tagfield, authtypecode => $authtypecode}, {order_by => 'display_order'})->unblessed;
108
    my $i;
108
    my $i;
109
    for my $ass ( @$asses ) {
109
    for my $ass ( @$asses ) {
110
        my %row_data = %$ass;
110
        my %row_data = %$ass;
Lines 181-187 if ($op eq 'add_form') { Link Here
181
		my $hidden = $ohidden[$i]; #collate from 3 hiddens;
181
		my $hidden = $ohidden[$i]; #collate from 3 hiddens;
182
		my $isurl = $input->param("isurl$i")?1:0;
182
		my $isurl = $input->param("isurl$i")?1:0;
183
        if ($liblibrarian) {
183
        if ($liblibrarian) {
184
            my $ass = Koha::AuthSubfieldStructures->find(
184
            my $ass = Koha::Authority::Subfields->find(
185
                {
185
                {
186
                    authtypecode => $authtypecode,
186
                    authtypecode => $authtypecode,
187
                    tagfield     => $tagfield,
187
                    tagfield     => $tagfield,
Lines 209-215 if ($op eq 'add_form') { Link Here
209
                $ass->update($attributes);
209
                $ass->update($attributes);
210
            }
210
            }
211
            else {
211
            else {
212
                Koha::AuthSubfieldStructure->new(
212
                Koha::Authority::Subfield->new(
213
                    {
213
                    {
214
                        authtypecode => $authtypecode,
214
                        authtypecode => $authtypecode,
215
                        tagfield     => $tagfield,
215
                        tagfield     => $tagfield,
Lines 229-235 if ($op eq 'add_form') { Link Here
229
# called by default form, used to confirm deletion of data in DB
229
# called by default form, used to confirm deletion of data in DB
230
}
230
}
231
elsif ( $op eq 'delete_confirm' ) {
231
elsif ( $op eq 'delete_confirm' ) {
232
  my $ass = Koha::AuthSubfieldStructures->find(
232
  my $ass = Koha::Authority::Subfields->find(
233
      {
233
      {
234
          authtypecode => $authtypecode,
234
          authtypecode => $authtypecode,
235
          tagfield     => $tagfield,
235
          tagfield     => $tagfield,
Lines 242-248 elsif ( $op eq 'delete_confirm' ) { Link Here
242
  );
242
  );
243
}
243
}
244
elsif ( $op eq 'delete_confirmed' ) {
244
elsif ( $op eq 'delete_confirmed' ) {
245
    Koha::AuthSubfieldStructures->find(
245
    Koha::Authority::Subfields->find(
246
        {
246
        {
247
            authtypecode => $authtypecode,
247
            authtypecode => $authtypecode,
248
            tagfield     => $tagfield,
248
            tagfield     => $tagfield,
Lines 253-259 elsif ( $op eq 'delete_confirmed' ) { Link Here
253
    exit;
253
    exit;
254
}
254
}
255
else {    # DEFAULT
255
else {    # DEFAULT
256
    my $ass = Koha::AuthSubfieldStructures->search(
256
    my $ass = Koha::Authority::Subfields->search(
257
        {
257
        {
258
            tagfield      => { -like => "$tagfield%" },
258
            tagfield      => { -like => "$tagfield%" },
259
            authtypecode  => $authtypecode,
259
            authtypecode  => $authtypecode,
260
- 

Return to bug 8976