#!/usr/bin/perl -w # -*- perl -*- use P4CGI ; use strict ; # ################################################################# # CONFIGURATION INFORMATION # All config info should be in P4CGI.pm # ################################################################# # # View labels # ################################################################# # Get label my $label = P4CGI::cgi()->param("LABEL") ; &P4CGI::bail("No label specified") unless defined $label ; $label = &P4CGI::htmlEncode($label) ; my $found ; # Get list of all labels and also check that supplied label exists my @labels ; &P4CGI::p4call(\@labels, "labels" ); foreach (@labels) { $_ =~ s/^Label (\S+).*$/$1/ ; if($_ eq $label) { $found = "Yes" ; } ; } # Print header print &P4CGI::start_page("Label \"$label\"") ; &P4CGI::signalError("Label $label not in depot") unless $found ; my @otherLabels ; foreach (@labels) { next if ($_ eq $label) ; push @otherLabels,$_ ; } ; ### ### "Sort" other labels after "closeness" ### { my $lab=uc($label) ; my $len = length($lab) ; my @labs ; while($len > 3) { my @tmp ; my $l ; $len-- ; $lab = substr($lab,0,$len) ; foreach $l (@otherLabels) { if(uc(substr($l,0,$len)) eq $lab) { push @labs,$l ; } else { push @tmp,$l ; } } @otherLabels = @tmp ; } ; @otherLabels = (@labs,@otherLabels) ; } my %values ; my @fields = &P4CGI::p4readform("label -o '$label'",\%values) ; # Fix description field if(exists $values{"Description"}) { $values{"Description"} = &P4CGI::formatDescription($values{"Description"}) ; } # Fix owner field if (exists $values{"Owner"}) { # Get real user names... my %userCvt ; &P4CGI::p4user2name(\%userCvt) ; my $u = $values{"Owner"} ; if(exists $userCvt{$u}) { $values{"Owner"} = &P4CGI::ahref(-url=>"userView.cgi", "USER=$u", "HELP=View user info", "$u") . " (" . $userCvt{$u} . ")" ; } else { $values{"Owner"} = "$u (Unknown user)" ; } } # Fix view field my $viewFSPC = $values{"View"} ; my $view ; foreach (split("\n",$values{"View"})) { my $t = &P4CGI::ahref(-url => "depotTreeBrowser.cgi", "FSPC=$_", "HELP=Browse depot at $_", "<tt>$_</tt>") ; if (defined $view) { $view .= "<br>$t" ; } else { $view .= "$t" ; } ; } ; $values{"View"} = $view ; print "<br>", &P4CGI::start_framedTable(""), &P4CGI::start_table("") ; my $f ; foreach $f (@fields) { my %x ; $x{class} = "Description" if $f eq "Description" ; print &P4CGI::table_row({-class =>"Prompt", -text => "$f"}, {%x, -text => $values{$f}}, "") ; } ; $viewFSPC =~ s/\n//ig ; my @b ; push @b, (&P4CGI::buttonLink("changeList.cgi", "View changes for label $label", "LABEL=$label", "Submits..."), &P4CGI::buttonLink("fileSearch.cgi", "List files in label $label", "LABEL=$label", "Files"), &P4CGI::buttonLink("changeList.cgi", "List changes in label view not included in label $label", "FSPC=$viewFSPC", "EXLABEL=$label", "Changes after label")) ; print &P4CGI::table_row("",undef, join(" ",@b)) ; print &P4CGI::end_table() ; print &P4CGI::table_row(undef,"<br>") ; my $diffSel = join("\n", ("<table>", "<tr>", &P4CGI::cgi()->startform(-action => "labelDiffView.cgi" , -method => "GET"), &P4CGI::cgi()->hidden(-name=>"DP", -value=>&P4CGI::CURR_DEPOT_NO()), &P4CGI::cgi()->hidden(-name=>"LABEL1", -value=>"$label"), "<td>Diff with label:</td>", "<td>", &P4CGI::cgi()->popup_menu(-name => "LABEL2", -value => \@otherLabels), "</td>", "<td>Show files that:</td>", "<td>", &P4CGI::cgi()->checkbox(-name => "SHOWSAME", -value => "Y", -label => " are not modified"), "<br>", &P4CGI::cgi()->checkbox(-name => "SHOWNOTSAME", -checked => "Y", -value => "Y", -label => " are modified"), "<br>", &P4CGI::cgi()->checkbox(-name => "SHOWDIFF", -checked => "Y", -value => "Y", -label => " differ"), "</td>", "<td>", &P4CGI::cgi()->submit(-name => "Go", -value => "Go"), &P4CGI::cgi()->endform(), "</td></tr>", "</table>")) ; print &P4CGI::table_row(undef,undef,$diffSel) ; print &P4CGI::table_row(undef,"<br>") ; my $diffcSel = join("\n", ("<table>", "<tr>", &P4CGI::cgi()->startform(-action => "labelDiffView.cgi" , -method => "GET"), &P4CGI::cgi()->hidden(-name=>"LABEL1", -value=>"$label"), &P4CGI::cgi()->hidden(-name=>"DP", -value=>&P4CGI::CURR_DEPOT_NO()), "<td>Diff with current detpot files in label view. </td>", "<td> Show files that:</td>", "<td>", &P4CGI::cgi()->checkbox(-name => "SHOWSAME", -value => "Y", -label => " are not modified"), "<br>", &P4CGI::cgi()->checkbox(-name => "SHOWNOTSAME", -checked => "Y", -value => "Y", -label => " are modified"), "<br>", &P4CGI::cgi()->checkbox(-name => "SHOWDIFF", -checked => "Y", -value => "Y", -label => " differ"), "</td>", "<td>", &P4CGI::cgi()->submit(-name => "Go", -value => "Go"), &P4CGI::cgi()->endform(), "</td></tr>", "</table>")) ; print &P4CGI::table_row(undef,undef,$diffcSel) ; print "<tr><td colspacing=2>" ; print "<br>", &P4CGI::cgi()->startform(-action => "changeList.cgi", -method => "GET"), &P4CGI::cgi()->hidden(-name=>"LABEL", -value=>"$label"), "View changes for label $label excluding label:", &P4CGI::cgi()->hidden(-name=>"DP", -value=>"&P4CGI::CURR_DEPOT_NO()"), &P4CGI::cgi()->popup_menu(-name => "EXLABEL", -value => \@otherLabels), &P4CGI::cgi()->submit(-name => "Go", -value => "Go"), &P4CGI::cgi()->endform() ; print "<br>", &P4CGI::cgi()->startform(-action => "fileSearch.cgi", -method => "GET"), &P4CGI::cgi()->hidden(-name=>"LABEL", -value=>"$label"), &P4CGI::cgi()->hidden(-name=>"DP", -value=>&P4CGI::CURR_DEPOT_NO()), &P4CGI::cgi()->submit(-name => "ignore", -value => "Search in label for:"), &P4CGI::cgi()->textfield(-name => "FSPC", -default => "//...", -override => 1, -size => 50, -maxlength => 256), &P4CGI::cgi()->endform() ; print "</td></tr>" ; print &P4CGI::end_framedTable(), &P4CGI::end_page() ; # # That's all folks #
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#11 | 4998 | Fredric Fredricson |
P4DB: cleaned up some code. Added p4users(), p4client() and p4user2name() to P4CGI.pm and modified all cgi:s to use these, |
||
#10 | 4306 | Fredric Fredricson |
P4DB: Hardened P4DB against malicious parameters (cross site scripting), performed some cleanup and increased version to 3.1.1. |
||
#9 | 4237 | Fredric Fredricson | P4DB: Maybe the final submit for P4DB 3.1.0 | ||
#8 | 4152 | Fredric Fredricson | P4DB: Some more work on tha way to version 3.1.... | ||
#7 | 4070 | Fredric Fredricson |
P4DB: Updated labelView and labelDiffView cgi:s to "3.1 standard". Added the function to view diff between label and current depot files in label view. These scripts are still a bit ancient though. Should be re-implemented. Some day... |
||
#6 | 4069 | Fredric Fredricson | P4DB: More changes on the way to 3.1 | ||
#5 | 4046 | Fredric Fredricson |
P4DB: First submit for 3.1. * Removed frame-stuff and some related files * Added new page header * Started update of documentation * Changed a lot of CGI:s to conform to new "look and feel" Still a lot to do: - clean up stuff (especially the javascript) - Fix the file list to use new annotate-command - Clean up and document css-file - and more....... |
||
#4 | 2942 | Fredric Fredricson | P4DB: Fixed bug: Can now handle spaces in label names etc.... | ||
#3 | 2875 | Fredric Fredricson | P4DB 3.0 first beta... | ||
#2 | 1920 | Fredric Fredricson |
P4DB: Mainly some user interface fixes: * Added a small arrow that points to selection in list of options * Added tooltip help * Added user prefereces to turn the above off (or on) * Some other user interface fixes And fixed a bug in jobList.cgi and some minor bugs in label and branch viewers. |
||
#1 | 1638 | Fredric Fredricson | P4DB: Added all (I think) files for P4DB |