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,ind1_defaultvalue,ind2_defaultvalue 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 128-156
if ($op eq 'add_form') {
Link Here
|
128 |
$sth = $dbh->prepare( |
128 |
$sth = $dbh->prepare( |
129 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=?, ind1_defaultvalue=?, ind2_defaultvalue=? WHERE frameworkcode=? AND tagfield=?" |
129 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=?, ind1_defaultvalue=?, ind2_defaultvalue=? WHERE frameworkcode=? AND tagfield=?" |
130 |
); |
130 |
); |
131 |
$sth->execute( $liblibrarian, |
131 |
$sth->execute( $liblibrarian, |
132 |
$libopac, |
132 |
$libopac, |
133 |
$repeatable, |
133 |
$repeatable, |
134 |
$mandatory, |
134 |
$mandatory, |
135 |
$authorised_value, |
135 |
$authorised_value, |
136 |
$ind1_defaultvalue, |
136 |
$ind1_defaultvalue, |
137 |
$ind2_defaultvalue, |
137 |
$ind2_defaultvalue, |
138 |
$frameworkcode, |
138 |
$frameworkcode, |
139 |
$tagfield |
139 |
$tagfield |
140 |
); |
140 |
); |
141 |
} else { |
141 |
} else { |
142 |
$sth = $dbh->prepare( |
142 |
$sth = $dbh->prepare( |
143 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue,frameworkcode) values (?,?,?,?,?,?,?,?,?)" |
143 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue,frameworkcode) values (?,?,?,?,?,?,?,?,?)" |
144 |
); |
144 |
); |
145 |
$sth->execute($tagfield, |
145 |
$sth->execute( $tagfield, |
146 |
$liblibrarian, |
146 |
$liblibrarian, |
147 |
$libopac, |
147 |
$libopac, |
148 |
$repeatable, |
148 |
$repeatable, |
149 |
$mandatory, |
149 |
$mandatory, |
150 |
$authorised_value, |
150 |
$authorised_value, |
151 |
$ind1_defaultvalue, |
151 |
$ind1_defaultvalue, |
152 |
$ind2_defaultvalue, |
152 |
$ind2_defaultvalue, |
153 |
$frameworkcode |
153 |
$frameworkcode |
154 |
); |
154 |
); |
155 |
} |
155 |
} |
156 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
156 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
Lines 163-169
if ($op eq 'add_form') {
Link Here
|
163 |
################## DELETE_CONFIRM ################################## |
163 |
################## DELETE_CONFIRM ################################## |
164 |
# 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 |
165 |
} elsif ($op eq 'delete_confirm') { |
165 |
} elsif ($op eq 'delete_confirm') { |
166 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,ind1_defaultvalue,ind2_defaultvalue 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=?"); |
167 |
$sth->execute($searchfield, $frameworkcode); |
167 |
$sth->execute($searchfield, $frameworkcode); |
168 |
my $data = $sth->fetchrow_hashref; |
168 |
my $data = $sth->fetchrow_hashref; |
169 |
$template->param( |
169 |
$template->param( |
Lines 223-230
if ($op eq 'add_form') {
Link Here
|
223 |
marc_tag_structure.repeatable as mts_repeatable, |
223 |
marc_tag_structure.repeatable as mts_repeatable, |
224 |
marc_tag_structure.mandatory as mts_mandatory, |
224 |
marc_tag_structure.mandatory as mts_mandatory, |
225 |
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, |
226 |
marc_tag_structure.ind1_defaultvalue as mts_ind1_defaultvalue, |
227 |
marc_tag_structure.ind1_defaultvalue as mts_ind2_defaultvalue, |
227 |
marc_tag_structure.ind1_defaultvalue as mts_ind2_defaultvalue, |
228 |
marc_subfield_structure.* |
228 |
marc_subfield_structure.* |
229 |
FROM marc_tag_structure |
229 |
FROM marc_tag_structure |
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"); |
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 246-253
if ($op eq 'add_form') {
Link Here
|
246 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
246 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
247 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
247 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
248 |
$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'}; |
249 |
$row_data{ind1_defaultvalue} = $results[$i]->{'mts_ind1_defaultvalue'}; |
250 |
$row_data{ind2_defaultvalue} = $results[$i]->{'mts_ind2_defaultvalue'}; |
250 |
$row_data{ind2_defaultvalue} = $results[$i]->{'mts_ind2_defaultvalue'}; |
251 |
$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; |
252 |
$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; |
253 |
$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 293-300
if ($op eq 'add_form') {
Link Here
|
293 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
293 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
294 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
294 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
295 |
$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'}; |
296 |
$row_data{ind1_defaultvalue} = $results->[$i]{'ind1_defaultvalue'}; |
297 |
$row_data{ind2_defaultvalue} = $results->[$i]{'ind2_defaultvalue'}; |
297 |
$row_data{ind2_defaultvalue} = $results->[$i]{'ind2_defaultvalue'}; |
298 |
$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; |
299 |
$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; |
300 |
$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; |