Lines 89-95
if ($op eq 'add_form') {
Link Here
|
89 |
#---- if primkey exists, it's a modify action, so read values to modify... |
89 |
#---- if primkey exists, it's a modify action, so read values to modify... |
90 |
my $data; |
90 |
my $data; |
91 |
if ($searchfield) { |
91 |
if ($searchfield) { |
92 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where tagfield=? and frameworkcode=?"); |
92 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue from marc_tag_structure where tagfield=? and frameworkcode=?"); |
93 |
$sth->execute($searchfield,$frameworkcode); |
93 |
$sth->execute($searchfield,$frameworkcode); |
94 |
$data=$sth->fetchrow_hashref; |
94 |
$data=$sth->fetchrow_hashref; |
95 |
} |
95 |
} |
Lines 108-113
if ($op eq 'add_form') {
Link Here
|
108 |
repeatable => $data->{'repeatable'}, |
108 |
repeatable => $data->{'repeatable'}, |
109 |
mandatory => $data->{'mandatory'}, |
109 |
mandatory => $data->{'mandatory'}, |
110 |
authorised_value => $data->{authorised_value}, |
110 |
authorised_value => $data->{authorised_value}, |
|
|
111 |
ind1_defaultvalue => $data->{'ind1_defaultvalue'}, |
112 |
ind2_defaultvalue => $data->{'ind2_defaultvalue'}, |
111 |
frameworkcode => $frameworkcode, |
113 |
frameworkcode => $frameworkcode, |
112 |
); # FIXME: move checkboxes to presentation layer |
114 |
); # FIXME: move checkboxes to presentation layer |
113 |
# END $OP eq ADD_FORM |
115 |
# END $OP eq ADD_FORM |
Lines 120-140
if ($op eq 'add_form') {
Link Here
|
120 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
122 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
121 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
123 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
122 |
my $authorised_value = $input->param('authorised_value'); |
124 |
my $authorised_value = $input->param('authorised_value'); |
|
|
125 |
my $ind1_defaultvalue = $input->param('ind1_defaultvalue'); |
126 |
my $ind2_defaultvalue = $input->param('ind2_defaultvalue'); |
123 |
if ($input->param('modif')) { |
127 |
if ($input->param('modif')) { |
124 |
$sth = $dbh->prepare( |
128 |
$sth = $dbh->prepare( |
125 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
129 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=?, ind1_defaultvalue=?, ind2_defaultvalue=? WHERE frameworkcode=? AND tagfield=?" |
126 |
); |
130 |
); |
127 |
$sth->execute( $liblibrarian, |
131 |
$sth->execute( $liblibrarian, |
128 |
$libopac, |
132 |
$libopac, |
129 |
$repeatable, |
133 |
$repeatable, |
130 |
$mandatory, |
134 |
$mandatory, |
131 |
$authorised_value, |
135 |
$authorised_value, |
|
|
136 |
$ind1_defaultvalue, |
137 |
$ind2_defaultvalue, |
132 |
$frameworkcode, |
138 |
$frameworkcode, |
133 |
$tagfield |
139 |
$tagfield |
134 |
); |
140 |
); |
135 |
} else { |
141 |
} else { |
136 |
$sth = $dbh->prepare( |
142 |
$sth = $dbh->prepare( |
137 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) values (?,?,?,?,?,?,?)" |
143 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue,frameworkcode) values (?,?,?,?,?,?,?,?,?)" |
138 |
); |
144 |
); |
139 |
$sth->execute($tagfield, |
145 |
$sth->execute($tagfield, |
140 |
$liblibrarian, |
146 |
$liblibrarian, |
Lines 142-147
if ($op eq 'add_form') {
Link Here
|
142 |
$repeatable, |
148 |
$repeatable, |
143 |
$mandatory, |
149 |
$mandatory, |
144 |
$authorised_value, |
150 |
$authorised_value, |
|
|
151 |
$ind1_defaultvalue, |
152 |
$ind2_defaultvalue, |
145 |
$frameworkcode |
153 |
$frameworkcode |
146 |
); |
154 |
); |
147 |
} |
155 |
} |
Lines 155-161
if ($op eq 'add_form') {
Link Here
|
155 |
################## DELETE_CONFIRM ################################## |
163 |
################## DELETE_CONFIRM ################################## |
156 |
# called by default form, used to confirm deletion of data in DB |
164 |
# called by default form, used to confirm deletion of data in DB |
157 |
} elsif ($op eq 'delete_confirm') { |
165 |
} elsif ($op eq 'delete_confirm') { |
158 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where tagfield=? and frameworkcode=?"); |
166 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue from marc_tag_structure where tagfield=? and frameworkcode=?"); |
159 |
$sth->execute($searchfield, $frameworkcode); |
167 |
$sth->execute($searchfield, $frameworkcode); |
160 |
my $data = $sth->fetchrow_hashref; |
168 |
my $data = $sth->fetchrow_hashref; |
161 |
$template->param( |
169 |
$template->param( |
Lines 215-220
if ($op eq 'add_form') {
Link Here
|
215 |
marc_tag_structure.repeatable as mts_repeatable, |
223 |
marc_tag_structure.repeatable as mts_repeatable, |
216 |
marc_tag_structure.mandatory as mts_mandatory, |
224 |
marc_tag_structure.mandatory as mts_mandatory, |
217 |
marc_tag_structure.authorised_value as mts_authorized_value, |
225 |
marc_tag_structure.authorised_value as mts_authorized_value, |
|
|
226 |
marc_tag_structure.ind1_defaultvalue as mts_ind1_defaultvalue, |
227 |
marc_tag_structure.ind1_defaultvalue as mts_ind2_defaultvalue, |
218 |
marc_subfield_structure.* |
228 |
marc_subfield_structure.* |
219 |
FROM marc_tag_structure |
229 |
FROM marc_tag_structure |
220 |
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"); |
230 |
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 236-241
if ($op eq 'add_form') {
Link Here
|
236 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
246 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
237 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
247 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
238 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
248 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
|
|
249 |
$row_data{ind1_defaultvalue} = $results[$i]->{'mts_ind1_defaultvalue'}; |
250 |
$row_data{ind2_defaultvalue} = $results[$i]->{'mts_ind2_defaultvalue'}; |
239 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
251 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
240 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
252 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
241 |
$row_data{delete} = "$script_name?op=delete_confirm&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
253 |
$row_data{delete} = "$script_name?op=delete_confirm&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
Lines 281-286
if ($op eq 'add_form') {
Link Here
|
281 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
293 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
282 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
294 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
283 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
295 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
|
|
296 |
$row_data{ind1_defaultvalue} = $results->[$i]{'ind1_defaultvalue'}; |
297 |
$row_data{ind2_defaultvalue} = $results->[$i]{'ind2_defaultvalue'}; |
284 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
298 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
285 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
299 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
286 |
$row_data{delete} = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
300 |
$row_data{delete} = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
Lines 313-319
output_html_with_http_headers $input, $cookie, $template->output;
Link Here
|
313 |
sub StringSearch { |
327 |
sub StringSearch { |
314 |
my ($searchstring,$frameworkcode)=@_; |
328 |
my ($searchstring,$frameworkcode)=@_; |
315 |
my $sth = C4::Context->dbh->prepare(" |
329 |
my $sth = C4::Context->dbh->prepare(" |
316 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value |
330 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue |
317 |
FROM marc_tag_structure |
331 |
FROM marc_tag_structure |
318 |
WHERE (tagfield >= ? and frameworkcode=?) |
332 |
WHERE (tagfield >= ? and frameworkcode=?) |
319 |
ORDER BY tagfield |
333 |
ORDER BY tagfield |
Lines 329-336
sub StringSearch {
Link Here
|
329 |
sub duplicate_framework { |
343 |
sub duplicate_framework { |
330 |
my ($newframeworkcode,$oldframeworkcode) = @_; |
344 |
my ($newframeworkcode,$oldframeworkcode) = @_; |
331 |
my $dbh = C4::Context->dbh; |
345 |
my $dbh = C4::Context->dbh; |
332 |
$dbh->do(q|INSERT INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, frameworkcode) |
346 |
$dbh->do(q|INSERT INTO marc_tag_structure (tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, ind1_defaultvalue, ind2_defaultvalue, frameworkcode) |
333 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value, ? from marc_tag_structure where frameworkcode=?|, undef, $newframeworkcode, $oldframeworkcode ); |
347 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value, ind1_defaultvalue, ind2_defaultvalue, ? from marc_tag_structure where frameworkcode=?|, undef, $newframeworkcode, $oldframeworkcode ); |
334 |
|
348 |
|
335 |
$dbh->do(q|INSERT INTO marc_subfield_structure (frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso,hidden) |
349 |
$dbh->do(q|INSERT INTO marc_subfield_structure (frameworkcode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso,hidden) |
336 |
SELECT ?,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso,hidden from marc_subfield_structure where frameworkcode=? |
350 |
SELECT ?,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,authtypecode,value_builder,seealso,hidden from marc_subfield_structure where frameworkcode=? |