From c89eaeb41aa3d45ed6b0e35629a5f452cc4df42b Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 22 Feb 2004 18:22:54 +0000 Subject: [PATCH] fixed an upgrade problem with new template features --- docs/changelog/6.x.x.txt | 3 +++ docs/upgrades/upgrade_5.9.9-6.0.0.pl | 6 ++++++ docs/upgrades/upgrade_5.9.9-6.0.0.sql | 6 ------ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 8f51a691d..a41b1924b 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -72,5 +72,8 @@ webgui. - The Events Calendar is now 100% template driven. - The Events Calendar now allows for more than one drawn calendar per page. Choose with your pagination options. + - Added options for developers for an empty style + $session{page}{useEmptyStyle} and added settings to the template table to + to allow templates to be hidden from forms and/or management. diff --git a/docs/upgrades/upgrade_5.9.9-6.0.0.pl b/docs/upgrades/upgrade_5.9.9-6.0.0.pl index 2ff86d83d..f14bb79fd 100644 --- a/docs/upgrades/upgrade_5.9.9-6.0.0.pl +++ b/docs/upgrades/upgrade_5.9.9-6.0.0.pl @@ -51,6 +51,12 @@ $sth->finish; WebGUI::SQL->write("delete from incrementer where incrementerId='styleId'"); WebGUI::SQL->write("delete from settings where name='docTypeDec'"); WebGUI::SQL->write("drop table style"); +WebGUI::SQL->write("alter table template add column isEditable int not null default 1"); +WebGUI::SQL->write("alter table template add column showInForms int not null default 1"); +WebGUI::SQL->write("update template set showInForms=0 where namespace='style' and templateId=10"); +WebGUI::SQL->write("update template set isEditable=0, showInForms=0 where namespace='style' and templateId in (1,2,4,5)"); +WebGUI::SQL->write("insert into template (templateId, name, template, namespace, isEditable, showInForms) values (6,'Empty','','style',0,0)"); + my @templateManagers = WebGUI::SQL->buildArray("select userId from groupings where groupId=8"); my $clause; if ($#templateManagers > 0) { diff --git a/docs/upgrades/upgrade_5.9.9-6.0.0.sql b/docs/upgrades/upgrade_5.9.9-6.0.0.sql index cf1766c95..1d58cd420 100644 --- a/docs/upgrades/upgrade_5.9.9-6.0.0.sql +++ b/docs/upgrades/upgrade_5.9.9-6.0.0.sql @@ -523,12 +523,6 @@ INSERT INTO template VALUES (2,'Events List','\r\n

INSERT INTO template VALUES (3,'Calendar Month (Small)','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \">\r\n

\r\n\r\n\r\n\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

 
HeaderData\" width=\"28\" valign=\"top\" align=\"left\">

\n \n \">\n \n \n \n

 
\n
\n\n\n\n

\n · · \n
\n
\n','EventsCalendar'); INSERT INTO template VALUES (1,'Calendar Month (Big)','\r\n

\r\n
\r\n\r\n\r\n

\r\n\r\n\r\n\r\n \">\r\n

\r\n\r\n\r\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

 
HeaderData\" width=\"14%\" valign=\"top\" align=\"left\">

\n \n \n ·\">
\n
\n
\n
 
\n
\n\n\n\n

\n · · \n
\n
\n','EventsCalendar'); -alter table template add column isEditable int not null default 1; -alter table template add column showInForms int not null default 1; -update template set showInForms=0 where namespace='style' and templateId=10; -update template set isEditable=0, showInForms=0 where namespace='style' and templateId in (1,2,4,5); -insert into template (templateId, name, template, namespace, isEditable, showInForms) values (6,'Empty','','style',0,0); -