Subversion Repositories PEEPS

Rev

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

Rev 14 Rev 16
Line 42... Line 42...
42
	tax_id              => [qw(TaxID                55    text               )],
42
	tax_id              => [qw(TaxID                55    text               )],
43
	date_established    => [qw(Established          60    date               )],
43
	date_established    => [qw(Established          60    date               )],
44
	updated             => [qw(Updated              65    readonly  static   )],
44
	updated             => [qw(Updated              65    readonly  static   )],
45
);
45
);
Line -... Line 46...
-
 
46
 
-
 
47
if ($user->{SYSADMIN}) {
-
 
48
  $FIELDS{visible} = [qw(Visible 70 switch)];
Line 46... Line 49...
46
 
49
}
47
 
50
 
48
my %fieldDisplayName = map  { $_ => $FIELDS{$_}->[0]   } keys %FIELDS;
51
my %fieldDisplayName = map  { $_ => $FIELDS{$_}->[0]   } keys %FIELDS;
49
my %fieldType        = map  { $_ => $FIELDS{$_}->[2]   } keys %FIELDS;
52
my %fieldType        = map  { $_ => $FIELDS{$_}->[2]   } keys %FIELDS;
50
my @requiredFields   = sort fieldOrder grep { defined $FIELDS{$_}->[3] } keys %FIELDS;
53
my @requiredFields   = sort fieldOrder grep { defined $FIELDS{$_}->[3] } keys %FIELDS;
51
my @DBFields   = sort fieldOrder grep { $fieldType{$_} =~ /^(text|select|number|switch|date|time|auto)/ } keys %FIELDS;
54
my @DBFields   = sort fieldOrder grep { $fieldType{$_} =~ /^(text|select|number|switch|date|time|auto)/ } keys %FIELDS;
52
my @ROFields   = sort fieldOrder grep { $fieldType{$_} =~ /^(readonly)/ } keys %FIELDS;
55
my @ROFields   = sort fieldOrder grep { $fieldType{$_} =~ /^(readonly)/ } keys %FIELDS;
Line 53... Line 56...
53
my @SAFields = qw/ type status /;
56
my @SAFields = qw/ type status visible/;
54
my $primary = $DBFields[0];
57
my $primary = $DBFields[0];
55
 
58
 
Line 151... Line 154...
151
      $F{$DBFields[0]} .= $h->input ({ type=>"hidden", name=>$DBFields[0], value=> $F{$DBFields[0]} });
154
      $F{$DBFields[0]} .= $h->input ({ type=>"hidden", name=>$DBFields[0], value=> $F{$DBFields[0]} });
Line 152... Line 155...
152
 
155
 
153
      # Put the time fields into the user's preference
156
      # Put the time fields into the user's preference
154
      map { $F{$_} = convertTime $F{$_} } grep { $fieldType{$_} eq "time" } keys %FIELDS;
157
      map { $F{$_} = convertTime $F{$_} } grep { $fieldType{$_} eq "time" } keys %FIELDS;
-
 
158
      $F{url} = $h->a ({href => $F{url}, target=>"_blank"}, $F{url}) unless !$F{url};
Line 155... Line 159...
155
      $F{url} = $h->a ({href => $F{url}, target=>"_blank"}, $F{url}) unless !$F{url};
159
      $F{visible} = $F{visible} ? "True" : "False";
156
      
160
      
157
      $actionbutton = formField ("choice", "Update") if $ORCUSER->{SYSADMIN} or $leagueAdmin;
161
      $actionbutton = formField ("choice", "Update") if $ORCUSER->{SYSADMIN} or $leagueAdmin;
158
      if ($view eq "POSTSAVE" or $choice eq "View") {
162
      if ($view eq "POSTSAVE" or $choice eq "View") {
Line 292... Line 296...
292
    my $league_name = getLeagueName ($FTS->{$primary});
296
    my $league_name = getLeagueName ($FTS->{$primary});
Line 293... Line 297...
293
    
297
    
294
    foreach my $field (grep { notInArray ($_, \@ROFields) } keys %{$FTS}) {
298
    foreach my $field (grep { notInArray ($_, \@ROFields) } keys %{$FTS}) {
295
      if (notInArray ($field, \@SAFields) or $ORCUSER->{SYSADMIN}) {
299
      if (notInArray ($field, \@SAFields) or $ORCUSER->{SYSADMIN}) {
-
 
300
        if ($FTS->{$field} ne $OG->{$field}) {
-
 
301
        	if ($field eq "visible") {
-
 
302
        		$FTS->{$field} = $FTS->{$field} ? 1 : 0;
296
        if ($FTS->{$field} ne $OG->{$field}) {
303
        	}
297
          $dbh->do ("update $DBTable set $field = ?, updated = now() where $primary = ?", undef, $FTS->{$field}, $FTS->{$primary});
304
          $dbh->do ("update $DBTable set $field = ?, updated = now() where $primary = ?", undef, $FTS->{$field}, $FTS->{$primary});
298
          logit ($ORCUSER->{person_id}, "Updated league $league_name [$FTS->{$primary}]: $field -> $FTS->{$field}");
305
          logit ($ORCUSER->{person_id}, "Updated league $league_name [$FTS->{$primary}]: $field -> $FTS->{$field}");
299
          orglogit ($ORCUSER->{person_id}, $FTS->{$primary}, "Updated league: $field -> $FTS->{$field}");
306
          orglogit ($ORCUSER->{person_id}, $FTS->{$primary}, "Updated league: $field -> $FTS->{$field}");
300
        }
307
        }