added content prototypes
This commit is contained in:
parent
25b7e89b0c
commit
7446031b99
6 changed files with 80 additions and 12 deletions
|
|
@ -1,6 +1,10 @@
|
|||
6.5.0
|
||||
- Added content prototypes.
|
||||
- Fixed a bug in the Collaboration post where the post end date was set to
|
||||
the start date.
|
||||
- fix [ 1157202 ] users can add themselves to Admins group
|
||||
- fix [ 1157218 ] user cannot view it's own profile
|
||||
|
||||
|
||||
6.4.0
|
||||
- You can now see the groups of groups hierarchy in the group manager.
|
||||
|
|
|
|||
4
docs/upgrades/upgrade_6.4.0-6.5.0.sql
Normal file
4
docs/upgrades/upgrade_6.4.0-6.5.0.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
insert into webguiVersion values ('6.5.0','upgrade',unix_timestamp());
|
||||
alter table asset add column isPrototype int not null default 0;
|
||||
alter table asset add index isPrototype_className_assetId (isPrototype,className,assetId);
|
||||
|
||||
|
|
@ -381,6 +381,10 @@ sub definition {
|
|||
fieldType=>'yesNo',
|
||||
defaultValue=>0
|
||||
},
|
||||
isPrototype=>{
|
||||
fieldType=>'yesNo',
|
||||
defaultValue=>0
|
||||
},
|
||||
isHidden=>{
|
||||
fieldType=>'yesNo',
|
||||
defaultValue=>0
|
||||
|
|
@ -703,6 +707,22 @@ sub getAssetAdderLinks {
|
|||
}
|
||||
}
|
||||
}
|
||||
my $constraint;
|
||||
if ($getContainerLinks) {
|
||||
$constraint = quoteAndJoin($session{config}{assetContainers});
|
||||
} else {
|
||||
$constraint = quoteAndJoin($session{config}{assets});
|
||||
}
|
||||
my $sth = WebGUI::SQL->read("select className,assetId from asset where isPrototype=1 and className in ($constraint)");
|
||||
while (my ($class,$id) = $sth->array) {
|
||||
my $asset = WebGUI::Asset->newByDynamicClass($id,$class);
|
||||
my $url = $self->getUrl("func=add&class=".$class."&prototype=".$id);
|
||||
$url = WebGUI::URL::append($url,$addToUrl) if ($addToUrl);
|
||||
push(@links,{
|
||||
label=>$asset->get("title"),
|
||||
url=>$url
|
||||
});
|
||||
}
|
||||
return \@links;
|
||||
}
|
||||
|
||||
|
|
@ -1026,6 +1046,12 @@ sub getEditForm {
|
|||
-value=>$self->getValue("isPackage"),
|
||||
-uiLevel=>7
|
||||
);
|
||||
$tabform->getTab("meta")->yesNo(
|
||||
-name=>"isPrototype",
|
||||
-label=>WebGUI::International::get("make prototype","Asset"),
|
||||
-value=>$self->getValue("isPrototype"),
|
||||
-uiLevel=>7
|
||||
);
|
||||
return $tabform;
|
||||
}
|
||||
|
||||
|
|
@ -2222,7 +2248,20 @@ Adds a new Asset based upon the class of the current form. Returns the Asset cal
|
|||
|
||||
sub www_add {
|
||||
my $self = shift;
|
||||
my %prototypeProperties;
|
||||
if ($session{form}{'prototype'}) {
|
||||
my $prototype = WebGUI::Asset->newByDynamicClass($session{form}{'prototype'},$session{form}{class});
|
||||
foreach my $definition (@{$prototype->definition}) { # cycle through rather than copying properties to avoid grabbing stuff we shouldn't grab
|
||||
foreach my $property (keys %{$definition->{properties}}) {
|
||||
next if (isIn($property,qw(title menuTitle url isPrototype isPackage)));
|
||||
next if ($definition->{properties}{$property}{noFormPost});
|
||||
$prototypeProperties{$property} = $prototype->get($property);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
my %properties = (
|
||||
%prototypeProperties,
|
||||
groupIdView => $self->get("groupIdView"),
|
||||
groupIdEdit => $self->get("groupIdEdit"),
|
||||
ownerUserId => $self->get("ownerUserId"),
|
||||
|
|
|
|||
|
|
@ -303,16 +303,27 @@ sub www_editGroup {
|
|||
-value=>$g->scratchFilter,
|
||||
-label=>WebGUI::International::get(945)
|
||||
);
|
||||
$f->yesNo(
|
||||
-name=>"autoAdd",
|
||||
-value=>$g->autoAdd,
|
||||
-label=>WebGUI::International::get(974)
|
||||
);
|
||||
$f->yesNo(
|
||||
-name=>"autoDelete",
|
||||
-value=>$g->autoDelete,
|
||||
-label=>WebGUI::International::get(975)
|
||||
);
|
||||
if ($session{form}{gid} eq "3") {
|
||||
$f->hidden(
|
||||
-name=>"autoAdd",
|
||||
-value=>0
|
||||
);
|
||||
$f->hidden(
|
||||
-name=>"autoDelete",
|
||||
-value=>0
|
||||
);
|
||||
} else {
|
||||
$f->yesNo(
|
||||
-name=>"autoAdd",
|
||||
-value=>$g->autoAdd,
|
||||
-label=>WebGUI::International::get(974)
|
||||
);
|
||||
$f->yesNo(
|
||||
-name=>"autoDelete",
|
||||
-value=>$g->autoDelete,
|
||||
-label=>WebGUI::International::get(975)
|
||||
);
|
||||
}
|
||||
$f->databaseLink(
|
||||
-value=>[$g->databaseLinkId]
|
||||
);
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ sub www_viewProfile {
|
|||
$u = WebGUI::User->new($session{form}{uid});
|
||||
$vars->{displayTitle} = '<h1>'.WebGUI::International::get(347).' '.$u->username.'</h1>';
|
||||
return WebGUI::Privilege::notMember() if($u->username eq "");
|
||||
return $vars->{displayTitle}.WebGUI::International::get(862) if($u->profileField("publicProfile") < 1);
|
||||
return $vars->{displayTitle}.WebGUI::International::get(862) if($u->profileField("publicProfile") < 1 && ($session{user}{userId} ne $session{form}{uid} || WebGUI::Grouping::isInGroup(3)));
|
||||
return WebGUI::Privilege::insufficient() if(!WebGUI::Grouping::isInGroup(2));
|
||||
$a = WebGUI::SQL->read("select * from userProfileField,userProfileCategory where userProfileField.profileCategoryId=userProfileCategory.profileCategoryId
|
||||
and userProfileCategory.visible=1 and userProfileField.visible=1 order by userProfileCategory.sequenceNumber,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ our $I18N = {
|
|||
lastUpdated => 1099344172,
|
||||
},
|
||||
|
||||
'make prototype' => {
|
||||
message => q|Make prototype?|,
|
||||
lastUpdated => 1099344172,
|
||||
},
|
||||
|
||||
'asset id' => {
|
||||
message => q|Asset ID|,
|
||||
lastUpdated => 1099344172,
|
||||
|
|
@ -107,10 +112,15 @@ These tags will be added to the <HEAD> section of each page that the asset
|
|||
</p>
|
||||
|
||||
<p>
|
||||
<b>Make available as package?</b><br>
|
||||
<b>Make package?</b><br>
|
||||
Many WebGUI tasks are very repetitive. Automating such tasks in Webgui, such as
|
||||
creating an Asset, or sets of Assets, is done by creating a package that can be reused
|
||||
through the site. Check yes if you want this Asset to be available as a package.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Make prototype?</b><br>
|
||||
Chances are if you like assets to be configured a certain way, then you'll find prototypes useful. By setting an asset as a prototype you can create new items in your add content menu configured exactly as you like. For instance, if you use the Collaboration System as a photo gallery, then create a photo gallery and mark it as a prototype. From then on you can just "Add content > New Content > Photo Gallery".
|
||||
</p>
|
||||
|
||||
|,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue