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, important 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 |
important => $data->{'important'}, |
111 |
frameworkcode => $frameworkcode, |
112 |
frameworkcode => $frameworkcode, |
112 |
); # FIXME: move checkboxes to presentation layer |
113 |
); # FIXME: move checkboxes to presentation layer |
113 |
# END $OP eq ADD_FORM |
114 |
# END $OP eq ADD_FORM |
Lines 119-146
if ($op eq 'add_form') {
Link Here
|
119 |
my $libopac = $input->param('libopac'); |
120 |
my $libopac = $input->param('libopac'); |
120 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
121 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
121 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
122 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
|
|
123 |
my $important = $input->param('important') ? 1 : 0; |
122 |
my $authorised_value = $input->param('authorised_value'); |
124 |
my $authorised_value = $input->param('authorised_value'); |
123 |
if ($input->param('modif')) { |
125 |
if ($input->param('modif')) { |
124 |
$sth = $dbh->prepare( |
126 |
$sth = $dbh->prepare( |
125 |
"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=? ,important=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
126 |
); |
128 |
); |
127 |
$sth->execute( $liblibrarian, |
129 |
$sth->execute( $liblibrarian, |
128 |
$libopac, |
130 |
$libopac, |
129 |
$repeatable, |
131 |
$repeatable, |
130 |
$mandatory, |
132 |
$mandatory, |
|
|
133 |
$important, |
131 |
$authorised_value, |
134 |
$authorised_value, |
132 |
$frameworkcode, |
135 |
$frameworkcode, |
133 |
$tagfield |
136 |
$tagfield |
134 |
); |
137 |
); |
135 |
} else { |
138 |
} else { |
136 |
$sth = $dbh->prepare( |
139 |
$sth = $dbh->prepare( |
137 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) values (?,?,?,?,?,?,?)" |
140 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,important,authorised_value,frameworkcode) values (?,?,?,?,?,?,?,?)" |
138 |
); |
141 |
); |
139 |
$sth->execute($tagfield, |
142 |
$sth->execute($tagfield, |
140 |
$liblibrarian, |
143 |
$liblibrarian, |
141 |
$libopac, |
144 |
$libopac, |
142 |
$repeatable, |
145 |
$repeatable, |
143 |
$mandatory, |
146 |
$mandatory, |
|
|
147 |
$important, |
144 |
$authorised_value, |
148 |
$authorised_value, |
145 |
$frameworkcode |
149 |
$frameworkcode |
146 |
); |
150 |
); |
Lines 214-219
if ($op eq 'add_form') {
Link Here
|
214 |
marc_tag_structure.libopac as mts_libopac, |
218 |
marc_tag_structure.libopac as mts_libopac, |
215 |
marc_tag_structure.repeatable as mts_repeatable, |
219 |
marc_tag_structure.repeatable as mts_repeatable, |
216 |
marc_tag_structure.mandatory as mts_mandatory, |
220 |
marc_tag_structure.mandatory as mts_mandatory, |
|
|
221 |
marc_tag_structure.important as mts_important, |
217 |
marc_tag_structure.authorised_value as mts_authorized_value, |
222 |
marc_tag_structure.authorised_value as mts_authorized_value, |
218 |
marc_subfield_structure.* |
223 |
marc_subfield_structure.* |
219 |
FROM marc_tag_structure |
224 |
FROM marc_tag_structure |
Lines 235-240
if ($op eq 'add_form') {
Link Here
|
235 |
$row_data{liblibrarian} = $results[$i]->{'mts_liblibrarian'}; |
240 |
$row_data{liblibrarian} = $results[$i]->{'mts_liblibrarian'}; |
236 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
241 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
237 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
242 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
|
|
243 |
$row_data{important} = $results[$i]->{'mts_important'}; |
238 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
244 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
239 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
245 |
$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; |
246 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
Lines 248-253
if ($op eq 'add_form') {
Link Here
|
248 |
$subfield_data{kohafield} = $results[$j]->{'kohafield'}; |
254 |
$subfield_data{kohafield} = $results[$j]->{'kohafield'}; |
249 |
$subfield_data{repeatable} = $results[$j]->{'repeatable'}; |
255 |
$subfield_data{repeatable} = $results[$j]->{'repeatable'}; |
250 |
$subfield_data{mandatory} = $results[$j]->{'mandatory'}; |
256 |
$subfield_data{mandatory} = $results[$j]->{'mandatory'}; |
|
|
257 |
$subfield_data{important} = $results[$j]->{'important'}; |
251 |
$subfield_data{tab} = $results[$j]->{'tab'}; |
258 |
$subfield_data{tab} = $results[$j]->{'tab'}; |
252 |
$subfield_data{seealso} = $results[$j]->{'seealso'}; |
259 |
$subfield_data{seealso} = $results[$j]->{'seealso'}; |
253 |
$subfield_data{authorised_value} = $results[$j]->{'authorised_value'}; |
260 |
$subfield_data{authorised_value} = $results[$j]->{'authorised_value'}; |
Lines 280-285
if ($op eq 'add_form') {
Link Here
|
280 |
$row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; |
287 |
$row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; |
281 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
288 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
282 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
289 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
|
|
290 |
$row_data{important} = $results->[$i]{'important'}; |
283 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
291 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
284 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
292 |
$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; |
293 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
Lines 313-319
output_html_with_http_headers $input, $cookie, $template->output;
Link Here
|
313 |
sub StringSearch { |
321 |
sub StringSearch { |
314 |
my ($searchstring,$frameworkcode)=@_; |
322 |
my ($searchstring,$frameworkcode)=@_; |
315 |
my $sth = C4::Context->dbh->prepare(" |
323 |
my $sth = C4::Context->dbh->prepare(" |
316 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value |
324 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,important |
317 |
FROM marc_tag_structure |
325 |
FROM marc_tag_structure |
318 |
WHERE (tagfield >= ? and frameworkcode=?) |
326 |
WHERE (tagfield >= ? and frameworkcode=?) |
319 |
ORDER BY tagfield |
327 |
ORDER BY tagfield |