upgrades eventscalendars and events, but not templates yet...
This commit is contained in:
parent
536e2679e8
commit
5ae0ab119d
1 changed files with 30 additions and 23 deletions
|
|
@ -259,6 +259,8 @@ WebGUI::SQL->write("delete from EventsCalendar_event where assetId is null or as
|
||||||
WebGUI::SQL->write("alter table EventsCalendar_event add primary key (assetId)");
|
WebGUI::SQL->write("alter table EventsCalendar_event add primary key (assetId)");
|
||||||
WebGUI::SQL->write("alter table EventsCalendar_event drop column name");
|
WebGUI::SQL->write("alter table EventsCalendar_event drop column name");
|
||||||
WebGUI::SQL->write("alter table EventsCalendar_event drop column wobjectId");
|
WebGUI::SQL->write("alter table EventsCalendar_event drop column wobjectId");
|
||||||
|
WebGUI::SQL->write("alter table EventsCalendar_event drop column EventsCalendar_eventId");
|
||||||
|
|
||||||
|
|
||||||
WebGUI::SQL->write("drop table forum");
|
WebGUI::SQL->write("drop table forum");
|
||||||
WebGUI::SQL->write("drop table forumRead");
|
WebGUI::SQL->write("drop table forumRead");
|
||||||
|
|
@ -1131,6 +1133,15 @@ while (my ($assetId, $namespace, $tid) = $sth->array) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
|
print "\t\tMigrating Event templates to new IDs\n" unless ($quiet);
|
||||||
|
my $sth = WebGUI::SQL->read("select assetId, templateId from EventsCalendar_event");
|
||||||
|
while (my ($assetId, $tid) = $sth->array) {
|
||||||
|
WebGUI::SQL->setRow("EventsCalendar_event","assetId",{
|
||||||
|
assetId=>$assetId,
|
||||||
|
templateId=>$templateCache{"EventsCalendar/Event"}{$tid}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$sth->finish;
|
||||||
WebGUI::SQL->write("alter table Shortcut drop column proxiedNamespace");
|
WebGUI::SQL->write("alter table Shortcut drop column proxiedNamespace");
|
||||||
WebGUI::SQL->write("alter table Shortcut change templateId templateId varchar(22) not null");
|
WebGUI::SQL->write("alter table Shortcut change templateId templateId varchar(22) not null");
|
||||||
WebGUI::SQL->write("update Shortcut set templateId='PBtmpl0000000000000140'");
|
WebGUI::SQL->write("update Shortcut set templateId='PBtmpl0000000000000140'");
|
||||||
|
|
@ -1770,29 +1781,25 @@ sub walkTree {
|
||||||
}
|
}
|
||||||
} elsif ($wobject->{namespace} eq "EventsCalendar") {
|
} elsif ($wobject->{namespace} eq "EventsCalendar") {
|
||||||
print "\t\t\tMigrating Events Calendar ".$wobject->{wobjectId}." and its Events\n" unless ($quiet);
|
print "\t\t\tMigrating Events Calendar ".$wobject->{wobjectId}." and its Events\n" unless ($quiet);
|
||||||
my $wobjectId = $namespace->{wobjectId};
|
my $calId = $namespace->{wobjectId};
|
||||||
my $sth = WebGUI::SQL->read("select * from EventsCalendar_event where wobjectId=".quote($wobjectId));
|
my $sth = WebGUI::SQL->read("select * from EventsCalendar_event where wobjectId=".quote($calId));
|
||||||
my $calendar = WebGUI::Asset->newByDynamicClass($wobjectId,"WebGUI::Asset::Wobject::EventsCalendar");
|
my $eventRank = 1;
|
||||||
# This is definitely not finished!!!!!! nor even tested!!!! yikes!!!
|
while (my $event = $sth->hashRef) { #Migrate each event to an asset.
|
||||||
# while (my $event = $sth->hashRef) {
|
#generate a new ID.
|
||||||
# #Migrate each event to an asset.
|
my $eventId = getNewId();
|
||||||
# my $eventObject = $calendar->addChild({
|
#insert a new asset for the event.
|
||||||
# className=>'WebGUI::Asset::Event',
|
print "\t\t\t\tMigrating Event ".$event->{EventsCalendar_eventId}."\n" unless ($quiet);
|
||||||
# title=>$event->{name},
|
WebGUI::SQL->write("insert into asset (assetId, parentId, lineage, className, state, title, menuTitle,
|
||||||
# menuTitle=>$event->{name},
|
url, startDate, endDate, isHidden, ownerUserId, groupIdView, groupIdEdit,assetSize) values (".
|
||||||
# isHidden=>1,
|
quote($eventId).", ".quote($wobjectId).", ".quote($wobjectLineage.sprintf("%06d",$eventRank)).",
|
||||||
# newWindow=>0,
|
'WebGUI::Asset::Event','published',".quote($event->{name}).", ".
|
||||||
# startDate=>$calendar->getValue("startDate"),
|
quote($event->{name}).", ".quote(fixUrl($eventId,$wobjectUrl.'/'.$event->{name})).",
|
||||||
# endDate=>$calendar->getValue("endDate"),
|
".quote($wobject->{startDate}).", ".quote($wobject->{endDate}).", 1, ".quote($ownerId).",
|
||||||
# ownerUserId=>$calendar->getValue("ownerUserId"),
|
".quote($groupIdView).", ".quote($groupIdEdit).",".quote(0).")");
|
||||||
# groupIdEdit=>$calendar->getValue("groupIdEdit"),
|
WebGUI::SQL->write("update EventsCalendar_event set assetId=".quote($eventId).", templateId=".quote($namespace->{eventTemplateId})." where EventsCalendar_eventId=".quote($event->{EventsCalendar_eventId}));
|
||||||
# groupIdView=>$calendar->getValue("groupIdView"),
|
#increment the rank.
|
||||||
# url=>$event->fixUrl($calendar->getUrl().'/'.$namespace->{name}),
|
$eventRank++;
|
||||||
# templateId=>$calendar->getValue("eventTemplateId")
|
}
|
||||||
# });
|
|
||||||
# WebGUI::SQL->write("update EventsCalendar_event set assetId=".quote($eventObject->getId)." where EventsCalendar_eventId=".quote($event->{EventsCalendar_eventId}));
|
|
||||||
# I'm sure there's something else I'm forgetting...
|
|
||||||
# }
|
|
||||||
}
|
}
|
||||||
$rank++;
|
$rank++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue