Lines 96-102
if ($op eq 'add_form') {
Link Here
|
96 |
#---- if primkey exists, it's a modify action, so read values to modify... |
96 |
#---- if primkey exists, it's a modify action, so read values to modify... |
97 |
my $data; |
97 |
my $data; |
98 |
if ($searchfield) { |
98 |
if ($searchfield) { |
99 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where tagfield=? and frameworkcode=?"); |
99 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value, important from marc_tag_structure where tagfield=? and frameworkcode=?"); |
100 |
$sth->execute($searchfield,$frameworkcode); |
100 |
$sth->execute($searchfield,$frameworkcode); |
101 |
$data=$sth->fetchrow_hashref; |
101 |
$data=$sth->fetchrow_hashref; |
102 |
} |
102 |
} |
Lines 128-133
if ($op eq 'add_form') {
Link Here
|
128 |
libopac => $data->{'libopac'}, |
128 |
libopac => $data->{'libopac'}, |
129 |
repeatable => $data->{'repeatable'}, |
129 |
repeatable => $data->{'repeatable'}, |
130 |
mandatory => $data->{'mandatory'}, |
130 |
mandatory => $data->{'mandatory'}, |
|
|
131 |
important => $data->{'important'}, |
131 |
authorised_value => $authorised_value, |
132 |
authorised_value => $authorised_value, |
132 |
frameworkcode => $frameworkcode, |
133 |
frameworkcode => $frameworkcode, |
133 |
); # FIXME: move checkboxes to presentation layer |
134 |
); # FIXME: move checkboxes to presentation layer |
Lines 140-162
if ($op eq 'add_form') {
Link Here
|
140 |
my $libopac = $input->param('libopac'); |
141 |
my $libopac = $input->param('libopac'); |
141 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
142 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
142 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
143 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
|
|
144 |
my $important = $input->param('important') ? 1 : 0; |
143 |
my $authorised_value = $input->param('authorised_value'); |
145 |
my $authorised_value = $input->param('authorised_value'); |
144 |
unless (C4::Context->config('demo')) { |
146 |
unless (C4::Context->config('demo')) { |
145 |
if ($input->param('modif')) { |
147 |
if ($input->param('modif')) { |
146 |
$sth = $dbh->prepare( |
148 |
$sth = $dbh->prepare( |
147 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
149 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,important=?, authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
148 |
); |
150 |
); |
149 |
$sth->execute( $liblibrarian, |
151 |
$sth->execute( $liblibrarian, |
150 |
$libopac, |
152 |
$libopac, |
151 |
$repeatable, |
153 |
$repeatable, |
152 |
$mandatory, |
154 |
$mandatory, |
|
|
155 |
$important, |
153 |
$authorised_value, |
156 |
$authorised_value, |
154 |
$frameworkcode, |
157 |
$frameworkcode, |
155 |
$tagfield |
158 |
$tagfield |
156 |
); |
159 |
); |
157 |
} else { |
160 |
} else { |
158 |
$sth = $dbh->prepare( |
161 |
$sth = $dbh->prepare( |
159 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) values (?,?,?,?,?,?,?)" |
162 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode,important) values (?,?,?,?,?,?,?,?)" |
160 |
); |
163 |
); |
161 |
$sth->execute($tagfield, |
164 |
$sth->execute($tagfield, |
162 |
$liblibrarian, |
165 |
$liblibrarian, |
Lines 164-170
if ($op eq 'add_form') {
Link Here
|
164 |
$repeatable, |
167 |
$repeatable, |
165 |
$mandatory, |
168 |
$mandatory, |
166 |
$authorised_value, |
169 |
$authorised_value, |
167 |
$frameworkcode |
170 |
$frameworkcode, |
|
|
171 |
$important |
168 |
); |
172 |
); |
169 |
} |
173 |
} |
170 |
} |
174 |
} |
Lines 232-237
if ($op eq 'add_form') {
Link Here
|
232 |
marc_tag_structure.libopac as mts_libopac, |
236 |
marc_tag_structure.libopac as mts_libopac, |
233 |
marc_tag_structure.repeatable as mts_repeatable, |
237 |
marc_tag_structure.repeatable as mts_repeatable, |
234 |
marc_tag_structure.mandatory as mts_mandatory, |
238 |
marc_tag_structure.mandatory as mts_mandatory, |
|
|
239 |
marc_tag_structure.important as mts_important, |
235 |
marc_tag_structure.authorised_value as mts_authorized_value, |
240 |
marc_tag_structure.authorised_value as mts_authorized_value, |
236 |
marc_subfield_structure.* |
241 |
marc_subfield_structure.* |
237 |
FROM marc_tag_structure |
242 |
FROM marc_tag_structure |
Lines 253-258
if ($op eq 'add_form') {
Link Here
|
253 |
$row_data{liblibrarian} = $results[$i]->{'mts_liblibrarian'}; |
258 |
$row_data{liblibrarian} = $results[$i]->{'mts_liblibrarian'}; |
254 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
259 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
255 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
260 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
|
|
261 |
$row_data{important} = $results[$i]->{'mts_important'}; |
256 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
262 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
257 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
263 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
258 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
264 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
Lines 266-271
if ($op eq 'add_form') {
Link Here
|
266 |
$subfield_data{kohafield} = $results[$j]->{'kohafield'}; |
272 |
$subfield_data{kohafield} = $results[$j]->{'kohafield'}; |
267 |
$subfield_data{repeatable} = $results[$j]->{'repeatable'}; |
273 |
$subfield_data{repeatable} = $results[$j]->{'repeatable'}; |
268 |
$subfield_data{mandatory} = $results[$j]->{'mandatory'}; |
274 |
$subfield_data{mandatory} = $results[$j]->{'mandatory'}; |
|
|
275 |
$subfield_data{important} = $results[$j]->{'important'}; |
269 |
$subfield_data{tab} = $results[$j]->{'tab'}; |
276 |
$subfield_data{tab} = $results[$j]->{'tab'}; |
270 |
$subfield_data{seealso} = $results[$j]->{'seealso'}; |
277 |
$subfield_data{seealso} = $results[$j]->{'seealso'}; |
271 |
$subfield_data{authorised_value} = $results[$j]->{'authorised_value'}; |
278 |
$subfield_data{authorised_value} = $results[$j]->{'authorised_value'}; |
Lines 292-297
if ($op eq 'add_form') {
Link Here
|
292 |
$row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; |
299 |
$row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; |
293 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
300 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
294 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
301 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
|
|
302 |
$row_data{important} = $results->[$i]{'important'}; |
295 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
303 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
296 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
304 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
297 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
305 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
Lines 325-331
output_html_with_http_headers $input, $cookie, $template->output;
Link Here
|
325 |
sub StringSearch { |
333 |
sub StringSearch { |
326 |
my ($searchstring,$frameworkcode)=@_; |
334 |
my ($searchstring,$frameworkcode)=@_; |
327 |
my $sth = C4::Context->dbh->prepare(" |
335 |
my $sth = C4::Context->dbh->prepare(" |
328 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value |
336 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,important |
329 |
FROM marc_tag_structure |
337 |
FROM marc_tag_structure |
330 |
WHERE (tagfield >= ? and frameworkcode=?) |
338 |
WHERE (tagfield >= ? and frameworkcode=?) |
331 |
ORDER BY tagfield |
339 |
ORDER BY tagfield |