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