Subversion Repositories PEEPS

Rev

Rev 6 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 16
Line 39... Line 39...
39
);
39
);
Line 40... Line 40...
40
 
40
 
41
# Set any custom "where" DB filters here...
41
# Set any custom "where" DB filters here...
Line -... Line 42...
-
 
42
my @whereClause;
-
 
43
 
-
 
44
if ($ORCUSER->{SYSADMIN}) {
-
 
45
  $COLUMNS{visible} = [qw(Visible   65    select)];
-
 
46
} else {
-
 
47
  push @whereClause, "visible = 1";
-
 
48
}
42
my @whereClause;
49
 
43
 
50
 
Line 44... Line 51...
44
# If we need to modify line item values, create a subroutine named "modify_$columnname"
51
# If we need to modify line item values, create a subroutine named "modify_$columnname"
45
#    It will receive a hashref to the object lineitem
52
#    It will receive a hashref to the object lineitem
46
 
53
 
47
sub modify_url {
54
sub modify_url {
Line -... Line 55...
-
 
55
  my $thing = shift;
-
 
56
  return $h->a ({ href => $thing->{url}, target => "_blank", onClick=>"event.stopPropagation();" }, $thing->{url});
-
 
57
}
-
 
58
 
-
 
59
sub modify_visible {
48
  my $thing = shift;
60
  my $thing = shift;
49
  return $h->a ({ href => $thing->{url}, target => "_blank", onClick=>"event.stopPropagation();" }, $thing->{url});
61
  return $thing->{visible} ? "True" : "False";
Line -... Line 62...
-
 
62
}
-
 
63
 
-
 
64
# If we need to modify how a filter works, create a subroutine named "filter_$columnname"
-
 
65
#    It will receive two fields, the field name and the current filter value (if any)
-
 
66
 
-
 
67
sub filter_visible {
-
 
68
  my $colName = shift;
-
 
69
  my $filter = shift;
-
 
70
  
-
 
71
  if (defined $filter)  {
-
 
72
    if ($filter eq "True") {
-
 
73
      return "$colName = 1";
-
 
74
    } elsif ($filter eq "False") {
-
 
75
      return "$colName = 0";
-
 
76
    }
-
 
77
  } else {    
-
 
78
    my $Options = $h->option ("", "True", "False");
-
 
79
    
-
 
80
    my $tmpfilter = getFilterValue ($colName);
-
 
81
    
50
}
82
    $Options =~ s/>($tmpfilter)/ selected>$1/;
51
 
83
    return "<SELECT name=filter-${colName} onChange='page.value = 1; submit();'>$Options</SELECT>";
52
# If we need to modify how a filter works, create a subroutine named "filter_$columnname"
84
  }
53
#    It will receive two fields, the field name and the current filter value (if any)
85
}
54
 
86