(FILECREATED " 8-Dec-86 22:50:28" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH168.;2 6197   

      changes to:  (VARS RHTPATCH168COMS)
		   (FNS NCP.GetOpenEventsCard NCP.GetCloseEventsCard NCP.MarkAsNotNeedingFiling 
			NC.RunOpenEvents NC.RunCloseEvents NC.EvaluateListCardSubstance)

      previous date: " 8-Dec-86 21:57:24" {QV}<NOTECARDS>1.3K>NEXT>RHTPATCH168.;1)


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

(PRETTYCOMPRINT RHTPATCH168COMS)

(RPAQQ RHTPATCH168COMS ((* * Adds the functionality of open events cards without defining a new 
			     card type. Also makes it possible to mark single cards as not needing 
			     filing.)
			  (* * New functions for NCPROGINT)
			  (FNS NCP.GetOpenEventsCard NCP.GetCloseEventsCard 
			       NCP.MarkAsNotNeedingFiling)
			  (* * Change to NCCARDS)
			  (FNS NC.CardNeedsFilingP)
			  (* * New stuff for NCDATABASE)
			  (FNS NC.RunOpenEvents NC.RunCloseEvents)
			  (ADDVARS (NC.OpenNoteFileFns NC.RunOpenEvents)
				   (NC.CloseNoteFileFns NC.RunCloseEvents))
			  (* * New function for NCLISTCARD)
			  (FNS NC.EvaluateListCardSubstance)))
(* * Adds the functionality of open events cards without defining a new card type. Also makes 
it possible to mark single cards as not needing filing.)

(* * New functions for NCPROGINT)

(DEFINEQ

(NCP.GetOpenEventsCard
  (LAMBDA (NoteFile)                                         (* rht: " 8-Dec-86 21:31")

          (* * Find the open events card for the given notefile, creating a new one if necessary. Mark the card as not 
	  needing to be filed.)


    (LET ((OpenEventsCard (NCP.LookupCardByName (QUOTE OpenEventsCard)
						  NoteFile)))
         (if (NOT (NCP.ValidCardP OpenEventsCard))
	     then (SETQ OpenEventsCard (NCP.CreateCard (QUOTE List)
							     NoteFile "Open Events" T))
		    (NCP.MarkAsNotNeedingFiling OpenEventsCard)
		    (NCP.RegisterCardByName (QUOTE OpenEventsCard)
					      OpenEventsCard))
     OpenEventsCard)))

(NCP.GetCloseEventsCard
  (LAMBDA (NoteFile)                                         (* rht: " 8-Dec-86 21:31")

          (* * Find the close events card for the given notefile, creating a new one if necessary. Mark the card as not 
	  needing to be filed.)


    (LET ((CloseEventsCard (NCP.LookupCardByName (QUOTE CloseEventsCard)
						   NoteFile)))
         (if (NOT (NCP.ValidCardP CloseEventsCard))
	     then (SETQ CloseEventsCard (NCP.CreateCard (QUOTE List)
							      NoteFile "Close Events" T))
		    (NCP.MarkAsNotNeedingFiling CloseEventsCard)
		    (NCP.RegisterCardByName (QUOTE CloseEventsCard)
					      CloseEventsCard))
     CloseEventsCard)))

(NCP.MarkAsNotNeedingFiling
  (LAMBDA (Card)                                             (* rht: " 8-Dec-86 21:34")

          (* * Indicate on the card's prop list that it doesn't have to be filed.)


    (NCP.CardProp Card (QUOTE Don'tRequireFilingFlg)
		    T)))
)
(* * Change to NCCARDS)

(DEFINEQ

(NC.CardNeedsFilingP
  (LAMBDA (Card)                                             (* rht: " 8-Dec-86 22:47")

          (* * Returns non-nil if this card is filed in some not currently filed anywhere unless it's a top level card.
	  Assumes card is active.)



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



          (* * rht 10/6/86: Now checks for card types that don't have to be filed. Also makes sure that there's at least one 
	  filing link that's within this notefile.)



          (* * rht 12/8/86: Now checks for individual cards that don't require filing.)


    (LET ((NoteFile (fetch (Card NoteFile) of Card)))
         (AND (NOT (NC.TopLevelCardP Card))
		(NC.ForceFilingForCardTypeP (NC.FetchType Card))
		(NOT (NCP.CardProp Card (QUOTE Don'tRequireFilingFlg)))
		(for Link in (NC.FetchFromLinks Card)
		   never (AND (FMEMB (fetch (Link Label) of Link)
					   (QUOTE (FiledCard SubBox)))
				  (NC.SameNoteFileP NoteFile (fetch (Card NoteFile)
								  of (fetch (Link SourceCard)
									  of Link)))))))))
)
(* * New stuff for NCDATABASE)

(DEFINEQ

(NC.RunOpenEvents
  (LAMBDA (FileName NoteFile When)                           (* rht: " 8-Dec-86 21:55")

          (* * If When = AFTER then read and eval the OpenEvents card.)


    (SELECTQ When
	       (AFTER (OR (type? NoteFile NoteFile)
			    (SETQ NoteFile (NC.NoteFileFromFileName FileName)))
		      (LET ((OpenEventsCard (NCP.LookupCardByName (QUOTE OpenEventsCard)
								    NoteFile)))
		           (if (NCP.ValidCardP OpenEventsCard)
			       then (NC.EvaluateListCardSubstance OpenEventsCard 
								"Evaluating the Open Events card"))))
	       NIL)))

(NC.RunCloseEvents
  (LAMBDA (FileName NoteFile When)                           (* rht: " 8-Dec-86 21:54")

          (* * If When = AFTER then read and eval the CloseEvents card.)


    (SELECTQ When
	       (AFTER (OR (type? NoteFile NoteFile)
			    (SETQ NoteFile (NC.NoteFileFromFileName FileName)))
		      (LET ((CloseEventsCard (NCP.LookupCardByName (QUOTE CloseEventsCard)
								     NoteFile)))
		           (if (NCP.ValidCardP CloseEventsCard)
			       then (NC.EvaluateListCardSubstance CloseEventsCard 
							       "Evaluating the Close Events card"))))
	       NIL)))
)

(ADDTOVAR NC.OpenNoteFileFns NC.RunOpenEvents)

(ADDTOVAR NC.CloseNoteFileFns NC.RunCloseEvents)
(* * New function for NCLISTCARD)

(DEFINEQ

(NC.EvaluateListCardSubstance
  (LAMBDA (Card Message)                                     (* rht: " 8-Dec-86 21:51")

          (* * Evaluate the contents of a list card.)


    (if Message
	then (NC.PrintMsg NIL NIL Message))
    (ERSETQ (for Item in (NCP.CardSubstance Card) do (ERRORSET Item)))))
)
(PUTPROPS RHTPATCH168 COPYRIGHT ("Xerox Corporation" 1986))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1320 3070 (NCP.GetOpenEventsCard 1330 . 2048) (NCP.GetCloseEventsCard 2050 . 2781) (
NCP.MarkAsNotNeedingFiling 2783 . 3068)) (3101 4286 (NC.CardNeedsFilingP 3111 . 4284)) (4324 5608 (
NC.RunOpenEvents 4334 . 4962) (NC.RunCloseEvents 4964 . 5606)) (5755 6115 (
NC.EvaluateListCardSubstance 5765 . 6113)))))
STOP