|
Lines 90-96
if ($op eq 'add_form') {
Link Here
|
| 90 |
#---- if primkey exists, it's a modify action, so read values to modify... |
90 |
#---- if primkey exists, it's a modify action, so read values to modify... |
| 91 |
my $data; |
91 |
my $data; |
| 92 |
if ($searchfield) { |
92 |
if ($searchfield) { |
| 93 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from marc_tag_structure where tagfield=? and frameworkcode=?"); |
93 |
$sth=$dbh->prepare("select tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value, important from marc_tag_structure where tagfield=? and frameworkcode=?"); |
| 94 |
$sth->execute($searchfield,$frameworkcode); |
94 |
$sth->execute($searchfield,$frameworkcode); |
| 95 |
$data=$sth->fetchrow_hashref; |
95 |
$data=$sth->fetchrow_hashref; |
| 96 |
} |
96 |
} |
|
Lines 109-114
if ($op eq 'add_form') {
Link Here
|
| 109 |
repeatable => $data->{'repeatable'}, |
109 |
repeatable => $data->{'repeatable'}, |
| 110 |
mandatory => $data->{'mandatory'}, |
110 |
mandatory => $data->{'mandatory'}, |
| 111 |
authorised_value => $data->{authorised_value}, |
111 |
authorised_value => $data->{authorised_value}, |
|
|
112 |
important => $data->{'important'}, |
| 112 |
frameworkcode => $frameworkcode, |
113 |
frameworkcode => $frameworkcode, |
| 113 |
); # FIXME: move checkboxes to presentation layer |
114 |
); # FIXME: move checkboxes to presentation layer |
| 114 |
# END $OP eq ADD_FORM |
115 |
# END $OP eq ADD_FORM |
|
Lines 120-142
if ($op eq 'add_form') {
Link Here
|
| 120 |
my $libopac = $input->param('libopac'); |
121 |
my $libopac = $input->param('libopac'); |
| 121 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
122 |
my $repeatable = $input->param('repeatable') ? 1 : 0; |
| 122 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
123 |
my $mandatory = $input->param('mandatory') ? 1 : 0; |
|
|
124 |
my $important = $input->param('important') ? 1 : 0; |
| 123 |
my $authorised_value = $input->param('authorised_value'); |
125 |
my $authorised_value = $input->param('authorised_value'); |
| 124 |
unless (C4::Context->config('demo')) { |
126 |
unless (C4::Context->config('demo')) { |
| 125 |
if ($input->param('modif')) { |
127 |
if ($input->param('modif')) { |
| 126 |
$sth = $dbh->prepare( |
128 |
$sth = $dbh->prepare( |
| 127 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
129 |
"UPDATE marc_tag_structure SET liblibrarian=? ,libopac=? ,repeatable=? ,mandatory=? ,important=?, authorised_value=? WHERE frameworkcode=? AND tagfield=?" |
| 128 |
); |
130 |
); |
| 129 |
$sth->execute( $liblibrarian, |
131 |
$sth->execute( $liblibrarian, |
| 130 |
$libopac, |
132 |
$libopac, |
| 131 |
$repeatable, |
133 |
$repeatable, |
| 132 |
$mandatory, |
134 |
$mandatory, |
|
|
135 |
$important, |
| 133 |
$authorised_value, |
136 |
$authorised_value, |
| 134 |
$frameworkcode, |
137 |
$frameworkcode, |
| 135 |
$tagfield |
138 |
$tagfield |
| 136 |
); |
139 |
); |
| 137 |
} else { |
140 |
} else { |
| 138 |
$sth = $dbh->prepare( |
141 |
$sth = $dbh->prepare( |
| 139 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode) values (?,?,?,?,?,?,?)" |
142 |
"INSERT INTO marc_tag_structure (tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,frameworkcode,important) values (?,?,?,?,?,?,?,?)" |
| 140 |
); |
143 |
); |
| 141 |
$sth->execute($tagfield, |
144 |
$sth->execute($tagfield, |
| 142 |
$liblibrarian, |
145 |
$liblibrarian, |
|
Lines 144-150
if ($op eq 'add_form') {
Link Here
|
| 144 |
$repeatable, |
147 |
$repeatable, |
| 145 |
$mandatory, |
148 |
$mandatory, |
| 146 |
$authorised_value, |
149 |
$authorised_value, |
| 147 |
$frameworkcode |
150 |
$frameworkcode, |
|
|
151 |
$important |
| 148 |
); |
152 |
); |
| 149 |
} |
153 |
} |
| 150 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
154 |
$cache->clear_from_cache("MarcStructure-0-$frameworkcode"); |
|
Lines 219-224
if ($op eq 'add_form') {
Link Here
|
| 219 |
marc_tag_structure.libopac as mts_libopac, |
223 |
marc_tag_structure.libopac as mts_libopac, |
| 220 |
marc_tag_structure.repeatable as mts_repeatable, |
224 |
marc_tag_structure.repeatable as mts_repeatable, |
| 221 |
marc_tag_structure.mandatory as mts_mandatory, |
225 |
marc_tag_structure.mandatory as mts_mandatory, |
|
|
226 |
marc_tag_structure.important as mts_important, |
| 222 |
marc_tag_structure.authorised_value as mts_authorized_value, |
227 |
marc_tag_structure.authorised_value as mts_authorized_value, |
| 223 |
marc_subfield_structure.* |
228 |
marc_subfield_structure.* |
| 224 |
FROM marc_tag_structure |
229 |
FROM marc_tag_structure |
|
Lines 240-245
if ($op eq 'add_form') {
Link Here
|
| 240 |
$row_data{liblibrarian} = $results[$i]->{'mts_liblibrarian'}; |
245 |
$row_data{liblibrarian} = $results[$i]->{'mts_liblibrarian'}; |
| 241 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
246 |
$row_data{repeatable} = $results[$i]->{'mts_repeatable'}; |
| 242 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
247 |
$row_data{mandatory} = $results[$i]->{'mts_mandatory'}; |
|
|
248 |
$row_data{important} = $results[$i]->{'mts_important'}; |
| 243 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
249 |
$row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; |
| 244 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
250 |
$row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
| 245 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
251 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; |
|
Lines 253-258
if ($op eq 'add_form') {
Link Here
|
| 253 |
$subfield_data{kohafield} = $results[$j]->{'kohafield'}; |
259 |
$subfield_data{kohafield} = $results[$j]->{'kohafield'}; |
| 254 |
$subfield_data{repeatable} = $results[$j]->{'repeatable'}; |
260 |
$subfield_data{repeatable} = $results[$j]->{'repeatable'}; |
| 255 |
$subfield_data{mandatory} = $results[$j]->{'mandatory'}; |
261 |
$subfield_data{mandatory} = $results[$j]->{'mandatory'}; |
|
|
262 |
$subfield_data{important} = $results[$j]->{'important'}; |
| 256 |
$subfield_data{tab} = $results[$j]->{'tab'}; |
263 |
$subfield_data{tab} = $results[$j]->{'tab'}; |
| 257 |
$subfield_data{seealso} = $results[$j]->{'seealso'}; |
264 |
$subfield_data{seealso} = $results[$j]->{'seealso'}; |
| 258 |
$subfield_data{authorised_value} = $results[$j]->{'authorised_value'}; |
265 |
$subfield_data{authorised_value} = $results[$j]->{'authorised_value'}; |
|
Lines 285-290
if ($op eq 'add_form') {
Link Here
|
| 285 |
$row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; |
292 |
$row_data{liblibrarian} = $results->[$i]{'liblibrarian'}; |
| 286 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
293 |
$row_data{repeatable} = $results->[$i]{'repeatable'}; |
| 287 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
294 |
$row_data{mandatory} = $results->[$i]{'mandatory'}; |
|
|
295 |
$row_data{important} = $results->[$i]{'important'}; |
| 288 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
296 |
$row_data{authorised_value} = $results->[$i]{'authorised_value'}; |
| 289 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
297 |
$row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
| 290 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
298 |
$row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; |
|
Lines 318-324
output_html_with_http_headers $input, $cookie, $template->output;
Link Here
|
| 318 |
sub StringSearch { |
326 |
sub StringSearch { |
| 319 |
my ($searchstring,$frameworkcode)=@_; |
327 |
my ($searchstring,$frameworkcode)=@_; |
| 320 |
my $sth = C4::Context->dbh->prepare(" |
328 |
my $sth = C4::Context->dbh->prepare(" |
| 321 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value |
329 |
SELECT tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,important |
| 322 |
FROM marc_tag_structure |
330 |
FROM marc_tag_structure |
| 323 |
WHERE (tagfield >= ? and frameworkcode=?) |
331 |
WHERE (tagfield >= ? and frameworkcode=?) |
| 324 |
ORDER BY tagfield |
332 |
ORDER BY tagfield |