[interchange-cvs] interchange - heins modified 3 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Tue Apr 12 16:09:02 EDT 2005
User: heins
Date: 2005-04-12 20:09:01 GMT
Added: code/Filter filter_select.filter
Added: eg/filter calculated.filter
Removed: code/Filter calculated.filter
Log:
* Remove calculated filter and put in eg/.
* Add filter_select filter which is designed to automatically select
a filter based on the widget in use. Only intended for survey at
this point.
* Alias calculated -> filter_select so surveys won't break on old
installations.
Revision Changes Path
1.1 interchange/code/Filter/filter_select.filter
rev 1.1, prev_rev 1.0
Index: filter_select.filter
===================================================================
# Copyright 2005 Interchange Development Group (http://www.icdevgroup.org/)
# Licensed under the GNU GPL v2. See file LICENSE for details.
# $Id: filter_select.filter,v 1.1 2005/04/12 20:09:01 mheins Exp $
CodeDef calculated Filter
CodeDef calculated Alias filter_select
CodeDef filter_select Filter
CodeDef filter_select Description Date widget
CodeDef filter_select Version $Revision: 1.1 $
CodeDef filter_select Routine <<EOR
sub {
## This replaces the calculated filter for the survey
## Selects an appropriate filter based on the widget type
my $wid = $CGI->{type};
if($wid =~ /fillin/) {
return 'nullselect';
}
elsif($wid =~ /select.*multip/) {
return 'null_to_comma';
}
elsif ($wid =~ /checkbox/) {
return 'checkbox null_to_comma';
}
return '';
}
EOR
1.1 interchange/eg/filter/calculated.filter
rev 1.1, prev_rev 1.0
Index: calculated.filter
===================================================================
# Copyright 2002-2004 Interchange Development Group (http://www.icdevgroup.org/)
# Copyright 1996-2002 Red Hat, Inc.
# Licensed under the GNU GPL v2. See file LICENSE for details.
# $Id: calculated.filter,v 1.1 2005/04/12 20:09:01 mheins Exp $
CodeDef calculated Filter
CodeDef calculated Routine <<EOR
sub {
my ($val, $tag, $table, $column, $key, $indirect) = @_;
$key = $CGI::values{$indirect}
if $indirect;
my $code = tag_data($table, $column, $key);
$code =~ s/\r/\n/g;
#::logDebug("calculated code=$code");
$s = $val;
my $result = $ready_safe->reval($code);
#::logDebug("calculated result='$result'");
return $result;
}
EOR
More information about the interchange-cvs
mailing list