From: Rob H. <for...@us...> - 2003-06-01 09:27:11
|
Update of /cvsroot/sandweb/sandweb/bin In directory sc8-pr-cvs1:/tmp/cvs-serv25558/bin Modified Files: Tag: release-1_0-branch sandweb.cgi Log Message: tag is working again! finally :) I ended up passing the params as a loop through the html ( params is a hash ), then picking up the array in the CGI and turning it back into a hash. sweet! Index: sandweb.cgi =================================================================== RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v retrieving revision 1.348.2.2 retrieving revision 1.348.2.3 diff -U2 -r1.348.2.2 -r1.348.2.3 --- sandweb.cgi 1 Jun 2003 07:58:24 -0000 1.348.2.2 +++ sandweb.cgi 1 Jun 2003 09:27:03 -0000 1.348.2.3 @@ -239,6 +239,9 @@ # whether or not this is a submenu my $submenu = $cgi->param('submenu') || ''; + # whether or not this is the final submenu + my $submenu_final = $cgi->param('submenu_final') || ''; $log->debug("submenu: $submenu\n"); + $log->debug("submenu_final: $submenu_final\n"); $log->debug("action: $action - submit: $submit"); $log->debug("module_description: $module_description\n"); @@ -320,5 +323,12 @@ } + my %params; + + if ( $cgi->param('params')) { + %params = $cgi->param('params'), + } + if ( $vcs_command eq "tag" ) { + $log->debug("called tag.."); my $tag_sync = $cgi->param('tag_sync') || ''; my $tag_switch = $cgi->param('tag_switch') || ''; @@ -327,5 +337,7 @@ my $create_tag = $cgi->param('create_tag') || ''; my $remove_tag = $cgi->param('remove_tag') || ''; - if ($submenu) { + + if (($submenu == 1) + && ($submenu_final != 1)){ tag_commit( ck_auth => $ck_auth, @@ -342,7 +354,8 @@ location => $location, submenu => $submenu, + submenu_final => 1, ); exit; - } else { + } elsif ($submenu_final != 1){ tag_menu( ck_auth => $ck_auth, @@ -354,5 +367,4 @@ exit; } - exit; } @@ -396,4 +408,5 @@ vcs_command => $vcs_command, module_name => $module_name, + params => \%params, repo_name => $repo_name, repo_password => $repo_password, @@ -1903,6 +1916,10 @@ my $main_window_url = $args{'main_window_url'} || ''; my $submenu = $args{'submenu'} || ''; + my $submenu_final = $args{'submenu_final'} || ''; $log->debug("submenu in vcs_menu : $submenu"); my @filename_loop = (); + my @params_loop = (); + # dereference params hash, turn into array + my @params_array = %$params; my $count = 0; @@ -1930,4 +1947,22 @@ } + $count = 0; + while ( @params_array->[$count] ) { + # build loop to pass params through template + # + my %entry; + $entry{'PARAMS'} = @params_array->[$count]; + push (@params_loop, \%entry); + $count++; + } + + my @params= (); + $count = 0; + + while ( @params_array->[$count] ) { + push (@params, @params_array->[$count]); + $count++; + } + unless ( @filename || @filename eq '.' ) { $log->debug("no file was selected for vcs action"); @@ -1938,4 +1973,5 @@ PROGNAME => $progname, SUBMENU => $submenu, + SUBMENU_FINAL => $submenu_final, OUTPUT => "Please select file(s) or folder(s) to perform vcs action on", ERROR => "No file(s) or folder(s) selected", @@ -1979,4 +2015,5 @@ LOCATION => $location, FILENAME_LOOP => \@filename_loop, + PARAMS_LOOP => \@params_loop, VCS_COMMAND => $vcs_command, VCS_MESSAGE => $vcs_message, @@ -1986,4 +2023,5 @@ IMAGE_DIR => $image_dir, SUBMENU => $submenu, + SUBMENU_FINAL => $submenu_final, ); print $cgi->header( -cookie => $ck_auth ); @@ -2583,8 +2621,10 @@ } + $log->debug("in vcs_commit"); $log->debug("module_name: $module_name"); $log->debug("username: $username"); $log->debug("location: $location"); $log->debug("main_window_url: $main_window_url"); + $log->debug("params: ".Dumper(%params)); my $repo_server = $user->get_repo_server(repo => $repo_name); @@ -3186,4 +3226,5 @@ my $repo_name = $args{'repo_name'}; my $submenu = $args{'submenu'} || ''; + my $submenu_final = $args{'submenu_final'} || ''; my $prev_url = "$ENV{'HTTP_REFERER'}"; $log->debug("prev_url $prev_url"); @@ -3197,4 +3238,5 @@ my $remove_tag = $args{'remove_tag'} || ''; + $log->debug("in tag_commit"); $log->debug("module_name: $module_name"); $log->debug("username: $username"); @@ -3234,4 +3276,5 @@ repo_password => $repo_password, submenu => $submenu, + submenu_final => $submenu_final, filename => \@filename, location => $location, @@ -3253,4 +3296,5 @@ repo_name => $repo_name, submenu => $submenu, + submenu_final => $submenu_final, repo_password => $repo_password, filename => \@filename, @@ -3272,4 +3316,5 @@ repo_name => $repo_name, submenu => $submenu, + submenu_final => $submenu_final, repo_password => $repo_password, filename => \@filename, @@ -3293,4 +3338,5 @@ repo_password => $repo_password, submenu => $submenu, + submenu_final => $submenu_final, filename => \@filename, location => $location, @@ -3307,4 +3353,5 @@ $log->debug("submenu passed from create_tag: $submenu"); + $log->debug("cvs params passed: $create_tag"); vcs_menu( ck_auth => $ck_auth, @@ -3314,4 +3361,5 @@ repo_password => $repo_password, submenu => $submenu, + submenu_final => $submenu_final, filename => \@filename, location => $location, @@ -3334,4 +3382,5 @@ repo_password => $repo_password, submenu => $submenu, + submenu_final => $submenu_final, filename => \@filename, location => $location, @@ -3422,4 +3471,5 @@ my $remove_branch = $args{'remove_branch'} || ''; + $log->debug("in branch_commit"); $log->debug("module_name: $module_name"); $log->debug("username: $username"); |