fixed an upgrade problem with new template features

This commit is contained in:
JT Smith 2004-02-22 18:22:54 +00:00
parent 044b024011
commit c89eaeb41a
3 changed files with 9 additions and 6 deletions

View file

@ -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.

View file

@ -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','<tmpl_var body.content>','style',0,0)");
my @templateManagers = WebGUI::SQL->buildArray("select userId from groupings where groupId=8");
my $clause;
if ($#templateManagers > 0) {

View file

@ -523,12 +523,6 @@ INSERT INTO template VALUES (2,'Events List','<tmpl_if displayTitle>\r\n <h1>
INSERT INTO template VALUES (3,'Calendar Month (Small)','<tmpl_if displayTitle>\r\n <h1><tmpl_var title></h1>\r\n</tmpl_if>\r\n\r\n<tmpl_if description>\r\n <tmpl_var description><p />\r\n</tmpl_if>\r\n\r\n<tmpl_if session.var.adminOn>\r\n <a href=\"<tmpl_var addevent.url>\"><tmpl_var addevent.label></a>\r\n <p />\r\n</tmpl_if>\r\n\r\n\n\n\n<tmpl_loop month_loop>\n <table border=\"1\" width=\"100%\">\n <tr><td colspan=7 class=\"tableHeader\"><h2 align=\"center\"><tmpl_var month> <tmpl_var year></h2></td></tr>\n <tr>\n <tmpl_if session.user.firstDayOfWeek>\n <th class=\"tableData\"><tmpl_var monday.label.short></th>\n <th class=\"tableData\"><tmpl_var tuesday.label.short></th>\n <th class=\"tableData\"><tmpl_var wednesday.label.short></th>\n <th class=\"tableData\"><tmpl_var thursday.label.short></th>\n <th class=\"tableData\"><tmpl_var friday.label.short></th>\n <th class=\"tableData\"><tmpl_var saturday.label.short></th>\n <th class=\"tableData\"><tmpl_var sunday.label.short></th>\n <tmpl_else>\n <th class=\"tableData\"><tmpl_var sunday.label.short></th>\n <th class=\"tableData\"><tmpl_var monday.label.short></th>\n <th class=\"tableData\"><tmpl_var tuesday.label.short></th>\n <th class=\"tableData\"><tmpl_var wednesday.label.short></th>\n <th class=\"tableData\"><tmpl_var thursday.label.short></th>\n <th class=\"tableData\"><tmpl_var friday.label.short></th>\n <th class=\"tableData\"><tmpl_var saturday.label.short></th>\n </tmpl_if>\n </tr><tr>\n <tmpl_loop prepad_loop>\n <td>&nbsp;</td>\n </tmpl_loop>\n <tmpl_loop day_loop>\n <tmpl_if isStartOfWeek>\n <tr>\n </tmpl_if>\n <td class=\"table<tmpl_if isToday>Header<tmpl_else>Data</tmpl_if>\" width=\"28\" valign=\"top\" align=\"left\"><p><b>\n <tmpl_if url>\n <a href=\"<tmpl_var url>\"><tmpl_var day></a>\n <tmpl_else>\n <tmpl_var day>\n </tmpl_if>\n </b></p></td> \n <tmpl_if isEndOfWeek>\n </tr>\n </tmpl_if>\n </tmpl_loop>\n <tmpl_loop postpad_loop>\n <td>&nbsp;</td>\n </tmpl_loop>\n </tr>\n </table>\n</tmpl_loop>\n\n\n<tmpl_if pagination.pageCount.isMultiple>\n <div class=\"pagination\">\n <tmpl_var pagination.previousPage> &middot; <tmpl_var pagination.pageList.upTo20> &middot; <tmpl_var pagination.nextPage>\n </div>\n</tmpl_if>\n','EventsCalendar');
INSERT INTO template VALUES (1,'Calendar Month (Big)','<tmpl_if displayTitle>\r\n <h1><tmpl_var title></h1>\r\n</tmpl_if>\r\n\r\n<tmpl_if description>\r\n <tmpl_var description><p />\r\n</tmpl_if>\r\n\r\n<tmpl_if session.var.adminOn>\r\n <a href=\"<tmpl_var addevent.url>\"><tmpl_var addevent.label></a>\r\n <p />\r\n</tmpl_if>\r\n\r\n<tmpl_loop month_loop>\n <table border=\"1\" width=\"100%\">\n <tr><td colspan=7 class=\"tableHeader\"><h2 align=\"center\"><tmpl_var month> <tmpl_var year></h2></td></tr>\n <tr>\n <tmpl_if session.user.firstDayOfWeek>\n <th class=\"tableData\"><tmpl_var monday.label></th>\n <th class=\"tableData\"><tmpl_var tuesday.label></th>\n <th class=\"tableData\"><tmpl_var wednesday.label></th>\n <th class=\"tableData\"><tmpl_var thursday.label></th>\n <th class=\"tableData\"><tmpl_var friday.label></th>\n <th class=\"tableData\"><tmpl_var saturday.label></th>\n <th class=\"tableData\"><tmpl_var sunday.label></th>\n <tmpl_else>\n <th class=\"tableData\"><tmpl_var sunday.label></th>\n <th class=\"tableData\"><tmpl_var monday.label></th>\n <th class=\"tableData\"><tmpl_var tuesday.label></th>\n <th class=\"tableData\"><tmpl_var wednesday.label></th>\n <th class=\"tableData\"><tmpl_var thursday.label></th>\n <th class=\"tableData\"><tmpl_var friday.label></th>\n <th class=\"tableData\"><tmpl_var saturday.label></th>\n </tmpl_if>\n </tr><tr>\n <tmpl_loop prepad_loop>\n <td>&nbsp;</td>\n </tmpl_loop>\n <tmpl_loop day_loop>\n <tmpl_if isStartOfWeek>\n <tr>\n </tmpl_if>\n <td class=\"table<tmpl_if isToday>Header<tmpl_else>Data</tmpl_if>\" width=\"14%\" valign=\"top\" align=\"left\"><p><b><tmpl_var day></b></p>\n <tmpl_loop event_loop>\n <tmpl_if name>\n &middot;<a href=\"<tmpl_var url>\"><tmpl_var name></a><br />\n </tmpl_if>\n </tmpl_loop>\n </td>\n <tmpl_if isEndOfWeek>\n </tr>\n </tmpl_if>\n </tmpl_loop>\n <tmpl_loop postpad_loop>\n <td>&nbsp;</td>\n </tmpl_loop>\n </tr>\n </table>\n</tmpl_loop>\n\n\n<tmpl_if pagination.pageCount.isMultiple>\n <div class=\"pagination\">\n <tmpl_var pagination.previousPage> &middot; <tmpl_var pagination.pageList.upTo20> &middot; <tmpl_var pagination.nextPage>\n </div>\n</tmpl_if>\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','<tmpl_var body.content>','style',0,0);