|
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 136-141
if ($op eq 'add_form') {
Link Here
|
| 136 |
-value => 1, |
136 |
-value => 1, |
| 137 |
-label => '', |
137 |
-label => '', |
| 138 |
-id => 'mandatory'), |
138 |
-id => 'mandatory'), |
|
|
139 |
important => CGI::checkbox(-name => 'important', |
| 140 |
-checked => $data->{'important'}?'checked':'', |
| 141 |
-value => 1, |
| 142 |
-label => '', |
| 143 |
-id => 'important'), |
| 139 |
authorised_value => $authorised_value, |
144 |
authorised_value => $authorised_value, |
| 140 |
frameworkcode => $frameworkcode, |
145 |
frameworkcode => $frameworkcode, |
| 141 |
); # FIXME: move checkboxes to presentation layer |
146 |
); # FIXME: move checkboxes to presentation layer |
|
Lines 148-170
if ($op eq 'add_form') {
Link Here
|
| 148 |
my $libopac = $input->param('libopac'); |
153 |
my $libopac = $input->param('libopac'); |
| 149 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
154 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
| 150 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
155 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
|
|
156 |
my $important = $input->param('important') ? 1 : 0; |
| 151 |
my $authorised_value = $input->param('authorised_value'); |
157 |
my $authorised_value = $input->param('authorised_value'); |
| 152 |
unless (C4::Context->config('demo') == 1) { |
158 |
unless (C4::Context->config('demo') == 1) { |
| 153 |
if ($input->param('modif')) { |
159 |
if ($input->param('modif')) { |
| 154 |
$sth = $dbh->prepare( |
160 |
$sth = $dbh->prepare( |
| 155 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
161 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,important=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
| 156 |
); |
162 |
); |
| 157 |
$sth->execute( $liblibrarian, |
163 |
$sth->execute( $liblibrarian, |
| 158 |
$libopac, |
164 |
$libopac, |
| 159 |
$repeatable, |
165 |
$repeatable, |
| 160 |
$mandatory, |
166 |
$mandatory, |
|
|
167 |
$important, |
| 161 |
$authorised_value, |
168 |
$authorised_value, |
| 162 |
$frameworkcode, |
169 |
$frameworkcode, |
| 163 |
$tagfield |
170 |
$tagfield |
| 164 |
); |
171 |
); |
| 165 |
} else { |
172 |
} else { |
| 166 |
$sth = $dbh->prepare( |
173 |
$sth = $dbh->prepare( |
| 167 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) values (?,?,?,?,?,?,?)" |
174 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode,important) values (?,?,?,?,?,?,?,?)" |
| 168 |
); |
175 |
); |
| 169 |
$sth->execute($tagfield, |
176 |
$sth->execute($tagfield, |
| 170 |
$liblibrarian, |
177 |
$liblibrarian, |
|
Lines 172-178
if ($op eq 'add_form') {
Link Here
|
| 172 |
$repeatable, |
179 |
$repeatable, |
| 173 |
$mandatory, |
180 |
$mandatory, |
| 174 |
$authorised_value, |
181 |
$authorised_value, |
| 175 |
$frameworkcode |
182 |
$frameworkcode, |
|
|
183 |
$important |
| 176 |
); |
184 |
); |
| 177 |
} |
185 |
} |
| 178 |
} |
186 |
} |
|
Lines 240-245
if ($op eq 'add_form') {
Link Here
|
| 240 |
marc_tag_structure.libopac as mts_libopac, |
248 |
marc_tag_structure.libopac as mts_libopac, |
| 241 |
marc_tag_structure.repeatable as mts_repeatable, |
249 |
marc_tag_structure.repeatable as mts_repeatable, |
| 242 |
marc_tag_structure.mandatory as mts_mandatory, |
250 |
marc_tag_structure.mandatory as mts_mandatory, |
|
|
251 |
marc_tag_structure.important as mts_important, |
| 243 |
marc_tag_structure.authorised_value as mts_authorized_value, |
252 |
marc_tag_structure.authorised_value as mts_authorized_value, |
| 244 |
marc_subfield_structure.* |
253 |
marc_subfield_structure.* |
| 245 |
FROM marc_tag_structure |
254 |
FROM marc_tag_structure |
|
Lines 261-266
if ($op eq 'add_form') {
Link Here
|
| 261 |
$row_data{liblibrarian} = $results[$i]->{'mts_liblibrarian'}; |
270 |
$row_data{liblibrarian} = $results[$i]->{'mts_liblibrarian'}; |
| 262 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
271 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
| 263 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
272 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
|
|
273 |
$row_data{important} = $results[$i]->{'mts_important'}; |
| 264 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
274 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
| 265 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
275 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
| 266 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
276 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
|
Lines 274-279
if ($op eq 'add_form') {
Link Here
|
| 274 |
$subfield_data{kohafield} = $results[$j]->{'kohafield'}; |
284 |
$subfield_data{kohafield} = $results[$j]->{'kohafield'}; |
| 275 |
$subfield_data{repeatable} = $results[$j]->{'repeatable'}; |
285 |
$subfield_data{repeatable} = $results[$j]->{'repeatable'}; |
| 276 |
$subfield_data{mandatory} = $results[$j]->{'mandatory'}; |
286 |
$subfield_data{mandatory} = $results[$j]->{'mandatory'}; |
|
|
287 |
$subfield_data{important} = $results[$j]->{'important'}; |
| 277 |
$subfield_data{tab} = $results[$j]->{'tab'}; |
288 |
$subfield_data{tab} = $results[$j]->{'tab'}; |
| 278 |
$subfield_data{seealso} = $results[$j]->{'seealso'}; |
289 |
$subfield_data{seealso} = $results[$j]->{'seealso'}; |
| 279 |
$subfield_data{authorised_value} = $results[$j]->{'authorised_value'}; |
290 |
$subfield_data{authorised_value} = $results[$j]->{'authorised_value'}; |
|
Lines 300-305
if ($op eq 'add_form') {
Link Here
|
| 300 |
$row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; |
311 |
$row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; |
| 301 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
312 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
| 302 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
313 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
|
|
314 |
$row_data{important} = $results->[$i]{'important'}; |
| 303 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
315 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
| 304 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
316 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
| 305 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
317 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
|
Lines 333-339
output_html_with_http_headers $input, $cookie, $template->output;
Link Here
|
| 333 |
sub StringSearch { |
345 |
sub StringSearch { |
| 334 |
my ($searchstring,$frameworkcode)=@_; |
346 |
my ($searchstring,$frameworkcode)=@_; |
| 335 |
my $sth = C4::Context->dbh->prepare(" |
347 |
my $sth = C4::Context->dbh->prepare(" |
| 336 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value |
348 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,important |
| 337 |
FROM marc_tag_structure |
349 |
FROM marc_tag_structure |
| 338 |
WHERE (tagfield >= ? and frameworkcode=?) |
350 |
WHERE (tagfield >= ? and frameworkcode=?) |
| 339 |
ORDER BY tagfield |
351 |
ORDER BY tagfield |