DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ F T

⟦6cffe7e3c⟧ TextFile

    Length: 4365 (0x110d)
    Types: TextFile
    Notes: @(#)Form.cancel 13.3 (RC International) 91/12/06
    Names: »Form.cancel«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/sadm/sysadm/add-ons/lp/printers/requests/Form.cancel« 

TextFile

#	@(#)Form.cancel	13.3 (RC International) 91/12/06

form=Cancel Print Requests

help=OPEN TEXT $INTFBASE/Text.itemhelp $LININFO 

`indicator -w; 
	message "Loading print requests, please wait ...";
	set -e name_r="/tmp/lp.r$VPID";
	set -e name_p="/tmp/lp.p$VPID";
	set -e name_u="/tmp/lp.u$VPID";
        lpstat -o | fmlcut -d' ' -f1 > $name_r;
	echo "all" >> $name_r;
	echo "" >> $name_r;
	lpstat -o | fmlcut -d'-' -f1 > $name_p;
	echo "all" >> $name_p;
	echo "" >> $name_p;
        lpstat -o | fmlcut -d' ' -f2 > $name_u;
	echo "all" >> $name_u;
	echo "" >> $name_u;
	if lpstat -o | grep -s '$';
	then
		echo "init=true";
	else
		echo "init=false";
		message -b "There are no print requests available";
	fi`

close=`rm -f $name_r $name_p $name_u;
	unset -e name_p -e name_u -e clist;
	unset -l do_all -e name_r -l name_valid -l bad_one`

done=`
  if [ -n $F2 -a $F2 != 'all' ]; 
  then 
	message -w "Cancelling from print request-ids, please wait ...";
	echo "$F2" | tr ',' ' ' | set -e clist;
  	shell "
  	for c in $clist
  	do
  		cancel \$c > /dev/null;
  	done
  	";
  else
  	if [ -n $F1 -a $F1 != 'all' ]; 
	then
		message -w "Cancelling from printer names, please wait ...";
		lpstat -o > $name_p;
		> $name_r;
		echo "$F1" | tr ',' ' ' | set -e clist;
		shell "
		for c in \$clist
		do
			grep \$c \$name_p >> $name_r;
		done
		";
		sort -u $name_r | fmlcut -d" " -f1  > $name_p;

		cat $name_p | set -e clist;
		shell "
		for c in \$clist
		do
			cancel \$c > /dev/null;
		done
		";
	else

      		if [  -n $F3 -a $F3 != 'all' ]; 
		then 
			message -w "Cancelling from user names, please wait ...";
			lpstat -o > $name_p;
			> $name_r;
			echo "$F3" | tr ',' ' ' | set -e clist;
			shell "
			for c in \$clist
			do
				grep \$c \$name_p >> $name_r;
			done
			";
			sort -u $name_r | fmlcut -d" " -f1  > $name_p;
	
			cat $name_p | set -e clist;
			shell "
			for c in \$clist
			do
				cancel \$c > /dev/null;
			done
			";
      		fi;
	

		if [ $F1 = 'all' -o $F2 = 'all' -o $F3 = 'all' ];
		then 
			message -w "Cancelling all requests, please wait ...";
			lpstat -o | awk '{print $1}' | set -e clist;
			shell "
			for c in \$clist
			do
				cancel \$c > /dev/null;
			done
			";
		fi;


      		if [ -z $F2 -a -z $F1 -a -z $F3 ]; 
		then
			message "Must specify printers, request-ids or users to cancel";
		fi;
  	fi;
  fi;
message "";`

#F1
name=Printers:
lininfo="cancel:F1"
nrow=1
ncol=1
frow=1
fcol=20
rows=1
columns=40
value=
rmenu=OPEN MENU $OBJ_DIR/Menu.pr.q.ch
choicemsg="MARK printers then press ENTER"
fieldmsg="To cancel requests on certain printers, enter printers then press [SAVE]"
valid=`indicator -w;
	unset -l bad_one;
	if [ -z "$F1" ];
	then
		set -l name_valid=true;
		true;
	else
		set -l name_valid=true;
		echo "$F1" | tr " ," "[\012*]" | regex -e '^(.*)$0$'
		'`fmlgrep "^$m0\$" $name_p || set -l bad_one="$m0" -l name_valid=false`' > /dev/null;
		if lpdata -p | fmlgrep $F1 > /dev/null;
		then
			set -l imsg="There are no requests for this/these printer(s).";
		else
			set -l imsg="$bad_one invalid printer - press CHOICES for selection.";
		fi;
	fi;`$name_valid
invalidmsg=$imsg

#F2
name=Print request-ids:
lininfo="cancel:F2"
nrow=2
ncol=1
frow=2
fcol=20
rows=1
columns=40
scroll=true
value=
rmenu=OPEN MENU $OBJ_DIR/Menu.rq.ch
choicemsg="MARK requests then press ENTER"
fieldmsg="Enter request-ids then press SAVE or skip to cancel by printer or user"
valid=`indicator -w;
	set -l name_valid=true;
	unset -l bad_one;
	if [ -z $F2 ];
	then echo "true";
	fi;
	echo "$F2" | tr " ," "[\012*]" | regex -e '^(.*)$0$'
	'`fmlgrep "^$m0\$" $name_r || set -l bad_one="$m0" -l name_valid=false`' > /dev/null`$name_valid
invalidmsg=`echo "$bad_one Invalid print request - press [CHOICES] for selection";`

#F3
name=Originating users:
lininfo="cancel:F3"
nrow=3
ncol=1
frow=3
fcol=20
rows=1
columns=40
scroll=yes
value=
rmenu=OPEN MENU $OBJ_DIR/Menu.usr.rq.ch 
choicemsg="MARK choices then press ENTER"
fieldmsg="To cancel requests of certain users, enter users then press [SAVE]"
valid=`indicator -w;
	set -l name_valid=true;
	unset -l bad_one;
	if [ -z $F3 ];
	then echo "true";
	fi;
	echo "$F3" | tr " ," "[\012*]" | regex -e '^(.*)$0$'
	'`fmlgrep "^$m0\$" $name_u || set -l bad_one="$m0" -l name_valid=false`' > /dev/null`$name_valid
invalidmsg="User $bad_one has no active print requests - press [CHOICES] for selection"