the first major round of changes for versioning

This commit is contained in:
JT Smith 2005-07-06 22:21:52 +00:00
parent e535c5d43f
commit 5531a9b3d2
10 changed files with 443 additions and 303 deletions

View file

@ -115,25 +115,25 @@ sub getEditForm {
$tabform->getTab("properties")->yesNo(
-name=>"overrideTitle",
-value=>$self->getValue("overrideTitle"),
-label=>WebGUI::International::get(7,"Asset_Shortcut")
-label=>WebGUI::International::get(7,"Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get('7 description',"Asset_Shortcut")
);
$tabform->getTab("display")->yesNo(
-name=>"overrideDisplayTitle",
-value=>$self->getValue("overrideDisplayTitle"),
-label=>WebGUI::International::get(8,"Asset_Shortcut")
-label=>WebGUI::International::get(8,"Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get('8 description',"Asset_Shortcut")
);
$tabform->getTab("properties")->yesNo(
-name=>"overrideDescription",
-value=>$self->getValue("overrideDescription"),
-label=>WebGUI::International::get(9,"Asset_Shortcut")
-label=>WebGUI::International::get(9,"Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get('9 description',"Asset_Shortcut")
);
$tabform->getTab("display")->yesNo(
-name=>"overrideTemplate",
-value=>$self->getValue("overrideTemplate"),
-label=>WebGUI::International::get(10,"Asset_Shortcut")
-label=>WebGUI::International::get(10,"Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get('10 description',"Asset_Shortcut")
);
$tabform->getTab("properties")->readOnly(
@ -150,16 +150,16 @@ sub getEditForm {
-extras=>q|Onchange="
if (this.form.shortcutByCriteria[0].checked) {
this.form.resolveMultiples.disabled=false;
this.form.proxyCriteria.disabled=false;
this.form.shortcutCriteria.disabled=false;
} else {
this.form.resolveMultiples.disabled=true;
this.form.proxyCriteria.disabled=true;
this.form.shortcutCriteria.disabled=true;
}"|
);
$tabform->getTab("properties")->yesNo(
-name=>"disableContentLock",
-value=>$self->getValue("disableContentLock"),
-label=>WebGUI::International::get("disable content lock","Asset_Shortcut")
-label=>WebGUI::International::get("disable content lock","Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get("disable content lock description","Asset_Shortcut")
);
if ($self->getValue("shortcutByCriteria") == 0) {
@ -180,7 +180,7 @@ sub getEditForm {
$tabform->getTab("properties")->readOnly(
-value=>$self->_drawQueryBuilder(),
-label=>WebGUI::International::get("Criteria","Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get("Criteria description","Asset_Shortcut"),
-hoverHelp=>WebGUI::International::get("Criteria description","Asset_Shortcut")
);
}
return $tabform;
@ -232,7 +232,7 @@ A typical hashRef for this function will look like:
{
proxiedNamespace => "Article",
resolveMultiples => "random",
proxyCriteria => "State = Wisconsin AND Country != Sauk"
shortcutCriteria => 'State = "Wisconsin" AND County != "Sauk"'
}
Most of the time this will be a:
@ -413,8 +413,8 @@ sub _drawQueryBuilder {
# Static form fields
my $shortcutCriteriaField = WebGUI::Form::textarea({
name=>"shortcutCriteria",
value=>$_[0]->getValue("shortcutCriteria"),
extras=>'style="width: 100%" '.$_[0]->{_disabled}
value=>$self->getValue("shortcutCriteria"),
extras=>'style="width: 100%" '.$self->{_disabled}
});
my $conjunctionField = WebGUI::Form::selectList({
name=>"conjunction",

View file

@ -205,7 +205,7 @@ Specify the namespace to build the list for.
sub getList {
my $class = shift;
my $namespace = shift;
return WebGUI::SQL->buildHashRef("select asset.assetId,asset.title from template left join asset on asset.assetId=template.assetId where template.namespace=".quote($namespace)." and template.showInForms=1 and state='published' order by asset.title",WebGUI::SQL->getSlave);
return WebGUI::SQL->buildHashRef("select assetData.assetId,assetData.title from template left join asset on asset.assetId=template.assetId left join assetData on asset.assetId=assetData.assetId where template.namespace=".quote($namespace)." and template.showInForms=1 and asset.state='published' and (assetData.status='approved' or assetData.tagId=".quote($session{scratch}{versionTag}).") group by assetData.assetId order by assetData.title",WebGUI::SQL->getSlave);
}

View file

@ -509,10 +509,12 @@ sub www_addStyledEvent {
printableStyleTemplateId => $self->get("printableStyleTemplateId"),
isHidden => $self->get("isHidden"),
startDate => $self->get("startDate"),
endDate => $self->get("endDate")
endDate => $self->get("endDate"),
assetId=> "new",
className=>"WebGUI::Asset::Event"
);
$properties{isHidden} = 1 unless (WebGUI::Utility::isIn(ref $session{form}{class}, @{$session{config}{assetContainers}}));
my $newAsset = WebGUI::Asset->newByDynamicClass("new","WebGUI::Asset::Event",\%properties);
my $newAsset = WebGUI::Asset->newByPropertyHashRef(\%properties);
$newAsset->{_parent} = $self;
#get parent so we can get the parent's style. Hopefully the parent is an EventsCalendar. If not, oh well.
# return "You must add an Event as a child of an EventsCalendar." unless ($self->getValue("className") = "WebGUI::Asset::Wobject::EventsCalendar");