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

(-)a/Koha/ImportBatchProfile.pm (-1 / +1 lines)
Lines 48-54 sub to_api_mapping { Link Here
48
=cut
48
=cut
49
49
50
sub _type {
50
sub _type {
51
    return 'ImportBatchesProfile';
51
    return 'ImportBatchProfile';
52
}
52
}
53
53
54
1;
54
1;
(-)a/Koha/ImportBatchProfiles.pm (-1 / +1 lines)
Lines 37-43 Koha::ImportBatchProfiles - Koha ImportBatchProfiles Object class Link Here
37
=cut
37
=cut
38
38
39
sub _type {
39
sub _type {
40
    return 'ImportBatchesProfile';
40
    return 'ImportBatchProfile';
41
}
41
}
42
42
43
=head3 object_class
43
=head3 object_class
(-)a/Koha/REST/V1/ImportBatchProfiles.pm (-2 / +2 lines)
Lines 91-97 sub edit { Link Here
91
    my $c = shift->openapi->valid_input or return;
91
    my $c = shift->openapi->valid_input or return;
92
92
93
    return try {
93
    return try {
94
        my $profile_id = $c->validation->param('profile_id');
94
        my $profile_id = $c->validation->param('import_batch_profile_id');
95
        my $profile = Koha::ImportBatchProfiles->find( $profile_id );
95
        my $profile = Koha::ImportBatchProfiles->find( $profile_id );
96
        unless ($profile) {
96
        unless ($profile) {
97
            return $c->render( status  => 404,
97
            return $c->render( status  => 404,
Lines 121-127 Method that handles deleting a Koha::ImportBatchProfile object Link Here
121
sub delete {
121
sub delete {
122
    my $c = shift->openapi->valid_input or return;
122
    my $c = shift->openapi->valid_input or return;
123
123
124
    my $profile_id = $c->validation->param('profile_id');
124
    my $profile_id = $c->validation->param('import_batch_profile_id');
125
    my $profile = Koha::ImportBatchProfiles->find( $profile_id );
125
    my $profile = Koha::ImportBatchProfiles->find( $profile_id );
126
126
127
    unless ($profile) {
127
    unless ($profile) {
(-)a/Koha/Schema/Result/ImportBatch.pm (-4 / +4 lines)
Lines 246-258 __PACKAGE__->has_many( Link Here
246
246
247
Type: belongs_to
247
Type: belongs_to
248
248
249
Related object: L<Koha::Schema::Result::ImportBatchesProfile>
249
Related object: L<Koha::Schema::Result::ImportBatchProfile>
250
250
251
=cut
251
=cut
252
252
253
__PACKAGE__->belongs_to(
253
__PACKAGE__->belongs_to(
254
  "profile",
254
  "profile",
255
  "Koha::Schema::Result::ImportBatchesProfile",
255
  "Koha::Schema::Result::ImportBatchProfile",
256
  { id => "profile_id" },
256
  { id => "profile_id" },
257
  {
257
  {
258
    is_deferrable => 1,
258
    is_deferrable => 1,
Lines 263-270 __PACKAGE__->belongs_to( Link Here
263
);
263
);
264
264
265
265
266
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-06-03 15:47:08
266
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-11-06 13:52:29
267
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jGfBdM8ht823HaxSr2c9Wg
267
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nnGJ0Nvgiz123+ic7v0GqQ
268
268
269
=head2 koha_object_class
269
=head2 koha_object_class
270
270
(-)a/Koha/Schema/Result/ImportBatchesProfile.pm (-6 / +23 lines)
Lines 1-12 Link Here
1
use utf8;
1
use utf8;
2
package Koha::Schema::Result::ImportBatchesProfile;
2
package Koha::Schema::Result::ImportBatchProfile;
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::ImportBatchesProfile
9
Koha::Schema::Result::ImportBatchProfile
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<import_batches_profile>
18
=head1 TABLE: C<import_batch_profiles>
19
19
20
=cut
20
=cut
21
21
22
__PACKAGE__->table("import_batches_profile");
22
__PACKAGE__->table("import_batch_profiles");
23
23
24
=head1 ACCESSORS
24
=head1 ACCESSORS
25
25
Lines 132-137 __PACKAGE__->add_columns( Link Here
132
132
133
__PACKAGE__->set_primary_key("id");
133
__PACKAGE__->set_primary_key("id");
134
134
135
=head1 UNIQUE CONSTRAINTS
136
137
=head2 C<u_import_batch_profiles__name>
138
139
=over 4
140
141
=item * L</name>
142
143
=back
144
145
=cut
146
147
__PACKAGE__->add_unique_constraint("u_import_batch_profiles__name", ["name"]);
148
135
=head1 RELATIONS
149
=head1 RELATIONS
136
150
137
=head2 import_batches
151
=head2 import_batches
Lines 150-157 __PACKAGE__->has_many( Link Here
150
);
164
);
151
165
152
166
153
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-06-03 15:47:08
167
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-11-06 13:52:29
154
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BWFz5yLEEP6ANuAWKAMCeg
168
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kThbQZTT2c0fuWAGgvoDLQ
169
170
171
# You can replace this text with custom code or comments, and it will be preserved on regeneration
155
172
156
__PACKAGE__->add_columns(
173
__PACKAGE__->add_columns(
157
  '+parse_items' => { is_boolean => 1 },
174
  '+parse_items' => { is_boolean => 1 },
(-)a/api/v1/swagger/parameters.json (-2 / +2 lines)
Lines 11-18 Link Here
11
  "patron_id_qp": {
11
  "patron_id_qp": {
12
    "$ref": "parameters/patron.json#/patron_id_qp"
12
    "$ref": "parameters/patron.json#/patron_id_qp"
13
  },
13
  },
14
  "profile_id_pp": {
14
  "import_batch_profile_id_pp": {
15
    "$ref": "parameters/import_batch_profile.json#/profile_id_pp"
15
    "$ref": "parameters/import_batch_profile.json#/import_batch_profile_id_pp"
16
  },
16
  },
17
  "city_id_pp": {
17
  "city_id_pp": {
18
    "$ref": "parameters/city.json#/city_id_pp"
18
    "$ref": "parameters/city.json#/city_id_pp"
(-)a/api/v1/swagger/parameters/import_batch_profile.json (-2 / +2 lines)
Lines 1-6 Link Here
1
{
1
{
2
  "profile_id_pp": {
2
  "import_batch_profile_id_pp": {
3
    "name": "profile_id",
3
    "name": "import_batch_profile_id",
4
    "in": "path",
4
    "in": "path",
5
    "description": "Internal profile identifier",
5
    "description": "Internal profile identifier",
6
    "required": true,
6
    "required": true,
(-)a/api/v1/swagger/paths/import_batch_profiles.json (-1 / +1 lines)
Lines 352-358 Link Here
352
      },
352
      },
353
      "x-koha-authorization": {
353
      "x-koha-authorization": {
354
        "permissions": {
354
        "permissions": {
355
          "catalogue": "1"
355
          "tools": "stage_marc_import"
356
        }
356
        }
357
      }
357
      }
358
    }
358
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt (-4 / +3 lines)
Lines 362-368 Link Here
362
                    return getProfiles(profile.profile_id);
362
                    return getProfiles(profile.profile_id);
363
                })
363
                })
364
                .catch(function(error) {
364
                .catch(function(error) {
365
                    alert(_("An error occurred")+"\n\n"+error);
365
                    alert(_("An error occurred")+"\n\n"+((error.responseJSON && error.responseJSON.error) || error.responseText || error.statusText));
366
                })
366
                })
367
            });
367
            });
368
368
Lines 386-392 Link Here
386
                    return getProfiles();
386
                    return getProfiles();
387
                })
387
                })
388
                .catch(function(error) {
388
                .catch(function(error) {
389
                    alert(_("An error occurred")+"\n\n"+error);
389
                    alert(_("An error occurred")+"\n\n"+((error.responseJSON && error.responseJSON.error) || error.responseText || error.statusText));
390
                })
390
                })
391
            });
391
            });
392
        });
392
        });
Lines 460-466 Link Here
460
                        opt.prop('selected', true);
460
                        opt.prop('selected', true);
461
                    }
461
                    }
462
                    opt.attr("value", profile.profile_id);
462
                    opt.attr("value", profile.profile_id);
463
                    opt.html(profile.name);
463
                    opt.text(profile.name);
464
                    opt.data("profile", profile);
464
                    opt.data("profile", profile);
465
                });
465
                });
466
            })
466
            })
467
- 

Return to bug 23019