<!---
/*========================================================================================================================================
 
Name script: Update the default field's value
Fogbugz: RR-79 Eliminate default start/end time for new event
 
Description: This script will update the default value to the OldFieldname on EventsFields table.
 
Table: [dbo].[EventsField]
Field: [OldFieldName] (New value = '') for FieldName = 'StartDayTime' and 'EndDayTime'
 
Fogbugz: 9244 - RR-83 Contextual help message for menu widget is incorrect 
 
========================================================================================================================================*/
--->

<cfif form.Type EQ "Patch">
        <cfinclude template="patch_14.0.06.cfm">
</cfif>


<cfquery datasource="#application.config.DSN#">

declare @appTypeID int, @assetID int,
		@tableName4 varchar(255), @FieldName varchar(250)

select @appTypeID = AppTypeID from ApplicationType where link like '%calendar%'

select top 1 @assetID = AssetID from Asset where title like '%Calendar%' and baseAssetID is NULL and ParentSiteID is NULL order by AssetID desc

select @tableName4 = TableName4 from Application where AppID = @assetID

IF (EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = @tableName4))
	begin
		set @FieldName = 'StartDayTime'
		exec('update ' + @tableName4 + ' set OldFieldName = '''' where FieldName = ''' + @FieldName + '''')

		set @FieldName = 'EndDayTime'
		exec('update ' + @tableName4 + ' set OldFieldName = '''' where FieldName = ''' + @FieldName + '''')
	end	

else
	print 'the table' + @tableName4 + 'does not exist'


/*  Fogbugz: 9244 - RR-83 Contextual help message for menu widget is incorrect */        
UPDATE WidgetType
SET WidgetTypeDesc = 'Creates a menu widget available for all users. Used to display quick links to internal and external resources.'
WHERE WidgetSectionID = 6 and WidgetTypeTitle = 'Menu'

</cfquery>