<MvCOMMENT>
|
| Miva Merchant v4.x
|
| This file and the source codes contained herein are the property
| of Miva Corporation.  Use of this file is restricted to the specific
| terms and conditions in the License Agreement associated with this
| file.  Distribution of this file or portions of this file for uses
| not covered by the License Agreement is not allowed without a written
| agreement signed by an officer of Miva Corporation.
|
| Copyright 1998-2001 Miva Corporation.  All rights reserved.
| http://www.miva.com/
|
| Miva Merchant Provisionable Notes
| $Source: /home/cvs/merchant/Merchant/features/not/not_ad.mv,v $
|
| Prefix         : MER-NOT-
| Next Error Code: 2    
| Next Text ID   : 20   
|
</MvCOMMENT>

<MvCOMMENT>
|
| Insert Note
|
</MvCOMMENT>

<MvFUNCTION NAME = "Screen_Domain_Note" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ Find_NoteID( g.Note_ID ) }">

	<MvIF EXPR = "{ l.ok }">

	<HEAD>
		<TITLE><MvEVAL EXPR = "{ Notes.d.label }"></TITLE>
		
		<MvIF EXPR = "{ g.Secure }">
			<BASE HREF = "{ g.secure_baseurl }">
		<MvELSE>
			<BASE HREF = "{ g.baseurl }">
		</MvIF>
	</HEAD>
	
	<BODY BGCOLOR = "#ffffff">
	<SCRIPT LANGUAGE = "JavaScript">
<!--
function Close_Note()
{
	window.close();
}
//-->
	</SCRIPT>

		<MvEVAL EXPR = "{ Notes.d.note }">

		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD VALIGN = "bottom" ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<FORM ACTION = "{ g.sessionurl }" METHOD = "POST">
						<INPUT TYPE = "hidden" NAME = "Action" VALUE = "DLDN">
						<INPUT TYPE = "hidden" NAME = "Screen" VALUE = "DLDN">
						<INPUT TYPE = "hidden" NAME = "Note_ID" VALUE = "{ g.Note_ID }">
						<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00006">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<INPUT TYPE = "submit" NAME = "DLDN" VALUE = "{ l.text }">
					</FORM>
				</FONT>
			</TD><TD VALIGN = "bottom" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-NOT-00001">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">
						<FORM>
							<INPUT TYPE = "button" VALUE = "Close" ONCLICK = "Close_Note();">
						</FORM>
					</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD></TR>
		</TABLE>
	</MvIF>

	</BODY>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Store_Note" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<HEAD><TITLE>
		<MvLOCALIZED ID = "MER-NOT-00007">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Notifications</MvLOCALIZED-TEXT>
		</MvLOCALIZED></TITLE>

		<MvIF EXPR = "{ g.Secure }">
			<BASE HREF = "{ g.secure_baseurl }">
		<MvELSE>
			<BASE HREF = "{ g.baseurl }">
		</MvIF>
	</HEAD>

	<BODY BGCOLOR = "#ffffff">
	<SCRIPT LANGUAGE = "JavaScript">
<!--
function Close_Note()
{
	window.close();
}
//-->
	</SCRIPT>

	<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ Find_StoreNoteID( g.Note_ID ) }">

	<MvIF EXPR = "{ l.ok }">
		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD ALIGN = "left" NOWRAP>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
				<MvLOCALIZED ID = "MER-NOT-00002">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Store Notifications:</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</B></FONT>
			</TD><TD ALIGN = "left" VALIGN = "middle" WIDTH = 100%>
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ StoreNotes.d.label }">
				</FONT>
			</TD></TR>
		</TABLE>

		<TABLE BORDER = 0 CELLPADDING = 5 CELLSPACING = 0 WIDTH = "100%">
			<TR><TD COLSPAN = 2>
				&nbsp;
			</TD></TR>

			<TR><TD ALIGN = "left" VALIGN = "top">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvEVAL EXPR = "{ StoreNotes.d.note }">
				</FONT>
			</TD></TR>

			<TR><TD>
				&nbsp;
			</TD></TR>

			<TR><TD VALIGN = "bottom" ALIGN = "left">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
					<FORM ACTION = "{ g.sessionurl }" METHOD = "POST">
						<INPUT TYPE = "hidden" NAME = "Action" VALUE = "DLNT">
						<INPUT TYPE = "hidden" NAME = "Screen" VALUE = "DLNT">
						<INPUT TYPE = "hidden" NAME = "Note_ID" VALUE = "{ g.Note_ID }">
						<INPUT TYPE = "hidden" NAME = "Store_Code" VALUE = "{ g.Store_Code }">
						<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00008">
							<MvLOCALIZED-TEXT LANGUAGE = "en-US">Delete</MvLOCALIZED-TEXT>
						</MvLOCALIZED>
						<INPUT TYPE = "submit" NAME = "DLNT" VALUE = "{ l.text }">
					</FORM>
				</FONT>
			</TD><TD VALIGN = "bottom" ALIGN = "right">
				<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-NOT-00003">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">
						<FORM>
							<INPUT TYPE = "button" VALUE = "Close" ONCLICK = "Close_Note();">
						</FORM>
					</MvLOCALIZED-TEXT>
				</MvLOCALIZED>
				</FONT>
			</TD></TR>
		</TABLE>
	</MvIF>

	</BODY>
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Deleted_Note" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "NoteSettings_Validate" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "g.Domain_NoteSettings_PollURL" VALUE = "{ ltrim( rtrim( g.Domain_NoteSettings_PollURL ) ) }">

	<MvIF EXPR = "{ len( g.Domain_NoteSettings_PollURL ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error_msg" ID = "MER-NOT-00009">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">Please enter the URL to Notification Server</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Admin }" NAME = "l.valid" VALUE = "{ FieldError( 'NOTS', 'Domain_NoteSettings_PollURL', l.error_msg ) }">
		<MvFUNCTIONRETURN VALUE = 0>
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>

<MvFUNCTION NAME = "Notification_Settings_Tab" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvFUNCTIONRETURN VALUE = "{ 'NOTS:Notification Settings' }">
</MvFUNCTION>

<MvFUNCTION NAME = "Screen_Notification_Settings" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ g.Load_Fields }">
		<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ _DB_Open_NotificationSettings() }">
		<MvIF EXPR = "{ l.ok }">
			<MvASSIGN NAME = "g.Domain_NoteSettings_Security" VALUE = "{ RemoteNotificationSettings.d.security }">
			<MvASSIGN NAME = "g.Domain_NoteSettings_Updates" VALUE = "{ RemoteNotificationSettings.d.updates }">
			<MvASSIGN NAME = "g.Domain_NoteSettings_Offers" VALUE = "{ RemoteNotificationSettings.d.offers }">
			<MvASSIGN NAME = "g.Domain_NoteSettings_Poll" VALUE = "{ RemoteNotificationSettings.d.poll }">
			<MvASSIGN NAME = "g.Domain_NoteSettings_PollURL" VALUE = "{ RemoteNotificationSettings.d.pollurl }">
		</MvIF>
	</MvIF>

	<MvIF EXPR = "{ g.Tab EQ 'NOTS' }">
		<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 0 WIDTH = "100%">
		<TR><TD NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1"><B>
			<MvLOCALIZED ID = "MER-NOT-00010">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">URL To Notification Server:</MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</B></FONT>
		</TD><TD WIDTH = "100%">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<INPUT TYPE = "text" SIZE = 40 NAME = "Domain_NoteSettings_PollURL" VALUE = "{ encodeentities( g.Domain_NoteSettings_PollURL ) }">
			</FONT>
		</TD></TR>

		<TR><TD COLSPAN = "2">
			&nbsp;
		</TD></TR>

		<TR><TD ALIGN = "left" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED ID = "MER-NOT-00011">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>Display:</B></MvLOCALIZED-TEXT>
				</MvLOCALIZED>
			</FONT>
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00012">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Security Alerts</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Domain_NoteSettings_Security, 'Domain_NoteSettings_Security', 'Yes', l.text ) }">
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left" NOWRAP>
			&nbsp;
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00013">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Software Updates/Upgrades</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Domain_NoteSettings_Updates, 'Domain_NoteSettings_Updates', 'Yes', l.text ) }">
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left" NOWRAP>
			&nbsp;
		</TD><TD ALIGN = "left">
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00014">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US">Special Offers</MvLOCALIZED-TEXT>
			</MvLOCALIZED>

			<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawCheckbox( g.Domain_NoteSettings_Offers, 'Domain_NoteSettings_Offers', 'Yes', l.text ) }">
			</FONT>
		</TD></TR>

		<TR><TD COLSPAN = "2">
			&nbsp;
		</TD></TR>

		<TR><TD ALIGN = "left" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
			<MvLOCALIZED ID = "MER-NOT-00015">
				<MvLOCALIZED-TEXT LANGUAGE = "en-US"><B>Check for Notifications:</B></MvLOCALIZED-TEXT>
			</MvLOCALIZED>
			</FONT>
		</TD><TD ALIGN = "left" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00016">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">At Every Login</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawRadio( 'Domain_NoteSettings_Poll', 'L', g.Domain_NoteSettings_Poll, l.text ) }">
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left" NOWRAP>
			&nbsp;
		</TD><TD ALIGN = "left" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00017">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Daily</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawRadio( 'Domain_NoteSettings_Poll', 'D', g.Domain_NoteSettings_Poll, l.text ) }">
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left" NOWRAP>
			&nbsp;
		</TD><TD ALIGN = "left" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00018">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Weekly</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawRadio( 'Domain_NoteSettings_Poll', 'W', g.Domain_NoteSettings_Poll, l.text ) }">
			</FONT>
		</TD></TR>

		<TR><TD ALIGN = "left" NOWRAP>
			&nbsp;
		</TD><TD ALIGN = "left" NOWRAP>
			<FONT FACE = "Arial, Helvetica" SIZE = "-1">
				<MvLOCALIZED NAME = "l.text" ID = "MER-NOT-00019">
					<MvLOCALIZED-TEXT LANGUAGE = "en-US">Never</MvLOCALIZED-TEXT>
				</MvLOCALIZED>

				<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.foo" VALUE = "{ DrawRadio( 'Domain_NoteSettings_Poll', 'N', g.Domain_NoteSettings_Poll, l.text ) }">
			</FONT>
		</TD></TR>

		</TABLE>
	<MvELSE>
		<MvHIDE FIELDS = "g.Domain_NoteSettings_Poll, g.Domain_NoteSettings_PollURL, g.Domain_NoteSettings_Offers, g.Domain_NoteSettings_Updates, g.Domain_NoteSettings_Security">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "NOT_FindCurrent_Notes" PARAMETERS = "check_now" ERROROUTPUTLEVEL = "syntax, expression" STANDARDOUTPUTLEVEL = "text,html,debug">

	<MvASSIGN NAME = "l.ok" VALUE = "1">
	<MvASSIGN NAME = "l.type" VALUE = "">
	
	<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ _DB_Open_NotificationSettings() }">
	
	
	<MvIF EXPR = "{ l.ok }">
		<MvASSIGN NAME = "l.check_notifications" VALUE = "">
	
		<MvIF EXPR = "{ l.check_now }">
			<MvASSIGN NAME = "l.check_notifications" VALUE = "1">
		<MvELSE>
			<MvIF EXPR = "{ RemoteNotificationSettings.d.poll EQ 'L' }">
				<MvASSIGN NAME = "l.check_notifications" VALUE = "1">
			</MvIF>
			<MvIF EXPR = "{ RemoteNotificationSettings.d.poll EQ 'D' }">
				<MvASSIGN NAME = "l.lastpoll_day" VALUE = "{ time_t_dayofyear( RemoteNotificationSettings.d.lastpoll, timezone()  ) }">
				<MvASSIGN NAME = "l.current_day" VALUE = "{ time_t_dayofyear( s.time_t, timezone()  ) }">
				
				<MvIF EXPR = "{ l.lastpoll_day NE l.current_day }">
					<MvASSIGN NAME = "l.check_notifications" VALUE = "1">
				</MvIF>
			</MvIF>
			<MvIF EXPR = "{ RemoteNotificationSettings.d.poll EQ 'W' }">
				<MvASSIGN NAME = "l.nextpoll_time" VALUE = "{ RemoteNotificationSettings.d.lastpoll + 604800 }">
				<MvASSIGN NAME = "l.nextpoll_year" VALUE = "{ time_t_year( l.nextpoll_time, timezone()  ) }">
				<MvASSIGN NAME = "l.current_year" VALUE = "{ time_t_year( s.time_t, timezone()  ) }">
				
				<MvIF EXPR = "{ (l.current_year GT l.nextpoll_year) }"> 
					<MvASSIGN NAME = "l.check_notifications" VALUE = "1">
				<MvELSE>
					<MvASSIGN NAME = "l.nextpoll_day" VALUE = "{ time_t_dayofyear( l.nextpoll_time, timezone()  ) }">
					<MvASSIGN NAME = "l.current_day" VALUE = "{ time_t_dayofyear( s.time_t, timezone()  ) }">
					<MvIF EXPR = "{ (l.current_year EQ l.nextpoll_year) AND (l.current_day GE l.nextpoll_day) }">
						<MvASSIGN NAME = "l.check_notifications" VALUE = "1">				
					</MvIF>
				</MvIF>
			</MvIF>
		</MvIF>
		
		<MvIF EXPR = "{ l.check_notifications }">
			<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ NoteSettings_UpdateLastPoll( s.time_t ) }">				

			<MvIF EXPR = "{ RemoteNotificationSettings.d.security }">
				<MvASSIGN NAME = "l.type" VALUE = "S">
			</MvIF>
			
			<MvIF EXPR = "{ RemoteNotificationSettings.d.updates }">
				<MvASSIGN NAME = "l.type" VALUE = "{ l.type $ 'U' }">
			</MvIF>

			<MvIF EXPR = "{ RemoteNotificationSettings.d.offers }">
				<MvASSIGN NAME = "l.type" VALUE = "{ l.type $ 'O' }">
			</MvIF>

			<MvIF EXPR = "{ len( l.type ) GT 0 }">
				<MvASSIGN NAME = "l.titlevalue" 	VALUE = 0>
				<MvASSIGN NAME = "l.bodyvalue" 		VALUE = 0>
				<MvASSIGN NAME = "l.disp_type" 		VALUE = 0>
				<MvASSIGN NAME = "l.inamessage" 	VALUE = 0>
				<MvASSIGN NAME = "l.date_stamp" 	VALUE = 0>
				<MvASSIGN NAME = "l.greatest_time"  VALUE = 0>

				<MvASSIGN NAME = "NOTIFY_TYPE" VALUE = "{ l.type }">
				<MvASSIGN NAME = "NOTIFY_LAST" VALUE = "{ RemoteNotificationSettings.d.lastreply }">
				<MvASSIGN NAME = "OPERATIONS" VALUE = "NOTIFY">

				<MIVA MvCALL_ERROR = "nonfatal, nodisplay">
				<MvCALL METHOD = "POST"
						ACTION = "{ RemoteNotificationSettings.d.pollurl }"
						FIELDS = "NOTIFY_TYPE, NOTIFY_LAST, OPERATIONS">
						
						<MvIF EXPR = "{ s.callobjectelement EQ 'message' }">
							<MvASSIGN NAME = "l.pos" VALUE = 1>
							<MvWHILE EXPR = "{ l.pos LE s.callobjectnumattributes }">
								<MvIF EXPR = "{ tolower( s.callobjectattribute[ l.pos ] ) EQ 'type' }">
									<MvASSIGN NAME = "l.disp_type" VALUE = "{ s.callobjectvalue[ l.pos ] }">
								</MvIF>
							
								<MvIF EXPR = "{ tolower( s.callobjectattribute[ l.pos ] ) EQ 'dtstamp' }">
									<MvASSIGN NAME = "l.date_stamp" VALUE = "{ s.callobjectvalue[ l.pos ] }">
								</MvIF>

								<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
							</MvWHILE>

							<MvASSIGN NAME = "l.inamessage" VALUE = 1>
						</MvIF>
						
						<MvIF EXPR = "{ l.inamessage }">
							<MvIF EXPR = "{ tolower( s.callobjectelement ) EQ 'title' }">
								<MvASSIGN NAME = "l.intitle" VALUE = 1>
							</MvIF>

							<MvIF EXPR = "{ tolower( s.callobjectelement ) EQ '/title' }">
								<MvASSIGN NAME = "l.intitle" VALUE = 0>
							</MvIF>

							<MvIF EXPR = "{ tolower( s.callobjecttype ) EQ 'text' }">
								<MvIF EXPR = "{ l.intitle }">
									<MvASSIGN NAME = "l.titlevalue" VALUE = "{ decodeentities( s.callvalue ) }">
								</MvIF>
							</MvIF>

							<MvIF EXPR = "{ tolower( s.callobjectelement ) EQ 'body' }">
								<MvASSIGN NAME = "l.inbody" VALUE = 1>
							</MvIF>

							<MvIF EXPR = "{ tolower( s.callobjectelement ) EQ '/body' }">
								<MvASSIGN NAME = "l.inbody" VALUE = 0>
							</MvIF>

							<MvIF EXPR = "{ tolower( s.callobjecttype ) EQ 'text' }">
								<MvIF EXPR = "{ l.inbody }">
									<MvASSIGN NAME = "l.bodyvalue" VALUE = "{ decodeentities( s.callvalue ) }">
								</MvIF>
							</MvIF>
						</MvIF>
						
						<MvIF EXPR = "{ s.callobjectelement EQ '/message' }">
							<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ Notes_Insert( l.titlevalue, l.bodyvalue ) }">

							<MvIF EXPR = "{ ( l.date_stamp GT l.greatest_time ) AND l.ok }">
								<MvASSIGN NAME = "l.greatest_time" VALUE = "{ l.date_stamp }">
							</MvIF>

							<MvASSIGN NAME = "l.titlevalue" VALUE = "0">
							<MvASSIGN NAME = "l.bodyvalue" VALUE = "0">
							<MvASSIGN NAME = "l.type" VALUE = 0>
							<MvASSIGN NAME = "l.inamessage" VALUE = 0>
						</MvIF>
				</MvCALL>

				<MvIF EXPR = "{ l.ok AND ( l.greatest_time GT 0 ) }">
					<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ NoteSettings_UpdateLastReply( l.greatest_time ) }">				
				</MvIF>
			</MvIF>
		</MvIF>
	</MvIF>	
	
	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Delete_DomainNote" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ Find_NoteID( g.Note_ID ) }">
	<MvIF EXPR = "{ l.ok }">
		<MvIF EXPR = "{ g.Admin_User_Administrator }">
			<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ Note_Delete( g.Note_ID ) }">			
		</MvIF>
	</MvIF>

	<SCRIPT LANGUAGE = "JavaScript">
<!--
		opener.location.reload();

		window.close();
//-->
	</SCRIPT>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "Action_Delete_StoreNote" STANDARDOUTPUTLEVEL = "text,html,compresswhitespace">
	<MvASSIGN NAME = "l.ok" VALUE = 1>

	<MvIF EXPR = "{ ( g.Admin_User_Administrator ) OR ( Stores.d.manager_id EQ g.Admin_User_ID ) }">
		<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ StoreNotes_Delete( g.Note_ID ) }">
	</MvIF>

	<SCRIPT LANGUAGE = "JavaScript">
<!--
		opener.location.reload();

		window.close();
//-->
	</SCRIPT>
	
	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "NOT_Provision_Add_Note" PARAMETERS = "version, store_code, delimiter, data" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "l.ok" VALUE = "1">

	<MvASSIGN NAME = "l.pos" VALUE = "1">
	<MvASSIGN NAME = "l.label" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	<MvASSIGN NAME = "l.pos" VALUE = "{ l.pos + 1 }">
	<MvASSIGN NAME = "l.note" VALUE = "{ ltrim( rtrim( gettoken( l.data, l.delimiter, l.pos ) ) ) }">
	
	<MvIF EXPR = "{ len( l.label ) EQ 0 }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-NOT-00004">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">'Label' is required</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-00000', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "{ l.ok }">
	</MvIF>

	<MvIF EXPR = "{ len( l.note ) EQ 0  }">
		<MvLOCALIZED NAME = "l.error" ID = "MER-NOT-00005">
			<MvLOCALIZED-TEXT LANGUAGE = "en-US">'Note' is required</MvLOCALIZED-TEXT>
		</MvLOCALIZED>
		<MvDO FILE = "{ g.Module_Library_Utilities }" NAME = "l.ok" VALUE = "{ Error( 'MER-NOT-00001', l.error ) }">
		<MvFUNCTIONRETURN VALUE = "{ l.ok }">
	</MvIF>
	
	<MvIF EXPR = "{ len( l.store_code ) EQ 0 }">
		<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ Notes_Insert( l.label, l.note) }">
	<MvELSE>
		<MvDO FILE = "{ g.Feature_Filename_NOT_DB }" NAME = "l.ok" VALUE = "{ StoreNotes_Insert( l.store_code, l.label, l.note) }">
	</MvIF>

	<MvFUNCTIONRETURN VALUE = "{ l.ok }">
</MvFUNCTION>

<MvFUNCTION NAME = "NOT_Upgrade_Setup_State" STANDARDOUTPUTLEVEL = "">
	<MvCOMMENT>
	|
	| rn_set.dbf
	|
	| 4.10: Added "Remote Notification Settings" advanced feature for Notification system
	|
	</MvCOMMENT>

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Domain_DB_New_Insert( 4.10, 'rn_set.dbf',
											'security	BOOL,
											 updates	BOOL,
											 offers		BOOL,
											 o_lupdate	CHAR( 10 ),
											 poll		CHAR( 1 ),
											 lastpoll	NUMBER,
											 lastreply	NUMBER,
											 pollurl	CHAR( 254 )' ) }">

	<MvCOMMENT>
	|
	| notes.dbf
	| *********************************************************************************************
	|
	| 4.00: Created
	|
	</MvCOMMENT>

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Domain_DB_New_Insert( 4.00, 'notes.dbf',
								'id 			NUMBER,
								 label		CHAR( 100 ),
								 scode		CHAR( 50 ),
								 note		MEMO' ) }">

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Domain_DB_Change_Insert( 4.10, 'notes.dbf',
								'id 			NUMBER,
								 label		CHAR( 100 ),
								 note		MEMO' ) }">

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Domain_DB_Index_Insert( 4.00, 'Notes', 'notes.dbf', 'note_id.mvx', 'Notes.d.id', 'unique, ascending' ) }">

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Domain_Key_New_Insert( 4.00, 'Notes', 1 ) }">

	<MvCOMMENT>
	|
	| snotes.dbf
	| *********************************************************************************************
	|
	| 4.00: Created
	|
	</MvCOMMENT>

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Store_DB_New_Insert( 4.00, 'snotes.dbf',
								'id 			NUMBER,
								 scode		CHAR( 50 ),
								 label		CHAR( 100 ),
								 note		MEMO' ) }">
	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Store_DB_Index_Insert( 4.00, 'StoreNotes', 'snotes.dbf', 'snote_id.mvx', 'StoreNotes.d.id', 'unique, ascending' ) }">

	<MvDO FILE = "{ g.Module_Upgrade }" NAME = "l.null" VALUE = "{ Store_Key_New_Insert( 4.00, 'StoreNotes', 1 ) }">
</MvFUNCTION>

<MvFUNCTION NAME = "NOT_Upgrade_Domain_DB_New_NoteSettings" PARAMETERS = "sec, upd, off, poll" STANDARDOUTPUTLEVEL = "">
	<MvASSIGN NAME = "Temporary.d.security"	VALUE = "{ l.sec }">
	<MvASSIGN NAME = "Temporary.d.updates"	VALUE = "{ l.upd }">
	<MvASSIGN NAME = "Temporary.d.offers"	VALUE = "{ l.off }">
	<MvASSIGN NAME = "Temporary.d.poll"	VALUE = "{ l.poll }">
	<MvASSIGN NAME = "Temporary.d.pollurl"	VALUE = "http://licensemgr.miva.com/gateway/gateway.mv">

	<MvADD NAME = "Temporary">

	<MvFUNCTIONRETURN VALUE = 1>
</MvFUNCTION>

<MvFUNCTION NAME = "NOT_Upgrade_Domain_DB_Change_Notes">
	<MvASSIGN NAME = "Temporary.d.id" VALUE = "{ Original.d.id }">
	<MvASSIGN NAME = "Temporary.d.label" VALUE = "{ Original.d.label }">
	<MvASSIGN NAME = "Temporary.d.note" VALUE = "{ Original.d.note }">

	<MvADD NAME = "Temporary">
	
	<MvFUNCTIONRETURN VALUE = "1">
</MvFUNCTION>
