#!/usr/bin/perl -w # -*- perl -*- use P4CGI ; use strict ; # ################################################################# # CONFIGURATION INFORMATION # All config info should be in P4CGI.pm # ################################################################# # # P4 depot browser, top # ################################################################# my $goto = &P4CGI::cgi()->param("GOTO") ; if(defined $goto) { &P4CGI::ONLOADSCRIPT("location='$goto';") ; print &P4CGI::start_page("Please wait.....") ; print &P4CGI::end_page() ; exit 0 ; } &P4CGI::SKIPHEADERBUTTONS() ; print &P4CGI::start_page("Add shortcut") ; my $urlpath=&P4CGI::cgi()->url() ; $urlpath =~ s|[^/]+$|| ; my $scurl=&P4CGI::cgi()->param("SC") ; if(!defined $scurl) { &P4CGI::bail("Internal error! Parameter SC not defined!") ; } $scurl =~ s/^$urlpath// ; my $decscurl = $scurl ; if($decscurl =~ /\?/) { $decscurl .= ";" } else { $decscurl .= "?" } $scurl = &P4CGI::urlEncode($scurl) ; my %shortcuts = &P4CGI::SHORTCUTS() ; delete $shortcuts{&P4CGI::STARTPAGE_MARKER()} ; my $scts = ""; my $name ; my @sameAs ; foreach $name (sort { uc($a) cmp uc($b) } keys %shortcuts) { if($scts eq "") { $scts = &P4CGI::start_table("") ; } my $url=$shortcuts{$name} ; if(&P4CGI::urlEncode($url) eq $scurl) { push @sameAs,"
$name\n" ; } &P4CGI::cgi()->param("RMSHORTCUT","$url\:\:\:$name") ; my $del = &P4CGI::buttonLink(&P4CGI::cgi()->url(-query=>1),"Remove shortcut $name","Remove Shortcut") ; &P4CGI::cgi()->delete("RMSHORTCUT") ; $scts .= "$name$del\n" ; } if($scts ne "") { $scts .= &P4CGI::end_table() ; } ; my $currDepotNo = &P4CGI::CURR_DEPOT_NO() ; print &P4CGI::start_framedTable(""),"\n" ; print &P4CGI::start_table(" class=\"Text\""), ""; while() { last if /============/ ; s/__URL__/$scurl/g ; print ; } my $existwarning = "" ; { my $noInWarning =""; $noInWarning = "is a shortcut" if @sameAs == 1 ; $noInWarning = "are " . scalar @sameAs . " shortcuts" if @sameAs > 1 ; my $scts = join("",@sameAs) ; while() { last if /============/ ; s/__SCTS__/$scts/g ; s/__N__/$noInWarning/g ; $existwarning .= $_ ; } } ; print $existwarning if @sameAs > 0 ; my $script = "" ; while() { last if /============/ ; s/__SCURL__/$scurl/g ; s/__CURR_P4_DEPOT__/$currDepotNo/g ; s/__DECURL__/$decscurl/g ; $script .= $_ ; } while() { last if /============/ ; s/__SCURL__/$scurl/g ; s/__CURR_P4_DEPOT__/$currDepotNo/g ; s/__DECURL__/$decscurl/g ; s/__SCRIPT__/$script/ ; print ; } if($scts ne "") { while() { last if /============/ ; s/__SCTS__/$scts/g ; print ; } } print "", &P4CGI::end_table() ; print "", &P4CGI::end_framedTable() ; print &P4CGI::end_page() ; # # That's all folks # __END__

Name the shourtcut and press "Add Shortcut" or "Cancel" ============================================================

There already __N__ to this page: __SCTS__
You can Go back or continue and add another shortcut to the same page. ============================================================ var scdata='__SCURL__' + ':::' + document.TheForm.SCNAME.value ; location='addshortcut.cgi?DP=__CURR_P4_DEPOT__;ADDSHORTCUT=' + scdata + '&GOTO=__SCURL__' ; return false ; ============================================================


============================================================

You have the following shortcut(s) specified: __SCTS__
If you specify an already existing name it will be modified.