Subversion Repositories PEEPS

Rev

Rev 19 | Rev 36 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19 Rev 34
Line 134... Line 134...
134
print $h->open ("form", { action=>url, method=>'POST', name=>'UserRoleForm', id=>'UserForm'  });
134
print $h->open ("form", { action=>url, method=>'POST', name=>'UserRoleForm', id=>'UserForm'  });
135
print $h->input ({ type=>"hidden", name=>"person_id", value=>$person_id}),
135
print $h->input ({ type=>"hidden", name=>"person_id", value=>$person_id}),
136
      $h->input ({ type=>"hidden", name=>"league_id", value=>$league_id});
136
      $h->input ({ type=>"hidden", name=>"league_id", value=>$league_id});
Line 137... Line 137...
137
 
137
 
138
my @leagueroles = ($h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableHead", style=>"font-size: smaller;" }, "Role".' '.$h->input ({type=>"submit", name=>"Add", value=>"Add"}),  "Change" ) ]));
-
 
139
foreach (@roles) {
-
 
140
  
-
 
141
}
-
 
142
 
138
my @leagueroles = ($h->div ({ class=>"rTableRow" },[ $h->div ({ class=>"rTableHead", style=>"font-size: smaller;" }, "Role".' '.$h->input ({type=>"submit", name=>"Add", value=>"Add"}),  "Change" ) ]));
143
push @leagueroles, map { $h->div ({ class=>"rTableRow shaded" },
139
push @leagueroles, map { $h->div ({ class=>"rTableRow shaded" },
144
                         [ $h->div ({ class=>"rTableCellr".($_->[1] eq "Pending" ? " highlighted" : ""), style=>"font-size: smaller;".($_->[1] eq "Pending" ? " font-style: italic;" : "") },
140
                         [ $h->div ({ class=>"rTableCellr".($_->[1] eq "Pending" ? " highlighted" : ""), style=>"font-size: smaller;".($_->[1] eq "Pending" ? " font-style: italic;" : "") },
Line 145... Line 141...
145
                           $_->[1], [ $h->input ({type=>"submit", name=>"Delete", value=>"Delete", onClick=>"this.value=$_->[0]"}) ] ) ]) } @roles; # Change button -> , $h->input ({type=>"submit", name=>"Change", value=>"Change", onClick=>"this.value=$_->[0]"})
141
                           $_->[1], [ $h->input ({type=>"submit", name=>"Delete", value=>"Delete", onClick=>"this.value=$_->[0]"}) ] ) ]) } @roles; # Change button -> , $h->input ({type=>"submit", name=>"Change", value=>"Change", onClick=>"this.value=$_->[0]"})
146
 
142
 
147
if (WebDB::trim scalar param ("Add")) {
143
if (WebDB::trim scalar param ("Add")) {
148
  use tableViewer qw(notInArray);
144
  use tableViewer qw(notInArray);
149
  my @allowed_roles = grep { notInArray ($_, [map { $_->[1] } @roles]) } grep { $_ ne "System Admin" unless $league_name eq "WFTDA Leadership" } grep { $_ ne "Pending" } map { $_->[0] } @{ $dbh->selectall_arrayref ("select distinct role from role order by role") };
145
  my @allowed_roles = grep { notInArray ($_, [map { $_->[1] } @roles]) } grep { $_ ne "System Admin" unless $league_name eq "WFTDA Leadership" } grep { $_ ne "Pending" } map { $_->[0] } @{ $dbh->selectall_arrayref ("select distinct role from user_roles where visible = ? order by role", undef, 1) };
150
  push @leagueroles, $h->div ({ class=>"rTableRow shaded" },
146
  push @leagueroles, $h->div ({ class=>"rTableRow shaded" },
Line 151... Line 147...
151
                       [ $h->div ({ class=>"rTableCellr"}, $h->select ({name=>"newrole"}, [ map { $h->option ($_) } @allowed_roles ]), $h->input ({type=>"submit", name=>"savenewrole", value=>"Save"}).' '.$h->button ("Cancel")) ]);
147
                       [ $h->div ({ class=>"rTableCellr"}, $h->select ({name=>"newrole"}, [ map { $h->option ($_) } @allowed_roles ]), $h->input ({type=>"submit", name=>"savenewrole", value=>"Save"}).' '.$h->button ("Cancel")) ]);