jobView.cgi #1

  • //
  • guest/
  • fredric_fredricson/
  • P4DB/
  • rel/
  • 2.1/
  • jobView.cgi
  • View
  • Commits
  • Open Download .zip Download (2 KB)
#!/usr/bin/perl -w
# -*- perl -*-
use P4CGI ;
use strict ;
#
#################################################################
#  CONFIGURATION INFORMATION 
#  All config info should be in the config file
#
#################################################################
#
#  P4 view job
#  View a job
#
#################################################################

# Get file spec argument
my $job = P4CGI::cgi()->param("JOB") ;
&P4CGI::bail("No job specified") unless defined $job ;

				# Create title

print "", &P4CGI::start_page("Job $job",(&P4CGI::ahref(-url => "jobList.cgi",
						       "LIST=Y",
						       "View job list"))) ;

my @fields ;
my %fieldData ;
@fields = &P4CGI::p4readform("job -o $job",\%fieldData);

				# Check that job exist
if($fieldData{"Description"} =~ /<enter description here>/) {
    &P4CGI::signalError("Job $job does not exist") ;
}
				# Fix user field
if(exists $fieldData{"User"}) {
    $fieldData{"User"} =  &P4CGI::ahref(-url => "userView.cgi",
					"USER=$fieldData{User}",
					"HELP=View user info",
					$fieldData{"User"}) ;
}
				# Fix description field
if(exists $fieldData{"Description"}) {
    my $d =  &P4CGI::fixSpecChar($fieldData{"Description"}) ;
    $d =~ s/\n/<br>/g ;
    $fieldData{"Description"} = "<tt>$d</tt>" ;
}

my @fixes ;
&P4CGI::p4call(\@fixes,"fixes -j $job") ;

if(@fixes > 0) {
    push @fields,"Fixed by" ;
    $fieldData{"Fixed by"} = join("<br>\n",
				  map {/change (\d+) on (\S+) by (\S+)\@(\S+)/ ;
				       my ($ch,$date,$user,$client) = ($1,$2,$3,$4) ;
				       $ch = &P4CGI::ahref(-url => "changeView.cgi",
							   "CH=$ch",
							   "HELP=View change",
							   $ch) ;
				       $user = &P4CGI::ahref(-url => "userView.cgi",
							     "USER=$user",
							     "HELP=View user info",
							     $user) ;
				       $client = &P4CGI::ahref(-url => "clientView.cgi",
							       "CLIENT=$client",
							       "HELP=View client info",
							       $client) ;
				       "Change $ch on $date by $user\@$client" ; } @fixes ) ;    
}



print
    "",
    &P4CGI::start_table("") ;

my $f ;
foreach $f (@fields) {
    print &P4CGI::table_row({-align => "right",
			     -valign => "top",
			     -type  => "th",
			     -text  => $f},
			    $fieldData{$f}) ;
} ;

print &P4CGI::end_table("") ;

print  &P4CGI::end_page();

#
# That's all folks
#









# Change User Description Committed
#1 1933 Fredric Fredricson P4DB: Created 2.1 "release branch".
(The quotation marks are
there because this is not really a release. Yet. Perhaps.)
//guest/fredric_fredricson/P4DB/main/jobView.cgi
#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