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

(-)a/admin/oai_servers.pl (-4 / +5 lines)
Lines 90-101 if ( $op eq 'cud-delete_confirmed' && $id ) { Link Here
90
# Now list multiple records, or edit one record
90
# Now list multiple records, or edit one record
91
91
92
my $data = [];
92
my $data = [];
93
if ( $op eq 'add' || $op eq 'edit' ) {
93
if ( $op eq 'add_form' || $op eq 'edit_form' ) {
94
    $data = server_search( $schema, $id, $searchfield ) if $searchfield || $id;
94
    $data = server_search( $schema, $id, $searchfield ) if $searchfield || $id;
95
    delete $data->[0]->{id}                             if @$data && $op eq 'add';    #cloning record
95
    delete $data->[0]->{id}                             if @$data && $op eq 'add_form';    #cloning record
96
    $template->param(
96
    $template->param(
97
        add_form => 1, server => @$data ? $data->[0] : undef,
97
        server => @$data ? $data->[0] : undef,
98
        op => $op, type => $op eq 'add' ? lc $type : ''
98
        op     => $op,
99
        type   => ( $op eq 'add_form' ) ? lc $type : ''
99
    );
100
    );
100
} else {
101
} else {
101
    $data = server_search( $schema, $id, $searchfield );
102
    $data = server_search( $schema, $id, $searchfield );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_servers.tt (-13 / +12 lines)
Lines 7-17 Link Here
7
[% PROCESS 'i18n.inc' %]
7
[% PROCESS 'i18n.inc' %]
8
8
9
<title>
9
<title>
10
    [% IF op == 'edit' %]
10
    [% IF op == 'edit_form' %]
11
        Modify OAI repository [% server.servername | html %] &rsaquo;
11
        Modify OAI repository [% server.servername | html %] &rsaquo;
12
    [% END %]
12
    [% END %]
13
13
14
    [% IF op ==  'add' %]
14
    [% IF op ==  'add_form' %]
15
        New OAI repository &rsaquo;
15
        New OAI repository &rsaquo;
16
    [% END %]
16
    [% END %]
17
    OAI repositories &rsaquo; Administration &rsaquo; Koha
17
    OAI repositories &rsaquo; Administration &rsaquo; Koha
Lines 30-46 Link Here
30
            <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
30
            <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
31
        [% END %]
31
        [% END %]
32
32
33
        [% IF op == 'edit' || op == 'add' %]
33
        [% IF op == 'edit_form' || op == 'add_form' %]
34
            [% WRAPPER breadcrumb_item %]
34
            [% WRAPPER breadcrumb_item %]
35
                <a href="/cgi-bin/koha/admin/oai_servers.pl">OAI repositories</a>
35
                <a href="/cgi-bin/koha/admin/oai_servers.pl">OAI repositories</a>
36
            [% END %]
36
            [% END %]
37
        [% END %]
37
        [% END %]
38
38
39
        [% IF op == 'edit' %]
39
        [% IF op == 'edit_form' %]
40
            [% WRAPPER breadcrumb_item bc_active= 1 %]
40
            [% WRAPPER breadcrumb_item bc_active= 1 %]
41
                <span>Modify OAI repository [% server.servername | html %]</span>
41
                <span>Modify OAI repository [% server.servername | html %]</span>
42
            [% END %]
42
            [% END %]
43
        [% ELSIF op == 'add' %]
43
        [% ELSIF op == 'add_form' %]
44
            [% WRAPPER breadcrumb_item bc_active= 1 %]
44
            [% WRAPPER breadcrumb_item bc_active= 1 %]
45
                <span>New OAI repository</span>
45
                <span>New OAI repository</span>
46
            [% END %]
46
            [% END %]
Lines 64-73 Link Here
64
        <div class="alert alert-warning">Error: Server with ID [% msg_add | html %] not found</div>
64
        <div class="alert alert-warning">Error: Server with ID [% msg_add | html %] not found</div>
65
    [% END %]
65
    [% END %]
66
66
67
    [% IF ( add_form ) %]
67
    [% IF op == 'edit_form' || op == 'add_form' %]
68
        <form action="/cgi-bin/koha/admin/oai_servers.pl" name="Aform" method="post" id="serverentry">
68
        <form action="/cgi-bin/koha/admin/oai_servers.pl" name="Aform" method="post" id="serverentry">
69
            [% INCLUDE 'csrf-token.inc' %]
69
            [% INCLUDE 'csrf-token.inc' %]
70
            [% IF op == 'edit' %]
70
            [% IF op == 'edit_form' %]
71
                <h1>Modify OAI repository</h1>
71
                <h1>Modify OAI repository</h1>
72
                <input type="hidden" name="id" value="[% server.oai_server_id | html %]" />
72
                <input type="hidden" name="id" value="[% server.oai_server_id | html %]" />
73
            [% ELSE %]
73
            [% ELSE %]
Lines 121-127 Link Here
121
121
122
    [% IF op == 'list' %]
122
    [% IF op == 'list' %]
123
        <div id="toolbar" class="btn-toolbar">
123
        <div id="toolbar" class="btn-toolbar">
124
            <a id="newserver" class="btn btn-default" href="/cgi-bin/koha/admin/oai_servers.pl?op=add"><i class="fa fa-plus"></i> New OAI repository</a>
124
            <a id="newserver" class="btn btn-default" href="/cgi-bin/koha/admin/oai_servers.pl?op=add_form"><i class="fa fa-plus"></i> New OAI repository</a>
125
        </div>
125
        </div>
126
        <h1>OAI repositories</h1>
126
        <h1>OAI repositories</h1>
127
        [% IF id %]
127
        [% IF id %]
Lines 139-145 Link Here
139
                    [% FOREACH loo IN loop %]
139
                    [% FOREACH loo IN loop %]
140
                        <tr>
140
                        <tr>
141
                            <td>[% loo.oai_server_id | html %]</td>
141
                            <td>[% loo.oai_server_id | html %]</td>
142
                            <td><a href="/cgi-bin/koha/admin/oai_servers.pl?op=edit&amp;id=[% loo.oai_server_id | uri %]">[% loo.servername | html %]</a></td
142
                            <td><a href="/cgi-bin/koha/admin/oai_servers.pl?op=edit_form&amp;id=[% loo.oai_server_id | uri %]">[% loo.servername | html %]</a></td
143
                            ><td>[% loo.endpoint | html %]</td><td>[% loo.oai_set | html %]</td>
143
                            ><td>[% loo.endpoint | html %]</td><td>[% loo.oai_set | html %]</td>
144
                            <td>[% loo.dataformat | html %]</td>
144
                            <td>[% loo.dataformat | html %]</td>
145
                            <td
145
                            <td
Lines 154-163 Link Here
154
                                    <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions </a>
154
                                    <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions </a>
155
                                    <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id | html %]">
155
                                    <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id | html %]">
156
                                        <li
156
                                        <li
157
                                            ><a class="dropdown-item" href="/cgi-bin/koha/admin/oai_servers.pl?op=edit&amp;id=[% loo.oai_server_id | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a></li
157
                                            ><a class="dropdown-item" href="/cgi-bin/koha/admin/oai_servers.pl?op=edit_form&amp;id=[% loo.oai_server_id | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a></li
158
                                        >
158
                                        >
159
                                        <li
159
                                        <li
160
                                            ><a class="dropdown-item" href="/cgi-bin/koha/admin/oai_servers.pl?op=add&amp;id=[% loo.oai_server_id | uri %]"><i class="fa fa-copy"></i> Copy</a></li
160
                                            ><a class="dropdown-item" href="/cgi-bin/koha/admin/oai_servers.pl?op=add_form&amp;id=[% loo.oai_server_id | uri %]"><i class="fa fa-copy"></i> Copy</a></li
161
                                        >
161
                                        >
162
                                        <li>
162
                                        <li>
163
                                            <a href="#" class="dropdown-item delete" data-formid="server_row_[% loo.oai_server_id | uri %]" data-servername="[% loo.servername | html %]"><i class="fa fa-trash-can"></i> Delete</a>
163
                                            <a href="#" class="dropdown-item delete" data-formid="server_row_[% loo.oai_server_id | uri %]" data-servername="[% loo.servername | html %]"><i class="fa fa-trash-can"></i> Delete</a>
Lines 185-191 Link Here
185
        [% INCLUDE 'datatables.inc' %]
185
        [% INCLUDE 'datatables.inc' %]
186
    [% END %]
186
    [% END %]
187
    <script>
187
    <script>
188
        [% IF ( add_form ) %]
188
        [% IF op == 'edit_form' || op == 'add_form' %]
189
            $(document).ready(function(){
189
            $(document).ready(function(){
190
                // Update selects for dataformat and recordtype
190
                // Update selects for dataformat and recordtype
191
                [% IF server %]
191
                [% IF server %]
192
- 

Return to bug 41043