|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/compasssysweb/calendar/CalciumDir39/Operation/ |
Upload File : |
# Copyright 1999-2003, Fred Steinberg, Brown Bear Software
# SearchPerform - do the search, display the results in condensed mode
package SearchPerform;
use strict;
use CGI (':standard');
use Calendar::Date;
use Calendar::Header;
use Calendar::Body;
use Calendar::Name;
use Calendar::NavigationBar;
use Calendar::Title;
use Calendar::ListView;
use Calendar::Footer;
use Calendar::BottomBars;
use vars ('@ISA');
@ISA = ('Operation');
sub perform {
my $self = shift;
my $i18n = $self->I18N;
my $cgi = new CGI;
my ($fromDate, $toDate, $searchText, $searchIn, $useRegex, $categories) =
$self->getParams (qw (FromDate ToDate TextFilter FilterIn UseRegex
FilterCategories));
$self->{audit_searchstring} = $searchText;
my $textRow;
if ($searchText) {
my $inString;
$inString = $i18n->get ('Event or Popup Text for') . ' -'
if $searchIn =~ /both/i;
$inString = $i18n->get ('Event Text Only for') . ' -'
if $searchIn =~ /event/i;
$inString = $i18n->get ('Popup Text Only for') . ' -'
if $searchIn =~ /popup/i;
$textRow = Tr (td ({align => 'center'},
font ({color => 'black'},
$i18n->get ('Searching') . " $inString") .
font ({color => 'red'}, $searchText) .
font ({color => 'black'},
"-" . ($useRegex ? ' (regex)' : ''))));
}
my $categoryRow;
if ($categories) {
my @cats = split /$;/, $categories;
$categoryRow = Tr (td ({align => 'center'},
$cgi->font ({color => 'black'},
$i18n->get ('Only Events in Categories: ')) .
$cgi->font ({color => 'red'},
join ', ', @cats)));
}
$self->{params}->{Type} = 'Condensed';
my ($amount, $navType, $type) = $self->ParseDisplaySpecs ($self->prefs);
$fromDate = Date->new ($fromDate);
$toDate = Date->new ($toDate);
my $fnord;
print $cgi->header;
$fnord = Header->new ('Calcium ' . $i18n->get ('Search Results from') .
' "' . $self->calendarName . '"');
print $fnord->getHTML;
$fnord = Body->new ($self->prefs);
print $fnord->getHTML;
print $cgi->table ({width => '100%',
bgcolor => '#cccccc',
border => 0},
$cgi->Tr ($cgi->td ({align => 'center'},
$cgi->font ({size => '+3',
color => 'black'},
$i18n->get ('Search Result')))),
$textRow || '',
$categoryRow || '');
$fnord = Name->new ($self->prefs);
print $fnord->getHTML;
delete $self->{params}->{Type}; # for links in nav bar
delete $self->{params}->{TextFilter}; # for links in nav bar
delete $self->{params}->{FilterIn}; # for links in nav bar
delete $self->{params}->{FilterCategories}; # for links in nav bar
$self->{params}->{NavType} = 'Absolute';
$fnord = NavigationBar->new ($self, $fromDate, 'top');
print $fnord->getHTML if $fnord;
$self->{params}->{Type} = 'Condensed';
$self->{params}->{TextFilter} = $searchText;
$self->{params}->{FilterIn} = $searchIn;
$self->{params}->{FilterCategories} = $categories;
$fnord = Title->new ($self, $amount, $type, $fromDate, $toDate);
print $fnord->getHTML;
$fnord = ListView->new ($self, $fromDate, $toDate);
print $fnord->getHTML;
$fnord = Footer->new ($self->prefs);
print $fnord->getHTML;
$fnord = NavigationBar->new ($self, $fromDate, 'bottom');
print $fnord->getHTML if $fnord;
print $cgi->end_html;
}
# hack! Yikes!
sub removeTentatives {
require Operation::ShowIt;
return ShowIt::removeTentatives (@_)
}
sub auditString {
my ($self, $short) = @_;
my $line = $self->SUPER::auditString ($short);
$line .= ' ' . $self->{audit_searchstring};
}
1;