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

(-)a/C4/Biblio.pm (-2 / +2 lines)
Lines 1142-1149 sub GetMarcStructure { Link Here
1142
        $res->{$tag}->{tab}        = "";
1142
        $res->{$tag}->{tab}        = "";
1143
        $res->{$tag}->{mandatory}  = $mandatory;
1143
        $res->{$tag}->{mandatory}  = $mandatory;
1144
        $res->{$tag}->{repeatable} = $repeatable;
1144
        $res->{$tag}->{repeatable} = $repeatable;
1145
	$res->{$tag}->{ind1_defaultvalue} = $ind1_defaultvalue;
1145
        $res->{$tag}->{ind1_defaultvalue} = $ind1_defaultvalue;
1146
	$res->{$tag}->{ind2_defaultvalue} = $ind2_defaultvalue;
1146
        $res->{$tag}->{ind2_defaultvalue} = $ind2_defaultvalue;
1147
    }
1147
    }
1148
1148
1149
    $sth = $dbh->prepare(
1149
    $sth = $dbh->prepare(
(-)a/admin/marctagstructure.pl (-22 / +22 lines)
Lines 98-104 if ($op eq 'add_form') { Link Here
98
	#---- if primkey exists, it's a modify action, so read values to modify...
98
	#---- if primkey exists, it's a modify action, so read values to modify...
99
	my $data;
99
	my $data;
100
	if ($searchfield) {
100
	if ($searchfield) {
101
		$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue from marc_tag_structure where tagfield=? and frameworkcode=?");
101
        $sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue from marc_tag_structure where tagfield=? and frameworkcode=?");
102
		$sth->execute($searchfield,$frameworkcode);
102
		$sth->execute($searchfield,$frameworkcode);
103
		$data=$sth->fetchrow_hashref;
103
		$data=$sth->fetchrow_hashref;
104
	}
104
	}
Lines 121-131 if ($op eq 'add_form') { Link Here
121
	$template->param('use_heading_flags_p' => 1);
121
	$template->param('use_heading_flags_p' => 1);
122
	$template->param(liblibrarian => $data->{'liblibrarian'},
122
	$template->param(liblibrarian => $data->{'liblibrarian'},
123
			libopac => $data->{'libopac'},
123
			libopac => $data->{'libopac'},
124
			repeatable => $data->{'repeatable'},
124
            repeatable => $data->{'repeatable'},
125
			mandatory => $data->{'mandatory'},
125
            mandatory => $data->{'mandatory'},
126
			authorised_value => $authorised_value,
126
			authorised_value => $authorised_value,
127
			ind1_defaultvalue => $data->{'ind1_defaultvalue'},
127
            ind1_defaultvalue => $data->{'ind1_defaultvalue'},
128
			ind2_defaultvalue => $data->{'ind2_defaultvalue'},
128
            ind2_defaultvalue => $data->{'ind2_defaultvalue'},
129
			frameworkcode => $frameworkcode,
129
			frameworkcode => $frameworkcode,
130
    );  # FIXME: move checkboxes to presentation layer
130
    );  # FIXME: move checkboxes to presentation layer
131
													# END $OP eq ADD_FORM
131
													# END $OP eq ADD_FORM
Lines 138-145 if ($op eq 'add_form') { Link Here
138
	my $repeatable       = $input->param('repeatable') ? 1 : 0;
138
	my $repeatable       = $input->param('repeatable') ? 1 : 0;
139
	my $mandatory        = $input->param('mandatory')  ? 1 : 0;
139
	my $mandatory        = $input->param('mandatory')  ? 1 : 0;
140
	my $authorised_value = $input->param('authorised_value');
140
	my $authorised_value = $input->param('authorised_value');
141
	my $ind1_defaultvalue = $input->param('ind1_defaultvalue');
141
    my $ind1_defaultvalue = $input->param('ind1_defaultvalue');
142
	my $ind2_defaultvalue = $input->param('ind2_defaultvalue');
142
    my $ind2_defaultvalue = $input->param('ind2_defaultvalue');
143
    unless (C4::Context->config('demo')) {
143
    unless (C4::Context->config('demo')) {
144
        if ($input->param('modif')) {
144
        if ($input->param('modif')) {
145
            $sth = $dbh->prepare(
145
            $sth = $dbh->prepare(
Lines 150-157 if ($op eq 'add_form') { Link Here
150
                            $repeatable,
150
                            $repeatable,
151
                            $mandatory,
151
                            $mandatory,
152
                            $authorised_value,
152
                            $authorised_value,
153
			    $ind1_defaultvalue,
153
                            $ind1_defaultvalue,
154
			    $ind2_defaultvalue,
154
                            $ind2_defaultvalue,
155
                            $frameworkcode,
155
                            $frameworkcode,
156
                            $tagfield
156
                            $tagfield
157
            );
157
            );
Lines 165-172 if ($op eq 'add_form') { Link Here
165
                          $repeatable,
165
                          $repeatable,
166
                          $mandatory,
166
                          $mandatory,
167
                          $authorised_value,
167
                          $authorised_value,
168
			  $ind1_defaultvalue,
168
                          $ind1_defaultvalue,
169
			  $ind2_defaultvalue,
169
                          $ind2_defaultvalue,
170
                          $frameworkcode
170
                          $frameworkcode
171
            );
171
            );
172
        }
172
        }
Lines 181-187 if ($op eq 'add_form') { Link Here
181
################## DELETE_CONFIRM ##################################
181
################## DELETE_CONFIRM ##################################
182
# called by default form, used to confirm deletion of data in DB
182
# called by default form, used to confirm deletion of data in DB
183
} elsif ($op eq 'delete_confirm') {
183
} elsif ($op eq 'delete_confirm') {
184
	$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue from marc_tag_structure where tagfield=? and frameworkcode=?");
184
    $sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue from marc_tag_structure where tagfield=? and frameworkcode=?");
185
    $sth->execute($searchfield, $frameworkcode);
185
    $sth->execute($searchfield, $frameworkcode);
186
    my $data = $sth->fetchrow_hashref;
186
    my $data = $sth->fetchrow_hashref;
187
	$template->param(
187
	$template->param(
Lines 244-251 if ($op eq 'add_form') { Link Here
244
		              marc_tag_structure.repeatable as mts_repeatable,
244
		              marc_tag_structure.repeatable as mts_repeatable,
245
		              marc_tag_structure.mandatory as mts_mandatory,
245
		              marc_tag_structure.mandatory as mts_mandatory,
246
		              marc_tag_structure.authorised_value as mts_authorized_value,
246
		              marc_tag_structure.authorised_value as mts_authorized_value,
247
			      marc_tag_structure.ind1_defaultvalue as mts_ind1_defaultvalue,
247
                      marc_tag_structure.ind1_defaultvalue as mts_ind1_defaultvalue,
248
			      marc_tag_structure.ind1_defaultvalue as mts_ind2_defaultvalue,
248
                      marc_tag_structure.ind1_defaultvalue as mts_ind2_defaultvalue,
249
		              marc_subfield_structure.*
249
		              marc_subfield_structure.*
250
                FROM marc_tag_structure 
250
                FROM marc_tag_structure 
251
                LEFT JOIN marc_subfield_structure ON (marc_tag_structure.tagfield=marc_subfield_structure.tagfield AND marc_tag_structure.frameworkcode=marc_subfield_structure.frameworkcode) WHERE (marc_tag_structure.tagfield >= ? and marc_tag_structure.frameworkcode=?) AND marc_subfield_structure.tab>=0 ORDER BY marc_tag_structure.tagfield,marc_subfield_structure.tagsubfield");
251
                LEFT JOIN marc_subfield_structure ON (marc_tag_structure.tagfield=marc_subfield_structure.tagfield AND marc_tag_structure.frameworkcode=marc_subfield_structure.frameworkcode) WHERE (marc_tag_structure.tagfield >= ? and marc_tag_structure.frameworkcode=?) AND marc_subfield_structure.tab>=0 ORDER BY marc_tag_structure.tagfield,marc_subfield_structure.tagsubfield");
Lines 267-274 if ($op eq 'add_form') { Link Here
267
			$row_data{repeatable}       = $results[$i]->{'mts_repeatable'};
267
			$row_data{repeatable}       = $results[$i]->{'mts_repeatable'};
268
			$row_data{mandatory}        = $results[$i]->{'mts_mandatory'};
268
			$row_data{mandatory}        = $results[$i]->{'mts_mandatory'};
269
			$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'};
269
			$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'};
270
			$row_data{ind1_defaultvalue} = $results[$i]->{'mts_ind1_defaultvalue'};
270
            $row_data{ind1_defaultvalue} = $results[$i]->{'mts_ind1_defaultvalue'};
271
			$row_data{ind2_defaultvalue} = $results[$i]->{'mts_ind2_defaultvalue'};
271
            $row_data{ind2_defaultvalue} = $results[$i]->{'mts_ind2_defaultvalue'};
272
			$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode;
272
			$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode;
273
			$row_data{edit}          = "$script_name?op=add_form&searchfield="            .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode;
273
			$row_data{edit}          = "$script_name?op=add_form&searchfield="            .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode;
274
			$row_data{delete}        = "$script_name?op=delete_confirm&searchfield="      .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode;
274
			$row_data{delete}        = "$script_name?op=delete_confirm&searchfield="      .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode;
Lines 308-315 if ($op eq 'add_form') { Link Here
308
			$row_data{repeatable}       = $results->[$i]{'repeatable'};
308
			$row_data{repeatable}       = $results->[$i]{'repeatable'};
309
			$row_data{mandatory}        = $results->[$i]{'mandatory'};
309
			$row_data{mandatory}        = $results->[$i]{'mandatory'};
310
			$row_data{authorised_value} = $results->[$i]{'authorised_value'};
310
			$row_data{authorised_value} = $results->[$i]{'authorised_value'};
311
			$row_data{ind1_defaultvalue} = $results->[$i]{'ind1_defaultvalue'};
311
            $row_data{ind1_defaultvalue} = $results->[$i]{'ind1_defaultvalue'};
312
			$row_data{ind2_defaultvalue} = $results->[$i]{'ind2_defaultvalue'};
312
            $row_data{ind2_defaultvalue} = $results->[$i]{'ind2_defaultvalue'};
313
			$row_data{subfield_link}    = "marc_subfields_structure.pl?tagfield="          .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
313
			$row_data{subfield_link}    = "marc_subfields_structure.pl?tagfield="          .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
314
			$row_data{edit}             = "$script_name?op=add_form&searchfield="      .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
314
			$row_data{edit}             = "$script_name?op=add_form&searchfield="      .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
315
			$row_data{delete}           = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
315
			$row_data{delete}           = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode;
Lines 358-368 sub StringSearch { Link Here
358
sub duplicate_framework {
358
sub duplicate_framework {
359
	my ($newframeworkcode,$oldframeworkcode) = @_;
359
	my ($newframeworkcode,$oldframeworkcode) = @_;
360
	my $dbh = C4::Context->dbh;
360
	my $dbh = C4::Context->dbh;
361
	my $sth = $dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaulvalue from marc_tag_structure where frameworkcode=?");
361
    my $sth = $dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaulvalue from marc_tag_structure where frameworkcode=?");
362
	$sth->execute($oldframeworkcode);
362
	$sth->execute($oldframeworkcode);
363
	my $sth_insert = $dbh->prepare("insert into marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, ind1_defaultvalue, ind2_defaultvalue, frameworkcode) values (?,?,?,?,?,?,?,?,?)");
363
    my $sth_insert = $dbh->prepare("insert into marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, ind1_defaultvalue, ind2_defaultvalue, frameworkcode) values (?,?,?,?,?,?,?,?,?)");
364
	while ( my ($tagfield,$liblibrarian,$libopac,$repeatable,$mandatory,$authorised_value,$ind1_defaultvalue,$ind2_defaultvalue) = $sth->fetchrow) {
364
    while ( my ($tagfield,$liblibrarian,$libopac,$repeatable,$mandatory,$authorised_value,$ind1_defaultvalue,$ind2_defaultvalue) = $sth->fetchrow) {
365
		$sth_insert->execute($tagfield,$liblibrarian,$libopac,$repeatable,$mandatory,$authorised_value,$ind1_defaultvalue,$ind2_defaultvalue,$newframeworkcode);
365
        $sth_insert->execute($tagfield,$liblibrarian,$libopac,$repeatable,$mandatory,$authorised_value,$ind1_defaultvalue,$ind2_defaultvalue,$newframeworkcode);
366
	}
366
	}
367
367
368
	$sth = $dbh->prepare("select frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso,hidden from marc_subfield_structure where frameworkcode=?");
368
	$sth = $dbh->prepare("select frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso,hidden from marc_subfield_structure where frameworkcode=?");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt (-9 / +8 lines)
Lines 94-103 $(document).ready(function() { Link Here
94
        [% END %]
94
        [% END %]
95
    </li>
95
    </li>
96
    <li><label for="ind1_defaultvalue">First indicator default value: </label>
96
    <li><label for="ind1_defaultvalue">First indicator default value: </label>
97
	    <input id="ind1_defaultvalue" type="text" name="ind1_defaultvalue" value="[% ind1_defaultvalue |html %]" maxlength="1" size="1" />
97
        <input id="ind1_defaultvalue" type="text" name="ind1_defaultvalue" value="[% ind1_defaultvalue |html %]" maxlength="1" size="1" />
98
    </li>
98
    </li>
99
    <li><label for="ind2_defaultvalue">Second indicator default value: </label>
99
    <li><label for="ind2_defaultvalue">Second indicator default value: </label>
100
	    <input id="ind2_defaultvalue" type="text" name="ind2_defaultvalue" value="[% ind2_defaultvalue |html %]" maxlength="1" size="1" />
100
        <input id="ind2_defaultvalue" type="text" name="ind2_defaultvalue" value="[% ind2_defaultvalue |html %]" maxlength="1" size="1" />
101
    </li>
101
    </li>
102
    <li><label for="authorised_value">Authorized value: </label>
102
    <li><label for="authorised_value">Authorized value: </label>
103
        <select name="authorised_value" id="authorised_value" size="1">
103
        <select name="authorised_value" id="authorised_value" size="1">
Lines 195-202 $(document).ready(function() { Link Here
195
        <th>Repeatable</th>
195
        <th>Repeatable</th>
196
        <th>Mandatory</th>
196
        <th>Mandatory</th>
197
        <th>Auth value</th>
197
        <th>Auth value</th>
198
	<th>Indic1</th>
198
        <th>Ind. 1</th>
199
	<th>Indic2</th>
199
        <th>Ind. 2</th>
200
        <th>Subfields</th>
200
        <th>Subfields</th>
201
        <th>Edit</th>
201
        <th>Edit</th>
202
        <th>Delete</th>
202
        <th>Delete</th>
Lines 219-226 $(document).ready(function() { Link Here
219
            <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
219
            <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
220
            <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
220
            <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
221
            <td>[% loo.authorised_value %]</td>
221
            <td>[% loo.authorised_value %]</td>
222
	    <td>[% loo.ind1_defaultvalue %]</td>
222
            <td>[% loo.ind1_defaultvalue %]</td>
223
	    <td>[% loo.ind2_defaultvalue %]</td>
223
            <td>[% loo.ind2_defaultvalue %]</td>
224
            <td><a href="[% loo.subfield_link %]">subfields</a></td>
224
            <td><a href="[% loo.subfield_link %]">subfields</a></td>
225
            <td><a href="[% loo.edit %]">Edit</a></td>
225
            <td><a href="[% loo.edit %]">Edit</a></td>
226
            <td><a href="[% loo.delete %]">Delete</a></td>
226
            <td><a href="[% loo.delete %]">Delete</a></td>
Lines 234-241 $(document).ready(function() { Link Here
234
        <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
234
        <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
235
        <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
235
        <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
236
        <td>[% loo.authorised_value %]</td>
236
        <td>[% loo.authorised_value %]</td>
237
	<td>[% loo.ind1_defaultvalue %]</td>
237
        <td>[% loo.ind1_defaultvalue %]</td>
238
	<td>[% loo.ind2_defaultvalue %]</td>
238
        <td>[% loo.ind2_defaultvalue %]</td>
239
        <td><a href="[% loo.subfield_link %]">Subfields</a></td>
239
        <td><a href="[% loo.subfield_link %]">Subfields</a></td>
240
        <td><a href="[% loo.edit %]">Edit</a></td>
240
        <td><a href="[% loo.edit %]">Edit</a></td>
241
        <td><a href="[% loo.delete %]">Delete</a></td>
241
        <td><a href="[% loo.delete %]">Delete</a></td>
242
- 

Return to bug 9701