(FILECREATED "28-Jan-87 16:57:41" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH012.;1 2927   

      changes to:  (VARS RGPATCH012COMS))


(* Copyright (c) 1987 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT RGPATCH012COMS)

(RPAQQ RGPATCH012COMS ((FNS NC.CheckFiling NC.InsureProperFiling)))
(DEFINEQ

(NC.CheckFiling
  [LAMBDA (Card)                                             (* Randy.Gobbel "28-Jan-87 16:49")
                                                             (* Check to make sure this card has a contents hook of
							     some sort. If not, hook it up to a contents card.)

          (* * rht 12/8/84: Now checks whether both cards *and* fileboxes have been filed.)



          (* * rht 12/9/84: Now files in orphan filebox if NC.ForceFiling flag is off, without bothering the user.)



          (* * rht 2/9/85: Added call to NC.CardNeedsFilingP)



          (* * fgh 11/12/85 Updated to handle Card and NoteFile objects.)



          (* * fgh 6/9/86 Updated to set operation in progress indicator.)



          (* * rg 1/28/87 Make sure we always return a useful value)


    (LET (OperationInProgress)
         (COND
	   [(NC.CardNeedsFilingP Card)
	     (NC.ProtectedCardOperation Card Filing (COND
					  [NC.ForceFilingFlg (NC.MakeFilingLinks
							       Card
							       (CONCAT "This card (" (
									   NC.RetrieveTitle Card)
									 
							 ") is not currently filed in a FileBox."
									 (CHARACTER 13]
					  (T (NC.PrintMsg (NC.FetchWindow Card)
							    T "This card (" (NC.RetrieveTitle
							      Card)
							    ") is not currently filed in a FileBox."
							    (CHARACTER 13)
							    
						    "It is being filed in the ToBeFiled FileBox."
							    (CHARACTER 13))
					     (NC.HookToOrphanCard Card (fetch (NoteFile 
										    ToBeFiledCard)
									    of (fetch
										   (Card NoteFile)
										    of Card]
	   (T T])

(NC.InsureProperFiling
  [LAMBDA (Card)                                             (* Randy.Gobbel "28-Jan-87 16:49")
                                                             (* Called when any type of note card is being quitted 
							     from, i.e., closed)

          (* * rht 12/9/84: Moved check of the NC.ForceFiling flag into NC.CheckContentsHooks.)



          (* * fgh 11/12/85 Updated to handle Card and NoteFile objects.)



          (* * fgh 6/27/86 Changed format to allow being killed by ERROR!)



          (* * rg 1/28/87 Now returns CANCELLED if any of the component tests fail)


    (COND
      ((AND (NULL (NC.FetchBeingDeletedFlg Card))
	      (NC.CheckTitle Card)
	      (NC.CheckFiling Card))
	T)
      (T (QUOTE CANCELLED])
)
(PUTPROPS RGPATCH012 COPYRIGHT ("Xerox Corporation" 1987))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (304 2846 (NC.CheckFiling 314 . 2025) (NC.InsureProperFiling 2027 . 2844)))))
STOP