#!/usr/local/bin/perl5
# -*- perl -*-
use P4CGI ;
use strict ;
#
#####################################################################
##
## CONFIGURATION INFORMATION:
## All config info should be in $configFile (see init() in P4CGI.pm)
##
#####################################################################
##
## INDEX (homepage for P4 depot browser)
##
#####################################################################
# Set back references
my $backtourl = "$ENV{RETURN_PAGE}" ;
my $backtoname = "$ENV{RETURN_NAME}" ;
# Print title and legend
print
"",
&P4CGI::start_page("P4DB
Perforce Depot Browser",
"Hint:
You can bookmark any page you want to get back to later.",
$backtourl, $backtoname) ;
# Print options
print
"",
&P4CGI::start_table("width=100%"),
&P4CGI::table_row(-align => "left",
&P4CGI::ahref(-url => &P4CGI::DTB_URL(),
"FSPC=/", "HIDEDEL=NO", "NDX=yes",
"Browse Depot Tree"),
&P4CGI::ahref(-url => &P4CGI::CHB_URL(),
"FSPC=//...",
"STATUS=pending",
"Pending Changes"),
&P4CGI::ahref(-url => &P4CGI::LAB_URL(),
"List Branches"),
&P4CGI::ahref(-url => &P4CGI::LAL_URL(),
"List Labels"),
{ -text => &P4CGI::ahref(-url => &P4CGI::LAU_URL(),
"List Users"), -align => "right"} ),
&P4CGI::end_table(),
"
" ;
# Search-for-file form
print
&P4CGI::cgi()->startform(-action => &P4CGI::SFF_URL(),
-method => "GET"),
&P4CGI::cgi()->submit(-name => "ignore",
-value => "Search for file:"),
&P4CGI::cgi()->textfield(-name => "FSPC",
-default => "//...",
-size => 50,
-maxlength => 256),
&P4CGI::cgi()->endform() ;
# View-changes-for-file form
print
&P4CGI::cgi()->startform(-action => &P4CGI::CHB_URL(),
-method => "GET"),
&P4CGI::cgi()->submit(-name => "ignore",
-value => "View changes for file:"),
&P4CGI::cgi()->hidden(-name => "MAXCH",
-value => "100"),
&P4CGI::cgi()->textfield(-name => "FSPC",
-default => "//...",
-size => 41,
-maxlength => 256),
&P4CGI::cgi()->endform() ;
# View-change-number form
my $currlev = &P4CGI::CURRENT_CHANGE_LEVEL() ;
print
"",
&P4CGI::cgi()->startform(-action => &P4CGI::CHV_URL(),
-method => "GET"),
&P4CGI::cgi()->submit(-name => "ignore",
-value => "View change number:"),
&P4CGI::cgi()->textfield(-name => "CH",
-default => "$currlev",
-size => 20,
-maxlength => 20),
&P4CGI::cgi()->endform() ;
# Browse-a-different-repository form
my $userp4port = &P4CGI::USER_P4PORT() ;
my ($host,$port) ;
($host,$port) = split( /:/, $userp4port ) ;
print
"",
&P4CGI::cgi()->startform(-action => &P4CGI::MAIN_URL(),
-method => "GET"),
&P4CGI::cgi()->submit(-name => "ignore",
-value => "Browse a different repository:"),
&P4CGI::cgi()->textfield(-name => "HOST",
-default => "$host",
-size => 20,
-maxlength => 256),
&P4CGI::cgi()->textfield(-name => "PORT",
-default => "$port",
-size => 20,
-maxlength => 256),
&P4CGI::cgi()->submit(-name => "Go",
-value => "Go"),
&P4CGI::cgi()->endform() ;
# Print list-changes options
print
"",
&P4CGI::start_table("width=100%"),
&P4CGI::table_row(-align => "left",
&P4CGI::ahref(-url => &P4CGI::CBB_URL(),
"List Changes by Branch"),
{-align => "center",
-text => &P4CGI::ahref(-url => &P4CGI::LOF_URL(),
"List Opened Files")},
{-align => "right",
-text => &P4CGI::ahref(-url => &P4CGI::CBU_URL(),
"List Changes by User")}),
&P4CGI::end_table();
# Javascript function to open Help as an offset window
print "\n" ;
# Print help-link and silliness option
print
"
",
&P4CGI::start_table("width=100%"),
&P4CGI::table_row(
-align => "left",
"Get Help",
{ -text => &P4CGI::ahref(-url => "p4race.cgi",
"The Great
Submit Race"), -align => "right"}),
&P4CGI::end_table() ;
# End the page, pass that we're the homepage so it doesn't do Page Top link,
# since the homepage should never be so long you'd need that
print
"",
&P4CGI::end_page("index") ;