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";
168 $tabsysprefs{PatronsPerPage}="Patrons";
171 $tabsysprefs{FRBRizeEditions}="FRBR";
172 $tabsysprefs{XISBN}="FRBR";
173 $tabsysprefs{OCLCAffiliateID}="FRBR";
174 $tabsysprefs{XISBNDailyLimit}="FRBR";
175 $tabsysprefs{PINESISBN}="FRBR";
176 $tabsysprefs{ThingISBN}="FRBR";
177 $tabsysprefs{OPACFRBRizeEditions}="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{AmazonContent}="Amazon";
204 $tabsysprefs{AWSAccessKeyID}="Amazon";
205 $tabsysprefs{AmazonLocale}="Amazon";
206 $tabsysprefs{AmazonAssocTag}="Amazon";
207 $tabsysprefs{AmazonSimilarItems}="Amazon";
208 $tabsysprefs{OPACAmazonContent}="Amazon";
209 $tabsysprefs{OPACAmazonSimilarItems}="Amazon";
212 $tabsysprefs{BiblioDefaultView}="OPAC";
213 $tabsysprefs{LibraryName}="OPAC";
214 $tabsysprefs{opaccolorstylesheet}="OPAC";
215 $tabsysprefs{opaccredits}="OPAC";
216 $tabsysprefs{opaclargeimage}="OPAC";
217 $tabsysprefs{opaclayoutstylesheet}="OPAC";
218 $tabsysprefs{OpacNav}="OPAC";
219 $tabsysprefs{opacsmallimage}="OPAC";
220 $tabsysprefs{opacstylesheet}="OPAC";
221 $tabsysprefs{opacthemes}="OPAC";
222 $tabsysprefs{opacuserjs}="OPAC";
223 $tabsysprefs{SubscriptionHistory}="OPAC";
224 $tabsysprefs{opacheader}="OPAC";
226 $tabsysprefs{hideBiblioNumber}="OPAC";
227 $tabsysprefs{noOPACUserLogin}="OPAC";
228 $tabsysprefs{OPACDisplayExtendedSubInfo}="OPAC";
229 $tabsysprefs{OpacMainUserBlock}="OPAC";
230 $tabsysprefs{OPACSubscriptionDisplay}="OPAC";
231 $tabsysprefs{OPACURLOpenInNewWindow}="OPAC";
232 $tabsysprefs{OPACUserCSS}="OPAC";
233 $tabsysprefs{OPACHighlightedWords}="OPAC";
234 $tabsysprefs{OPACViewOthersSuggestions}="OPAC";
235 $tabsysprefs{URLLinkText}="OPAC";
238 $tabsysprefs{SearchMyLibraryFirst}="OPAC";
239 $tabsysprefs{Disable_Dictionary}="OPAC";
240 $tabsysprefs{hidelostitems}="OPAC";
241 $tabsysprefs{opacbookbag}="OPAC";
242 $tabsysprefs{opaclanguagesdisplay}="OPAC";
243 $tabsysprefs{OpacPasswordChange}="OPAC";
244 $tabsysprefs{opacreadinghistory}="OPAC";
245 $tabsysprefs{virtualshelves}="OPAC";
246 $tabsysprefs{RequestOnOpac}="OPAC";
247 $tabsysprefs{reviewson}="OPAC";
248 $tabsysprefs{OpacTopissues}="OPAC";
249 $tabsysprefs{OpacAuthorities}="OPAC";
250 $tabsysprefs{OpacCloud}="OPAC";
251 $tabsysprefs{opacuserlogin}="OPAC";
252 $tabsysprefs{AnonSuggestions}="OPAC";
253 $tabsysprefs{suggestion}="OPAC";
254 $tabsysprefs{OpacTopissue}="OPAC";
255 $tabsysprefs{OpacBrowser}="OPAC";
256 $tabsysprefs{kohaspsuggest} = "OPAC";
257 $tabsysprefs{OpacRenewalAllowed} = "OPAC";
260 $tabsysprefs{CataloguingLog} = "LOGFeatures";
261 $tabsysprefs{BorrowersLog} = "LOGFeatures";
262 $tabsysprefs{SubscriptionLog} = "LOGFeatures";
263 $tabsysprefs{IssueLog} = "LOGFeatures";
264 $tabsysprefs{ReturnLog} = "LOGFeatures";
265 $tabsysprefs{LetterLog} = "LOGFeatures";
266 $tabsysprefs{FinesLog} = "LOGFeatures";
269 $tabsysprefs{'OAI-PMH'} = "OAI-PMH";
270 $tabsysprefs{'OAI-PMH:archiveID'} = "OAI-PMH";
271 $tabsysprefs{'OAI-PMH:MaxCount'} = "OAI-PMH";
272 $tabsysprefs{'OAI-PMH:Set'} = "OAI-PMH";
273 $tabsysprefs{'OAI-PMH:Subset'} = "OAI-PMH";
277 my ($searchstring,$type)=@_;
278 my $dbh = C4::Context->dbh;
279 $searchstring=~ s/\'/\\\'/g;
280 my @data=split(' ',$searchstring);
285 # used for doing a plain-old sys-pref search
286 if ($type eq 'all' ){
287 my $sth=$dbh->prepare("SELECT * FROM systempreferences
288 WHERE variable LIKE ? OR explanation LIKE ?
290 $sth->execute("%$searchstring%", "%$searchstring%");
291 while (my $data=$sth->fetchrow_hashref){
292 $data->{value} =~ s/</</g;
293 $data->{value} =~ s/>/>/g;
294 $data->{value}=substr($data->{value},0,100)."..." if length($data->{value}) >100;
295 push(@results,$data);
301 foreach my $syspref (sort { lc $a cmp lc $b } keys %tabsysprefs){
302 if ($tabsysprefs{$syspref} eq $type){
303 my $sth=$dbh->prepare("Select variable,value,explanation,type,options from systempreferences where (variable like ?) order by variable");
304 $sth->execute($syspref);
305 while (my $data=$sth->fetchrow_hashref){
306 $data->{value} =~ s/</</g;
307 $data->{value} =~ s/>/>/g;
308 $data->{value}=substr($data->{value},0,100)."..." if length($data->{value}) >100;
309 push(@results,$data);
316 my $strsth ="Select variable,value,explanation,type,options from systempreferences where variable not in (";
317 foreach my $syspref (keys %tabsysprefs){
318 $strsth .= $dbh->quote($syspref).",";
321 $strsth .= " order by variable";
322 my $sth=$dbh->prepare($strsth);
324 while (my $data=$sth->fetchrow_hashref){
325 $data->{value}=substr($data->{value},0,100);
326 push(@results,$data);
331 return ($cnt,\@results);
335 my $searchfield=$input->param('searchfield');
336 my $offset=$input->param('offset');
337 my $script_name="/cgi-bin/koha/admin/systempreferences.pl";
339 my ($template, $borrowernumber, $cookie)
340 = get_template_and_user({template_name => "admin/systempreferences.tmpl",
343 authnotrequired => 0,
344 flagsrequired => {parameters => 1},
348 my $op = $input->param('op');
349 $searchfield=~ s/\,//g;
352 $template->param(script_name => $script_name,
353 $op => 1); # we show only the TMPL_VAR names $op
355 $template->param(script_name => $script_name,
356 else => 1); # we show only the TMPL_VAR names $op
359 if ($op eq 'update_and_reedit') {
360 foreach ($input->param) {
363 if (my $currentorder=$input->param('currentorder')) {
364 my @currentorder=split /\|/, $currentorder;
366 foreach my $param ($input->param) {
367 if ($param=~m#up-(\d+).x#) {
368 my $temp=$currentorder[$1];
369 $currentorder[$1]=$currentorder[$1-1];
370 $currentorder[$1-1]=$temp;
373 } elsif ($param=~m#down-(\d+).x#) {
374 my $temp=$currentorder[$1];
375 $currentorder[$1]=$currentorder[$1+1];
376 $currentorder[$1+1]=$temp;
381 $value=join ' ', @currentorder;
384 $template->param(script_name => $script_name,
385 $op => 1); # we show only the TMPL_VAR names $op
389 $template->param(script_name => $script_name,
390 else => 1); # we show only the TMPL_VAR names $op
393 my $dbh = C4::Context->dbh;
394 my $query="select * from systempreferences where variable=?";
395 my $sth=$dbh->prepare($query);
396 $sth->execute($input->param('variable'));
398 unless (C4::Context->config('demo') eq 1) {
399 my $sth=$dbh->prepare("update systempreferences set value=?,explanation=?,type=?,options=? where variable=?");
400 $sth->execute($value, $input->param('explanation'), $input->param('variable'), $input->param('preftype'), $input->param('prefoptions'));
404 unless (C4::Context->config('demo') eq 1) {
405 my $sth=$dbh->prepare("insert into systempreferences (variable,value,explanation) values (?,?,?,?,?)");
406 $sth->execute($input->param('variable'), $input->param('value'), $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions'));
414 ################## ADD_FORM ##################################
415 # called by default. Used to create form to add or modify a record
417 if ($op eq 'add_form') {
418 #---- if primkey exists, it's a modify action, so read values to modify...
421 my $dbh = C4::Context->dbh;
422 my $sth=$dbh->prepare("select variable,value,explanation,type,options from systempreferences where variable=?");
423 $sth->execute($searchfield);
424 $data=$sth->fetchrow_hashref;
426 $template->param(modify => 1);
427 # save tab to return to if user cancels edit
428 $template->param(return_tab => $tabsysprefs{$searchfield});
432 foreach my $option (split(/\|/, $data->{'options'})) {
434 $option eq $data->{'value'} and $selected=1;
435 push @options, { option => $option, selected => $selected };
437 if ($data->{'type'} eq 'Choice') {
438 $template->param('type-choice' => 1);
439 } elsif ($data->{'type'} eq 'YesNo') {
440 $template->param('type-yesno' => 1);
441 $data->{'value'}=C4::Context->boolean_preference($data->{'variable'});
442 ($data->{'value'} eq '1') ? ($template->param('value-yes'=>1)) : ($template->param('value-no'=>1));
443 } elsif ($data->{'type'} eq 'Integer') {
444 $template->param('type-free' => 1);
445 $template->param('fieldlength' => $data->{'options'});
446 } elsif ($data->{'type'} eq 'Textarea') {
447 $template->param('type-textarea' => 1);
448 $data->{options} =~ /(.*)\|(.*)/;
449 $template->param('cols' => $1, 'rows' => $2);;
450 } elsif ($data->{'type'} eq 'Float') {
451 $template->param('type-free' => 1);
452 $template->param('fieldlength' => $data->{'options'});
453 } elsif ($data->{'type'} eq 'Themes') {
454 $template->param('type-choice' => 1);
456 ($data->{'variable'}=~m#opac#i) ? ($type='opac') : ($type='intranet');
458 my $currently_selected_themes;
460 foreach my $theme (split /\s+/, $data->{'value'}) {
461 push @options, { option => $theme, counter => $counter };
462 $currently_selected_themes->{$theme}=1;
465 foreach my $theme (getallthemes($type)) {
467 next if $currently_selected_themes->{$theme};
468 push @options, { option => $theme, counter => $counter };
471 } elsif ($data->{'type'} eq 'ClassSources') {
472 $template->param('type-choice' => 1);
475 my $sources = GetClassSources();
477 foreach my $cn_source (sort keys %$sources) {
478 if ($cn_source eq $data->{'value'}) {
479 push @options, { option => $cn_source, counter => $counter, selected => 1 };
481 push @options, { option => $cn_source, counter => $counter };
485 } elsif ($data->{'type'} eq 'Languages') {
486 my $currently_selected_languages;
487 foreach my $language (split /\s+/, $data->{'value'}) {
488 $currently_selected_languages->{$language}=1;
491 my $lang = $template->param('lang');
494 if ($data->{'variable'} =~ /opac/) {
497 $theme = C4::Context->preference('opacthemes');
500 # this is the staff client
501 $interface = 'intranet';
502 $theme = C4::Context->preference('template');
504 my $languages_loop = getTranslatedLanguages($interface,$theme,$lang,$currently_selected_languages);
506 $template->param('languages_loop' => $languages_loop);
507 $template->param('type-langselector' => 1);
509 $template->param('type-free' => 1);
510 $template->param('fieldlength' => $data->{'options'}>0?$data->{'options'}:60);
512 $template->param(explanation => $data->{'explanation'},
513 value => $data->{'value'},
514 type => $data->{'type'},
515 options => \@options,
516 preftype => $data->{'type'},
517 prefoptions => $data->{'options'},
518 searchfield => $searchfield);
520 ################## ADD_VALIDATE ##################################
521 # called by add_form, used to insert/modify data in DB
522 } elsif ($op eq 'add_validate') {
523 my $dbh = C4::Context->dbh;
524 my $sth=$dbh->prepare("select * from systempreferences where variable=?");
525 $sth->execute($input->param('variable'));
526 # to handle multiple values
528 # handle multiple value strings (separated by ',')
529 my $params = $input->Vars;
530 my @values = split("\0",$params->{'value'}) if $params->{'value'};
531 for my $vl (@values) {
536 unless (C4::Context->config('demo') eq 1) {
537 my $sth=$dbh->prepare("update systempreferences set value=?,explanation=?,type=?,options=? where variable=?");
538 $sth->execute($value, $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions'), $input->param('variable'));
542 unless (C4::Context->config('demo') eq 1) {
543 my $sth=$dbh->prepare("insert into systempreferences (variable,value,explanation,type,options) values (?,?,?,?,?)");
544 $sth->execute($input->param('variable'), $value, $input->param('explanation'), $input->param('preftype'), $input->param('prefoptions'));
549 print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=systempreferences.pl?tab=".$tabsysprefs{$input->param('variable')}."\"></html>";
551 ################## DELETE_CONFIRM ##################################
552 # called by default form, used to confirm deletion of data in DB
553 } elsif ($op eq 'delete_confirm') {
554 my $dbh = C4::Context->dbh;
555 my $sth=$dbh->prepare("select variable,value,explanation,type,options from systempreferences where variable=?");
556 $sth->execute($searchfield);
557 my $data=$sth->fetchrow_hashref;
559 $template->param(searchfield => $searchfield,
560 Tvalue => $data->{'value'},
563 # END $OP eq DELETE_CONFIRM
564 ################## DELETE_CONFIRMED ##################################
565 # called by delete_confirm, used to effectively confirm deletion of data in DB
566 } elsif ($op eq 'delete_confirmed') {
567 my $dbh = C4::Context->dbh;
568 my $sth=$dbh->prepare("delete from systempreferences where variable=?");
569 $sth->execute($searchfield);
572 # END $OP eq DELETE_CONFIRMED
573 ################## DEFAULT ##################################
575 #Adding tab management for system preferences
576 my $tab=$input->param('tab');
577 $template->param($tab => 1);
578 my ($count,$results)=StringSearch($searchfield,$tab);
581 for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
587 my %row_data; # get a fresh hash for the row data
588 $row_data{variable} = $results->[$i]{'variable'};
589 $row_data{value} = $results->[$i]{'value'};
590 $row_data{yes} = 1 if ($results->[$i]{'value'} == 1);
591 $row_data{yesno} = 1 if ($results->[$i]{'type'} eq 'YesNo');
592 $row_data{explanation} = $results->[$i]{'explanation'};
593 $row_data{toggle} = $toggle;
594 $row_data{edit} = "$script_name?op=add_form&searchfield=".$results->[$i]{'variable'};
595 $row_data{delete} = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'variable'};
596 push(@loop_data, \%row_data);
598 $tab=($tab?$tab:"Local Use");
599 $template->param(loop => \@loop_data, $tab => 1);
601 my $prevpage = $offset-$pagesize;
602 $template->param("<a href=$script_name?offset=".$prevpage.'<< Prev</a>');
604 if ($offset+$pagesize<$count) {
605 my $nextpage =$offset+$pagesize;
606 $template->param("a href=$script_name?offset=".$nextpage.'Next >></a>');
608 $template->param( tab => $tab,
610 } #---- END $OP eq DEFAULT
611 output_html_with_http_headers $input, $cookie, $template->output;