fixed a feedback loop with shortcut

This commit is contained in:
JT Smith 2005-02-05 22:58:37 +00:00
parent 1b08faa78b
commit d0ac36daf3
3 changed files with 16 additions and 5 deletions

View file

@ -119,8 +119,7 @@ walkTree('0','PBasset000000000000001','000001','2');
mapProductCollateral();
print "\t\tMaking second round of table structure changes\n" unless ($quiet);
my $sth = WebGUI::SQL->read("select distinct(namespace) from wobject where namespace is not null");
while (my ($namespace) = $sth->array) {
foreach my $namespace (@allWobjects) {
if (isIn($namespace, @wobjects)) {
WebGUI::SQL->write("alter table ".$namespace." drop column wobjectId");
WebGUI::SQL->write("alter table ".$namespace." add primary key (assetId)");
@ -131,7 +130,6 @@ while (my ($namespace) = $sth->array) {
WebGUI::SQL->write("alter table ".$namespace." add primary key (assetId)");
}
}
$sth->finish;
WebGUI::SQL->write("alter table WobjectProxy add column shortcutToAssetId varchar(22) not null");
my $sth = WebGUI::SQL->read("select proxiedWobjectId from WobjectProxy");
while (my ($wobjectId) = $sth->array) {

View file

@ -2172,6 +2172,13 @@ sub www_createShortcut () {
shortcutToAssetId=>$self->getId,
title=>$self->get("title"),
menuTitle=>$self->get("menuTitle"),
isHidden=>$self->get("isHidden"),
newWindow=>$self->get("newWindow"),
startDate=>$self->get("startDate"),
endDate=>$self->get("endDate"),
ownerUserId=>$self->get("ownerUserId"),
groupIdEdit=>$self->get("groupIdEdit"),
groupIdView=>$self->get("groupIdView"),
url=>$self->get("title"),
templateId=>'PBtmpl0000000000000140'
});

View file

@ -320,9 +320,15 @@ sub processPropertiesFromFormPost {
#-------------------------------------------------------------------
sub view {
my $self = shift;
my $content;
if ($self->get("shortcutToAssetId") eq $self->get("parentId")) {
$content = "Displaying this shortcut would cause a feedback loop.";
} else {
$content = $self->getShortcut->view;
}
my %var = (
isShortcut => 1,
'shortcut.content' => $self->getShortcut->view,
'shortcut.content' => $content,
'shortcut.label' => 'Shortcut',
originalURL => $self->getShortcut->getUrl
);
@ -335,7 +341,7 @@ sub www_edit {
my $self = shift;
return WebGUI::Privilege::insufficient() unless $self->canEdit;
$self->getAdminConsole->setHelp("shortcut add/edit","Shortcut");
return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get(2));
return $self->getAdminConsole->render($self->getEditForm->print,WebGUI::International::get(2,"Shortcut"));
}
#-------------------------------------------------------------------