INSERT INTO `ie_zz_SettingsCategory` (`id`, `name`, `system`, `sorter`) VALUES (8, 'Applications Portal', 'n', '7');

INSERT INTO `ie_zz_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('applicationUserRegistrationEmailHeader', 8, 'header', '', 'Applicant Password Notification Email Template', '', '', 'n', 'n', 10, NOW(), NOW()),
('applicationUserRegistrationEmailFrom', 8, 'text', 'From Email Address', '', '', '', 'y', 'n', 20, NOW(), NOW()),
('applicationUserRegistrationEmailSubject', 8, 'text', 'Subject', '', '', '', 'y', 'n', 30, NOW(), NOW()),
('applicationUserRegistrationEmailBody', 8, 'HtmlEditor', 'Message Body', '', '', 'Constants: {schoolName} {name} {position} {phone} {email} {password} {link}', 'y', 'n', 40, NOW(), NOW());

INSERT INTO `ie_zz_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`) VALUES
(NULL, 'applicationUserRegistrationEmailBody', 'scriptOptions[Config][EnterMode]', 'br', 'string'),
(NULL, 'applicationUserRegistrationEmailBody', 'height', '200', 'int'),
(NULL, 'applicationUserRegistrationEmailBody', 'mode', 'view', 'string'),
(NULL, 'applicationUserRegistrationEmailBody', 'toolbarSet', 'Basic', 'string');

INSERT INTO `ie_zz_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('appUserForgotPasswordEmailHeader', 8, 'header', '', 'Applcant \"Forgot Password\" Email Template', '', '', 'n', 'n', 90, '2010-09-13 15:54:08', '2010-09-13 15:54:08'),
('appUserForgotPasswordEmailSubject', 8, 'text', 'Subject', 'Recovery account password at improvek-12education.org', '', '', 'y', 'n', 100, '2010-09-13 15:54:08', '2021-01-27 12:26:57'),
('appUserForgotPasswordEmailFrom', 8, 'text', 'From Email Address', 'Friends of Education <info@improvek-12education.org>', '', '', 'y', 'n', 120, '2010-09-13 15:54:08', '2021-01-27 12:26:57'),
('appUserForgotPasswordEmailBody', 8, 'HtmlEditor', 'Message Body', '<div style=\"font-family: Arial,Helvetica,sans-serif\">\r\n<p>Here is the new password your requested to login to the Authorized School Login section of www.improvek-12education.org. To activate it, please click below.</p>\r\n\r\n<p>Email Address: <strong>{email}</strong><br />\r\nNew Password: <strong>{newPassword}</strong><br />\r\nExpiration date for activation: <strong>{recoverCodeExpirationDate}</strong></p>\r\n\r\n<p>To activate your new password click <a href=\"{link}\" target=\"_blank\">here</a>..</p>\r\n</div>\r\n', '', 'Constants: {name} {email} {newPassword} {recoverCodeExpirationDate} {link}', 'y', 'n', 130, '2010-09-13 15:54:08', '2021-01-27 12:26:57');

INSERT INTO `ie_zz_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`) VALUES
(NULL, 'appUserForgotPasswordEmailBody', 'scriptOptions[Config][EnterMode]', 'br', 'string'),
(NULL, 'appUserForgotPasswordEmailBody', 'height', '200', 'int'),
(NULL, 'appUserForgotPasswordEmailBody', 'mode', 'view', 'string'),
(NULL, 'appUserForgotPasswordEmailBody', 'toolbarSet', 'Basic', 'string');

INSERT INTO `ie_zz_DPageHandler` (`name`, `title`, `sorter`) VALUES
('applicant', 'Applicant Page', 4),
('applicantLogin', 'Applicant Login Page', 5);

INSERT INTO `ie_zz_DPageItemType` (`id`, `type`, `title`, `sorter`) VALUES
(NULL, 'Application_User_Login_', 'Applicant Login Form', 500),
(NULL, 'Application_User_Logout_', 'Applicant Logout', 510),
(NULL, 'Application_User_ForgotPassword_', 'Applicant \"Forgot Password\" Form', 520);

INSERT INTO `ie_zz_DPageItemType` (`id`, `type`, `title`, `sorter`)
VALUES (NULL, 'Application_Document_', 'Application Documents', 530);

UPDATE `ie_zz_Settings` set sorter = sorter + 50 WHERE idCategory = 8;

INSERT INTO `ie_zz_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('applicationDeadlineDate', 8, 'date', 'Application Deadline Date', '2021-09-30', '', '', 'y', 'n', 20, NOW(), NOW()),
('applicationEnableApplicants', 8, 'checkbox', 'Allow Applicants Longin', 'y', '', '', 'n', 'n', 30, NOW(), NOW()),
('applicationEnableReviewers', 8, 'checkbox', 'Allow Reviewers Longin', 'y', '', '', 'n', 'n', 40, NOW(), NOW());

INSERT INTO `ie_zz_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`) VALUES
(NULL, 'applicationEnableApplicants', 'decoration', 'simple', 'string'),
(NULL, 'applicationEnableReviewers', 'decoration', 'simple', 'string');

INSERT INTO `ie_zz_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('applicationDeadlineNotice', 8, 'HtmlEditor', 'Application Deadline Notice', '', '', 'Constants: {deadlineDate}', 'n', 'n', 25, NOW(), NOW());

INSERT INTO `ie_zz_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`) VALUES
(NULL, 'applicationDeadlineNotice', 'scriptOptions[Config][EnterMode]', 'br', 'string'),
(NULL, 'applicationDeadlineNotice', 'height', '200', 'int'),
(NULL, 'applicationDeadlineNotice', 'mode', 'view', 'string'),
(NULL, 'applicationDeadlineNotice', 'toolbarSet', 'Basic', 'string');

INSERT INTO `ie_zz_DPageItemType` (`id`, `type`, `title`, `sorter`) VALUES
(NULL, 'Application_DeadlineNotice_', 'Application Deadline Notice', 540);

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

INSERT INTO `ie_zz_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('applicationReviewerRegistrationEmailHeader', 8, 'header', '', 'Reviewer Password Notification Email Template', '', '', 'n', 'n', 600, NOW(), NOW()),
('applicationReviewerRegistrationEmailFrom', 8, 'text', 'From Email Address', '', '', '', 'y', 'n', 610, NOW(), NOW()),
('applicationReviewerRegistrationEmailSubject', 8, 'text', 'Subject', '', '', '', 'y', 'n', 620, NOW(), NOW()),
('applicationReviewerRegistrationEmailBody', 8, 'HtmlEditor', 'Message Body', '', '', 'Constants: {name} {phone} {email} {password} {link}', 'y', 'n', 630, NOW(), NOW());

INSERT INTO `ie_zz_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`) VALUES
(NULL, 'applicationReviewerRegistrationEmailBody', 'scriptOptions[Config][EnterMode]', 'br', 'string'),
(NULL, 'applicationReviewerRegistrationEmailBody', 'height', '200', 'int'),
(NULL, 'applicationReviewerRegistrationEmailBody', 'mode', 'view', 'string'),
(NULL, 'applicationReviewerRegistrationEmailBody', 'toolbarSet', 'Basic', 'string');

INSERT INTO `ie_zz_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('appReviewerForgotPasswordEmailHeader', 8, 'header', '', 'Reviewer \"Forgot Password\" Email Template', '', '', 'n', 'n', 700, '2010-09-13 15:54:08', '2010-09-13 15:54:08'),
('appReviewerForgotPasswordEmailSubject', 8, 'text', 'Subject', 'Recovery account password at improvek-12education.org', '', '', 'y', 'n', 710, '2010-09-13 15:54:08', '2021-01-27 12:26:57'),
('appReviewerForgotPasswordEmailFrom', 8, 'text', 'From Email Address', 'Friends of Education <info@improvek-12education.org>', '', '', 'y', 'n', 720, '2010-09-13 15:54:08', '2021-01-27 12:26:57'),
('appReviewerForgotPasswordEmailBody', 8, 'HtmlEditor', 'Message Body', '<div style=\"font-family: Arial,Helvetica,sans-serif\">\r\n<p>Here is the new password your requested to login to the Authorized School Login section of www.improvek-12education.org. To activate it, please click below.</p>\r\n\r\n<p>Email Address: <strong>{email}</strong><br />\r\nNew Password: <strong>{newPassword}</strong><br />\r\nExpiration date for activation: <strong>{recoverCodeExpirationDate}</strong></p>\r\n\r\n<p>To activate your new password click <a href=\"{link}\" target=\"_blank\">here</a>..</p>\r\n</div>\r\n', '', 'Constants: {name} {email} {newPassword} {recoverCodeExpirationDate} {link}', 'y', 'n', 730, '2010-09-13 15:54:08', '2021-01-27 12:26:57');

INSERT INTO `ie_zz_SettingsOptions` (`id`, `name`, `variable`, `value`, `type`) VALUES
(NULL, 'appReviewerForgotPasswordEmailBody', 'scriptOptions[Config][EnterMode]', 'br', 'string'),
(NULL, 'appReviewerForgotPasswordEmailBody', 'height', '200', 'int'),
(NULL, 'appReviewerForgotPasswordEmailBody', 'mode', 'view', 'string'),
(NULL, 'appReviewerForgotPasswordEmailBody', 'toolbarSet', 'Basic', 'string');

INSERT INTO `ie_zz_DPageHandler` (`name`, `title`, `sorter`) VALUES
('reviewer', 'Reviewer Page', 6),
('reviewerLogin', 'Reviewer Login Page', 7);

INSERT INTO `ie_zz_DPageItemType` (`id`, `type`, `title`, `sorter`) VALUES
(NULL, 'Application_Reviewer_Login_', 'Reviewer Login Form', 600),
(NULL, 'Application_Reviewer_Logout_', 'Reviewer Logout', 610),
(NULL, 'Application_Reviewer_ForgotPassword_', 'Reviewer \"Forgot Password\" Form', 620);

INSERT INTO `ie_zz_DPageItemType` (`id`, `type`, `title`, `sorter`) VALUES
(NULL, 'Application_User_', 'Applicants', 700);

INSERT INTO `ie_zz_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`)
VALUES ('applicationGeneral', '8', 'header', '', 'General', '', '', 'n', 'n', '10', NOW(), NOW());

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

update `ie_zz_Settings` set `label` = 'Allow Applicants Logging in' where `name` = 'applicationEnableApplicants';
update `ie_zz_Settings` set `label` = 'Allow Reviewers Logging in' where `name` = 'applicationEnableReviewers';
UPDATE `ie_zz_Settings` SET `label` = 'Application Deadline Date (automatically disallow applicants to login after this date)' WHERE `name` = 'applicationDeadlineDate';

