merged to 9933
This commit is contained in:
parent
4fb7b2c81b
commit
df234709f4
16 changed files with 474 additions and 295 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
7.7.1
|
||||||
|
|
||||||
7.7.0
|
7.7.0
|
||||||
- fixed #9913: New Content Side Bar missing in Asset window
|
- fixed #9913: New Content Side Bar missing in Asset window
|
||||||
- fixed: New Mail macro never returns any messages
|
- fixed: New Mail macro never returns any messages
|
||||||
|
|
@ -22,6 +24,15 @@
|
||||||
- added: Users can now set a minimum cart amount required for checkout. ( Martin Kamerbeek / Oqapi )
|
- added: Users can now set a minimum cart amount required for checkout. ( Martin Kamerbeek / Oqapi )
|
||||||
- fixed validation issue in the donation asset ( Martin kamerbeek / Oqapi )
|
- fixed validation issue in the donation asset ( Martin kamerbeek / Oqapi )
|
||||||
- rfe #9354: Account activation email template (SDH Consulting Group)
|
- rfe #9354: Account activation email template (SDH Consulting Group)
|
||||||
|
- rfe #9233: Survey branching expressions (Patrick Donelan, SDH Consulting Group)
|
||||||
|
- rfe #9202: Survey Jump-to combo box (Patrick Donelan, SDH Consulting Group)
|
||||||
|
- rfe #9201: Make Survey TextAreas YUI resizable (SDH Consulting Group)
|
||||||
|
- rfe #9200: Survey Text/TextArea handling (SDH Consulting Group)
|
||||||
|
- rfe #9199: Survey final page detection (SDH Consulting Group)
|
||||||
|
- rfe #9198: Turn Survey Edit Section/Question/Answer fields into RTEs (SDH Consulting Group)
|
||||||
|
- rfe #9197: Survey timeout handling (SDH Consulting Group)
|
||||||
|
- rfe #8862: Passive Analytics (SDH Consulting Group)
|
||||||
|
- fixed #9979: i18n labels for Gallery (Knowmad Technologies)
|
||||||
|
|
||||||
7.6.14
|
7.6.14
|
||||||
- fixed: IE6 shows Admin Bar over Asset Manager
|
- fixed: IE6 shows Admin Bar over Asset Manager
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
125
docs/upgrades/upgrade_7.7.0-7.7.1.pl
Normal file
125
docs/upgrades/upgrade_7.7.0-7.7.1.pl
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# WebGUI is Copyright 2001-2009 Plain Black Corporation.
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# Please read the legal notices (docs/legal.txt) and the license
|
||||||
|
# (docs/license.txt) that came with this distribution before using
|
||||||
|
# this software.
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
# http://www.plainblack.com info@plainblack.com
|
||||||
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
our ($webguiRoot);
|
||||||
|
|
||||||
|
BEGIN {
|
||||||
|
$webguiRoot = "../..";
|
||||||
|
unshift (@INC, $webguiRoot."/lib");
|
||||||
|
}
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use Getopt::Long;
|
||||||
|
use WebGUI::Session;
|
||||||
|
use WebGUI::Storage;
|
||||||
|
use WebGUI::Asset;
|
||||||
|
|
||||||
|
|
||||||
|
my $toVersion = '7.7.1';
|
||||||
|
my $quiet; # this line required
|
||||||
|
|
||||||
|
|
||||||
|
my $session = start(); # this line required
|
||||||
|
|
||||||
|
# upgrade functions go here
|
||||||
|
|
||||||
|
finish($session); # this line required
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Describe what our function does
|
||||||
|
#sub exampleFunction {
|
||||||
|
# my $session = shift;
|
||||||
|
# print "\tWe're doing some stuff here that you should know about... " unless $quiet;
|
||||||
|
# # and here's our code
|
||||||
|
# print "DONE!\n" unless $quiet;
|
||||||
|
#}
|
||||||
|
|
||||||
|
|
||||||
|
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
# Add a package to the import node
|
||||||
|
sub addPackage {
|
||||||
|
my $session = shift;
|
||||||
|
my $file = shift;
|
||||||
|
|
||||||
|
# Make a storage location for the package
|
||||||
|
my $storage = WebGUI::Storage->createTemp( $session );
|
||||||
|
$storage->addFileFromFilesystem( $file );
|
||||||
|
|
||||||
|
# Import the package into the import node
|
||||||
|
my $package = WebGUI::Asset->getImportNode($session)->importPackage( $storage );
|
||||||
|
|
||||||
|
# Make the package not a package anymore
|
||||||
|
$package->update({ isPackage => 0 });
|
||||||
|
|
||||||
|
# Set the default flag for templates added
|
||||||
|
my $assetIds
|
||||||
|
= $package->getLineage( ['self','descendants'], {
|
||||||
|
includeOnlyClasses => [ 'WebGUI::Asset::Template' ],
|
||||||
|
} );
|
||||||
|
for my $assetId ( @{ $assetIds } ) {
|
||||||
|
my $asset = WebGUI::Asset->newByDynamicClass( $session, $assetId );
|
||||||
|
if ( !$asset ) {
|
||||||
|
print "Couldn't instantiate asset with ID '$assetId'. Please check package '$file' for corruption.\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
$asset->update( { isDefault => 1 } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub start {
|
||||||
|
my $configFile;
|
||||||
|
$|=1; #disable output buffering
|
||||||
|
GetOptions(
|
||||||
|
'configFile=s'=>\$configFile,
|
||||||
|
'quiet'=>\$quiet
|
||||||
|
);
|
||||||
|
my $session = WebGUI::Session->open($webguiRoot,$configFile);
|
||||||
|
$session->user({userId=>3});
|
||||||
|
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||||
|
$versionTag->set({name=>"Upgrade to ".$toVersion});
|
||||||
|
return $session;
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub finish {
|
||||||
|
my $session = shift;
|
||||||
|
updateTemplates($session);
|
||||||
|
my $versionTag = WebGUI::VersionTag->getWorking($session);
|
||||||
|
$versionTag->commit;
|
||||||
|
$session->db->write("insert into webguiVersion values (".$session->db->quote($toVersion).",'upgrade',".$session->datetime->time().")");
|
||||||
|
$session->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------
|
||||||
|
sub updateTemplates {
|
||||||
|
my $session = shift;
|
||||||
|
return undef unless (-d "packages-".$toVersion);
|
||||||
|
print "\tUpdating packages.\n" unless ($quiet);
|
||||||
|
opendir(DIR,"packages-".$toVersion);
|
||||||
|
my @files = readdir(DIR);
|
||||||
|
closedir(DIR);
|
||||||
|
my $newFolder = undef;
|
||||||
|
foreach my $file (@files) {
|
||||||
|
next unless ($file =~ /\.wgpkg$/);
|
||||||
|
# Fix the filename to include a path
|
||||||
|
$file = "packages-" . $toVersion . "/" . $file;
|
||||||
|
addPackage( $session, $file );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#vim:ft=perl
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package WebGUI;
|
package WebGUI;
|
||||||
|
|
||||||
|
|
||||||
our $VERSION = '7.7.0';
|
our $VERSION = '7.7.1';
|
||||||
our $STATUS = 'beta';
|
our $STATUS = 'beta';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -293,6 +293,7 @@ sub getThumbnailUrl {
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 getVendorId ( )
|
=head2 getVendorId ( )
|
||||||
|
|
||||||
Returns the vendorId of the vendor for this sku. Defaults to the default
|
Returns the vendorId of the vendor for this sku. Defaults to the default
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ use WebGUI::International;
|
||||||
use WebGUI::Utility;
|
use WebGUI::Utility;
|
||||||
use base 'WebGUI::Asset::Wobject';
|
use base 'WebGUI::Asset::Wobject';
|
||||||
|
|
||||||
|
# To get an installer for your wobject, add the Installable AssetAspect
|
||||||
|
# See WebGUI::AssetAspect::Installable and sbin/installClass.pl for more
|
||||||
|
# details
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 definition ( )
|
=head2 definition ( )
|
||||||
|
|
@ -29,46 +33,43 @@ getEditForm method is unnecessary/redundant/useless.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub definition {
|
sub definition {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $definition = shift;
|
my $definition = shift;
|
||||||
my $i18n = WebGUI::International->new($session, 'Asset_NewWobject');
|
my $i18n = WebGUI::International->new( $session, 'Asset_NewWobject' );
|
||||||
my %properties;
|
tie my %properties, 'Tie::IxHash', (
|
||||||
tie %properties, 'Tie::IxHash';
|
templateId => {
|
||||||
%properties = (
|
|
||||||
templateId =>{
|
|
||||||
|
|
||||||
#See the list of field/control types in /lib/WebGUI/Form/
|
#See the list of field/control types in /lib/WebGUI/Form/
|
||||||
fieldType=>"template",
|
fieldType => "template",
|
||||||
|
|
||||||
defaultValue=>'NewWobjectTmpl00000001',
|
defaultValue => 'NewWobjectTmpl00000001',
|
||||||
tab=>"display",
|
tab => "display",
|
||||||
|
|
||||||
#www_editSave will ignore anyone's attempts to update this field if this is set to 1
|
#www_editSave will ignore anyone's attempts to update this field if this is set to 1
|
||||||
noFormPost=>0,
|
noFormPost => 0,
|
||||||
|
|
||||||
#This is an option specific to the template fieldType.
|
#This is an option specific to the template fieldType.
|
||||||
namespace=>"NewWobject",
|
namespace => "NewWobject",
|
||||||
|
|
||||||
#This is what will appear when the user hovers the mouse over the label
|
#This is what will appear when the user hovers the mouse over the label
|
||||||
# of your form field.
|
# of your form field.
|
||||||
hoverHelp=>$i18n->get('templateId label description'),
|
hoverHelp => $i18n->get('templateId label description'),
|
||||||
|
|
||||||
# This is the text that will appear to the left of your form field.
|
|
||||||
label=>$i18n->get('templateId label'),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
push(@{$definition}, {
|
|
||||||
assetName=>$i18n->get('assetName'),
|
|
||||||
icon=>'newWobject.gif',
|
|
||||||
autoGenerateForms=>1,
|
|
||||||
tableName=>'NewWobject',
|
|
||||||
className=>'WebGUI::Asset::Wobject::NewWobject',
|
|
||||||
properties=>\%properties
|
|
||||||
});
|
|
||||||
return $class->SUPER::definition($session, $definition);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
# This is the text that will appear to the left of your form field.
|
||||||
|
label => $i18n->get('templateId label'),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
push @{$definition}, {
|
||||||
|
assetName => $i18n->get('assetName'),
|
||||||
|
icon => 'newWobject.gif',
|
||||||
|
autoGenerateForms => 1,
|
||||||
|
tableName => 'NewWobject',
|
||||||
|
className => 'WebGUI::Asset::Wobject::NewWobject',
|
||||||
|
properties => \%properties
|
||||||
|
};
|
||||||
|
return $class->SUPER::definition( $session, $definition );
|
||||||
|
} ## end sub definition
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -81,9 +82,9 @@ wobject instances, you will need to duplicate them here.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub duplicate {
|
sub duplicate {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $newAsset = $self->SUPER::duplicate(@_);
|
my $newAsset = $self->SUPER::duplicate(@_);
|
||||||
return $newAsset;
|
return $newAsset;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -96,16 +97,16 @@ This method is optional if you set autoGenerateForms=1 in the definition.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub getEditForm {
|
sub getEditForm {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $tabform = $self->SUPER::getEditForm();
|
my $tabform = $self->SUPER::getEditForm();
|
||||||
|
|
||||||
$tabform->getTab("display")->template(
|
$tabform->getTab("display")->template(
|
||||||
-value=>$self->getValue("templateId"),
|
value => $self->getValue("templateId"),
|
||||||
-label=>WebGUI::International::get("template_label","Asset_NewWobject"),
|
label => WebGUI::International::get( "template_label", "Asset_NewWobject" ),
|
||||||
-namespace=>"NewWobject"
|
namespace => "NewWobject"
|
||||||
);
|
);
|
||||||
|
|
||||||
return $tabform;
|
return $tabform;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -117,14 +118,13 @@ See WebGUI::Asset::prepareView() for details.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub prepareView {
|
sub prepareView {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->SUPER::prepareView();
|
$self->SUPER::prepareView();
|
||||||
my $template = WebGUI::Asset::Template->new($self->session, $self->get("templateId"));
|
my $template = WebGUI::Asset::Template->new( $self->session, $self->get("templateId") );
|
||||||
$template->prepare;
|
$template->prepare;
|
||||||
$self->{_viewTemplate} = $template;
|
$self->{_viewTemplate} = $template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 purge ( )
|
=head2 purge ( )
|
||||||
|
|
@ -137,10 +137,11 @@ wobject instances, you will need to purge them here.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub purge {
|
sub purge {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
#purge your wobject-specific data here. This does not include fields
|
|
||||||
# you create for your NewWobject asset/wobject table.
|
#purge your wobject-specific data here. This does not include fields
|
||||||
return $self->SUPER::purge;
|
# you create for your NewWobject asset/wobject table.
|
||||||
|
return $self->SUPER::purge;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -153,16 +154,16 @@ to be displayed within the page style.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub view {
|
sub view {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
|
|
||||||
#This automatically creates template variables for all of your wobject's properties.
|
#This automatically creates template variables for all of your wobject's properties.
|
||||||
my $var = $self->get;
|
my $var = $self->get;
|
||||||
|
|
||||||
#This is an example of debugging code to help you diagnose problems.
|
#This is an example of debugging code to help you diagnose problems.
|
||||||
#WebGUI::ErrorHandler::warn($self->get("templateId"));
|
#$session->log->warn($self->get("templateId"));
|
||||||
|
|
||||||
return $self->processTemplate($var, undef, $self->{_viewTemplate});
|
return $self->processTemplate( $var, undef, $self->{_viewTemplate} );
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -183,60 +184,6 @@ adminConsole views.
|
||||||
# return $self->getAdminConsole->render($self->getEditForm->print, $i18n->get("edit title"));
|
# return $self->getAdminConsole->render($self->getEditForm->print, $i18n->get("edit title"));
|
||||||
#}
|
#}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
# Everything below here is to make it easier to install your custom
|
|
||||||
# wobject, but has nothing to do with wobjects in general
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
# cd /data/WebGUI/lib
|
|
||||||
# perl -MWebGUI::Asset::Wobject::NewWobject -e install www.example.com.conf [ /path/to/WebGUI ]
|
|
||||||
# - or -
|
|
||||||
# perl -MWebGUI::Asset::Wobject::NewWobject -e uninstall www.example.com.conf [ /path/to/WebGUI ]
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
use base 'Exporter';
|
|
||||||
our @EXPORT = qw(install uninstall);
|
|
||||||
use WebGUI::Session;
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub install {
|
|
||||||
my $config = $ARGV[0];
|
|
||||||
my $home = $ARGV[1] || "/data/WebGUI";
|
|
||||||
die "usage: perl -MWebGUI::Asset::Wobject::NewWobject -e install www.example.com.conf\n" unless ($home && $config);
|
|
||||||
print "Installing asset.\n";
|
|
||||||
my $session = WebGUI::Session->open($home, $config);
|
|
||||||
$session->config->addToArray("assets","WebGUI::Asset::Wobject::NewWobject");
|
|
||||||
$session->db->write("create table NewWobject (
|
|
||||||
assetId varchar(22) binary not null,
|
|
||||||
revisionDate bigint not null,
|
|
||||||
primary key (assetId, revisionDate)
|
|
||||||
)");
|
|
||||||
$session->var->end;
|
|
||||||
$session->close;
|
|
||||||
print "Done. Please restart Apache.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
sub uninstall {
|
|
||||||
my $config = $ARGV[0];
|
|
||||||
my $home = $ARGV[1] || "/data/WebGUI";
|
|
||||||
die "usage: perl -MWebGUI::Asset::Wobject::NewWobject -e uninstall www.example.com.conf\n" unless ($home && $config);
|
|
||||||
print "Uninstalling asset.\n";
|
|
||||||
my $session = WebGUI::Session->open($home, $config);
|
|
||||||
$session->config->deleteFromArray("assets","WebGUI::Asset::Wobject::NewWobject");
|
|
||||||
my $rs = $session->db->read("select assetId from asset where className='WebGUI::Asset::Wobject::NewWobject'");
|
|
||||||
while (my ($id) = $rs->array) {
|
|
||||||
my $asset = WebGUI::Asset->new($session, $id, "WebGUI::Asset::Wobject::NewWobject");
|
|
||||||
$asset->purge if defined $asset;
|
|
||||||
}
|
|
||||||
$session->db->write("drop table NewWobject");
|
|
||||||
$session->var->end;
|
|
||||||
$session->close;
|
|
||||||
print "Done. Please restart Apache.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
#vim:ft=perl
|
#vim:ft=perl
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@ use Tie::IxHash;
|
||||||
use base 'WebGUI::Asset';
|
use base 'WebGUI::Asset';
|
||||||
use WebGUI::Utility;
|
use WebGUI::Utility;
|
||||||
|
|
||||||
|
# To get an installer for your wobject, add the Installable AssetAspect
|
||||||
|
# See WebGUI::AssetAspect::Installable and sbin/installClass.pl for more
|
||||||
|
# details
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
|
|
@ -40,21 +42,19 @@ These methods are available from this class:
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 addRevision
|
=head2 addRevision
|
||||||
|
|
||||||
This method exists for demonstration purposes only. The superclass
|
This method exists for demonstration purposes only. The superclass
|
||||||
handles revisions to NewAsset Assets.
|
handles revisions to NewAsset Assets.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub addRevision {
|
sub addRevision {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $newSelf = $self->SUPER::addRevision(@_);
|
my $newSelf = $self->SUPER::addRevision(@_);
|
||||||
return $newSelf;
|
return $newSelf;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -73,66 +73,68 @@ A hash reference passed in from a subclass definition.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub definition {
|
sub definition {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $definition = shift;
|
my $definition = shift;
|
||||||
my %properties;
|
my $i18n = WebGUI::International->new( $session, "Asset_NewAsset" );
|
||||||
tie %properties, 'Tie::IxHash';
|
tie my %properties, 'Tie::IxHash', (
|
||||||
my $i18n = WebGUI::International->new($session, "Asset_NewAsset");
|
templateId => {
|
||||||
%properties = (
|
|
||||||
templateId => {
|
|
||||||
# Determines which tab this property appears in
|
|
||||||
tab=>"display",
|
|
||||||
#See the list of field/control types in /lib/WebGUI/Form/
|
|
||||||
fieldType=>"template",
|
|
||||||
defaultValue=>'NewAssetTmpl0000000001',
|
|
||||||
#www_editSave will ignore anyone's attempts to update this field if this is set to 1
|
|
||||||
noFormPost=>0,
|
|
||||||
#This is an option specific to the template fieldType.
|
|
||||||
namespace=>"NewAsset",
|
|
||||||
#This is what will appear when the user hovers the mouse over the label
|
|
||||||
# of your form field.
|
|
||||||
hoverHelp=>$i18n->get('templateId label description'),
|
|
||||||
# This is the text that will appear to the left of your form field.
|
|
||||||
label=>$i18n->get('templateId label')
|
|
||||||
},
|
|
||||||
foo => {
|
|
||||||
tab=>"properties",
|
|
||||||
fieldType=>"text",
|
|
||||||
defaultValue=>undef,
|
|
||||||
label=>$i18n->get("foo label"),
|
|
||||||
hoverHelp=>$i18n->get("foo label help")
|
|
||||||
}
|
|
||||||
);
|
|
||||||
push(@{$definition}, {
|
|
||||||
assetName=>$i18n->get('assetName'),
|
|
||||||
icon=>'NewAsset.gif',
|
|
||||||
autoGenerateForms=>1,
|
|
||||||
tableName=>'NewAsset',
|
|
||||||
className=>'WebGUI::Asset::NewAsset',
|
|
||||||
properties=>\%properties
|
|
||||||
});
|
|
||||||
return $class->SUPER::definition($session, $definition);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
# Determines which tab this property appears in
|
||||||
|
tab => "display",
|
||||||
|
|
||||||
|
#See the list of field/control types in /lib/WebGUI/Form/
|
||||||
|
fieldType => "template",
|
||||||
|
defaultValue => 'NewAssetTmpl0000000001',
|
||||||
|
|
||||||
|
#www_editSave will ignore anyone's attempts to update this field if this is set to 1
|
||||||
|
noFormPost => 0,
|
||||||
|
|
||||||
|
#This is an option specific to the template fieldType.
|
||||||
|
namespace => "NewAsset",
|
||||||
|
|
||||||
|
#This is what will appear when the user hovers the mouse over the label
|
||||||
|
# of your form field.
|
||||||
|
hoverHelp => $i18n->get('templateId label description'),
|
||||||
|
|
||||||
|
# This is the text that will appear to the left of your form field.
|
||||||
|
label => $i18n->get('templateId label')
|
||||||
|
},
|
||||||
|
foo => {
|
||||||
|
tab => "properties",
|
||||||
|
fieldType => "text",
|
||||||
|
defaultValue => undef,
|
||||||
|
label => $i18n->get("foo label"),
|
||||||
|
hoverHelp => $i18n->get("foo label help")
|
||||||
|
},
|
||||||
|
);
|
||||||
|
push @{$definition}, {
|
||||||
|
assetName => $i18n->get('assetName'),
|
||||||
|
icon => 'NewAsset.gif',
|
||||||
|
autoGenerateForms => 1,
|
||||||
|
tableName => 'NewAsset',
|
||||||
|
className => 'WebGUI::Asset::NewAsset',
|
||||||
|
properties => \%properties,
|
||||||
|
};
|
||||||
|
return $class->SUPER::definition( $session, $definition );
|
||||||
|
} ## end sub definition
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 duplicate
|
=head2 duplicate
|
||||||
|
|
||||||
This method exists for demonstration purposes only. The superclass
|
This method exists for demonstration purposes only. The superclass
|
||||||
handles duplicating NewAsset Assets. This method will be called
|
handles duplicating NewAsset Assets. This method will be called
|
||||||
whenever a copy action is executed
|
whenever a copy action is executed
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub duplicate {
|
sub duplicate {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $newAsset = $self->SUPER::duplicate(@_);
|
my $newAsset = $self->SUPER::duplicate(@_);
|
||||||
return $newAsset;
|
return $newAsset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 indexContent ( )
|
=head2 indexContent ( )
|
||||||
|
|
@ -142,12 +144,11 @@ Making private. See WebGUI::Asset::indexContent() for additonal details.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub indexContent {
|
sub indexContent {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $indexer = $self->SUPER::indexContent;
|
my $indexer = $self->SUPER::indexContent;
|
||||||
$indexer->setIsPublic(0);
|
$indexer->setIsPublic(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 prepareView ( )
|
=head2 prepareView ( )
|
||||||
|
|
@ -157,14 +158,13 @@ See WebGUI::Asset::prepareView() for details.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub prepareView {
|
sub prepareView {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->SUPER::prepareView();
|
$self->SUPER::prepareView();
|
||||||
my $template = WebGUI::Asset::Template->new($self->session, $self->get("templateId"));
|
my $template = WebGUI::Asset::Template->new( $self->session, $self->get("templateId") );
|
||||||
$template->prepare;
|
$template->prepare;
|
||||||
$self->{_viewTemplate} = $template;
|
$self->{_viewTemplate} = $template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 processPropertiesFromFormPost ( )
|
=head2 processPropertiesFromFormPost ( )
|
||||||
|
|
@ -176,11 +176,10 @@ when /yourAssetUrl?func=editSave is requested/posted.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub processPropertiesFromFormPost {
|
sub processPropertiesFromFormPost {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
$self->SUPER::processPropertiesFromFormPost;
|
$self->SUPER::processPropertiesFromFormPost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 purge ( )
|
=head2 purge ( )
|
||||||
|
|
@ -194,8 +193,8 @@ asset instances, you will need to purge them here.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub purge {
|
sub purge {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->SUPER::purge;
|
return $self->SUPER::purge;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -207,8 +206,8 @@ This method is called when data is purged by the system.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub purgeRevision {
|
sub purgeRevision {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return $self->SUPER::purgeRevision;
|
return $self->SUPER::purgeRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -220,13 +219,12 @@ method called by the container www_view method.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub view {
|
sub view {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $var = $self->get; # $var is a hash reference.
|
my $var = $self->get; # $var is a hash reference.
|
||||||
$var->{controls} = $self->getToolbar;
|
$var->{controls} = $self->getToolbar;
|
||||||
return $self->processTemplate($var,undef, $self->{_viewTemplate});
|
return $self->processTemplate( $var, undef, $self->{_viewTemplate} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
||||||
=head2 www_edit ( )
|
=head2 www_edit ( )
|
||||||
|
|
@ -238,69 +236,14 @@ the module.
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub www_edit {
|
sub www_edit {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $session = $self->session;
|
my $session = $self->session;
|
||||||
return $session->privilege->insufficient() unless $self->canEdit;
|
return $session->privilege->insufficient() unless $self->canEdit;
|
||||||
return $session->privilege->locked() unless $self->canEditIfLocked;
|
return $session->privilege->locked() unless $self->canEditIfLocked;
|
||||||
my $i18n = WebGUI::International->new($session, 'Asset_NewAsset');
|
my $i18n = WebGUI::International->new( $session, 'Asset_NewAsset' );
|
||||||
return $self->getAdminConsole->render($self->getEditForm->print, $i18n->get('edit asset'));
|
return $self->getAdminConsole->render( $self->getEditForm->print, $i18n->get('edit asset') );
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
# Everything below here is to make it easier to install your custom
|
|
||||||
# asset, but has nothing to do with assets in general
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
# cd /data/WebGUI/lib
|
|
||||||
# perl -MWebGUI::Asset::NewAsset -e install www.example.com.conf [ /path/to/WebGUI ]
|
|
||||||
# - or -
|
|
||||||
# perl -MWebGUI::Asset::NewAsset -e uninstall www.example.com.conf [ /path/to/WebGUI ]
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
use base 'Exporter';
|
|
||||||
our @EXPORT = qw(install uninstall);
|
|
||||||
use WebGUI::Session;
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
sub install {
|
|
||||||
my $config = $ARGV[0];
|
|
||||||
my $home = $ARGV[1] || "/data/WebGUI";
|
|
||||||
die "usage: perl -MWebGUI::Asset::NewAsset -e install www.example.com.conf\n" unless ($home && $config);
|
|
||||||
print "Installing asset.\n";
|
|
||||||
my $session = WebGUI::Session->open($home, $config);
|
|
||||||
$session->config->addToArray("assets","WebGUI::Asset::NewAsset");
|
|
||||||
$session->db->write("create table NewAsset (
|
|
||||||
assetId varchar(22) binary not null,
|
|
||||||
revisionDate bigint not null,
|
|
||||||
primary key (assetId, revisionDate)
|
|
||||||
)");
|
|
||||||
$session->var->end;
|
|
||||||
$session->close;
|
|
||||||
print "Done. Please restart Apache.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
|
||||||
|
|
||||||
sub uninstall {
|
|
||||||
my $config = $ARGV[0];
|
|
||||||
my $home = $ARGV[1] || "/data/WebGUI";
|
|
||||||
die "usage: perl -MWebGUI::Asset::NewAsset -e uninstall www.example.com.conf\n" unless ($home && $config);
|
|
||||||
print "Uninstalling asset.\n";
|
|
||||||
my $session = WebGUI::Session->open($home, $config);
|
|
||||||
$session->config->deleteFromArray("assets","WebGUI::Asset::NewAsset");
|
|
||||||
my $rs = $session->db->read("select assetId from asset where className='WebGUI::Asset::NewAsset'");
|
|
||||||
while (my ($id) = $rs->array) {
|
|
||||||
my $asset = WebGUI::Asset->new($session, $id, "WebGUI::Asset::NewAsset");
|
|
||||||
$asset->purge if defined $asset;
|
|
||||||
}
|
|
||||||
$session->db->write("drop table NewAsset");
|
|
||||||
$session->var->end;
|
|
||||||
$session->close;
|
|
||||||
print "Done. Please restart Apache.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
#vim:ft=perl
|
#vim:ft=perl
|
||||||
|
|
|
||||||
|
|
@ -579,6 +579,7 @@ by the form param 'status'. Status can either be 'NotPaid' or 'Scheduled' and ma
|
||||||
not have their vendorPayoutStatus set to 'Paid'.
|
not have their vendorPayoutStatus set to 'Paid'.
|
||||||
|
|
||||||
Returns the status to which the item(s) are set.
|
Returns the status to which the item(s) are set.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub www_setPayoutStatus {
|
sub www_setPayoutStatus {
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ our $I18N = {
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
context => 'Label for button to submit search form',
|
context => 'Label for button to submit search form',
|
||||||
},
|
},
|
||||||
|
|
||||||
"templateIdAddArchive label" => {
|
"templateIdAddArchive label" => {
|
||||||
message => "Template to Add Multiple",
|
message => "Template to Add Multiple",
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
|
|
@ -741,6 +742,25 @@ our $I18N = {
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
context => q{Option label for 300 pixels-per-inch images, good for printing images},
|
context => q{Option label for 300 pixels-per-inch images, good for printing images},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'template listAlbumsRss' => {
|
||||||
|
message => 'Subscribe',
|
||||||
|
lastUpdated => 1237403207,
|
||||||
|
context => 'Label for link to RSS feed.',
|
||||||
|
},
|
||||||
|
|
||||||
|
'template search basic title' => {
|
||||||
|
message => 'Search Gallery',
|
||||||
|
lastUpdated => 1237403442,
|
||||||
|
context => 'Title for basic search form in page.',
|
||||||
|
},
|
||||||
|
|
||||||
|
'template search basic term' => {
|
||||||
|
message => 'Search Term',
|
||||||
|
lastUpdated => 1237403498,
|
||||||
|
context => 'Title for basic search term field in page.',
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -574,6 +574,18 @@ our $I18N = {
|
||||||
context => q{template label in the Edit Album template. To pick a thumbnail to use to represent the Album.},
|
context => q{template label in the Edit Album template. To pick a thumbnail to use to represent the Album.},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'template album thumbnail alt' => {
|
||||||
|
message => 'Preview thumbnail for',
|
||||||
|
lastUpdated => 1237404629,
|
||||||
|
context => 'Alt text for album thumbnail.',
|
||||||
|
},
|
||||||
|
|
||||||
|
'template url_addDescription' => {
|
||||||
|
message => 'Add a Description',
|
||||||
|
lastUpdated => 1237405184,
|
||||||
|
context => 'Label for URL to add an album Description.',
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -760,6 +760,10 @@ our $I18N = {
|
||||||
context => q{Error message when a user tries to recover password and they don't have an email address},
|
context => q{Error message when a user tries to recover password and they don't have an email address},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'newUser_username' => {
|
||||||
|
message => 'Username of registering user',
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
|
|
@ -161,5 +161,8 @@ $product->purge;
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# Cleanup
|
# Cleanup
|
||||||
END {
|
END {
|
||||||
|
if ($shipper) {
|
||||||
|
$shipper->delete;
|
||||||
|
}
|
||||||
$session2->close;
|
$session2->close;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
www/extras/assets/adsku.gif
Normal file
BIN
www/extras/assets/adsku.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
www/extras/assets/small/adsku.gif
Normal file
BIN
www/extras/assets/small/adsku.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1 KiB |
|
|
@ -45,10 +45,8 @@ if (typeof Survey === "undefined") {
|
||||||
function formsubmit(event){
|
function formsubmit(event){
|
||||||
var submit = 1;//boolean for if all was good or not
|
var submit = 1;//boolean for if all was good or not
|
||||||
for (var i in toValidate) {
|
for (var i in toValidate) {
|
||||||
console.log(toValidate);
|
|
||||||
if (YAHOO.lang.hasOwnProperty(toValidate, i)) {
|
if (YAHOO.lang.hasOwnProperty(toValidate, i)) {
|
||||||
var answered = 0;
|
var answered = 0;
|
||||||
console.log(toValidate[i].type);
|
|
||||||
if (toValidate[i].type === 'Multi Slider - Allocate') {
|
if (toValidate[i].type === 'Multi Slider - Allocate') {
|
||||||
var total = 0;
|
var total = 0;
|
||||||
for (var z in toValidate[i].answers) {
|
for (var z in toValidate[i].answers) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue