3 # script to administer the systempref table
4 # written 20/02/2002 by paul.poulain@free.fr
5 # This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
7 # Copyright 2000-2002 Katipo Communications
9 # This file is part of Koha.
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA 02111-1307 USA
24 =head1 systempreferences.pl
27 this script use an $op to know what to do.
28 if $op is empty or none of the above values,
29 - the default screen is build (with all records, or filtered datas).
30 - the user can clic on add, modify or delete record.
32 - if primkey exists, this is a modification,so we read the $primkey record
33 - builds the add/modify form
35 - the user has just send datas, so we create/modify the record
37 - we show the record having primkey=$primkey and ask for deletion validation form
39 - we delete the record having primkey=$primkey
48 use C4::Languages qw(getTranslatedLanguages);
53 # use Smart::Comments;
56 # FIXME, shouldnt we store this stuff in the systempreferences table?
60 $tabsysprefs{acquisitions}="Acquisitions";
61 $tabsysprefs{gist}="Acquisitions";
62 $tabsysprefs{emailPurchaseSuggestions}="Acquisitions";
65 $tabsysprefs{singleBranchMode}="Admin";
66 $tabsysprefs{staffClientBaseURL}="Admin";
67 $tabsysprefs{Version}="Admin";
68 $tabsysprefs{OpacMaintenance}="Admin";
69 $tabsysprefs{FrameworksLoaded}="Admin";
70 $tabsysprefs{libraryAddress}="Admin";
71 $tabsysprefs{delimiter}="Admin";
72 $tabsysprefs{IndependantBranches}="Admin";
73 $tabsysprefs{insecure}="Admin";
74 $tabsysprefs{KohaAdmin}="Admin";
75 $tabsysprefs{KohaAdminEmailAddress}="Admin";
76 $tabsysprefs{MIME}="Admin";
77 $tabsysprefs{timeout}="Admin";
78 $tabsysprefs{Intranet_includes}="Admin";
79 $tabsysprefs{AutoLocation}="Admin";
80 $tabsysprefs{DebugLevel}="Admin";
81 $tabsysprefs{SessionStorage}="Admin";
82 $tabsysprefs{noItemTypeImages}="Admin";
83 $tabsysprefs{OPACBaseURL}="Admin";
86 $tabsysprefs{authoritysep}="Authorities";
87 $tabsysprefs{AuthDisplayHierarchy}="Authorities";
88 $tabsysprefs{dontmerge}="Authorities";
89 $tabsysprefs{BiblioAddsAuthorities}="Authorities";
91 $tabsysprefs{advancedMARCEditor}="Cataloguing";
92 $tabsysprefs{autoBarcode}="Cataloguing";
93 $tabsysprefs{hide_marc}="Cataloguing";
94 $tabsysprefs{IntranetBiblioDefaultView} = "Cataloguing";
95 $tabsysprefs{ISBD}="Cataloguing";
96 $tabsysprefs{itemcallnumber}="Cataloguing";
97 $tabsysprefs{LabelMARCView}="Cataloguing";
98 $tabsysprefs{marc}="Cataloguing";
99 $tabsysprefs{marcflavour}="Cataloguing";
100 $tabsysprefs{serialsadditems}="Cataloguing";
101 $tabsysprefs{MARCOrgCode}="Cataloguing";
102 $tabsysprefs{z3950AuthorAuthFields}="Cataloguing";
103 $tabsysprefs{z3950NormalizeAuthor}="Cataloguing";
104 $tabsysprefs{Stemming}="Cataloguing";
105 $tabsysprefs{WeightFields}="Cataloguing";
106 $tabsysprefs{NoZebra}="Cataloguing";
107 $tabsysprefs{NoZebraIndexes}="Cataloguing";
108 $tabsysprefs{ReceiveBackIssues}="Cataloguing";
109 $tabsysprefs{DefaultClassificationSource}="Cataloguing";
110 $tabsysprefs{RoutingSerials}="Cataloguing";
111 $tabsysprefs{'item-level_itypes'}="Cataloguing";
114 $tabsysprefs{maxoutstanding}="Circulation";
115 $tabsysprefs{maxreserves}="Circulation";
116 $tabsysprefs{noissuescharge}="Circulation";
117 $tabsysprefs{IssuingInProcess}="Circulation";
118 $tabsysprefs{patronimages}="Circulation";
119 $tabsysprefs{printcirculationslips}="Circulation";
120 $tabsysprefs{ReturnBeforeExpiry}="Circulation";
121 $tabsysprefs{SpecifyDueDate}="Circulation";
122 $tabsysprefs{AutomaticItemReturn}="Circulation";
123 $tabsysprefs{ReservesMaxPickUpDelay}="Circulation";
124 $tabsysprefs{TransfersMaxDaysWarning}="Circulation";
125 $tabsysprefs{useDaysMode}="Circulation";
126 $tabsysprefs{ReservesNeedReturns}="Circulation";
127 $tabsysprefs{CircAutocompl}="Circulation";
128 $tabsysprefs{canreservefromotherbranches}="Circulation";
129 $tabsysprefs{finesMode}="Circulation";
130 $tabsysprefs{emailLibrarianWhenHoldIsPlaced}="Circulation";
131 $tabsysprefs{globalDueDate}="Circulation";
132 $tabsysprefs{holdCancelLength}="Circulation";
133 $tabsysprefs{itemBarcodeInputFilter}="Circulation";
134 $tabsysprefs{noOPACHolds}="Circulation";
135 $tabsysprefs{WebBasedSelfCheck}="Circulation";
136 $tabsysprefs{CircControl}="Circulation";
137 $tabsysprefs{finesCalendar}="Circulation";
138 $tabsysprefs{previousIssuesDefaultSortOrder}="Circulation";
139 $tabsysprefs{todaysIssuesDefaultSortOrder}="Circulation";
140 $tabsysprefs{HomeOrHoldingBranch}="Circulation";
143 $tabsysprefs{TemplateEncoding}="StaffClient";
144 $tabsysprefs{template}="StaffClient";
145 $tabsysprefs{intranetstylesheet}="StaffClient";
146 $tabsysprefs{IntranetNav}="StaffClient";
147 $tabsysprefs{intranetcolorstylesheet}="StaffClient";
148 $tabsysprefs{intranetuserjs}="StaffClient";
149 $tabsysprefs{yuipath}="StaffClient";
150 $tabsysprefs{IntranetmainUserblock}="StaffClient";
153 $tabsysprefs{automembernum}="Patrons";
154 $tabsysprefs{checkdigit}="Patrons";
155 $tabsysprefs{intranetreadinghistory}="Patrons";
156 $tabsysprefs{NotifyBorrowerDeparture}="Patrons";
157 $tabsysprefs{memberofinstitution}="Patrons";
158 $tabsysprefs{ReadingHistory}="Patrons";
159 $tabsysprefs{BorrowerMandatoryField}="Patrons";
160 $tabsysprefs{borrowerRelationship}="Patrons";
161 $tabsysprefs{BorrowersTitles}="Patrons";
162 $tabsysprefs{patronimages}="Patrons";
163 $tabsysprefs{MinPasswordLength}="Patrons";
164 $tabsysprefs{uppercasesurnames}="Patrons";
165 $tabsysprefs{NoReturnSetLost}="Patrons";
166 $tabsysprefs{MaxFine}="Patrons";
167 $tabsysprefs{NotifyBorrowerDeparture}="Patrons";
170 $tabsysprefs{FRBRizeEditions}="FRBR";
171 $tabsysprefs{XISBN}="FRBR";
172 $tabsysprefs{OCLCAffiliateID}="FRBR";
173 $tabsysprefs{XISBNDailyLimit}="FRBR";
174 $tabsysprefs{PINESISBN}="FRBR";
175 $tabsysprefs{ThingISBN}="FRBR";
176 $tabsysprefs{OPACFRBRizeEditions}="FRBR";
177 $tabsysprefs{XISBNAmazonSimilarItems}="FRBR";
180 $tabsysprefs{dateformat}="I18N/L10N";
181 $tabsysprefs{opaclanguages}="I18N/L10N";
182 $tabsysprefs{opacthemes}="I18N/L10N";
183 $tabsysprefs{language}="I18N/L10N";
186 $tabsysprefs{defaultSortField}="Searching";
187 $tabsysprefs{defaultSortOrder}="Searching";
188 $tabsysprefs{maxItemsInSearchResults}="Searching";
189 $tabsysprefs{numSearchResults}="Searching";
190 $tabsysprefs{OPACdefaultSortField}="Searching";
191 $tabsysprefs{OPACdefaultSortOrder}="Searching";
192 $tabsysprefs{OPACItemsResultsDisplay}="Searching";
193 $tabsysprefs{OPACnumSearchResults}="Searching";
194 $tabsysprefs{QueryFuzzy}="Searching";
195 $tabsysprefs{QueryStemming}="Searching";
196 $tabsysprefs{QueryWeightFields}="Searching";
197 $tabsysprefs{expandedSearchOption}="Searching";
198 $tabsysprefs{sortbynonfiling}="Searching";
199 $tabsysprefs{QueryAutoTruncate}="Searching";
200 $tabsysprefs{QueryRemoveStopwords}="Searching";
203 $tabsysprefs{AmazonAssocTag}="OPAC";
204 $tabsysprefs{AmazonSimilarItems}="OPAC";
205 $tabsysprefs{AmazonContent}="OPAC";
206 $tabsysprefs{OPACAmazonContent}="OPAC";
207 $tabsysprefs{AmazonDevKey}="OPAC";
208 $tabsysprefs{BiblioDefaultView}="OPAC";
209 $tabsysprefs{LibraryName}="OPAC";
210 $tabsysprefs{opaccolorstylesheet}="OPAC";
211 $tabsysprefs{opaccredits}="OPAC";
212 $tabsysprefs{opaclargeimage}="OPAC";
213 $tabsysprefs{opaclayoutstylesheet}="OPAC";
214 $tabsysprefs{OpacNav}="OPAC";
215 $tabsysprefs{opacsmallimage}="OPAC";
216 $tabsysprefs{opacstylesheet}="OPAC";
217 $tabsysprefs{opacthemes}="OPAC";
218 $tabsysprefs{opacuserjs}="OPAC";
219 $tabsysprefs{SubscriptionHistory}="OPAC";
220 $tabsysprefs{opacheader}="OPAC";
221 $tabsysprefs{OPACAmazonSimilarItems}="OPAC";
222 $tabsysprefs{OPACXISBNAmazonSimilarItems}="OPAC";
224 $tabsysprefs{hideBiblioNumber}="OPAC";
225 $tabsysprefs{noOPACUserLogin}="OPAC";
226 $tabsysprefs{OPACDisplayExtendedSubInfo}="OPAC";
227 $tabsysprefs{OpacMainUserBlock}="OPAC";
228 $tabsysprefs{OPACSubscriptionDisplay}="OPAC";
229 $tabsysprefs{OPACURLOpenInNewWindow}="OPAC";
230 $tabsysprefs{OPACUserCSS}="OPAC";
231 $tabsysprefs{OPACViewOthersSuggestions}="OPAC";
232 $tabsysprefs{URLLinkText}="OPAC";
235 $tabsysprefs{SearchMyLibraryFirst}="OPACFeatures";
236 $tabsysprefs{Disable_Dictionary}="OPACFeatures";
237 $tabsysprefs{hidelostitems}="OPACFeatures";
238 $tabsysprefs{opacbookbag}="OPACFeatures";
239 $tabsysprefs{opaclanguagesdisplay}="OPACFeatures";
240 $tabsysprefs{OpacPasswordChange}="OPACFeatures";
241 $tabsysprefs{opacreadinghistory}="OPACFeatures";
242 $tabsysprefs{virtualshelves}="OPACFeatures";
243 $tabsysprefs{RequestOnOpac}="OPACFeatures";
244 $tabsysprefs{reviewson}="OPACFeatures";
245 $tabsysprefs{OpacTopissues}="OPACFeatures";
246 $tabsysprefs{OpacAuthorities}="OPACFeatures";
247 $tabsysprefs{OpacCloud}="OPACFeatures";
248 $tabsysprefs{opacuserlogin}="OPACFeatures";
249 $tabsysprefs{AnonSuggestions}="OPACFeatures";
250 $tabsysprefs{suggestion}="OPACFeatures";
251 $tabsysprefs{OpacTopissue}="OPACFeatures";
252 $tabsysprefs{OpacBrowser}="OPACFeatures";
253 $tabsysprefs{kohaspsuggest} = "OPACFeatures";
254 $tabsysprefs{OpacRenewalAllowed} = "OPACFeatures";
257 $tabsysprefs{CataloguingLog} = "LOGFeatures";
258 $tabsysprefs{BorrowersLog} = "LOGFeatures";
259 $tabsysprefs{SubscriptionLog} = "LOGFeatures";
260 $tabsysprefs{IssueLog} = "LOGFeatures";
261 $tabsysprefs{ReturnLog} = "LOGFeatures";
262 $tabsysprefs{LetterLog} = "LOGFeatures";
263 $tabsysprefs{FinesLog} = "LOGFeatures";
266 my ($searchstring,$type)=@_;
267 my $dbh = C4::Context->dbh;
268 $searchstring=~ s/\'/\\\'/g;
269 my @data=split(' ',$searchstring);
274 # used for doing a plain-old sys-pref search
275 if ($type eq 'all' ){
276 my $sth=$dbh->prepare("SELECT * FROM systempreferences
277 WHERE variable LIKE ? OR explanation LIKE ?
279 $sth->execute("%$searchstring%", "%$searchstring%");
280 while (my $data=$sth->fetchrow_hashref){
281 $data->{value} =~ s/</</g;
282 $data->{value} =~ s/>/>/g;
283 $data->{value}=substr($data->{value},0,100)."..." if length($data->{value}) >100;
284 push(@results,$data);
290 foreach my $syspref (sort { lc $a cmp lc $b } keys %tabsysprefs){
291 if ($tabsysprefs{$syspref} eq $type){
292 my $sth=$dbh->prepare("Select variable,value,explanation,type,options from systempreferences where (variable like ?) order by variable");
293 $sth->execute($syspref);
294 while (my $data=$sth->fetchrow_hashref){
295 $data->{value} =~ s/</</g;
296 $data->{value} =~ s/>/>/g;
297 $data->{value}=substr($data->{value},0,100)."..." if length($data->{value}) >100;
298 push(@results,$data);
305 my $strsth ="Select variable,value,explanation,type,options from systempreferences where variable not in (";
306 foreach my $syspref (keys %tabsysprefs){
307 $strsth .= $dbh->quote($syspref).",";
310 $strsth .= " order by variable";
311 my $sth=$dbh->prepare($strsth);
313 while (my $data=$sth->fetchrow_hashref){
314 $data->{value}=substr($data->{value},0,100);
315 push(@results,$data);
320 return ($cnt,\@results);
324 my $searchfield=$input->param('searchfield');
325 my $offset=$input->param('offset');
326 my $script_name="/cgi-bin/koha/admin/systempreferences.pl";
328 my ($template, $borrowernumber, $cookie)
329 = get_template_and_user({template_name => "admin/systempreferences.tmpl",
332 authnotrequired => 0,
333 flagsrequired => {parameters => 1},
337 my $op = $input->param('op');
338 $searchfield=~ s/\,//g;
341 $template->param(script_name => $script_name,
342 $op => 1); # we show only the TMPL_VAR names $op
344 $template->param(script_name => $script_name,
345 else => 1); # we show only the TMPL_VAR names $op
348 if ($op eq 'update_and_reedit') {
349 foreach ($input->param) {
352 if (my $currentorder=$input->param('currentorder')) {
353 my @currentorder=split /\|/, $currentorder;
355 foreach my $param ($input->param) {
356 if ($param=~m#up-(\d+).x#) {
357 my $temp=$currentorder[$1];
358 $currentorder[$1]=$currentorder[$1-1];
359 $currentorder[$1-1]=$temp;
362 } elsif ($param=~m#down-(\d+).x#) {
363 my $temp=$currentorder[$1];
364 $currentorder[$1]=$currentorder[$1+1];
365 $currentorder[$1+1]=$temp;
370 $value=join ' ', @currentorder;
373 $template->param(script_name => $script_name,
374 $op => 1); # we show only the TMPL_VAR names $op
378 $template->param(script_name => $script_name,
379 else => 1); # we show only the TMPL_VAR names $op
382 my $dbh = C4::Context->dbh;
383 my $query="select * from systempreferences where variable=?";
384 my $sth=$dbh->prepare($query);
385 $sth->execute($input->param('variable'));
387 unless (C4::Context->config('demo') eq 1) {
388 my $sth=$dbh->prepare("update systempreferences set value=?,explanation=?,type=?,options=? where variable=?");
389 $sth->execute($value, $input->param('explanation'), $input->param('variable'), $input->param('preftype'), $input->param('prefoptions'));
393 unless (C4::Context->config('demo') eq 1) {
394 my $sth=$dbh->prepare("insert into systempreferences (variable,value,explanation) values (?,?,?,?,?)");
395 $sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions'));
403 ################## ADD_FORM ##################################
404 # called by default. Used to create form to add or modify a record
406 if ($op eq 'add_form') {
407 #---- if primkey exists, it's a modify action, so read values to modify...
410 my $dbh = C4::Context->dbh;
411 my $sth=$dbh->prepare("select variable,value,explanation,type,options from systempreferences where variable=?");
412 $sth->execute($searchfield);
413 $data=$sth->fetchrow_hashref;
415 $template->param(modify => 1);
416 # save tab to return to if user cancels edit
417 $template->param(return_tab => $tabsysprefs{$searchfield});
421 foreach my $option (split(/\|/, $data->{'options'})) {
423 $option eq $data->{'value'} and $selected=1;
424 push @options, { option => $option, selected => $selected };
426 if ($data->{'type'} eq 'Choice') {
427 $template->param('type-choice' => 1);
428 } elsif ($data->{'type'} eq 'YesNo') {
429 $template->param('type-yesno' => 1);
430 $data->{'value'}=C4::Context->boolean_preference($data->{'variable'});
431 ($data->{'value'} eq '1') ? ($template->param('value-yes'=>1)) : ($template->param('value-no'=>1));
432 } elsif ($data->{'type'} eq 'Integer') {
433 $template->param('type-free' => 1);
434 $template->param('fieldlength' => $data->{'options'});
435 } elsif ($data->{'type'} eq 'Textarea') {
436 $template->param('type-textarea' => 1);
437 $data->{options} =~ /(.*)\|(.*)/;
438 $template->param('cols' => $1, 'rows' => $2);;
439 } elsif ($data->{'type'} eq 'Float') {
440 $template->param('type-free' => 1);
441 $template->param('fieldlength' => $data->{'options'});
442 } elsif ($data->{'type'} eq 'Themes') {
443 $template->param('type-choice' => 1);
445 ($data->{'variable'}=~m#opac#i) ? ($type='opac') : ($type='intranet');
447 my $currently_selected_themes;
449 foreach my $theme (split /\s+/, $data->{'value'}) {
450 push @options, { option => $theme, counter => $counter };
451 $currently_selected_themes->{$theme}=1;
454 foreach my $theme (getallthemes($type)) {
456 next if $currently_selected_themes->{$theme};
457 push @options, { option => $theme, counter => $counter };
460 } elsif ($data->{'type'} eq 'ClassSources') {
461 $template->param('type-choice' => 1);
464 my $sources = GetClassSources();
466 foreach my $cn_source (sort keys %$sources) {
467 if ($cn_source eq $data->{'value'}) {
468 push @options, { option => $cn_source, counter => $counter, selected => 1 };
470 push @options, { option => $cn_source, counter => $counter };
474 } elsif ($data->{'type'} eq 'Languages') {
475 $template->param('type-choice' => 1);
478 my $currently_selected_languages;
480 foreach my $language (split /\s+/, $data->{'value'}) {
481 next if $language eq 'images';
482 push @options, { option => $language, counter => $counter };
483 $currently_selected_languages->{$language}=1;
486 my $langavail = getTranslatedLanguages();
487 foreach my $language (@$langavail) {
489 next if $currently_selected_languages->{$language->{'language_code'}};
490 #FIXME: could add language_name and language_locale_name for better display
491 push @options, { option => $language->{'language_code'}, counter => $counter };
495 $template->param('type-free' => 1);
496 $template->param('fieldlength' => $data->{'options'}>0?$data->{'options'}:60);
498 $template->param(explanation => $data->{'explanation'},
499 value => $data->{'value'},
500 type => $data->{'type'},
501 options => \@options,
502 preftype => $data->{'type'},
503 prefoptions => $data->{'options'},
504 searchfield => $searchfield);
506 ################## ADD_VALIDATE ##################################
507 # called by add_form, used to insert/modify data in DB
508 } elsif ($op eq 'add_validate') {
509 my $dbh = C4::Context->dbh;
510 my $sth=$dbh->prepare("select * from systempreferences where variable=?");
511 $sth->execute($input->param('variable'));
513 unless (C4::Context->config('demo') eq 1) {
514 my $sth=$dbh->prepare("update systempreferences set value=?,explanation=?,type=?,options=? where variable=?");
515 $sth->execute($input->param('value'), $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions'), $input->param('variable'));
519 unless (C4::Context->config('demo') eq 1) {
520 my $sth=$dbh->prepare("insert into systempreferences (variable,value,explanation,type,options) values (?,?,?,?,?)");
521 $sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions'));
526 print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=systempreferences.pl?tab=".$tabsysprefs{$input->param('variable')}."\"></html>";
528 ################## DELETE_CONFIRM ##################################
529 # called by default form, used to confirm deletion of data in DB
530 } elsif ($op eq 'delete_confirm') {
531 my $dbh = C4::Context->dbh;
532 my $sth=$dbh->prepare("select variable,value,explanation,type,options from systempreferences where variable=?");
533 $sth->execute($searchfield);
534 my $data=$sth->fetchrow_hashref;
536 $template->param(searchfield => $searchfield,
537 Tvalue => $data->{'value'},
540 # END $OP eq DELETE_CONFIRM
541 ################## DELETE_CONFIRMED ##################################
542 # called by delete_confirm, used to effectively confirm deletion of data in DB
543 } elsif ($op eq 'delete_confirmed') {
544 my $dbh = C4::Context->dbh;
545 my $sth=$dbh->prepare("delete from systempreferences where variable=?");
546 $sth->execute($searchfield);
549 # END $OP eq DELETE_CONFIRMED
550 ################## DEFAULT ##################################
552 #Adding tab management for system preferences
553 my $tab=$input->param('tab');
554 $template->param($tab => 1);
555 my ($count,$results)=StringSearch($searchfield,$tab);
558 for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
564 my %row_data; # get a fresh hash for the row data
565 $row_data{variable} = $results->[$i]{'variable'};
566 $row_data{value} = $results->[$i]{'value'};
567 $row_data{yes} = 1 if ($results->[$i]{'value'} == 1);
568 $row_data{yesno} = 1 if ($results->[$i]{'type'} eq 'YesNo');
569 $row_data{explanation} = $results->[$i]{'explanation'};
570 $row_data{toggle} = $toggle;
571 $row_data{edit} = "$script_name?op=add_form&searchfield=".$results->[$i]{'variable'};
572 $row_data{delete} = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'variable'};
573 push(@loop_data, \%row_data);
575 $tab=($tab?$tab:"Local Use");
576 $template->param(loop => \@loop_data, $tab => 1);
578 my $prevpage = $offset-$pagesize;
579 $template->param("<a href=$script_name?offset=".$prevpage.'<< Prev</a>');
581 if ($offset+$pagesize<$count) {
582 my $nextpage =$offset+$pagesize;
583 $template->param("a href=$script_name?offset=".$nextpage.'Next >></a>');
585 $template->param( tab => $tab,
587 } #---- END $OP eq DEFAULT
588 output_html_with_http_headers $input, $cookie, $template->output;