INSERT INTO `ie_zz_Settings` (`name`, `idCategory`, `fieldType`, `label`, `value`, `options`, `description`, `required`, `system`, `sorter`, `added`, `changed`) VALUES
('reportRejectAdminEmailHeader', 6, 'header', '', 'Report Rejection Notification Email Template (Admin Notification)', '', '', 'n', 'n', 222, '2015-10-28 10:00:00', '2015-10-28 10:00:00'),
('reportRejectAdminEmailFrom', 6, 'text', 'From Email Address', 'Friends of  Education <info@improvek-12education.org>', '', '', 'n', 'n', 224, '2015-10-28 10:00:00', '2015-10-30 16:16:31'),
('reportRejectAdminEmailSubject', 6, 'text', 'Subject', 'Report Rejection Notification from improvek-12education.org', '', '', 'y', 'n', 226, '2015-10-28 10:00:00', '2015-10-30 16:16:31'),
('reportRejectAdminEmailTo', 6, 'emails', 'To Email Address(es)', 'imed-admin@lazar.dev.adaptainc.com, imed@leo17.dev.adaptainc.com', '', 'Use commas to separate email addresses', 'y', 'n', 227, '2015-10-28 10:00:00', '2015-10-30 16:16:31'),
('reportRejectAdminEmailBody', 6, 'HtmlEditor', 'Message Body', '<p>The report has been rejected<strong>.<br />\r\n<br />\r\nDate</strong> &quot;{date}&quot;<br />\r\n<strong>School Name</strong> &quot;{schoolName}&quot;<br />\r\n<strong>Report Section</strong> &quot;{section}&quot;<br />\r\n<strong>Report Topic</strong> &quot;{topic}&quot;<br />\r\n<strong>Report File</strong> &quot;{file}&quot;<br />\r\n</p>', '', 'Constants: {date}, {schoolName}, {section}, {topic}, {file}, {link}', 'y', 'n', 228, '2015-10-28 10:00:00', '2015-10-30 16:16:31'),
('reportRejectSchoolEmailHeader', 6, 'header', '', 'Report Rejection Notification Email Template (User Notification)', '', '', 'n', 'n', 232, '2015-10-28 10:00:00', '2015-10-28 10:00:00'),
('reportRejectSchoolEmailFrom', 6, 'text', 'From Email Address', 'Friends of  Education <info@improvek-12education.org>', '', '', 'n', 'n', 234, '2015-10-28 10:00:00', '2015-10-30 16:16:31'),
('reportRejectSchoolEmailSubject', 6, 'text', 'Subject', 'Report Rejection Notification from improvek-12education.org', '', '', 'y', 'n', 236, '2015-10-28 10:00:00', '2015-10-30 16:16:31'),
('reportRejectSchoolEmailBody', 6, 'HtmlEditor', 'Message Body', '<p>The report has been rejected<strong>.<br />\r\n<br />\r\nDate</strong> &quot;{date}&quot;<br />\r\n<strong>School Name</strong> &quot;{schoolName}&quot;<br />\r\n<strong>Report Section</strong> &quot;{section}&quot;<br />\r\n<strong>Report Topic</strong> &quot;{topic}&quot;<br />\r\n<strong>Report File</strong> &quot;{file}&quot;<br />\r\n<br />\r\nClick <a href="{link}">here</a> to upload a new report file.</p>', '', 'Constants: {date}, {schoolName}, {section}, {topic}, {file}, {link}', 'y', 'n', 238, '2015-10-28 10:00:00', '2015-10-30 16:16:31');


INSERT INTO `ie_zz_SettingsOptions` (`name`, `variable`, `value`, `type`) VALUES
  ('reportRejectAdminEmailBody', 'toolbarSet', 'Basic', 'string'),
  ('reportRejectSchoolEmailBody', 'toolbarSet', 'Basic', 'string'),
  ('reportRejectAdminEmailBody', 'mode', 'view', 'string'),
  ('reportRejectSchoolEmailBody', 'mode', 'view', 'string');


ALTER TABLE `ie_UserReport`
  ADD `rejected` ENUM('y','n') NOT NULL DEFAULT 'n' AFTER `comments`,
  ADD `rejectComment` text NULL AFTER `rejected`,
  ADD `rejectDate` datetime NULL AFTER `rejectComment`;

ALTER TABLE `ie_UserReport`
    ADD INDEX `rejected` (`rejected`);


ALTER TABLE `ie_User`
  ADD `viewAllReports` enum('y','n') NOT NULL DEFAULT 'n' AFTER `lessonsAccess`;


INSERT INTO `ie_zz_DPageItemType` (`id`, `type`, `title`, `sorter`) VALUES (NULL, 'Report_Summary_', 'Report Summary Table', '145');


-- manually create page
-- www.improvek-12education.org/admin/cms?action=new
-- Title:         Reports Summary
-- Alias:         report-summary
-- Handler:       User Page
-- Body Template: logged.tpl
-- Options: none
-- Content: Report Summary Table
