TRUNCATE TABLE `help`;

INSERT INTO `help` (`HelpID`, `Topic`, `Category`, `Link`) VALUES
(1, 'Layout', 'General', 'manual/content/layout/overview.php'),
(2, 'Content', 'General', 'manual/content/content/types.php'),
(4, 'Schedule', 'General', 'manual/content/schedule/schedule_calendar.php'),
(5, 'Group', 'General', 'manual/content/users/groups.php'),
(6, 'Admin', 'General', 'manual/content/admin/settings.php'),
(7, 'Report', 'General', 'manual/content/admin/advanced.php'),
(8, 'Dashboard', 'General', 'manual/content/dashboard/dashboard.php'),
(9, 'User', 'General', 'manual/content/users/users.php'),
(10, 'Display', 'General', 'manual/content/admin/displays.php'),
(11, 'DisplayGroup', 'General', 'manual/content/admin/displays.php#Display_Group'),
(12, 'Layout', 'Add', 'manual/content/layout/addlayout.php'),
(13, 'Layout', 'Background', 'manual/content/layout/layoutdesigner.php#Background'),
(14, 'Content', 'Assign', 'manual/content/content/types.php'),
(15, 'Layout', 'RegionOptions', 'manual/content/layout/addregion.php'),
(16, 'Content', 'AddtoLibrary', 'manual/content/content/adding.php'),
(17, 'Display', 'Edit', 'manual/content/admin/displays.php#Display_Edit'),
(18, 'Display', 'Delete', 'manual/content/admin/displays.php#Display_Delete'),
(19, 'Displays', 'Groups', 'manual/content/admin/displays.php#Display_Group'),
(20, 'UserGroup', 'Add', 'manual/content/users/groups.php#Adding_Group'),
(21, 'User', 'Add', 'manual/content/users/users.php#Adding_User'),
(22, 'User', 'Delete', 'manual/content/users/users.php#Delete_User'),
(23, 'Content', 'Config', 'manual/content/admin/settings.php#Content'),
(24, 'LayoutMedia', 'Permissions', 'manual/content/layout/addlayout.php#Layout_Permission'),
(25, 'Region', 'Permissions', 'manual/content/layout/addregion.php#Region_Permissions'),
(26, 'Library', 'Assign', 'manual/content/layout/assigncontent.php#Add_From_Library'),
(27, 'Media', 'Delete', 'manual/content/content/types.php'),
(28, 'DisplayGroup', 'Add', 'manual/content/admin/displays.php#Display_Group'),
(29, 'DisplayGroup', 'Edit', 'manual/content/admin/displays.php#Display_Group'),
(30, 'DisplayGroup', 'Delete', 'manual/content/admin/displays.php#Display_Group'),
(31, 'DisplayGroup', 'Members', 'manual/content/admin/displays.php#Group_Members'),
(32, 'DisplayGroup', 'Permissions', 'manual/content/users/user_permissions.php'),
(34, 'Schedule', 'ScheduleNow', 'manual/content/schedule/schedule_now.php'),
(35, 'Layout', 'Delete', 'manual/content/layout/addlayout.php#Delete_Layout'),
(36, 'Layout', 'Copy', 'manual/content/layout/addlayout.php#Copy_Layout'),
(37, 'Schedule', 'Edit', 'manual/content/schedule/schedule_calendar.php'),
(38, 'Schedule', 'Add', 'manual/content/schedule/schedule_calendar.php'),
(39, 'Layout', 'Permissions', 'manual/content/layout/addregion.php#Region_Permissions'),
(40, 'Display', 'MediaInventory', 'manual/content/admin/displays.php#Media_Inventory'),
(41, 'User', 'ChangePassword', 'manual/content/dashboard/navbar.php#Navigation_Top'),
(42, 'Schedule', 'Delete', 'manual/content/schedule/schedule_event.htm'),
(43, 'Layout', 'Edit', 'manual/content/layout/addlayout.php#Edit_Layout'),
(44, 'Media', 'Permissions', 'manual/content/users/user_permissions.php'),
(45, 'Display', 'DefaultLayout', 'manual/content/admin/displays.php'),
(46, 'UserGroup', 'Edit', 'manual/content/users/groups.php#Edit_Group'),
(47, 'UserGroup', 'Members', 'manual/content/users/groups.php#Group_Member'),
(48, 'User', 'PageSecurity', 'manual/content/users/menu_page_security.php#Page_Security'),
(49, 'User', 'MenuSecurity', 'manual/content/users/menu_page_security.php#Menu_Security'),
(50, 'UserGroup', 'Delete', 'manual/content/users/groups.php#Delete_Group'),
(51, 'User', 'Edit', 'manual/content/users/users.php#Edit_User'),
(52, 'User', 'Applications', 'manual/content/users/menu_page_security.php'),
(53, 'User', 'SetHomepage', 'manual/content/dashboard/dashboard.php#Media_Dashboard'),
(54, 'DataSet', 'General', 'manual/content/layout/content_datasets.php'),
(55, 'DataSet', 'Add', 'manual/content/layout/content_datasets.php#Create_Dataset'),
(56, 'DataSet', 'Edit', 'manual/content/layout/content_datasets.php#Create_Dataset'),
(57, 'DataSet', 'Delete', 'manual/content/layout/content_datasets.php#Create_Dataset'),
(58, 'DataSet', 'AddColumn', 'manual/content/layout/content_datasets.php#Dataset_Column'),
(59, 'DataSet', 'EditColumn', 'manual/content/layout/content_datasets.php#Dataset_Column'),
(60, 'DataSet', 'DeleteColumn', 'manual/content/layout/content_datasets.php#Dataset_Column'),
(61, 'DataSet', 'Data', 'manual/content/layout/content_datasets.php#Dataset_Row'),
(62, 'DataSet', 'Permissions', 'manual/content/users/user_permissions.php'),
(63, 'Fault', 'General', 'manual/content/admin/advanced.php'),
(64, 'Report', 'General', 'manual/content/admin/advanced.php'),
(65, 'Stats', 'General', 'manual/content/admin/displays.php#Display_Statistic'),
(66, 'Resolution', 'General', 'manual/content/templates/template_resolution.php'),
(67, 'Template', 'General', 'manual/content/templates/overview.php'),
(68, 'Services', 'Register', 'manual/content/admin/api.php'),
(69, 'OAuth', 'General', 'manual/content/admin/api.php'),
(70, 'Services', 'Log', 'manual/content/admin/advanced.php'),
(71, 'Module', 'Edit', 'manual/content/admin/modules.php'),
(72, 'Module', 'General', 'manual/content/admin/modules.php'),
(73, 'Campaign', 'General', 'manual/content/layout/campaign_layout.php'),
(74, 'License', 'General', 'manual/content/license/licenses.php'),
(75, 'DataSet', 'ViewColumns', 'manual/content/layout/content_datasets.php#Dataset_Column'),
(76, 'Campaign', 'Permissions', 'manual/content/layout/addlayout.php#Layout_Permission'),
(77, 'Transition', 'Edit', 'manual/content/transitions/transitions.php#Edit');

ALTER TABLE  `menuitem` ADD  `External` TINYINT NOT NULL DEFAULT '0';

UPDATE `menuitem` SET External = 1 WHERE Class = 'help_button' AND PageID = (SELECT PageID FROM `pages` WHERE name = 'manual');

UPDATE `version` SET `app_ver` = '1.5.0', `XmdsVersion` = 3;
UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE';
UPDATE `version` SET `DBVersion` = '61';
