Lines 121-157
if ($op eq 'add_form') {
Link Here
|
121 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
121 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
122 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
122 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
123 |
my $authorised_value = $input->param('authorised_value'); |
123 |
my $authorised_value = $input->param('authorised_value'); |
124 |
unless (C4::Context->config('demo')) { |
124 |
if ($input->param('modif')) { |
125 |
if ($input->param('modif')) { |
125 |
$sth = $dbh->prepare( |
126 |
$sth = $dbh->prepare( |
126 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
127 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
127 |
); |
128 |
); |
128 |
$sth->execute( $liblibrarian, |
129 |
$sth->execute( $liblibrarian, |
129 |
$libopac, |
130 |
$libopac, |
130 |
$repeatable, |
131 |
$repeatable, |
131 |
$mandatory, |
132 |
$mandatory, |
132 |
$authorised_value, |
133 |
$authorised_value, |
133 |
$frameworkcode, |
134 |
$frameworkcode, |
134 |
$tagfield |
135 |
$tagfield |
135 |
); |
136 |
); |
136 |
} else { |
137 |
} else { |
137 |
$sth = $dbh->prepare( |
138 |
$sth = $dbh->prepare( |
138 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) values (?,?,?,?,?,?,?)" |
139 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) values (?,?,?,?,?,?,?)" |
139 |
); |
140 |
); |
140 |
$sth->execute($tagfield, |
141 |
$sth->execute($tagfield, |
141 |
$liblibrarian, |
142 |
$liblibrarian, |
142 |
$libopac, |
143 |
$libopac, |
143 |
$repeatable, |
144 |
$repeatable, |
144 |
$mandatory, |
145 |
$mandatory, |
145 |
$authorised_value, |
146 |
$authorised_value, |
146 |
$frameworkcode |
147 |
$frameworkcode |
147 |
); |
148 |
); |
|
|
149 |
} |
150 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
151 |
$cache->clear_from_cache("MarcStructure-1-$frameworkcode"); |
152 |
$cache->clear_from_cache("default_value_for_mod_marc-$frameworkcode"); |
153 |
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); |
154 |
} |
148 |
} |
|
|
149 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
150 |
$cache->clear_from_cache("MarcStructure-1-$frameworkcode"); |
151 |
$cache->clear_from_cache("default_value_for_mod_marc-$frameworkcode"); |
152 |
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); |
155 |
print $input->redirect("/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode"); |
153 |
print $input->redirect("/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode"); |
156 |
exit; |
154 |
exit; |
157 |
# END $OP eq ADD_VALIDATE |
155 |
# END $OP eq ADD_VALIDATE |
Lines 170-185
if ($op eq 'add_form') {
Link Here
|
170 |
################## DELETE_CONFIRMED ################################## |
168 |
################## DELETE_CONFIRMED ################################## |
171 |
# called by delete_confirm, used to effectively confirm deletion of data in DB |
169 |
# called by delete_confirm, used to effectively confirm deletion of data in DB |
172 |
} elsif ($op eq 'delete_confirmed') { |
170 |
} elsif ($op eq 'delete_confirmed') { |
173 |
unless (C4::Context->config('demo')) { |
171 |
my $sth1 = $dbh->prepare("DELETE FROM marc_tag_structure WHERE tagfield=? AND frameworkcode=?"); |
174 |
my $sth1 = $dbh->prepare("DELETE FROM marc_tag_structure WHERE tagfield=? AND frameworkcode=?"); |
172 |
my $sth2 = $dbh->prepare("DELETE FROM marc_subfield_structure WHERE tagfield=? AND frameworkcode=?"); |
175 |
my $sth2 = $dbh->prepare("DELETE FROM marc_subfield_structure WHERE tagfield=? AND frameworkcode=?"); |
173 |
$sth1->execute($searchfield, $frameworkcode); |
176 |
$sth1->execute($searchfield, $frameworkcode); |
174 |
$sth2->execute($searchfield, $frameworkcode); |
177 |
$sth2->execute($searchfield, $frameworkcode); |
175 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
178 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
176 |
$cache->clear_from_cache("MarcStructure-1-$frameworkcode"); |
179 |
$cache->clear_from_cache("MarcStructure-1-$frameworkcode"); |
177 |
$cache->clear_from_cache("default_value_for_mod_marc-$frameworkcode"); |
180 |
$cache->clear_from_cache("default_value_for_mod_marc-$frameworkcode"); |
178 |
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); |
181 |
$cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); |
|
|
182 |
} |
183 |
$template->param( |
179 |
$template->param( |
184 |
searchfield => $searchfield, |
180 |
searchfield => $searchfield, |
185 |
frameworkcode => $frameworkcode, |
181 |
frameworkcode => $frameworkcode, |