#!/usr/local/bin/perl -w # get_quick_status_update_data_1.pl # Get the information about the project specified by calling web form # and proceed to ask user for what to change. # June 22, 1999. V1.30 Change listgb to list. RCG # March 17, 1999. V1.20 Change separator between instrument and SI name # to be "--" rather than "-" to accommodate instrument names using # hyphens. Add test to print out debug lines if debug flag is # set. rcg # February 23, 1999. Check for no status lines. Change logic to # use existing level 12 updating scripts since it needs # to ask for PI name if it's a new instrument. Add time stamp # to STDERR if in debug mode. rcg # Robert C. Groman $version = "V1.30-June 22, 1999"; # Assumptions: # Only updates to existing projects in the inventory are allowed. $debug = "no"; #set to no if you want this to update the #real thing. print STDOUT <Get Quick Status Update Data - 1

Get Quick Status Update Data - 1

HEADING if ( $debug eq "no" ) { $datadir = "/data/rgroman/Inventory/"; $dataobj = "/globec/gb/inventory"; $webdir = "/inv"; $scriptsdir = "/data/rgroman/Inventory/scripts"; $list = "/data5/globec/bin/list -c -n -b "; } elsif ( $debug eq "yes" ) { $datadir = "/data/rgroman/Inventory/debug"; $dataobj = "/globec/gb/inventory_test"; $webdir = "/invtest"; $scriptsdir = "/data/rgroman/Inventory/scripts/debug"; $list = "/data5/globec/bin/list -c -n -b "; print STDOUT ("

DEBUG VERSION ONLY

\n"); print STDERR (scalar localtime, " $0, $version\n"); } else { print STDOUT <Perform Quick Update of Inventory Status

I am sorry but the debug flag ($debug) is not set correctly. I cannot continue. Contact the DMO for help.

TROUBLE exit 1; } $poststring = $scriptsdir . "/poststring |"; $action = $webdir . "/process_quick_status_update_data.pl"; $form_action = $webdir . "/doupdate_get_si"; #Get level 1 data for specified cruiseid open PARAM, $poststring or die "Could not get cruise/project information, $!"; ($cruiseid,$instrument,$new_instrument)=; close PARAM; chomp $cruiseid; chomp $instrument; if ( $debug eq "yes" ) { print STDOUT ("**debug, cruiseid=$cruiseid, for instrument=", $instrument, " and new instrument=$new_instrument

\n"); } ($instrument,$dummy) = split /--/, $instrument; if ( $debug eq "yes" ) { print STDOUT ("

**debug, instrument=$instrument \n"); } $dummy=$dummy; $instrument =~ s/\s//g; chomp $new_instrument; if ( ($instrument =~ m/^Select/i ) and ($new_instrument =~ m/^Select/i ) ) { print STDOUT <both sections. I don't know which one you want. Click on the Back button and select one or the other. HERE2 exit 0; } elsif ($instrument =~ m/^Select/i ) { $type = "new"; $instrument = $new_instrument; $instrument =~ s/\s//g; } else { $type = "old"; } unless ( $instrument =~ m/\w+/ ) { print STDOUT ("

The instrument specified ($instrument) is ", "not valid. Cannot continue.\n"); exit 0; } $instrument =~ s/_$//; print STDOUT ("

\n"); print STDOUT ("For project/cruiseid: "); print STDOUT ("

\n"); print STDOUT ("For instrument: "); print STDOUT ("

\n"); #Get level 2 data for specified cruiseid/project $restriction = "project=" . $cruiseid . ",data_type=" . $instrument . ",status,year,month,day,description"; $list_action = $list . " \"" . $dataobj . "(" . $restriction .")\"|"; if ( $debug eq "yes" ) { print STDOUT ("
**debug, list_action=$action
\n"); } if ($type eq "new" ) { goto NEWINSTRUMENT; } unless ( open LEVEL2, $list_action ) { print STDOUT ("

Problem accessing data for ", $cruiseid, " using the following command\n"); print STDOUT ("
$list_action
Must quick.\n"); exit 0; } print STDOUT ("

Existing status information follows:\n"); print STDOUT ("

Click on an existing status ", "and you will be prompted to enter a new description\n", "on the next form.\n", "If you click on an existing status of \"action_required\"\n", "the system will change the status to \"action_taken\", update\n", "the date, and leave the old\n", "description as specified.

\n"); print STDOUT (""); print STDOUT < \n \n TABLETITLE @status=(); $i=-1; while () { chomp; if ( m/&x/ ) { print STDOUT ("$_
\n"); while () { print STDOUT ("$_
\n"); exit 0; } } $i++; $j = $i + 1; $desc = ""; ($status[$i],$year,$month,$day,@desc)=split /,/, $_; $status[$i] =~ s/ //g; foreach $a (@desc) { $desc = $desc . $a; } $desc =~ s/^"//; $desc =~ s/"$//; if ( $debug eq "yes" ) { print STDOUT ("

**debug, $status[$i] $year $month $day $desc\n
"); } $url = "

\n TABLE } close LEVEL2; print STDOUT ("
Status Year Month Day Description
$url>$status[$i] $year $month $day $desc
\n"); print STDOUT ("

OR, "); NEWINSTRUMENT: print STDOUT ("

\n"); print STDOUT ("\n"); print STDOUT ("


Last modified: $version\n"); print STDOUT ("\n \n");