merged with HEAD and other interesting changes
This commit is contained in:
parent
66c6c0fae5
commit
856cc06d04
151 changed files with 7335 additions and 2602 deletions
|
|
@ -433,5 +433,15 @@ sub showError {
|
|||
return $self->processTemplate($var,$templateId)
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 store ( )
|
||||
|
||||
This method returns an internal hash where you can store things for your Account Plugin.
|
||||
The store is private to your plugin, to each user's copy of the plugin, and only lasts as
|
||||
long as the session does.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -328,7 +328,7 @@ sub www_removeFriend {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_removeFriend ( )
|
||||
=head2 www_removeFriendConfirm ( )
|
||||
|
||||
This is a confirmation page of whether or not the user wishes to remove the selected user from friend
|
||||
|
||||
|
|
|
|||
|
|
@ -48,8 +48,11 @@ sub appendCommonVars {
|
|||
my $user = $session->user;
|
||||
my $method = $session->form->get("do");
|
||||
|
||||
$var->{'manage_purchases_url' } = $self->getUrl("module=shop;do=managePurchases");
|
||||
$var->{'managesPurchasesIsActive'} = WebGUI::Utility::isIn($method,("","managePurchases","view","viewTransaction"));
|
||||
$var->{ 'manage_purchases_url' } = $self->getUrl("module=shop;do=managePurchases");
|
||||
$var->{ 'managesPurchasesIsActive' } = WebGUI::Utility::isIn($method,("","managePurchases","view","viewTransaction"));
|
||||
|
||||
$var->{ 'view_sales_url' } = $self->getUrl( 'module=shop;do=viewSales' );
|
||||
$var->{ 'viewSalesIsActive' } = $method eq 'viewSales';
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -108,6 +111,13 @@ sub editSettingsForm {
|
|||
label => $shopi18n->get("my purchases detail template"),
|
||||
hoverHelp => $shopi18n->get("my purchases detail template help")
|
||||
);
|
||||
$f->template(
|
||||
name => 'shopMySalesTemplateId',
|
||||
value => $self->session->setting->get('shopMySalesTemplateId'),
|
||||
namespace => 'Shop/MySales',
|
||||
label => $shopi18n->echo('my sales template'),
|
||||
hoverHelp => $shopi18n->echo('my sales template help'),
|
||||
);
|
||||
|
||||
return $f->printRowsOnly;
|
||||
}
|
||||
|
|
@ -130,6 +140,7 @@ sub editSettingsFormSave {
|
|||
$setting->set("shopLayoutTemplateId", $form->process("shopLayoutTemplateId","template"));
|
||||
$setting->set("shopMyPurchasesTemplateId", $form->process("shopMyPurchasesTemplateId","template"));
|
||||
$setting->set("shopMyPurchasesDetailTemplateId", $form->process("shopMyPurchasesDetailTemplateId","template"));
|
||||
$setting->set("shopMySalesTemplateId", $form->process("shopMySalesTemplateId","template"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -208,6 +219,43 @@ sub www_view {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewSales ( )
|
||||
|
||||
Page that show your earnings if you are a vendor.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewSales {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
my $vendor = WebGUI::Shop::Vendor->newByUserId( $session, $session->user->userId );
|
||||
|
||||
my $var = $vendor->getPayoutTotals;
|
||||
my $totalSales = 0;
|
||||
my @products;
|
||||
|
||||
my $sth = $session->db->read(
|
||||
'select *, sum(quantity) as quantity, sum(vendorPayoutAmount) as payoutAmount from transactionItem '
|
||||
.'where vendorId=? group by assetId order by quantity desc',
|
||||
[ $vendor->getId ]
|
||||
);
|
||||
while (my $row = $sth->hashRef) {
|
||||
push @products, $row;
|
||||
$totalSales += $row->{quantity};
|
||||
}
|
||||
$sth->finish;
|
||||
|
||||
$var->{ product_loop } = \@products;
|
||||
$var->{ total_products } = scalar @products;
|
||||
$var->{ total_sales } = $totalSales;
|
||||
|
||||
$self->appendCommonVars( $var );
|
||||
|
||||
return $self->processTemplate( $var, $session->setting->get('shopMySalesTemplateId') );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewTransaction ( )
|
||||
|
||||
The main view page for editing the user's profile.
|
||||
|
|
@ -294,4 +342,5 @@ sub www_viewTransaction {
|
|||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -262,27 +262,32 @@ sub set {
|
|||
$self->{_properties}{priority} = exists $properties->{priority} ? $properties->{priority} : $self->{_properties}{priority};
|
||||
# prerender the ad for faster display
|
||||
my $adSpace = WebGUI::AdSpace->new($self->session, $self->get("adSpaceId"));
|
||||
if ($self->get("type") eq "text") {
|
||||
$self->{_properties}{renderedAd} = '<div style="position:relative; width:' . ($adSpace->get("width")-2) . 'px; height:' .
|
||||
($adSpace->get("height")-2) . 'px; margin:0px; overflow:hidden; border:solid ' . $self->get("borderColor") .
|
||||
q{ 1px;"><a href='#' OnClick="window.location.assign('} .
|
||||
$self->session->url->gateway(undef, "op=clickAd;id=".$self->getId) .
|
||||
q{')" style="position:absolute; padding: 3px; top:0px; left:0px; width:100%; height:100%; z-index:10;} .
|
||||
' display:block; text-decoration:none; vertical-align:top; background-color:' . $self->get("backgroundColor") .
|
||||
'; font-size: 13px; font-weight: normal;"><b><span style="color:' . $self->get("textColor") . ';">' .
|
||||
$self->get("title") . '</span></b><br /><span style="color:' . $self->get("textColor") . ';">' .
|
||||
$self->get("adText") . '</span></a></div>';
|
||||
} elsif ($self->get("type") eq "image") {
|
||||
my $storage = WebGUI::Storage->get($self->session, $self->get("storageId"));
|
||||
$self->{_properties}{renderedAd} = '<div style="position:relative; width:' . $adSpace->get("width") . 'px; height:' .
|
||||
$adSpace->get("height") . 'px; margin:0px; overflow:hidden; border:0px;"><a href="#" ' .
|
||||
q{onClick="window.location.assign('} .
|
||||
$self->session->url->gateway(undef, "op=clickAd;id=".$self->getId) . q{')" style="position:absolute; padding: } .
|
||||
'3px; top:0px; left:0px; width:100%; height:100%; z-index:10; display:block; text-decoration:none; ' .
|
||||
'vertical-align:top;"><img ' .
|
||||
'src="' . $storage->getUrl($storage->getFiles->[0]) . '" alt="' . $self->get("title") .
|
||||
'" style="z-index:0;position:relative;border-style:none;border: 0px;" /></a></div>';
|
||||
} elsif ($self->get("type") eq "rich") {
|
||||
if ($self->get("type") eq "text") {
|
||||
$self->{_properties}{renderedAd} =
|
||||
q{<div style="position:relative; width:} . ($adSpace->get("width")-2) . q{px; height:}
|
||||
. ($adSpace->get("height")-2) . q{px; margin:0px; overflow:hidden; border:solid }
|
||||
. $self->get("borderColor") . q{ 1px;"><a href='#' onclick="window.location.assign('}
|
||||
. $self->session->url->gateway(undef, "op=clickAd;id=".$self->getId)
|
||||
. q{')" style="position:absolute; padding: 3px; top:0px; left:0px; width:100%; height:100%; z-index:10;}
|
||||
. q{ display:block; text-decoration:none; vertical-align:top; background-color:}
|
||||
. $self->get("backgroundColor") . q{; font-size: 13px; font-weight: normal;"><b><span style="color:}
|
||||
. $self->get("textColor") . q{;">} . $self->get("title")
|
||||
. q{</span></b><br /><span style="color:} . $self->get("textColor") . q{;">}
|
||||
. $self->get("adText") . q{</span></a></div>};
|
||||
}
|
||||
elsif ($self->get("type") eq "image") {
|
||||
my $storage = WebGUI::Storage->get($self->session, $self->get("storageId"));
|
||||
$self->{_properties}{renderedAd} =
|
||||
q{<div style="position:relative; width:} . $adSpace->get("width") . q{px; height:}
|
||||
. $adSpace->get("height") . q{px; margin:0px; overflow:hidden; border:0px;"><a href="#" }
|
||||
. q{onclick="window.location.assign('} .$self->session->url->gateway(undef, "op=clickAd;id=".$self->getId)
|
||||
. q{')" style="position:absolute; padding: }
|
||||
. q{3px; top:0px; left:0px; width:100%; height:100%; z-index:10; display:block; text-decoration:none; }
|
||||
. q{vertical-align:top;"><img }
|
||||
. q{src="} . $storage->getUrl($storage->getFiles->[0]) . q{" alt="} . $self->get("title")
|
||||
. q{" style="z-index:0;position:relative;border-style:none;border: 0px;" /></a></div>};
|
||||
}
|
||||
elsif ($self->get("type") eq "rich") {
|
||||
my $ad = $self->get("richMedia");
|
||||
WebGUI::Macro::process($self->session, \$ad);
|
||||
$self->{_properties}{renderedAd} = $ad;
|
||||
|
|
|
|||
|
|
@ -215,17 +215,27 @@ A reference to the current session.
|
|||
|
||||
If supplied, provides a list of defaults such as title and icons for the admin console.
|
||||
|
||||
=head3 options
|
||||
|
||||
A hash reference of options with the following keys
|
||||
|
||||
=head4 showAdminBar
|
||||
|
||||
If true, will show the admin bar on this admin console page
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $id = shift;
|
||||
my $options = shift;
|
||||
my $self;
|
||||
$self->{_session} = $session;
|
||||
bless $self, $class;
|
||||
$self->{_function} = {};
|
||||
$self->{_functionId} = $id;
|
||||
$self->{_options} = $options;
|
||||
return $self;
|
||||
}
|
||||
|
||||
|
|
@ -289,7 +299,17 @@ sub render {
|
|||
}
|
||||
|
||||
$var{"backtosite.url"} = $self->session->url->getBackToSiteURL();
|
||||
return $self->session->style->process(WebGUI::Asset::Template->new($self->session,$self->session->setting->get("AdminConsoleTemplate"))->process(\%var),"PBtmpl0000000000000137");
|
||||
my $template
|
||||
= WebGUI::Asset::Template->new(
|
||||
$self->session,
|
||||
$self->session->setting->get("AdminConsoleTemplate")
|
||||
);
|
||||
if ( $self->{_options}->{showAdminBar} ) {
|
||||
$var{adminBar}
|
||||
= WebGUI::Macro::AdminBar::process($self->session);
|
||||
}
|
||||
my $output = $template->process(\%var);
|
||||
return $self->session->style->process($output,"PBtmpl0000000000000137");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -58,6 +58,43 @@ sub addRevision {
|
|||
return $newSelf;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canAdd ( )
|
||||
|
||||
Override canAdd to ignore its permissions check. Permissions are handled
|
||||
by the parent Matrix.
|
||||
|
||||
=cut
|
||||
|
||||
sub canAdd {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canEdit ( )
|
||||
|
||||
Returns true if the user can edit this asset. C<userId> is a WebGUI user ID.
|
||||
|
||||
Users can edit this Matrix listing if they are the owner, or if they can edit
|
||||
the parent Matrix.
|
||||
|
||||
=cut
|
||||
|
||||
sub canEdit {
|
||||
my $self = shift;
|
||||
|
||||
if ( $self->session->form->process("assetId") eq "new" ) {
|
||||
return $self->getParent->canAddMatrixListing();
|
||||
}
|
||||
else {
|
||||
return 1 if $self->session->user->userId eq $self->get("ownerUserId");
|
||||
|
||||
return $self->getParent->canEdit();
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( session, definition )
|
||||
|
|
@ -313,11 +350,27 @@ sub getEditForm {
|
|||
$attribute->{label} = $attribute->{name};
|
||||
$attribute->{subtext} = $attribute->{description};
|
||||
$attribute->{name} = 'attribute_'.$attribute->{attributeId};
|
||||
if($attribute->{fieldType} eq 'Combo'){
|
||||
my %options;
|
||||
tie %options, 'Tie::IxHash';
|
||||
%options = $db->buildHash("select value, value from MatrixListing_attribute
|
||||
where attributeId = ? and value != '' order by value",[$attribute->{attributeId}]);
|
||||
$attribute->{options} = \%options;
|
||||
$attribute->{extras} = "style='width:120px'";
|
||||
}
|
||||
$form->dynamicField(%{$attribute});
|
||||
}
|
||||
}
|
||||
|
||||
$form->submit();
|
||||
$form->raw(
|
||||
'<tr><td COLSPAN=2>'.
|
||||
WebGUI::Form::Submit($session, {}).
|
||||
WebGUI::Form::Button($session, {
|
||||
-value => $i18n->get('cancel', 'WebGUI'),
|
||||
-extras => q|onclick="history.go(-1);" class="backwardButton"|
|
||||
}).
|
||||
'</td></tr>'
|
||||
);
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
|
@ -564,6 +617,16 @@ sub view {
|
|||
if ($emailSent){
|
||||
$var->{emailSent} = 1;
|
||||
}
|
||||
|
||||
unless($self->hasBeenCommitted){
|
||||
my $workflowInstanceId = $db->quickScalar("select workflowInstanceId from assetVersionTag where tagId =?"
|
||||
,[$self->get('tagId')]);
|
||||
$var->{canApprove} = $self->getParent->canEdit;
|
||||
$var->{approveOrDenyUrl} = $self->getUrl("op=manageRevisionsInTag;workflowInstanceId=".$workflowInstanceId
|
||||
.";tagId=".$self->get('tagId'));
|
||||
}
|
||||
$var->{canEdit} = $self->canEdit;
|
||||
$var->{editUrl} = $self->getUrl("func=edit");
|
||||
$var->{controls} = $self->getToolbar;
|
||||
$var->{comments} = $self->getFormattedComments();
|
||||
$var->{productName} = $var->{title};
|
||||
|
|
@ -629,33 +692,10 @@ sub view {
|
|||
my $storage = $file->getStorageLocation;
|
||||
my @files;
|
||||
@files = @{ $storage->getFiles } if (defined $storage);
|
||||
|
||||
$var->{screenshots} = qq|
|
||||
<script type="text/javascript" src="/extras/ukplayer/swfobject.js"></script>
|
||||
<script type="text/javascript">
|
||||
swfobject.registerObject("myFlashContent","9.0.0","/extras/ukplayer/expressInstall.swf");
|
||||
</script>
|
||||
<div>
|
||||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="400" height="300" id="myFlashContent">
|
||||
<param name="movie" value="/extras/ukplayer/slideShow.swf" />
|
||||
<param name="flashvars" value="config=?func=getScreenshotsConfig" />
|
||||
<!--[if !IE]>-->
|
||||
<object type="application/x-shockwave-flash" data="/extras/ukplayer/slideShow.swf" width="400"
|
||||
height="300">
|
||||
<param name="flashvars" value="config=?func=getScreenshotsConfig" />
|
||||
<!--<![endif]-->
|
||||
<a href="http:/www.adobe.com/go/getflashplayer">
|
||||
<img src="http:/www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe
|
||||
Flash player" />
|
||||
</a>
|
||||
<!--[if !IE]>-->
|
||||
</object>
|
||||
<!--<![endif]-->
|
||||
</object>
|
||||
</div>
|
||||
|;
|
||||
$var->{screenshotsUrl} = $self->getUrl('func=viewScreenshots');
|
||||
$var->{screenshotThumbnail} = $storage->getUrl('thumb-'.$files[0]);
|
||||
}
|
||||
|
||||
|
||||
# Rating form
|
||||
|
||||
my %rating;
|
||||
|
|
@ -817,12 +857,14 @@ Web facing method which is the default edit page
|
|||
|
||||
sub www_edit {
|
||||
my $self = shift;
|
||||
|
||||
return $self->session->privilege->noAccess() unless $self->getParent->canAddMatrixListing();
|
||||
|
||||
my $i18n = WebGUI::International->new($self->session, "Asset_MatrixListing");
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
return $self->session->privilege->locked() unless $self->canEditIfLocked;
|
||||
|
||||
if($self->session->form->process('func') eq 'add'){
|
||||
return $self->session->privilege->noAccess() unless $self->getParent->canAddMatrixListing();
|
||||
}else{
|
||||
return $self->session->privilege->insufficient() unless $self->canEdit;
|
||||
return $self->session->privilege->locked() unless $self->canEditIfLocked;
|
||||
}
|
||||
|
||||
my $var = $self->get;
|
||||
my $matrix = $self->getParent;
|
||||
|
|
@ -912,9 +954,7 @@ sub www_getScreenshots {
|
|||
my $thumb = 'thumb-'.$file;
|
||||
$xml .= "
|
||||
<slide>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<title><![CDATA[<b>Slide</b> One]]></title>
|
||||
<title></title>
|
||||
<description><![CDATA[ Screenshots ]]></description>
|
||||
<image_source>".$storage->getUrl($file)."</image_source>
|
||||
<duration>5</duration>
|
||||
|
|
@ -942,56 +982,14 @@ Returns the xml config file for the ukplayer that displays the screenshots.
|
|||
=cut
|
||||
|
||||
sub www_getScreenshotsConfig {
|
||||
my $self = shift;
|
||||
my $self = shift;
|
||||
my $var = $self->get;
|
||||
|
||||
return $self->session->privilege->noAccess() unless $self->canView;
|
||||
|
||||
$self->session->http->setMimeType('text/xml');
|
||||
|
||||
my $xml = qq|<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config>
|
||||
|
||||
<content_url>?func=getScreenshots</content_url>
|
||||
|
||||
<width>400</width><!-- this value is overwritten by the flashVars but the tag needs to be here (and it is
|
||||
useful for offline testing) -->
|
||||
<height>300</height><!-- this value is overwritten by the flashVars but the tag needs to be here (and it is
|
||||
useful for offline testing) -->
|
||||
<background_color>0xDDDDEE</background_color>
|
||||
<default_duration>20</default_duration>
|
||||
<default_slidewidth>100</default_slidewidth>
|
||||
<default_slideheight>100</default_slideheight>
|
||||
|
||||
<font>Verdana</font>
|
||||
<font_size>12</font_size>
|
||||
<font_color>0xCCCCCC</font_color>
|
||||
<text_border_color>0xCCCCCC</text_border_color>
|
||||
<text_bg_color>0x000000</text_bg_color>
|
||||
<text_autohide>true</text_autohide>
|
||||
|
||||
<controls_color>0xCCCCCC</controls_color>
|
||||
<controls_border_color>0xCCCCCC</controls_border_color>
|
||||
<controls_bg_color>0x000000</controls_bg_color>
|
||||
<controls_autohide>false</controls_autohide>
|
||||
|
||||
<thumbnail_width>48</thumbnail_width>
|
||||
<thumbnail_height>36</thumbnail_height>
|
||||
<thumbnail_border_color>0x000000</thumbnail_border_color>
|
||||
<menu_autohide>true</menu_autohide>
|
||||
<menu_dead_zone_width>100</menu_dead_zone_width>
|
||||
<menu_gaps>5</menu_gaps>
|
||||
|
||||
<mute_at_start>false</mute_at_start>
|
||||
<autostart>true</autostart>
|
||||
<autopause>false</autopause>
|
||||
<loop>false</loop>
|
||||
<error_message_content><![CDATA[XML not found: ]]></error_message_content>
|
||||
<error_message_image><![CDATA[Image not found]]></error_message_image>
|
||||
|
||||
</config>
|
||||
|;
|
||||
|
||||
return $xml;
|
||||
return $self->processTemplate($var,$self->getParent->get("screenshotsConfigTemplateId"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -1099,7 +1097,24 @@ sub www_view {
|
|||
return $self->view;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_viewScreenshots ( )
|
||||
|
||||
Returns this listing's screenshots in a ukplayer.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_viewScreenshots {
|
||||
my $self = shift;
|
||||
my $var = $self->get;
|
||||
|
||||
$var->{configUrl} = 'config='.$self->getUrl("func=getScreenshotsConfig");
|
||||
|
||||
return $self->session->privilege->noAccess() unless $self->canView;
|
||||
|
||||
return $self->processTemplate($var,$self->getParent->get("screenshotsTemplateId"));
|
||||
}
|
||||
1;
|
||||
|
||||
#vim:ft=perl
|
||||
|
|
|
|||
|
|
@ -292,6 +292,31 @@ sub getThumbnailUrl {
|
|||
return undef;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
=head2 getVendorId ( )
|
||||
|
||||
Returns the vendorId of the vendor for this sku. Defaults to the default
|
||||
vendor with id defaultvendor000000000.
|
||||
|
||||
=cut
|
||||
|
||||
sub getVendorId {
|
||||
my $self = shift;
|
||||
return 'defaultvendor000000000';
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getVendorPayout ( )
|
||||
|
||||
Returns the amount that should be payed to the vendor for this sku.
|
||||
|
||||
=cut
|
||||
|
||||
sub getVendorPayout {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getWeight ( )
|
||||
|
|
|
|||
|
|
@ -140,6 +140,25 @@ sub definition {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getDiscountAmount -- class level function
|
||||
|
||||
returns the amount of discount to apply to this purchase
|
||||
|
||||
=cut
|
||||
|
||||
sub getDiscountAmount {
|
||||
my($discounts,$count) = @_;
|
||||
my @discounts = parseDiscountText( $discounts );
|
||||
my $previousDiscount = 0;
|
||||
foreach my $discountSet ( @discounts ) {
|
||||
last if $count < $discountSet->[1];
|
||||
$previousDiscount = $discountSet->[0];
|
||||
}
|
||||
return $previousDiscount;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getDiscountText -- class level function
|
||||
|
||||
returns a string with a coma seperated list of counts fromt he discount text
|
||||
|
|
@ -181,6 +200,24 @@ sub getImpressionDiscountText {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getPrice
|
||||
|
||||
get the price for this purchase
|
||||
|
||||
sub getPrice {
|
||||
my $self = shift;
|
||||
my $options = $self->getOptions;
|
||||
my $impressionCount = $options->{impressions};
|
||||
my $clickCount = $options->{clicks};
|
||||
my $impressionDiscount = getDiscountAmount($self->get('impressionDiscounts'),$impressionCount );
|
||||
my $clickDiscount = getDiscountAmount($self->get('clickDiscounts'),$clickCount );
|
||||
my $impressionPrice = $self->get('pricePerImpression') - ( $impressionDiscount / 100 );
|
||||
my $clickPrice = $self->get('pricePerClick') - ( $clickDiscount / 100 );
|
||||
return sprintf "%.2f", $impressionPrice * $impressionCount + $clickPrice * $clickCount;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 i18n
|
||||
|
||||
returns an internationalization object for this class
|
||||
|
|
@ -235,7 +272,7 @@ sub manage {
|
|||
|
||||
=head2 onCompletePurchase
|
||||
|
||||
Applies the first term of the subscription. This method is called when the payment is successful.
|
||||
inserts the ad intothe adspace...
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -265,7 +302,7 @@ sub parseDiscountText {
|
|||
push @discounts, [ $1, $2 ];
|
||||
}
|
||||
}
|
||||
return @discounts;
|
||||
return sort { $a->[1] <=> $b->[1] } @discounts;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -325,40 +362,40 @@ sub view {
|
|||
manageLink => $self->getUrl("func=manage"),
|
||||
adSkuTitle => $self->get('title'),
|
||||
adSkuDescription => $self->get('description'),
|
||||
form_title => WebGUI::Form::text($session, {
|
||||
-name=>"form_title",
|
||||
formTitle => WebGUI::Form::text($session, {
|
||||
-name=>"formTitle",
|
||||
-value=>$self->{title},
|
||||
-size=>40
|
||||
-default=>'untitled',
|
||||
}),
|
||||
form_link => WebGUI::Form::Url($session, {
|
||||
-name=>"form_link",
|
||||
formLink => WebGUI::Form::Url($session, {
|
||||
-name=>"formLink",
|
||||
-value=>$self->{link},
|
||||
-size=>40
|
||||
-required=>1,
|
||||
}),
|
||||
form_image => WebGUI::Form::Image($session, {
|
||||
-name=>"form_image",
|
||||
formImage => WebGUI::Form::Image($session, {
|
||||
-name=>"formImage",
|
||||
-value=>$self->{image},
|
||||
-size=>40
|
||||
-required=>1,
|
||||
-forceImageOnly=>1,
|
||||
}),
|
||||
form_clicks => WebGUI::Form::Integer($session, {
|
||||
-name=>"form_clicks",
|
||||
formClicks => WebGUI::Form::Integer($session, {
|
||||
-name=>"formClicks",
|
||||
-value=>$self->{clicks},
|
||||
-size=>40
|
||||
-required=>1,
|
||||
}),
|
||||
form_impressions => WebGUI::Form::Integer($session, {
|
||||
-name=>"form_impressions",
|
||||
formImpressions => WebGUI::Form::Integer($session, {
|
||||
-name=>"formImpressions",
|
||||
-value=>$self->{impressions},
|
||||
-size=>40
|
||||
-required=>1,
|
||||
}),
|
||||
click_price => $self->get('pricePerClick'),
|
||||
impression_price => $self->get('pricePerImpression'),
|
||||
click_discount => $self->getClickDiscountText,
|
||||
impression_discount => $self->getImpressionDiscountText,
|
||||
clickPrice => $self->get('pricePerClick'),
|
||||
impressionPrice => $self->get('pricePerImpression'),
|
||||
clickDiscount => $self->getClickDiscountText,
|
||||
impressionDiscount => $self->getImpressionDiscountText,
|
||||
);
|
||||
return $self->processTemplate(\%var,undef,$self->{_viewTemplate});
|
||||
}
|
||||
|
|
@ -398,7 +435,14 @@ sub www_addToCart {
|
|||
my $self = shift;
|
||||
if ($self->canView) {
|
||||
$self->{_hasAddedToCart} = 1;
|
||||
$self->addToCart({price => $self->getPrice});
|
||||
my $form = $self->session->form;
|
||||
$self->addToCart({
|
||||
title => $form->get('formTitle'),
|
||||
link => $form->get('formLink','url'),
|
||||
image => $form->get('formImage'),
|
||||
clicks => $form->get('formClicks'),
|
||||
impressions => $form->get('formImpressions'),
|
||||
});
|
||||
}
|
||||
return $self->www_view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,11 +169,14 @@ Accepts the information from the donation form and adds it to the cart.
|
|||
=cut
|
||||
|
||||
sub www_donate {
|
||||
my $self = shift;
|
||||
if ($self->canView) {
|
||||
my $self = shift;
|
||||
my $price = $self->session->form->get("price") || $self->getPrice;
|
||||
|
||||
if ($self->canView && $price > 0) {
|
||||
$self->{_hasAddedToCart} = 1;
|
||||
$self->addToCart({price => ($self->session->form->get("price") || $self->getPrice) });
|
||||
$self->addToCart( { price => $price } );
|
||||
}
|
||||
|
||||
return $self->www_view;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ sub definition {
|
|||
},
|
||||
parser => {
|
||||
noFormPost => 1,
|
||||
fieldType => 'selectList',
|
||||
fieldType => 'selectBox',
|
||||
defaultValue => [$session->config->get("defaultTemplateParser")],
|
||||
},
|
||||
namespace => {
|
||||
|
|
@ -144,6 +144,7 @@ sub processPropertiesFromFormPost {
|
|||
my %data;
|
||||
my $needsUpdate = 0;
|
||||
if ($self->getValue("parser") ne $self->session->form->process("parser","className") && ($self->session->form->process("parser","className") ne "")) {
|
||||
$needsUpdate = 1;
|
||||
if (isIn($self->session->form->process("parser","className"),@{$self->session->config->get("templateParsers")})) {
|
||||
%data = ( parser => $self->session->form->process("parser","className") );
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -391,12 +391,13 @@ sub _cacheFieldConfig {
|
|||
my $fieldData;
|
||||
if ($jsonData && eval { $jsonData = JSON::from_json($jsonData) ; 1 }) {
|
||||
# jsonData is an array in the order the fields should be
|
||||
$self->{_fieldConfig} = {
|
||||
map { $_->{name}, $_ } @{ $jsonData }
|
||||
};
|
||||
$self->{_fieldOrder} = [
|
||||
map { $_->{name} } @{ $jsonData }
|
||||
];
|
||||
$self->{_fieldConfig} = {};
|
||||
$self->{_fieldOrder} = [];
|
||||
FIELD: foreach my $field (@{ $jsonData } ) {
|
||||
next FIELD unless ref $field eq 'HASH';
|
||||
$self->{_fieldConfig}->{$field->{name}} = $field;
|
||||
push @{ $self->{_fieldOrder} }, $field->{name};
|
||||
}
|
||||
}
|
||||
else {
|
||||
$self->{_fieldConfig} = {};
|
||||
|
|
@ -484,9 +485,7 @@ sub deleteAttachedFiles {
|
|||
my $form = $self->_createForm($fieldConfig->{$field}, $entryData->{$field});
|
||||
if ($form->can('getStorageLocation')) {
|
||||
my $storage = $form->getStorageLocation;
|
||||
if ($storage) {
|
||||
$storage->delete;
|
||||
}
|
||||
$storage->delete if $storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -498,7 +497,7 @@ sub deleteAttachedFiles {
|
|||
my $form = $self->_createForm($fieldConfig->{$field}, $entryData->{$field});
|
||||
if ($form->can('getStorageLocation')) {
|
||||
my $storage = $form->getStorageLocation;
|
||||
$storage->delete;
|
||||
$storage->delete if $storage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1104,6 +1104,7 @@ sub www_addAlbumService {
|
|||
description => $form->get('synopsis','textarea'),
|
||||
synopsis => $form->get('synopsis','textarea'),
|
||||
othersCanAdd => $form->get('othersCanAdd','yesNo'),
|
||||
ownerUserId => $session->user->userId,
|
||||
});
|
||||
|
||||
$album->requestAutoCommit;
|
||||
|
|
|
|||
|
|
@ -1019,6 +1019,7 @@ sub www_addFileService {
|
|||
title => $form->get('title','text'),
|
||||
description => $form->get('synopsis','textarea'),
|
||||
synopsis => $form->get('synopsis','textarea'),
|
||||
ownerUserId => $session->user->userId,
|
||||
});
|
||||
|
||||
my $storage = $file->getStorageLocation;
|
||||
|
|
|
|||
|
|
@ -30,10 +30,46 @@ Returns true if able to add MatrixListings.
|
|||
|
||||
sub canAddMatrixListing {
|
||||
my $self = shift;
|
||||
my $user = $self->session->user;
|
||||
|
||||
return 0 if $self->session->user->isVisitor;
|
||||
# Users in the groupToAdd group can add listings
|
||||
if ( $user->isInGroup( $self->get("groupToAdd") ) ) {
|
||||
return 1;
|
||||
}
|
||||
# Users who can edit matrix can add listings
|
||||
else {
|
||||
return $self->canEdit;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canEdit ( [userId] )
|
||||
|
||||
Returns true if the user can edit this Matrix.
|
||||
|
||||
Also checks if a user is adding a Matrix Listing and allows them to if they are
|
||||
part of the C<groupToAdd> group.
|
||||
|
||||
=cut
|
||||
|
||||
sub canEdit {
|
||||
my $self = shift;
|
||||
my $userId = shift || $self->session->user->userId;
|
||||
|
||||
my $form = $self->session->form;
|
||||
if ( $form->get('func') eq "editSave" && $form->get('assetId') eq "new" && $form->get( 'class' )->isa(
|
||||
'WebGUI::Asset::MatrixListing' ) ) {
|
||||
return $self->canAddMatrixListing();
|
||||
}
|
||||
else {
|
||||
if ($userId eq $self->get("ownerUserId")) {
|
||||
return 1;
|
||||
}
|
||||
my $user = WebGUI::User->new($self->session, $userId);
|
||||
return $user->isInGroup($self->get("groupIdEdit"));
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -94,6 +130,22 @@ sub definition {
|
|||
hoverHelp =>$i18n->get('edit listing template description'),
|
||||
label =>$i18n->get('edit listing template label'),
|
||||
},
|
||||
screenshotsTemplateId=>{
|
||||
defaultValue =>"matrixtmpl000000000006",
|
||||
fieldType =>"template",
|
||||
tab =>"display",
|
||||
namespace =>"Matrix/Screenshots",
|
||||
hoverHelp =>$i18n->get('screenshots template description'),
|
||||
label =>$i18n->get('screenshots template label'),
|
||||
},
|
||||
screenshotsConfigTemplateId=>{
|
||||
defaultValue =>"matrixtmpl000000000007",
|
||||
fieldType =>"template",
|
||||
tab =>"display",
|
||||
namespace =>"Matrix/ScreenshotsConfig",
|
||||
hoverHelp =>$i18n->get('screenshots config template description'),
|
||||
label =>$i18n->get('screenshots config template label'),
|
||||
},
|
||||
defaultSort=>{
|
||||
fieldType =>"selectBox",
|
||||
tab =>"display",
|
||||
|
|
@ -164,6 +216,13 @@ sub definition {
|
|||
hoverHelp =>$i18n->get('max comparisons privileged description'),
|
||||
label =>$i18n->get('max comparisons privileged label'),
|
||||
},
|
||||
groupToAdd=>{
|
||||
fieldType =>"group",
|
||||
tab =>"security",
|
||||
defaultValue =>2,
|
||||
hoverHelp =>$i18n->get('group to add description'),
|
||||
label =>$i18n->get('group to add label'),
|
||||
},
|
||||
submissionApprovalWorkflowId=>{
|
||||
fieldType =>"workflow",
|
||||
tab =>"security",
|
||||
|
|
@ -442,6 +501,8 @@ sub view {
|
|||
# javascript and css files for compare form datatable
|
||||
$self->session->style->setLink($self->session->url->extras('yui/build/datatable/assets/skins/sam/datatable.css'),
|
||||
{type =>'text/css', rel=>'stylesheet'});
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/yahoo-dom-event/yahoo-dom-event.js'), {type =>
|
||||
'text/javascript'});
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/json/json-min.js'), {type =>
|
||||
'text/javascript'});
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/connection/connection-min.js'), {type =>
|
||||
|
|
@ -541,7 +602,8 @@ sub view {
|
|||
}) };
|
||||
foreach my $pendingListing (@pendingListings){
|
||||
push (@{ $var->{pending_loop} }, {
|
||||
url => $pendingListing->getUrl,
|
||||
url => $pendingListing->getUrl
|
||||
."?func=view;revision=".$pendingListing->get('revisionDate'),
|
||||
name => $pendingListing->get('title'),
|
||||
});
|
||||
}
|
||||
|
|
@ -1024,6 +1086,7 @@ sub www_getCompareListData {
|
|||
unless (scalar(@listingIds)) {
|
||||
@listingIds = $self->session->form->checkList("listingId");
|
||||
}
|
||||
my @responseFields = ("attributeId", "name", "description","fieldType", "checked");
|
||||
|
||||
foreach my $listingId (@listingIds){
|
||||
$listingId =~ s/_____/-/g;
|
||||
|
|
@ -1038,11 +1101,13 @@ sub www_getCompareListData {
|
|||
url =>$listing->getUrl,
|
||||
lastUpdated =>$session->datetime->epochToHuman( $listing->get('revisonDate'),"%z" ),
|
||||
});
|
||||
push(@responseFields, $listingId_safe, $listingId_safe."_compareColor");
|
||||
}
|
||||
push(@results,{name=>$i18n->get('last updated label'),fieldType=>'lastUpdated'});
|
||||
|
||||
my $jsonOutput;
|
||||
$jsonOutput->{ColumnDefs} = \@columnDefs;
|
||||
$jsonOutput->{ColumnDefs} = \@columnDefs;
|
||||
$jsonOutput->{ResponseFields} = \@responseFields;
|
||||
|
||||
foreach my $category (keys %{$self->getCategories}) {
|
||||
push(@results,{name=>$category,fieldType=>'category'});
|
||||
|
|
@ -1144,6 +1209,7 @@ sub www_search {
|
|||
|
||||
my $self = shift;
|
||||
my $var = $self->get;
|
||||
my $db = $self->session->db;
|
||||
|
||||
$var->{compareForm} = $self->getCompareForm;
|
||||
$self->session->style->setScript($self->session->url->extras('yui/build/yahoo/yahoo-min.js'),
|
||||
|
|
@ -1175,7 +1241,7 @@ sub www_search {
|
|||
my $attributes;
|
||||
my @attribute_loop;
|
||||
my $categoryLoopName = $self->session->url->urlize($category)."_loop";
|
||||
$attributes = $self->session->db->read("select * from Matrix_attribute where category =? and assetId = ?",
|
||||
$attributes = $db->read("select * from Matrix_attribute where category =? and assetId = ?",
|
||||
[$category,$self->getId]);
|
||||
while (my $attribute = $attributes->hashRef) {
|
||||
$attribute->{label} = $attribute->{name};
|
||||
|
|
@ -1184,10 +1250,14 @@ sub www_search {
|
|||
$attribute->{extras} = " class='attributeSelect'";
|
||||
if($attribute->{fieldType} eq 'Combo'){
|
||||
$attribute->{fieldType} = 'SelectBox';
|
||||
}
|
||||
if($attribute->{fieldType} eq 'SelectBox'){
|
||||
$attribute->{options} = "blank\n".$attribute->{options};
|
||||
my %options;
|
||||
tie %options, 'Tie::IxHash';
|
||||
%options = $db->buildHash('select value, value from MatrixListing_attribute
|
||||
where attributeId = ? order by value',[$attribute->{attributeId}]);
|
||||
$options{'blank'} = 'blank';
|
||||
$attribute->{options} = \%options;
|
||||
$attribute->{value} = 'blank';
|
||||
$attribute->{extras} = "style='width:120px'";
|
||||
}
|
||||
$attribute->{form} = WebGUI::Form::DynamicField->new($self->session,%{$attribute})->toHtml;
|
||||
push(@attribute_loop,$attribute);
|
||||
|
|
|
|||
|
|
@ -210,7 +210,11 @@ sub importProducts {
|
|||
}
|
||||
|
||||
if ($productRow{title} ne $product->getTitle) {
|
||||
$product->update({ title => $product->fixTitle($productRow{title}) });
|
||||
my $newTitle = $product->fixTitle($productRow{title});
|
||||
$product->update({
|
||||
title => $newTitle,
|
||||
menuTitle => $newTitle,
|
||||
});
|
||||
}
|
||||
|
||||
my $collaterals = $product->getAllCollateral('variantsJSON');
|
||||
|
|
@ -230,10 +234,12 @@ sub importProducts {
|
|||
##Insert a new product;
|
||||
$session->log->warn("Making a new product: $productRow{sku}\n");
|
||||
my $newProduct = $node->addChild({className => 'WebGUI::Asset::Sku::Product'});
|
||||
my $newTitle = $newProduct->fixTitle($productRow{title});
|
||||
$newProduct->update({
|
||||
title => $newProduct->fixTitle($productRow{title}),
|
||||
url => $newProduct->fixUrl($productRow{title}),
|
||||
sku => $productRow{mastersku},
|
||||
title => $newTitle,
|
||||
menuTitle => $newTitle,
|
||||
url => $newProduct->fixUrl($productRow{title}),
|
||||
sku => $productRow{mastersku},
|
||||
});
|
||||
$newProduct->setCollateral('variantsJSON', 'variantId', 'new', \%productCollateral);
|
||||
$newProduct->commit;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -212,6 +212,7 @@ sub purgeRevision {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 view ( )
|
||||
|
||||
method called by the container www_view method.
|
||||
|
|
@ -261,6 +262,7 @@ our @EXPORT = qw(install uninstall);
|
|||
use WebGUI::Session;
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub install {
|
||||
my $config = $ARGV[0];
|
||||
my $home = $ARGV[1] || "/data/WebGUI";
|
||||
|
|
@ -279,6 +281,7 @@ sub install {
|
|||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
sub uninstall {
|
||||
my $config = $ARGV[0];
|
||||
my $home = $ARGV[1] || "/data/WebGUI";
|
||||
|
|
|
|||
|
|
@ -273,10 +273,13 @@ sub createAccountSave {
|
|||
to => $profile->{email},
|
||||
subject => $i18n->get('email address validation email subject','AuthWebGUI')
|
||||
});
|
||||
$mail->addText(
|
||||
$i18n->get('email address validation email body','AuthWebGUI') . "\n\n"
|
||||
. $session->url->page("op=auth;method=validateEmail;key=".$key, 'full') . "\n\n"
|
||||
);
|
||||
my $var;
|
||||
$var->{newUser_username} = $username;
|
||||
$var->{activationUrl} = $session->url->page("op=auth;method=validateEmail;key=".$key, 'full');
|
||||
my $text =
|
||||
WebGUI::Asset::Template->new($self->session,$self->getSetting('accountActivationTemplate'))->process($var);
|
||||
WebGUI::Macro::process($self->session,\$text);
|
||||
$mail->addText($text);
|
||||
$mail->addFooter;
|
||||
$mail->send;
|
||||
$self->user->status("Deactivated");
|
||||
|
|
@ -574,7 +577,14 @@ sub editUserSettingsForm {
|
|||
-label => $i18n->get("password recovery template"),
|
||||
-hoverHelp => $i18n->get("password recovery template help")
|
||||
);
|
||||
return $f->printRowsOnly;
|
||||
$f->template(
|
||||
-name => "webguiAccountActivationTemplate",
|
||||
-value => $self->session->setting->get("webguiAccountActivationTemplate"),
|
||||
-namespace => "Auth/WebGUI/Activation",
|
||||
-label => $i18n->get("account activation template"),
|
||||
-hoverHelp => $i18n->get("account activation template help")
|
||||
);
|
||||
return $f->printRowsOnly;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -625,6 +635,7 @@ sub editUserSettingsFormSave {
|
|||
$s->set("webguiExpiredPasswordTemplate", $f->process("webguiExpiredPasswordTemplate","template"));
|
||||
$s->set("webguiLoginTemplate", $f->process("webguiLoginTemplate","template"));
|
||||
$s->set("webguiPasswordRecoveryTemplate", $f->process("webguiPasswordRecoveryTemplate","template"));
|
||||
$s->set("webguiAccountActivationTemplate", $f->process("webguiAccountActivationTemplate","template"));
|
||||
|
||||
if (@errors) {
|
||||
return \@errors;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use strict;
|
|||
use LWP::MediaTypes qw(guess_media_type);
|
||||
use Time::HiRes;
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::PassiveAnalytics::Logging;
|
||||
|
||||
use Apache2::Const -compile => qw(OK);
|
||||
|
||||
|
|
@ -170,6 +171,9 @@ sub page {
|
|||
$method = "view";
|
||||
}
|
||||
}
|
||||
##Passive Analytics Logging
|
||||
WebGUI::PassiveAnalytics::Logging::log($session, $asset);
|
||||
|
||||
$output = tryAssetMethod($session,$asset,$method);
|
||||
$output = tryAssetMethod($session,$asset,"view") unless ($output || ($method eq "view"));
|
||||
}
|
||||
|
|
|
|||
165
lib/WebGUI/Content/AssetHistory.pm
Normal file
165
lib/WebGUI/Content/AssetHistory.pm
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
package WebGUI::Content::AssetHistory;
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
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
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Content::AssetHistory
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Give the admins an interface to view the history of assets on their site.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use WebGUI::Content::AssetHistory;
|
||||
my $output = WebGUI::Content::AssetHistory::handler($session);
|
||||
|
||||
=head1 SUBROUTINES
|
||||
|
||||
These subroutines are available from this package:
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 handler ( session )
|
||||
|
||||
The content handler for this package.
|
||||
|
||||
=cut
|
||||
|
||||
sub handler {
|
||||
my ($session) = @_;
|
||||
return undef unless ($session->form->get('op') eq 'assetHistory');
|
||||
my $method = $session->form->get( 'method' )
|
||||
? 'www_' . $session->form->get( 'method' )
|
||||
: 'www_view'
|
||||
;
|
||||
|
||||
# Validate the method name
|
||||
if ( !__PACKAGE__->can( $method ) ) {
|
||||
return "Invalid method";
|
||||
}
|
||||
else {
|
||||
return __PACKAGE__->can( $method )->( $session );
|
||||
}
|
||||
my $output = "";
|
||||
# ...
|
||||
return $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_getHistoryAsJson ( )
|
||||
|
||||
Servers side pagination for asset history data displayed in a YUI DataTable.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_getHistoryAsJson {
|
||||
my ($session) = @_;
|
||||
return $session->privilege->insufficient
|
||||
unless $session->user->isInGroup(12);
|
||||
my ($db, $form) = $session->quick(qw(db form));
|
||||
my $startIndex = $form->get('startIndex') || 0;
|
||||
my $numberOfResults = $form->get('results') || 25;
|
||||
my %goodKeys = qw/assetId 1 url 1 username 1 dateStamp 1/;
|
||||
my $sortKey = $form->get('sortKey');
|
||||
$sortKey = $goodKeys{$sortKey} == 1 ? $sortKey : 'dateStamp';
|
||||
my $sortDir = $form->get('sortDir');
|
||||
$sortDir = lc($sortDir) eq 'desc' ? 'desc' : 'asc';
|
||||
my @placeholders = ();
|
||||
my $sql = <<EOSQL;
|
||||
select SQL_CALC_FOUND_ROWS assetHistory.*,users.username from assetHistory join users on assetHistory.userId=users.userId
|
||||
EOSQL
|
||||
my $keywords = $form->get("keywords");
|
||||
if ($keywords ne "") {
|
||||
$db->buildSearchQuery(\$sql, \@placeholders, $keywords, [qw{url assetId username}])
|
||||
}
|
||||
push(@placeholders, $startIndex, $numberOfResults);
|
||||
$sql .= sprintf (" order by %s limit ?,?","$sortKey $sortDir");
|
||||
my %results = ();
|
||||
my @records = ();
|
||||
my $sth = $db->read($sql, \@placeholders);
|
||||
while (my $record = $sth->hashRef) {
|
||||
push(@records,$record);
|
||||
}
|
||||
$results{'recordsReturned'} = $sth->rows()+0;
|
||||
$sth->finish;
|
||||
$results{'records'} = \@records;
|
||||
$results{'totalRecords'} = $db->quickScalar('select found_rows()')+0; ##Convert to numeric
|
||||
$results{'startIndex'} = $startIndex;
|
||||
$results{'sort'} = undef;
|
||||
$results{'dir'} = $sortDir;
|
||||
$session->http->setMimeType('application/json');
|
||||
my $json = JSON::to_json(\%results);
|
||||
return $json;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_view
|
||||
|
||||
YUI DataTable for browsing asset history.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_view {
|
||||
my $session = shift;
|
||||
return $session->privilege->insufficient
|
||||
unless $session->user->isInGroup(12);
|
||||
##YUI specific datatable CSS
|
||||
my $ac = WebGUI::AdminConsole->new( $session, "assetHistory", {
|
||||
showAdminBar => 1
|
||||
} );
|
||||
my ($style, $url) = $session->quick(qw(style url));
|
||||
$style->setLink($url->extras('/yui/build/fonts/fonts-min.css'), {rel=>'stylesheet', type=>'text/css'});
|
||||
$style->setLink($url->extras('yui/build/datatable/assets/skins/sam/datatable.css'), {rel=>'stylesheet', type => 'text/CSS'});
|
||||
$style->setLink($url->extras('yui/build/paginator/assets/skins/sam/paginator.css'), {rel=>'stylesheet', type => 'text/CSS'});
|
||||
$style->setScript($url->extras('/yui/build/utilities/utilities.js'), {type=>'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/json/json-min.js'), {type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/paginator/paginator-min.js'), {type => 'text/javascript'});
|
||||
$style->setScript($url->extras('yui/build/datasource/datasource-min.js'), {type => 'text/javascript'});
|
||||
##YUI Datatable
|
||||
$style->setScript($url->extras('yui/build/datatable/datatable-min.js'), {type => 'text/javascript'});
|
||||
##WebGUI YUI AssetHistory
|
||||
$style->setScript( $url->extras( 'yui-webgui/build/i18n/i18n.js' ), {type => 'text/javascript'} );
|
||||
$style->setScript( $url->extras('yui-webgui/build/assetHistory/assetHistory.js'), {type => 'text/javascript'});
|
||||
##Default CSS
|
||||
$style->setRawHeadTags('<style type="text/css"> #paging a { color: #0000de; } #search form { display: inline; } </style>');
|
||||
my $i18n=WebGUI::International->new($session);
|
||||
|
||||
my $output;
|
||||
|
||||
$output .= q|
|
||||
<div class="yui-skin-sam">
|
||||
<div id="search"><form id="keywordSearchForm"><input type="text" name="keywords" id="keywordsField" /><input type="submit" value="|.$i18n->get(364, 'WebGUI').q|" /></form></div>
|
||||
<div id="dynamicdata"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady( WebGUI.AssetHistory.initManager );
|
||||
</script>
|
||||
|;
|
||||
|
||||
return $ac->render( $output );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
#vim:ft=perl
|
||||
|
|
@ -323,7 +323,9 @@ JavaScript that will take over if the browser has the cojones.
|
|||
|
||||
sub www_manage {
|
||||
my ( $session ) = @_;
|
||||
my $ac = WebGUI::AdminConsole->new( $session, "assets" );
|
||||
my $ac = WebGUI::AdminConsole->new( $session, "assets", {
|
||||
showAdminBar => 1
|
||||
} );
|
||||
my $currentAsset = getCurrentAsset( $session );
|
||||
my $i18n = WebGUI::International->new( $session, "Asset" );
|
||||
|
||||
|
|
@ -413,7 +415,7 @@ sub www_manage {
|
|||
YAHOO.util.Event.onDOMReady( WebGUI.AssetManager.initManager );
|
||||
</script>
|
||||
ENDHTML
|
||||
my $output = WebGUI::Macro::AdminBar::process($session).'<div class="yui-skin-sam" id="assetManager">' . getHeader( $session );
|
||||
my $output = '<div class="yui-skin-sam" id="assetManager">' . getHeader( $session );
|
||||
|
||||
### Crumbtrail
|
||||
my $crumb_markup = '<li><a href="%s">%s</a> ></li>';
|
||||
|
|
|
|||
49
lib/WebGUI/Content/PassiveAnalytics.pm
Normal file
49
lib/WebGUI/Content/PassiveAnalytics.pm
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
package WebGUI::Content::PassiveAnalytics;
|
||||
|
||||
use strict;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::Exception;
|
||||
use WebGUI::PassiveAnalytics::Flow;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Content::PassiveAnalytics
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Handle all requests for building and editing Passive Analytic flows.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use WebGUI::Content::PassiveAnalytics;
|
||||
my $output = WebGUI::Content::PassiveAnalytics::handler($session);
|
||||
|
||||
=head1 SUBROUTINES
|
||||
|
||||
These subroutines are available from this package:
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 handler ( session )
|
||||
|
||||
The content handler for this package.
|
||||
|
||||
=cut
|
||||
|
||||
sub handler {
|
||||
my ($session) = @_;
|
||||
my $output = undef;
|
||||
return undef unless $session->form->get('op') eq 'passiveAnalytics';
|
||||
my $function = "www_".$session->form->get('func');
|
||||
if ($function ne "www_" && (my $sub = WebGUI::PassiveAnalytics::Flow->can($function))) {
|
||||
$output = $sub->($session);
|
||||
}
|
||||
else {
|
||||
WebGUI::Error::MethodNotFound->throw(error=>"Couldn't call non-existant method $function inside PassiveAnalytics", method=>$function);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
@ -159,11 +159,16 @@ sub toHtml {
|
|||
$url->extras( 'yui-webgui/build/form/textarea.js' ),
|
||||
{ type => 'text/javascript' },
|
||||
);
|
||||
$style->setRawHeadTags( q|
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady( function () { WebGUI.Form.Textarea.setMaxLength() } );
|
||||
</script>
|
||||
| );
|
||||
|
||||
unless ( $self->session->stow->get( 'texareaHeadTagsLoaded' ) ) {
|
||||
$style->setRawHeadTags( q|
|
||||
<script type="text/javascript">
|
||||
YAHOO.util.Event.onDOMReady( function () { WebGUI.Form.Textarea.setMaxLength() } );
|
||||
</script>
|
||||
| );
|
||||
|
||||
$self->session->stow->set( 'texareaHeadTagsLoaded', 1 )
|
||||
}
|
||||
|
||||
if ($self->get("resizable")) {
|
||||
$style->setLink($url->extras("resize.css"), {type=>"text/css", rel=>"stylesheet"});
|
||||
|
|
|
|||
|
|
@ -543,7 +543,8 @@ sub getAllGroupsFor {
|
|||
=head2 getAllUsers ( [ withoutExpired ] )
|
||||
|
||||
Returns an array reference containing a list of users that belong to this group
|
||||
and in any group that belongs to this group.
|
||||
and in any group that belongs to this group. The list is unique, so that each
|
||||
userId is only in it one time.
|
||||
|
||||
=head3 withoutExpired
|
||||
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ sub fieldSetEnd {
|
|||
my $legend = shift;
|
||||
$self->{_data} .= "</tbody></table>\n"
|
||||
."</fieldset>\n"
|
||||
."<table ".$self->{_tableExtras}.'" style="width: 100%;"><tbody>'
|
||||
."<table ".$self->{_tableExtras}.' style="width: 100%;"><tbody>'
|
||||
."\n";
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ sub fieldSetStart {
|
|||
my $legend = shift;
|
||||
$self->{_data} .= "</tbody></table>\n"
|
||||
."<fieldset>\n<legend>".$legend."</legend>\n"
|
||||
."<table ".$self->{_tableExtras}.'" style="width: 100%;"><tbody>'
|
||||
."<table ".$self->{_tableExtras}.' style="width: 100%;"><tbody>'
|
||||
."\n";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ our $HELP = {
|
|||
{ 'name' => 'open.label' },
|
||||
{ 'name' => 'close.label' },
|
||||
{ 'name' => 'closed.label' },
|
||||
{ 'name' => 'collaborationAssetId' },
|
||||
{ 'name' => 'critical.label' },
|
||||
{ 'name' => 'minor.label' },
|
||||
{ 'name' => 'cosmetic.label' },
|
||||
|
|
@ -155,6 +154,7 @@ our $HELP = {
|
|||
{ 'name' => 'sortby.views.url' },
|
||||
{ 'name' => 'sortby.replies.url' },
|
||||
{ 'name' => 'sortby.rating.url' }
|
||||
{ 'name' => 'collaborationAssetId' },
|
||||
],
|
||||
related => [
|
||||
{ tag => 'collaboration template labels',
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ our $HELP = {
|
|||
},
|
||||
],
|
||||
variables => [
|
||||
{ 'name' => 'canEdit' },
|
||||
{ 'name' => 'editUrl' },
|
||||
{ 'name' => 'canApprove' },
|
||||
{ 'name' => 'approveOrDenyUrl' },
|
||||
{ 'name' => 'screenshots' },
|
||||
{ 'name' => 'emailForm' },
|
||||
{ 'name' => 'emailSent' },
|
||||
|
|
|
|||
|
|
@ -163,6 +163,16 @@ our $HELP = {
|
|||
related => [],
|
||||
},
|
||||
|
||||
'account activation template' => {
|
||||
title => 'account activation template title',
|
||||
body => '',
|
||||
variables => [
|
||||
{ 'name' => 'newUser_username' },
|
||||
{ 'name' => 'activationUrl' },
|
||||
],
|
||||
fields => [],
|
||||
related => []
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ sub process {
|
|||
|
||||
my $db = $session->db;
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
my ($count) = $db->quickArray("select count(*) from inbox where userId=? and status='unread'",[$session->user->userId]);
|
||||
my $count = WebGUI::Inbox->new($session)->getUnreadMessageCount;
|
||||
my $output = "";
|
||||
|
||||
if($count > 0) {
|
||||
|
|
|
|||
|
|
@ -485,6 +485,7 @@ sub definition {
|
|||
groupIdAdminGraphics
|
||||
groupIdAdminGroup
|
||||
groupIdAdminGroupAdmin
|
||||
groupIdAdminHistory
|
||||
groupIdAdminHelp
|
||||
groupIdAdminLDAPLink
|
||||
groupIdAdminLoginHistory
|
||||
|
|
|
|||
|
|
@ -504,6 +504,10 @@ sub getPageLinks {
|
|||
my $start = ($minPage > 0) ? $minPage : 1;
|
||||
my $maxPage = $start + $limit - 1;
|
||||
my $end = ($maxPage < $self->getPageNumber) ? $self->getPageNumber : $maxPage;
|
||||
if ($maxPage > $self->getNumberOfPages) {
|
||||
$end = $self->getNumberOfPages;
|
||||
$start = $self->getNumberOfPages - $limit + 1;
|
||||
}
|
||||
my @temp;
|
||||
foreach my $page (@pages) {
|
||||
if ($i <= $end && $i >= $start) {
|
||||
|
|
@ -754,5 +758,24 @@ sub setAlphabeticalKey {
|
|||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 setPageNumber ( pageNumber )
|
||||
|
||||
Sets the page number. This is really a convenience method for testing.
|
||||
Returns the page number that was set.
|
||||
|
||||
=head3 pageNumber
|
||||
|
||||
Sets the pageNumber. Setting the pageNumber outside of the set of
|
||||
pages would cause the Paginator to behave poorly.
|
||||
|
||||
=cut
|
||||
|
||||
sub setPageNumber {
|
||||
my $self = shift;
|
||||
$self->{_pn} = shift;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
458
lib/WebGUI/PassiveAnalytics/Flow.pm
Normal file
458
lib/WebGUI/PassiveAnalytics/Flow.pm
Normal file
|
|
@ -0,0 +1,458 @@
|
|||
package WebGUI::PassiveAnalytics::Flow;
|
||||
|
||||
use strict;
|
||||
use Tie::IxHash;
|
||||
use WebGUI::AdminConsole;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::International;
|
||||
use WebGUI::Pluggable;
|
||||
use WebGUI::PassiveAnalytics::Rule;
|
||||
use WebGUI::Utility;
|
||||
use WebGUI::HTMLForm;
|
||||
use WebGUI::Workflow;
|
||||
use WebGUI::Workflow::Instance;
|
||||
use WebGUI::User;
|
||||
use WebGUI::Text;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::PassiveAnalytics::Flow
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Web interface for making sets of rules for doing passive analytics, and
|
||||
running them.
|
||||
|
||||
=cut
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 analysisActive ( session )
|
||||
|
||||
Returns true if an instance of the PassiveAnalytics workflow is active.
|
||||
|
||||
=cut
|
||||
|
||||
sub analysisActive {
|
||||
my $session = shift;
|
||||
my ($running, $startDate, $endDate, $userId) = $session->db->quickArray(q!select running, startDate, endDate, userId from passiveAnalyticsStatus!);
|
||||
if (wantarray) {
|
||||
return $running, $startDate, $endDate, WebGUI::User->new($session, $userId);
|
||||
}
|
||||
return $running;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 canView ( session [, user] )
|
||||
|
||||
Returns true if the user can administrate this operation. user defaults to
|
||||
the current user.
|
||||
|
||||
=cut
|
||||
|
||||
sub canView {
|
||||
my $session = shift;
|
||||
my $user = shift || $session->user;
|
||||
return $user->isInGroup( 3 );
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 exportSomething ( session, sth, filename )
|
||||
|
||||
Generates CSV data from the supplied statement handle and generates
|
||||
a temporary WebGUI::Storage object containing that data in the requested
|
||||
filename.
|
||||
|
||||
This subroutine also does a setRedirect to the URL of the file in
|
||||
the storage object.
|
||||
|
||||
=head3 session
|
||||
|
||||
Session variable, to set the http redirect correctly.
|
||||
|
||||
=head3 sth
|
||||
|
||||
Statement handle for reading data and getting column names
|
||||
|
||||
=head3 filename
|
||||
|
||||
The name of the file to create inside the storage object.
|
||||
|
||||
=cut
|
||||
|
||||
sub exportSomething {
|
||||
my ($session, $sth, $filename) = @_;
|
||||
my $storage = WebGUI::Storage->createTemp($session);
|
||||
my @columns = $sth->getColumnNames;
|
||||
my $csvData = WebGUI::Text::joinCSV( @columns ). "\n";
|
||||
while (my $row = $sth->hashRef()) {
|
||||
my @row = @{ $row }{@columns};
|
||||
$csvData .= WebGUI::Text::joinCSV(@row) . "\n";
|
||||
}
|
||||
$storage->addFileFromScalar($filename, $csvData);
|
||||
$session->http->setRedirect($storage->getUrl($filename));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_deleteRule ( )
|
||||
|
||||
Deletes an activity from a workflow.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_deleteRule {
|
||||
my $session = shift;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
my $rule = WebGUI::PassiveAnalytics::Rule->new($session, $session->form->get("ruleId"));
|
||||
if (defined $rule) {
|
||||
$rule->delete;
|
||||
}
|
||||
return www_editRuleflow($session);
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------
|
||||
|
||||
=head2 www_demoteRule ( session )
|
||||
|
||||
Moves a Rule down one position in the execution order.
|
||||
|
||||
=head3 session
|
||||
|
||||
A reference to the current session.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_demoteRule {
|
||||
my $session = shift;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
my $rule = WebGUI::PassiveAnalytics::Rule->new($session, $session->form->get("ruleId"));
|
||||
if (defined $rule) {
|
||||
$rule->demote;
|
||||
}
|
||||
return www_editRuleflow($session);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editRuleflow ( session )
|
||||
|
||||
Configure a set of analyses to run on the passive logs. The analysis is destructive.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_editRuleflow {
|
||||
my $session = shift;
|
||||
my $error = shift;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
my ($running, $startDate, $endDate, $user) = analysisActive($session);
|
||||
if ($error) {
|
||||
$error = qq|<div class="error">$error</div>\n|;
|
||||
}
|
||||
elsif (!$running) {
|
||||
$error = qq|<div class="error">Passive Analytics analysis completed on $endDate</div>\n|;
|
||||
}
|
||||
my $i18n = WebGUI::International->new($session, "PassiveAnalytics");
|
||||
my $addmenu = '<div style="float: left; width: 200px; font-size: 11px;">';
|
||||
$addmenu .= sprintf '<a href="%s">%s</a>',
|
||||
$session->url->page('op=passiveAnalytics;func=editRule'),
|
||||
$i18n->get('Add a bucket');
|
||||
$addmenu .= '</div>';
|
||||
my $f = WebGUI::HTMLForm->new($session);
|
||||
$f->hidden(
|
||||
name=>'op',
|
||||
value=>'passiveAnalytics'
|
||||
);
|
||||
$f->hidden(
|
||||
name=>'func',
|
||||
value=>'editRuleflowSave'
|
||||
);
|
||||
$f->integer(
|
||||
name => 'pauseInterval',
|
||||
value => $session->form->get('pauseInterval') || $session->setting->get('passiveAnalyticsInterval') || 300,
|
||||
label => $i18n->get('pause interval'),
|
||||
hoverHelp => $i18n->get('pause interval help'),
|
||||
);
|
||||
if ($running) {
|
||||
$f->raw(sprintf <<EOD, $startDate, $user->username);
|
||||
<tr><td colspan="2">Passive Analytics analysis is currently active. Analysis was begun at %s by %s</td></tr>
|
||||
EOD
|
||||
}
|
||||
else {
|
||||
$f->submit(value => $i18n->get('Begin analysis'));
|
||||
}
|
||||
my $steps = '<table class="content"><tbody>';
|
||||
my $getARule = WebGUI::PassiveAnalytics::Rule->getAllIterator($session);
|
||||
my $icon = $session->icon;
|
||||
while (my $rule = $getARule->()) {
|
||||
my $id = $rule->getId;
|
||||
my $bucket = $rule->get('bucketName');
|
||||
$steps .= '<tr><td>'
|
||||
. $icon->delete( 'op=passiveAnalytics;func=deleteRule;ruleId='.$id, undef, $i18n->get('confirm delete rule'))
|
||||
. $icon->edit( 'op=passiveAnalytics;func=editRule;ruleId='.$id)
|
||||
. $icon->moveDown('op=passiveAnalytics;func=demoteRule;ruleId='.$id)
|
||||
. $icon->moveUp( 'op=passiveAnalytics;func=promoteRule;ruleId='.$id)
|
||||
. '</td><td>'.$bucket.'</td></tr>';
|
||||
|
||||
}
|
||||
$steps .= '<tr><td> </td><td>Other</td></tbody></table><div style="clear: both;"></div>';
|
||||
my $ac = WebGUI::AdminConsole->new($session,'passiveAnalytics');
|
||||
$ac->addSubmenuItem($session->url->page('op=passiveAnalytics;func=settings'), $i18n->get('Passive Analytics Settings'));
|
||||
if (!$running) {
|
||||
$ac->addSubmenuItem($session->url->page('op=passiveAnalytics;func=exportBucketData'), $i18n->get('Export bucket data'));
|
||||
$ac->addSubmenuItem($session->url->page('op=passiveAnalytics;func=exportDeltaData'), $i18n->get('Export delta data'));
|
||||
$ac->addSubmenuItem($session->url->page('op=passiveAnalytics;func=exportLogs'), $i18n->get('Export raw logs'));
|
||||
}
|
||||
return $ac->render($error.$f->print.$addmenu.$steps, 'Passive Analytics');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editRuleflowSave ( )
|
||||
|
||||
Saves the results of www_editRuleflow()
|
||||
|
||||
=cut
|
||||
|
||||
sub www_editRuleflowSave {
|
||||
my $session = shift;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
return www_editRuleflow($session, 'Passive Analytics is already active. Please do not try to subvert the UI in the future')
|
||||
if analysisActive($session);
|
||||
my $workflow = WebGUI::Workflow->new($session, 'PassiveAnalytics000001');
|
||||
return www_editRuleflow($session, "The Passive Analytics workflow has been deleted. Please contact an Administrator immediately.") unless defined $workflow;
|
||||
my $delta = $session->form->process('pauseInterval','integer');
|
||||
my $activities = $workflow->getActivities();
|
||||
##Note, they're in order, and the order is known.
|
||||
$activities->[0]->set('deltaInterval', $delta);
|
||||
$activities->[1]->set('userId', $session->user->userId);
|
||||
my $instance = WebGUI::Workflow::Instance->create($session, {
|
||||
workflowId => $workflow->getId,
|
||||
priority => 1,
|
||||
});
|
||||
if (!defined $instance) {
|
||||
return www_editRuleflow($session, "A Passive Analytics analysis is currently running.") if $session->stow->get('singletonWorkflowClash');
|
||||
return www_editRuleflow($session, "Error creating the workflow instance.");
|
||||
}
|
||||
$instance->start('skipRealtime');
|
||||
$session->db->write('update passiveAnalyticsStatus set startDate=NOW(), userId=?, endDate=?, running=1', [$session->user->userId, '']);
|
||||
return www_editRuleflow($session);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editRule ( )
|
||||
|
||||
Displays a form to edit the properties rule.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_editRule {
|
||||
my ($session, $error) = @_;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
|
||||
if ($error) {
|
||||
$error = qq|<div class="error">$error</div>\n|;
|
||||
}
|
||||
##Make a PassiveAnalytics rule to use to populate the form.
|
||||
my $ruleId = $session->form->get('ruleId');
|
||||
my $rule;
|
||||
if ($ruleId) {
|
||||
$rule = WebGUI::PassiveAnalytics::Rule->new($session, $ruleId);
|
||||
}
|
||||
else {
|
||||
##We need a temporary rule so that we can call dynamicForm, below
|
||||
$ruleId = 'new';
|
||||
$rule = WebGUI::PassiveAnalytics::Rule->create($session, {});
|
||||
}
|
||||
|
||||
##Build the form
|
||||
my $form = WebGUI::HTMLForm->new($session);
|
||||
$form->hidden( name=>"op", value=>"passiveAnalytics");
|
||||
$form->hidden( name=>"func", value=>"editRuleSave");
|
||||
$form->hidden( name=>"ruleId", value=>$ruleId);
|
||||
$form->dynamicForm([WebGUI::PassiveAnalytics::Rule->crud_definition($session)], 'properties', $rule);
|
||||
$form->submit;
|
||||
|
||||
my $i18n = WebGUI::International->new($session, 'PassiveAnalytics');
|
||||
my $ac = WebGUI::AdminConsole->new($session,'passiveAnalytics');
|
||||
$ac->addSubmenuItem($session->url->page("op=passiveAnalytics;func=editRuleflow"), $i18n->get("manage ruleset"));
|
||||
if ($ruleId eq 'new') {
|
||||
$rule->delete;
|
||||
}
|
||||
return $ac->render($error.$form->print,$i18n->get('Edit Rule'));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editRuleSave ( )
|
||||
|
||||
Saves the results of www_editRule().
|
||||
|
||||
=cut
|
||||
|
||||
sub www_editRuleSave {
|
||||
my $session = shift;
|
||||
my $form = $session->form;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
my $regexp = $form->get('regexp');
|
||||
eval {
|
||||
'fooBarBaz' =~ qr/$regexp/;
|
||||
};
|
||||
if ($@) {
|
||||
my $error = $@;
|
||||
$error =~ s/at \S+?\.pm line \d+.*$//;
|
||||
my $i18n = WebGUI::International->new($session, 'PassiveAnalytics');
|
||||
$error = join ' ', $i18n->get('Regular Expression Error:'), $error;
|
||||
return www_editRule($session, $error);
|
||||
}
|
||||
my $ruleId = $form->get('ruleId');
|
||||
my $rule;
|
||||
if ($ruleId eq 'new') {
|
||||
$rule = WebGUI::PassiveAnalytics::Rule->create($session, {});
|
||||
}
|
||||
else {
|
||||
$rule = WebGUI::PassiveAnalytics::Rule->new($session, $ruleId);
|
||||
}
|
||||
$rule->updateFromFormPost if $rule;
|
||||
return www_editRuleflow($session);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_exportBucketData ( )
|
||||
|
||||
Dump the contents of the bucket log.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_exportBucketData {
|
||||
my ($session) = @_;
|
||||
my $bucket = $session->db->read('select * from bucketLog order by userId, Bucket, timeStamp');
|
||||
exportSomething($session, $bucket, 'bucketData.csv');
|
||||
return "redirect";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_exportDeltaData ( )
|
||||
|
||||
Dump the contents of the delta log.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_exportDeltaData {
|
||||
my ($session) = @_;
|
||||
my $delta = $session->db->read('select * from deltaLog order by userId, timeStamp');
|
||||
exportSomething($session, $delta, 'deltaData.csv');
|
||||
return "redirect";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_exportLogs ( )
|
||||
|
||||
Dump the contents of the raw log.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_exportLogs {
|
||||
my ($session) = @_;
|
||||
my $raw = $session->db->read('select * from passiveLog order by userId, timeStamp');
|
||||
exportSomething($session, $raw, 'passiveData.csv');
|
||||
return "redirect";
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------
|
||||
|
||||
=head2 www_promoteRule ( session )
|
||||
|
||||
Moves a rule up one position in the execution order.
|
||||
|
||||
=head3 session
|
||||
|
||||
A reference to the current session.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_promoteRule {
|
||||
my $session = shift;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
my $rule = WebGUI::PassiveAnalytics::Rule->new($session, $session->form->get("ruleId"));
|
||||
if (defined $rule) {
|
||||
$rule->promote;
|
||||
}
|
||||
return www_editRuleflow($session);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_settings ( session )
|
||||
|
||||
Configure Passive Analytics settings.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_settings {
|
||||
my $session = shift;
|
||||
my $error = shift;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
if ($error) {
|
||||
$error = qq|<div class="error">$error</div>\n|;
|
||||
}
|
||||
my $i18n = WebGUI::International->new($session, "PassiveAnalytics");
|
||||
my $f = WebGUI::HTMLForm->new($session);
|
||||
$f->hidden(
|
||||
name=>'op',
|
||||
value=>'passiveAnalytics'
|
||||
);
|
||||
$f->hidden(
|
||||
name=>'func',
|
||||
value=>'settingsSave'
|
||||
);
|
||||
$f->integer(
|
||||
name => 'pauseInterval',
|
||||
value => $session->form->get('pauseInterval') || $session->setting->get('passiveAnalyticsInterval') || 300,
|
||||
label => $i18n->get('default pause interval'),
|
||||
hoverHelp => $i18n->get('default pause interval help'),
|
||||
);
|
||||
$f->yesNo(
|
||||
name => 'deleteDelta',
|
||||
value => $session->form->get('deleteDelta') || $session->setting->get('passiveAnalyticsDeleteDelta') || 0,
|
||||
label => $i18n->get('Delete Delta Table?'),
|
||||
hoverHelp => $i18n->get('Delete Delta Table? help'),
|
||||
);
|
||||
$f->yesNo(
|
||||
name => 'enabled',
|
||||
value => $session->form->get('enabled') || $session->setting->get('passiveAnalyticsEnabled') || 0,
|
||||
label => $i18n->get('Enabled?'),
|
||||
hoverHelp => $i18n->get('Enabled? help'),
|
||||
);
|
||||
$f->submit();
|
||||
my $ac = WebGUI::AdminConsole->new($session,'passiveAnalytics');
|
||||
$ac->addSubmenuItem($session->url->page('op=passiveAnalytics;func=editRuleflow'), $i18n->get('Passive Analytics'));
|
||||
return $ac->render($error.$f->print, 'Passive Analytics Settings');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_settingsSave ( session )
|
||||
|
||||
Save Passive Analytics settings.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_settingsSave {
|
||||
my $session = shift;
|
||||
return $session->privilege->insufficient() unless canView($session);
|
||||
my $form = $session->form;
|
||||
$session->setting->set('passiveAnalyticsInterval', $form->process('pauseInterval', 'integer'));
|
||||
$session->setting->set('passiveAnalyticsDeleteDelta', $form->process('deleteDelta', 'yesNo' ));
|
||||
$session->setting->set('passiveAnalyticsEnabled', $form->process('enabled', 'yesNo' ));
|
||||
return www_settings($session);
|
||||
}
|
||||
|
||||
1;
|
||||
47
lib/WebGUI/PassiveAnalytics/Logging.pm
Normal file
47
lib/WebGUI/PassiveAnalytics/Logging.pm
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
package WebGUI::PassiveAnalytics::Logging;
|
||||
|
||||
use strict;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::Asset;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::PassiveAnalytics::Logging
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Encapsulate all logging functions in here.
|
||||
|
||||
=cut
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 log ( session, asset )
|
||||
|
||||
Log Passive Analytics data to the db.
|
||||
|
||||
=head3 session
|
||||
|
||||
A session variable.
|
||||
|
||||
=head3 asset
|
||||
|
||||
The asset to log.
|
||||
|
||||
=cut
|
||||
|
||||
sub log {
|
||||
my ($session, $asset) = @_;
|
||||
return unless $session->setting->get('passiveAnalyticsEnabled');
|
||||
my $assetClass = $asset->get('className');
|
||||
$assetClass =~ s/^WebGUI::Asset:://;
|
||||
if ( $assetClass ne 'Snippet'
|
||||
&& substr($assetClass,0,4) ne 'File') {
|
||||
$session->db->write(
|
||||
q|INSERT INTO `passiveLog` (userId, sessionId, assetId, timestamp, url) VALUES (?,?,?,?,?)|,
|
||||
[ $session->user->userId, $session->getId, $asset->getId, time(), $session->request->unparsed_uri,]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
92
lib/WebGUI/PassiveAnalytics/Rule.pm
Normal file
92
lib/WebGUI/PassiveAnalytics/Rule.pm
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
package WebGUI::PassiveAnalytics::Rule;
|
||||
|
||||
use base qw/WebGUI::Crud/;
|
||||
use WebGUI::International;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::PassiveAnalytics::Rule;
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Base class for rules that are used to analyze the Passive Analytics log.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These methods are available from this class:
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 crud_definition ( )
|
||||
|
||||
WebGUI::Crud definition for this class.
|
||||
|
||||
=head3 tableName
|
||||
|
||||
analyticRule.
|
||||
|
||||
=head3 tableKey
|
||||
|
||||
ruleId
|
||||
|
||||
=head3 sequenceKey
|
||||
|
||||
None. There is only 1 sequence of rules for a site.
|
||||
|
||||
=head3 properties
|
||||
|
||||
=head4 bucketName
|
||||
|
||||
The name of a bucket to hold results for this rule.
|
||||
|
||||
=head4 rules
|
||||
|
||||
JSON blob with configuration data for the individual rules.
|
||||
|
||||
=cut
|
||||
|
||||
sub crud_definition {
|
||||
my ($class, $session) = @_;
|
||||
my $definition = $class->SUPER::crud_definition($session);
|
||||
$definition->{tableName} = 'analyticRule';
|
||||
$definition->{tableKey} = 'ruleId';
|
||||
$definition->{sequenceKey} = '';
|
||||
my $properties = $definition->{properties};
|
||||
my $i18n = WebGUI::International->new($session);
|
||||
$properties->{bucketName} = {
|
||||
fieldType => 'text',
|
||||
label => $i18n->get('Bucket Name','PassiveAnalytics'),
|
||||
hoverHelp => $i18n->get('Bucket Name help','PassiveAnalytics'),
|
||||
defaultValue => '',
|
||||
};
|
||||
$properties->{regexp} = {
|
||||
fieldType => 'text',
|
||||
label => $i18n->get('regexp','PassiveAnalytics'),
|
||||
hoverHelp => $i18n->get('regexp help','PassiveAnalytics'),
|
||||
defaultValue => '.+',
|
||||
};
|
||||
return $definition;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 matchesBucket ( $logLine )
|
||||
|
||||
Executes the rule to determine if a log file entry matches the rule.
|
||||
|
||||
=head3 $logLine
|
||||
|
||||
A hashref of information from 1 line of the logs.
|
||||
|
||||
=cut
|
||||
|
||||
sub matchesBucket {
|
||||
my ($self, $logLine) = @_;
|
||||
my $regexp = $self->get('regexp');
|
||||
return $logLine->{url} =~ m/$regexp/;
|
||||
}
|
||||
|
||||
1;
|
||||
#vim:ft=perl
|
||||
|
|
@ -220,12 +220,13 @@ sub buildHashRef {
|
|||
|
||||
=head2 buildArrayRefOfHashRefs ( sql )
|
||||
|
||||
Builds an array reference of hash references of data
|
||||
from a series of rows. Useful for returning many rows at once.
|
||||
Builds an array reference of hash references of data from a series of rows.
|
||||
Useful for returning many rows at once. Each element of the returned array
|
||||
reference is a hash of column names to column values.
|
||||
|
||||
=head3 sql
|
||||
|
||||
An SQL query. The query must select at least two columns of data, the first being the key for the hash, the second being the value. If the query selects more than two columns, then the last column will be the value and the remaining columns will be joined together by a colon ":" to form a complex key. If the query selects only one column, then the key and the value will be the same.
|
||||
An SQL query.
|
||||
|
||||
=head3 params
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ returns true if the remote address matches a site which is a known indexer or sp
|
|||
sub callerIsSearchSite {
|
||||
|
||||
my $self = shift;
|
||||
my $remoteAddress = $self->get('REMOTE_ADDR');
|
||||
my $remoteAddress = $self->getIp;
|
||||
|
||||
return 1 if $remoteAddress =~ /203\.87\.123\.1../ # Blaiz Enterprise Rawgrunt search
|
||||
|| $remoteAddress =~ /123\.113\.184\.2../ # Unknown Yahoo Robot
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ An address object's unique id.
|
|||
|
||||
sub getAddress {
|
||||
my ($self, $addressId) = @_;
|
||||
my $id = ref $self;
|
||||
my $id = id $self;
|
||||
unless (exists $addressCache{$id}{$addressId}) {
|
||||
$addressCache{$id}{$addressId} = WebGUI::Shop::Address->new($self, $addressId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ sub getAdminConsole {
|
|||
$ac->addSubmenuItem($url->page("shop=ship;method=manage"), $i18n->get("shipping methods"));
|
||||
$ac->addSubmenuItem($url->page("shop=transaction;method=manage"), $i18n->get("transactions"));
|
||||
$ac->addSubmenuItem($url->page("shop=vendor;method=manage"), $i18n->get("vendors"));
|
||||
$ac->addSubmenuItem($url->page("shop=vendor;method=managePayouts"), $i18n->get("vendor payouts"));
|
||||
$ac->addSubmenuItem($url->page("shop=credit;method=manage"), $i18n->get("in shop credit"));
|
||||
return $ac;
|
||||
}
|
||||
|
|
@ -151,6 +152,13 @@ sub www_editSettings {
|
|||
label => $i18n->get('who is a cashier'),
|
||||
hoverHelp => $i18n->get('who is a cashier help'),
|
||||
);
|
||||
$form->float(
|
||||
name => 'shopCartCheckoutMinimum',
|
||||
value => $setting->get('shopCartCheckoutMinimum'),
|
||||
defaultValue=> '0.00',
|
||||
label => $i18n->get('cart checkout minimum'),
|
||||
hoverHelp => $i18n->get('cart checkout minimum help'),
|
||||
);
|
||||
$form->template(
|
||||
name => "shopCartTemplateId",
|
||||
value => $setting->get("shopCartTemplateId"),
|
||||
|
|
@ -202,13 +210,21 @@ sub www_editSettingsSave {
|
|||
my $self = shift;
|
||||
return $self->session->privilege->adminOnly() unless ($self->session->user->isAdmin);
|
||||
my ($setting, $form) = $self->session->quick(qw(setting form));
|
||||
|
||||
# Save shop templates
|
||||
foreach my $template (qw(shopMyPurchasesDetailTemplateId shopMyPurchasesTemplateId
|
||||
shopCartTemplateId shopAddressBookTemplateId shopAddressTemplateId)) {
|
||||
$setting->set($template, $form->get($template, "template"));
|
||||
}
|
||||
|
||||
# Save group settings
|
||||
foreach my $group (qw(groupIdCashier groupIdAdminCommerce)) {
|
||||
$setting->set($group, $form->get($group, "group"));
|
||||
}
|
||||
|
||||
# Save mininmum cart checkout
|
||||
$setting->set( 'shopCartCheckoutMinimum', $form->get( 'shopCartCheckoutMinimum', 'float' ) );
|
||||
|
||||
return $self->www_editSettings();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ Returns a reference to the address book for the user who's cart this is.
|
|||
|
||||
sub getAddressBook {
|
||||
my $self = shift;
|
||||
my $id = ref $self;
|
||||
my $id = id $self;
|
||||
unless (exists $addressBookCache{$id}) {
|
||||
$addressBookCache{$id} = WebGUI::Shop::AddressBook->newBySession($self->session);
|
||||
}
|
||||
|
|
@ -297,7 +297,6 @@ sub getItem {
|
|||
unless (defined $itemId && $itemId =~ m/^[A-Za-z0-9_-]{22}$/) {
|
||||
WebGUI::Error::InvalidParam->throw(error=>"Need an itemId.");
|
||||
}
|
||||
my $id = ref $self;
|
||||
my $item = WebGUI::Shop::CartItem->new($self, $itemId);
|
||||
return $item;
|
||||
}
|
||||
|
|
@ -499,7 +498,7 @@ Returns whether all the required properties of the the cart are set.
|
|||
|
||||
sub readyForCheckout {
|
||||
my $self = shift;
|
||||
|
||||
|
||||
# Check if the shipping address is set and correct
|
||||
my $address = eval{$self->getShippingAddress};
|
||||
return 0 if WebGUI::Error->caught;
|
||||
|
|
@ -514,6 +513,12 @@ sub readyForCheckout {
|
|||
# fail if there are multiple recurring items or if
|
||||
return 0 if ($self->hasMixedItems);
|
||||
|
||||
# Check minimum cart checkout requirement
|
||||
my $requiredAmount = $self->session->setting->get( 'shopCartCheckoutMinimum' );
|
||||
if ( $requiredAmount > 0 ) {
|
||||
return 0 if $self->calculateTotal < $requiredAmount;
|
||||
}
|
||||
|
||||
# All checks passed so return true
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -802,6 +807,10 @@ sub www_view {
|
|||
shipToButton => WebGUI::Form::submit($session, {value=>$i18n->get("ship to button"),
|
||||
extras=>q|onclick="setCallbackForAddressChooser(this.form);"|}),
|
||||
subtotalPrice => $self->formatCurrency($self->calculateSubtotal()),
|
||||
minimumCartAmount => $session->setting->get( 'shopCartCheckoutMinimum' ) > 0
|
||||
? sprintf( '%.2f', $session->setting->get( 'shopCartCheckoutMinimum' ) )
|
||||
: 0
|
||||
,
|
||||
);
|
||||
|
||||
# get the shipping address
|
||||
|
|
@ -847,10 +856,11 @@ sub www_view {
|
|||
# calculate price adjusted for in-store credit
|
||||
$var{totalPrice} = $var{subtotalPrice} + $var{shippingPrice} + $var{tax};
|
||||
my $credit = WebGUI::Shop::Credit->new($session, $posUser->userId);
|
||||
$var{inShopCreditAvailable} = $credit->getSum;
|
||||
$var{inShopCreditDeduction} = $credit->calculateDeduction($var{totalPrice});
|
||||
$var{totalPrice} = $self->formatCurrency($var{totalPrice} + $var{inShopCreditDeduction});
|
||||
|
||||
$var{ inShopCreditAvailable } = $credit->getSum;
|
||||
$var{ inShopCreditDeduction } = $credit->calculateDeduction($var{totalPrice});
|
||||
$var{ totalPrice } = $self->formatCurrency($var{totalPrice} + $var{inShopCreditDeduction});
|
||||
$var{ readyForCheckout } = $self->readyForCheckout;
|
||||
|
||||
# render the cart
|
||||
my $template = WebGUI::Asset::Template->new($session, $session->setting->get("shopCartTemplateId"));
|
||||
return $session->style->userStyle($template->process(\%var));
|
||||
|
|
|
|||
|
|
@ -173,7 +173,6 @@ Returns an instanciated WebGUI::Asset::Sku object for this cart item.
|
|||
|
||||
sub getSku {
|
||||
my ($self) = @_;
|
||||
my $id = ref $self;
|
||||
my $asset = '';
|
||||
$asset = WebGUI::Asset->newByDynamicClass($self->cart->session, $self->get("assetId"));
|
||||
$asset->applyOptions($self->get("options"));
|
||||
|
|
|
|||
|
|
@ -267,11 +267,14 @@ sub update {
|
|||
if (exists $newProperties->{item}) {
|
||||
my $item = $newProperties->{ item };
|
||||
my $sku = $item->getSku;
|
||||
$newProperties->{ options } = $sku->getOptions;
|
||||
$newProperties->{ assetId } = $sku->getId;
|
||||
$newProperties->{ price } = $sku->getPrice;
|
||||
$newProperties->{ configuredTitle } = $item->get('configuredTitle');
|
||||
$newProperties->{ quantity } = $item->get('quantity');
|
||||
$newProperties->{ options } = $sku->getOptions;
|
||||
$newProperties->{ assetId } = $sku->getId;
|
||||
$newProperties->{ price } = $sku->getPrice;
|
||||
$newProperties->{ configuredTitle } = $item->get('configuredTitle');
|
||||
$newProperties->{ quantity } = $item->get('quantity');
|
||||
$newProperties->{ vendorId } = $sku->getVendorId;
|
||||
$newProperties->{ vendorPayoutAmount } = sprintf '%.2f', $sku->getVendorPayout * $item->get('quantity');
|
||||
|
||||
my $address = $item->getShippingAddress;
|
||||
$newProperties->{ shippingAddressId } = $address->getId;
|
||||
$newProperties->{ shippingAddressName } = $address->get('name');
|
||||
|
|
@ -289,7 +292,8 @@ sub update {
|
|||
}
|
||||
my @fields = (qw(assetId configuredTitle options shippingAddressId shippingTrackingNumber orderStatus
|
||||
shippingName shippingAddress1 shippingAddress2 shippingAddress3 shippingCity shippingState
|
||||
shippingCountry shippingCode shippingPhoneNumber quantity price vendorId));
|
||||
shippingCountry shippingCode shippingPhoneNumber quantity price vendorId
|
||||
vendorPayoutStatus vendorPayoutAmount));
|
||||
foreach my $field (@fields) {
|
||||
$properties{$id}{$field} = (exists $newProperties->{$field}) ? $newProperties->{$field} : $properties{$id}{$field};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ use Class::InsideOut qw{ :std };
|
|||
use WebGUI::Shop::Admin;
|
||||
use WebGUI::Exception::Shop;
|
||||
use WebGUI::International;
|
||||
|
||||
use WebGUI::Utility qw{ isIn };
|
||||
use List::Util qw{ sum };
|
||||
use JSON qw{ encode_json };
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
|
@ -117,6 +119,48 @@ sub getId {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getPayoutTotals ( )
|
||||
|
||||
Returns a hash ref, containing the payout details for this vendor. The keys in the hash are:
|
||||
|
||||
=head3 paid
|
||||
|
||||
The amount of money already transfered to the vendor.
|
||||
|
||||
=head3 scheduled
|
||||
|
||||
The amount of money scheduled to be transfered to the vendor.
|
||||
|
||||
=head3 notPaid
|
||||
|
||||
The amount of money that is yet to be scheduled for payment to the vendor.
|
||||
|
||||
=head3 total
|
||||
|
||||
The sum of these three values.
|
||||
|
||||
=cut
|
||||
|
||||
sub getPayoutTotals {
|
||||
my $self = shift;
|
||||
|
||||
my %totals = $self->session->db->buildHash(
|
||||
'select vendorPayoutStatus, sum(vendorPayoutAmount) as amount from transactionItem '
|
||||
.'where vendorId=? group by vendorPayoutStatus ',
|
||||
[ $self->getId ]
|
||||
);
|
||||
|
||||
# Format the payout categories and calc the total those.
|
||||
%totals =
|
||||
map { lcfirst $_ => sprintf '%.2f', $totals{ $_ } }
|
||||
qw( Paid Scheduled NotPaid );
|
||||
$totals{ total } = sprintf '%.2f', sum values %totals;
|
||||
|
||||
return \%totals;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 getVendors ( session, options )
|
||||
|
||||
Class method. Returns an array reference of WebGUI::Shop::Vendor objects.
|
||||
|
|
@ -150,6 +194,26 @@ sub getVendors {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 isVendorInfoComplete ( )
|
||||
|
||||
Returns a boolean indicating whether the payoutinformation entered by the vendor is complete.
|
||||
|
||||
=cut
|
||||
|
||||
sub isVendorInfoComplete {
|
||||
my $self = shift;
|
||||
|
||||
my $complete =
|
||||
defined $self->get( 'name' )
|
||||
&& defined $self->get( 'userId' )
|
||||
&& defined $self->get( 'preferredPaymentType' )
|
||||
&& defined $self->get( 'paymentInformation' );
|
||||
|
||||
return $complete
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 new ( session, vendorId )
|
||||
|
||||
Constructor. Returns a WebGUI::Shop::Vendor object.
|
||||
|
|
@ -405,5 +469,215 @@ sub www_manage {
|
|||
return $console->render($output, $i18n->get("vendors"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_managePayouts ( )
|
||||
|
||||
Displays the payout manager.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_managePayouts {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
||||
my $admin = WebGUI::Shop::Admin->new($session);
|
||||
return $session->privilege->adminOnly() unless ($admin->canManage);
|
||||
|
||||
# Load the required YUI stuff.
|
||||
$session->style->setLink('/extras/yui/build/paginator/assets/skins/sam/paginator.css', {type=>'text/css', rel=>'stylesheet'});
|
||||
$session->style->setLink('/extras/yui/build/datatable/assets/skins/sam/datatable.css', {type=>'text/css', rel=>'stylesheet'});
|
||||
$session->style->setLink('/extras/yui/build/button/assets/skins/sam/button.css', {type=>'text/css', rel=>'stylesheet'});
|
||||
$session->style->setScript('/extras/yui/build/yahoo-dom-event/yahoo-dom-event.js', {type=>'text/javascript'});
|
||||
$session->style->setScript('/extras/yui/build/element/element-beta-min.js', {type=>'text/javascript'});
|
||||
$session->style->setScript('/extras/yui/build/connection/connection-min.js', {type=>'text/javascript'});
|
||||
$session->style->setScript('/extras/yui/build/json/json-min.js', {type=>'text/javascript'});
|
||||
$session->style->setScript('/extras/yui/build/paginator/paginator-min.js', {type=>'text/javascript'});
|
||||
$session->style->setScript('/extras/yui/build/datasource/datasource.js', {type=>'text/javascript'});
|
||||
$session->style->setScript('/extras/yui/build/datatable/datatable-min.js', {type=>'text/javascript'});
|
||||
$session->style->setScript('/extras/yui/build/button/button-min.js', {type=>'text/javascript'});
|
||||
$session->style->setScript('/extras/VendorPayout/vendorPayout.js', {type=>'text/javascript'});
|
||||
|
||||
# Add css for scheduled payout highlighting
|
||||
$session->style->setRawHeadTags(<<CSS);
|
||||
<style type="text/css">
|
||||
.yui-skin-sam .yui-dt tr.scheduled,
|
||||
.yui-skin-sam .yui-dt tr.scheduled td.yui-dt-asc,
|
||||
.yui-skin-sam .yui-dt tr.scheduled td.yui-dt-desc,
|
||||
.yui-skin-sam .yui-dt tr.scheduled td.yui-dt-asc,
|
||||
.yui-skin-sam .yui-dt tr.scheduled td.yui-dt-desc {
|
||||
background-color : #080;
|
||||
color : #fff;
|
||||
}
|
||||
</style>
|
||||
CSS
|
||||
|
||||
my $output = q{<div id="vendorPayoutContainer" class="yui-skin-sam"></div>}
|
||||
.q{<script type="text/javascript">var vp = new WebGUI.VendorPayout( 'vendorPayoutContainer' );</script>};
|
||||
|
||||
my $console = WebGUI::Shop::Admin->new($session)->getAdminConsole;
|
||||
return $console->render($output, 'Vendor payout'); #$i18n->get("vendors"));
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_payoutDataAsJSON ( )
|
||||
|
||||
Returns a JSON string containing paginated payout data for a specific vendor.
|
||||
The following form params should be passed:
|
||||
|
||||
=head3 vendorId
|
||||
|
||||
The vendorId of the vendor you want the payout data for.
|
||||
|
||||
=head3 results
|
||||
|
||||
The number of results to be returned. Defaults to 100.
|
||||
|
||||
=head3 startIndex
|
||||
|
||||
The index of the record at which the payout data should start.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_payoutDataAsJSON {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
||||
my $admin = WebGUI::Shop::Admin->new($session);
|
||||
return $session->privilege->adminOnly() unless ($admin->canManage);
|
||||
|
||||
my $vendorId = $session->form->process('vendorId');
|
||||
my $startIndex = $session->form->process('startIndex');
|
||||
my $rowsPerPage = $session->form->process('results') || 100;
|
||||
my $pageNumber = int( $startIndex / $rowsPerPage ) + 1;
|
||||
|
||||
my $sql =
|
||||
"select t1.* from transactionItem as t1 join transaction as t2 on t1.transactionId=t2.transactionId "
|
||||
." where vendorId=? and vendorPayoutAmount > 0 and vendorPayoutStatus <> 'Paid' order by t2.orderNumber";
|
||||
my $placeholders = [ $vendorId ];
|
||||
|
||||
my $paginator = WebGUI::Paginator->new( $session, '', $rowsPerPage, '', $pageNumber );
|
||||
$paginator->setDataByQuery( $sql, undef, 0, $placeholders );
|
||||
|
||||
my $data = {
|
||||
totalRecords => $paginator->getRowCount,
|
||||
results => $paginator->getPageData,
|
||||
};
|
||||
|
||||
$session->http->setMimeType( 'application/json' );
|
||||
|
||||
return JSON::to_json( $data );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_setPayoutStatus ( )
|
||||
|
||||
Sets the vendorPayoutStatus flag for each transaction passed by the form param 'itemId'. The new status is passed
|
||||
by the form param 'status'. Status can either be 'NotPaid' or 'Scheduled' and may only be applied on items that do
|
||||
not have their vendorPayoutStatus set to 'Paid'.
|
||||
|
||||
Returns the status to which the item(s) are set.
|
||||
=cut
|
||||
|
||||
sub www_setPayoutStatus {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
||||
my $admin = WebGUI::Shop::Admin->new($session);
|
||||
return $session->privilege->adminOnly() unless ($admin->canManage);
|
||||
|
||||
my @itemIds = $session->form->process('itemId');
|
||||
my $status = $session->form->process('status');
|
||||
return "error: wrong status [$status]" unless isIn( $status, qw{ NotPaid Scheduled } );
|
||||
|
||||
foreach my $itemId (@itemIds) {
|
||||
my $item = WebGUI::Shop::TransactionItem->newByDynamicTransaction( $session, $itemId );
|
||||
return "error: invalid transactionItemId [$itemId]" unless $item;
|
||||
return "error: cannot change status of a Paid item" if $item->get('vendorPayoutStatus') eq 'Paid';
|
||||
|
||||
$item->update({ vendorPayoutStatus => $status });
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_submitScheduledPayouts ()
|
||||
|
||||
Sets the vendorPayoutStatus flag of scheduled payments to 'Paid'.
|
||||
|
||||
NOTE: This method does no payments at all. In the future this method should trigger some automated payout
|
||||
mechanism.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_submitScheduledPayouts {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
||||
my $admin = WebGUI::Shop::Admin->new($session);
|
||||
return $session->privilege->adminOnly() unless ($admin->canManage);
|
||||
|
||||
$session->db->write(
|
||||
q{ update transactionItem set vendorPayoutStatus = 'Paid' where vendorPayoutStatus = 'Scheduled' }
|
||||
);
|
||||
|
||||
return $class->www_managePayouts( $session );
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_vendorTotalsAsJSON ( )
|
||||
|
||||
Returns a JSON string containing all vendors and their payout details. The following
|
||||
form parameters can be passed:
|
||||
|
||||
=head3 vendorId
|
||||
|
||||
If passed, the results will include only the totals of this vendor.
|
||||
|
||||
=cut
|
||||
|
||||
sub www_vendorTotalsAsJSON {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
|
||||
my $admin = WebGUI::Shop::Admin->new($session);
|
||||
return $session->privilege->adminOnly() unless ($admin->canManage);
|
||||
|
||||
my $vendorId = $session->form->process('vendorId');
|
||||
my ($vendorPayoutData, @placeholders);
|
||||
|
||||
my @sql;
|
||||
push @sql,
|
||||
'select vendorId, vendorPayoutStatus, sum(vendorPayoutAmount) as total from transactionItem';
|
||||
push @sql, ' where vendorId=? ' if $vendorId;
|
||||
push @sql, ' group by vendorId, vendorPayoutStatus ';
|
||||
|
||||
push @placeholders, $vendorId if $vendorId;
|
||||
|
||||
my $sth = $session->db->read( join( ' ', @sql) , \@placeholders );
|
||||
while (my $row = $sth->hashRef) {
|
||||
$vendorPayoutData->{ $row->{vendorId} }->{ $row->{vendorPayoutStatus} } = $row->{total};
|
||||
}
|
||||
$sth->finish;
|
||||
|
||||
my @dataset;
|
||||
foreach my $vendorId (keys %{ $vendorPayoutData }) {
|
||||
my $vendor = WebGUI::Shop::Vendor->new( $session, $vendorId );
|
||||
|
||||
push @dataset, {
|
||||
%{ $vendor->get },
|
||||
%{ $vendorPayoutData->{ $vendorId } },
|
||||
}
|
||||
}
|
||||
|
||||
$session->http->setMimeType( 'application/json' );
|
||||
return JSON::to_json( { vendors => \@dataset } );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ sub acceptsPrivateMessages {
|
|||
my $userId = shift;
|
||||
|
||||
return 0 if ($self->isVisitor); #Visitor can't get private messages
|
||||
return 0 if ($userId eq "1"); # Visitor can't send private messages
|
||||
return 0 if ($self->userId eq $userId); #Can't send private messages to yourself
|
||||
|
||||
my $pmSetting = $self->profileField('allowPrivateMessages');
|
||||
|
|
|
|||
153
lib/WebGUI/Workflow/Activity/BucketPassiveAnalytics.pm
Normal file
153
lib/WebGUI/Workflow/Activity/BucketPassiveAnalytics.pm
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
package WebGUI::Workflow::Activity::BucketPassiveAnalytics;
|
||||
|
||||
use strict;
|
||||
use base 'WebGUI::Workflow::Activity';
|
||||
use WebGUI::PassiveAnalytics::Rule;
|
||||
use WebGUI::Inbox;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Workflow::Activity::BucketPassiveAnalytics
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Run through a set of rules to figure out how to classify log file entries.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
See WebGUI::Workflow::Activity for details on how to use any activity.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These methods are available from this class:
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( session, definition )
|
||||
|
||||
See WebGUI::Workflow::Activity::defintion() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, "PassiveAnalytics");
|
||||
push( @{$definition}, {
|
||||
name=>$i18n->get("Bucket Passive Analytics"),
|
||||
properties=> {
|
||||
notifyUser => {
|
||||
fieldType => 'user',
|
||||
label => $i18n->get('User'),
|
||||
hoverHelp => $i18n->get('User help'),
|
||||
defaultValue => $session->user->userId,
|
||||
},
|
||||
},
|
||||
});
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 execute ( [ object ] )
|
||||
|
||||
Analyze the deltaLog table, and generate the bucketLog table.
|
||||
|
||||
=head3 notes
|
||||
|
||||
=cut
|
||||
|
||||
sub execute {
|
||||
my ($self, undef, $instance) = @_;
|
||||
my $session = $self->session;
|
||||
my $endTime = time() + $self->getTTL;
|
||||
my $expired = 0;
|
||||
|
||||
##Load all the rules into an array
|
||||
my @rules = ();
|
||||
my $getARule = WebGUI::PassiveAnalytics::Rule->getAllIterator($session);
|
||||
while (my $rule = $getARule->()) {
|
||||
my $regexp = $rule->get('regexp');
|
||||
push @rules, [ $rule->get('bucketName'), qr/$regexp/];
|
||||
}
|
||||
|
||||
##Get the index stored from the last invocation of the Activity. If this is
|
||||
##the first run, then clear out the table.
|
||||
my $logIndex = $instance->getScratch('lastPassiveLogIndex') || 0;
|
||||
if ($logIndex == 0) {
|
||||
$session->db->write('delete from bucketLog');
|
||||
}
|
||||
my %bucketCache = ();
|
||||
|
||||
##Configure all the SQL
|
||||
my $deltaSql = <<"EOSQL1";
|
||||
select userId, assetId, url, delta, from_unixtime(timeStamp) as stamp
|
||||
from deltaLog order by timestamp limit $logIndex, 1234567890
|
||||
EOSQL1
|
||||
my $deltaSth = $session->db->read($deltaSql);
|
||||
my $bucketSth = $session->db->prepare('insert into bucketLog (userId, Bucket, duration, timeStamp) VALUES (?,?,?,?)');
|
||||
|
||||
##Walk through the log file entries, one by one. Run each entry against
|
||||
##all the rules until 1 matches. If it doesn't match any rule, then bin it
|
||||
##into the "Other" bucket.
|
||||
DELTA_ENTRY: while (my $entry = $deltaSth->hashRef()) {
|
||||
++$logIndex;
|
||||
my $bucketFound = 0;
|
||||
my $url = $entry->{url};
|
||||
if (exists $bucketCache{$url}) {
|
||||
$bucketSth->execute([$entry->{userId}, $bucketCache{$url}, $entry->{delta}, $entry->{stamp}]);
|
||||
}
|
||||
else {
|
||||
RULE: foreach my $rule (@rules) {
|
||||
next RULE unless $url =~ $rule->[1];
|
||||
|
||||
# Into the bucket she goes..
|
||||
$bucketCache{$url} = $rule->[0];
|
||||
$bucketSth->execute([$entry->{userId}, $rule->[0], $entry->{delta}, $entry->{stamp}]);
|
||||
$bucketFound = 1;
|
||||
last RULE;
|
||||
}
|
||||
if (!$bucketFound) {
|
||||
$bucketCache{$url} = 'Other';
|
||||
$bucketSth->execute([$entry->{userId}, 'Other', $entry->{delta}, $entry->{stamp}]);
|
||||
}
|
||||
}
|
||||
if (time() > $endTime) {
|
||||
$expired = 1;
|
||||
last DELTA_ENTRY;
|
||||
}
|
||||
}
|
||||
|
||||
if ($expired) {
|
||||
$instance->setScratch('logIndex', $logIndex);
|
||||
return $self->WAITING(1);
|
||||
}
|
||||
my $message = 'Passive analytics is done.';
|
||||
if ($session->setting->get('passiveAnalyticsDeleteDelta')) {
|
||||
$session->log->info('Clearing Passive Analytics delta log');
|
||||
$session->db->write('delete from deltaLog');
|
||||
$message .= ' The delta log has been cleaned up.';
|
||||
}
|
||||
##If userId was set to 0, do not send any emails.
|
||||
if ($self->get('userId')) {
|
||||
my $inbox = WebGUI::Inbox->new($self->session);
|
||||
$inbox->addMessage({
|
||||
status => 'unread',
|
||||
subject => 'Passive analytics is done',
|
||||
userId => $self->get('userId'),
|
||||
message => $message,
|
||||
});
|
||||
}
|
||||
$session->db->write('update passiveAnalyticsStatus set endDate=NOW(), running=0');
|
||||
|
||||
return $self->COMPLETE;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
#vim:ft=perl
|
||||
152
lib/WebGUI/Workflow/Activity/ExpireIncompleteSurveyResponses.pm
Normal file
152
lib/WebGUI/Workflow/Activity/ExpireIncompleteSurveyResponses.pm
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
package WebGUI::Workflow::Activity::ExpireIncompleteSurveyResponses;
|
||||
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
WebGUI is Copyright 2001-2008 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
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use base 'WebGUI::Workflow::Activity';
|
||||
use WebGUI::Asset;
|
||||
use WebGUI::DateTime;
|
||||
use DateTime::Duration;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Workflow::Activity::ExpireIncompleteSurveyResponses
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This activity deletes the survey responses for which the allowed time has expired and emails the survey user.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
See WebGUI::Workflow::Activity for details on how to use any activity.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These methods are available from this class:
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( session, definition )
|
||||
|
||||
See WebGUI::Workflow::Activity::defintion() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, "Workflow_Activity_ExpireIncompleteSurveyResponses");
|
||||
push(@{$definition}, {
|
||||
name => $i18n->get("name"),
|
||||
properties => {
|
||||
deleteExpired=>{
|
||||
fieldType=>"yesNo",
|
||||
defaultValue=>0,
|
||||
label=>$i18n->get("Delete expired survey responses"),
|
||||
hoverHelp=>$i18n->get("delete expired")
|
||||
},
|
||||
emailUsers=>{
|
||||
fieldType=>"yesNo",
|
||||
defaultValue=>0,
|
||||
label=>$i18n->get("Email users that responses were deleted"),
|
||||
hoverHelp=>$i18n->get("email users")
|
||||
},
|
||||
emailTemplateId => {
|
||||
fieldType => "template",
|
||||
defaultValue => 'ExpireIncResptmpl00001',
|
||||
namespace => "ExpireIncompleteSurveyResponses",
|
||||
label => $i18n->get('Email template sent to user'),
|
||||
hoverHelp => $i18n->get('email template'),
|
||||
},
|
||||
from => {
|
||||
fieldType=>"text",
|
||||
label=>$i18n->get("from"),
|
||||
defaultValue=>$session->setting->get("companyEmail"),
|
||||
hoverHelp=>$i18n->get("from mouse over"),
|
||||
},
|
||||
subject => {
|
||||
fieldType=>"text",
|
||||
label=>$i18n->get("subject"),
|
||||
defaultValue=>"Expired Survey",
|
||||
hoverHelp=>$i18n->get("subject mouse over"),
|
||||
},
|
||||
}
|
||||
});
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 execute ( [ object ] )
|
||||
|
||||
Finds all the expired Survey Responses on the system. If delete is selected, they are removed. Then if
|
||||
email is selected, the users are emailed the template.
|
||||
|
||||
=cut
|
||||
|
||||
sub execute {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
|
||||
my $sql = "select r.Survey_responseId, r.username, r.userId, upd.email,upd.firstName,upd.lastName, r.startDate, s.timeLimit, ad.title, ad.url
|
||||
from Survey s, Survey_response r, assetData ad, userProfileData upd
|
||||
where r.isComplete = 0 and s.timeLimit > 0 and (unix_timestamp() - r.startDate) > (s.timeLimit * 60)
|
||||
and r.assetId = s.assetId and s.revisionDate = (select max(revisionDate) from Survey where assetId = s.assetId)
|
||||
and ad.assetId = s.assetId and ad.revisionDate = s.revisionDate and upd.userId = r.userId";
|
||||
my $refs = $self->session->db->buildArrayRefOfHashRefs($sql);
|
||||
for my $ref (@{$refs}) {
|
||||
if($self->get("deleteExpired") == 1){
|
||||
$self->session->db->write("delete from Survey_response where Survey_responseId = ?",[$ref->{Survey_responseId}]);
|
||||
}else{#else sent to expired but not deleted
|
||||
$self->session->db->write("update Survey_response set isComplete = 99 where Survey_responseId = ?",[$ref->{Survey_responseId}]);
|
||||
}
|
||||
if($self->get("emailUsers") == 1 && $ref->{email} =~ /\@/){
|
||||
|
||||
my $var = {
|
||||
to => $ref->{email},
|
||||
from => $self->get("from"),
|
||||
firstName => $ref->{firstName},
|
||||
lastName => $ref->{lastName},
|
||||
surveyTitle => $ref->{title},
|
||||
surveyUrl => $ref->{url},
|
||||
responseId => $ref->{Survey_responseId},
|
||||
deleted => $self->get("deleteExpired"),
|
||||
companyName => $self->session->setting->get("companyName"),
|
||||
};
|
||||
my $template = WebGUI::Asset->newByDynamicClass($self->session,$self->get('emailTemplateId'));
|
||||
my $message = $template->processTemplate($var, $self->get("emailTemplateId"));
|
||||
WebGUI::Macro::process($self->session,\$message);
|
||||
my $mail = WebGUI::Mail::Send->create($self->session,{
|
||||
to => $ref->{email},
|
||||
subject => $self->get("subject"),
|
||||
from => $self->get('from'),
|
||||
});
|
||||
$mail->addHtml($message);
|
||||
$mail->addFooter;
|
||||
$mail->queue;
|
||||
}
|
||||
}
|
||||
return $self->COMPLETE;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
|
@ -342,8 +342,10 @@ sub setMessageCompleted {
|
|||
|
||||
# Set all messages to completed
|
||||
for my $messageId ( split /,/, $instance->getScratch("messageId") ) {
|
||||
my $message = $inbox->getMessage( $messageId );
|
||||
$message->setCompleted;
|
||||
if($messageId){
|
||||
my $message = $inbox->getMessage( $messageId );
|
||||
$message->setCompleted if $message;
|
||||
}
|
||||
}
|
||||
|
||||
$instance->deleteScratch( "messageId" );
|
||||
|
|
|
|||
148
lib/WebGUI/Workflow/Activity/SummarizePassiveAnalytics.pm
Normal file
148
lib/WebGUI/Workflow/Activity/SummarizePassiveAnalytics.pm
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
package WebGUI::Workflow::Activity::SummarizePassiveAnalytics;
|
||||
|
||||
use strict;
|
||||
use base 'WebGUI::Workflow::Activity';
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::Workflow::Activity::SummarizePassiveAnalytics
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Summarize how long a user stayed on a page, using a user supplied interval.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
See WebGUI::Workflow::Activity for details on how to use any activity.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
These methods are available from this class:
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 definition ( session, definition )
|
||||
|
||||
See WebGUI::Workflow::Activity::defintion() for details.
|
||||
|
||||
=cut
|
||||
|
||||
sub definition {
|
||||
my $class = shift;
|
||||
my $session = shift;
|
||||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session, 'PassiveAnalytics');
|
||||
push(@{$definition}, {
|
||||
name=>$i18n->get('Summarize Passive Analytics'),
|
||||
properties=> {
|
||||
deltaInterval => {
|
||||
fieldType => 'interval',
|
||||
label => $i18n->get('pause interval'),
|
||||
defaultValue => 15,
|
||||
hoverHelp => $i18n->get('pause interval help'),
|
||||
},
|
||||
}
|
||||
});
|
||||
return $class->SUPER::definition($session,$definition);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 execute ( [ object ] )
|
||||
|
||||
Analyze the passiveLog table, and generate the deltaLog table.
|
||||
|
||||
=head3 notes
|
||||
|
||||
If there is only 1 line in the table for a particular sessionId or
|
||||
userId, no conclusions as to how long the user viewed a page can be
|
||||
drawn from that. Similarly, the last entry in their browsing log
|
||||
yields no data, since we require another entry in the passiveLog to
|
||||
determine a delta.
|
||||
|
||||
=cut
|
||||
|
||||
sub execute {
|
||||
my ($self, undef, $instance) = @_;
|
||||
my $session = $self->session;
|
||||
my $endTime = time() + $self->getTTL;
|
||||
my $deltaInterval = $self->get('deltaInterval');
|
||||
|
||||
my $passive = q{select * from passiveLog where userId <> '1' order by userId, sessionId, timeStamp};
|
||||
my $sth;
|
||||
my $lastUserId;
|
||||
my $lastSessionId;
|
||||
my $lastTimeStamp;
|
||||
my $lastAssetId;
|
||||
my $lastUrl;
|
||||
my $counter = $instance->getScratch('counter');
|
||||
if ($counter) {
|
||||
$passive .= ' limit '. $counter .', 1234567890';
|
||||
$sth = $session->db->read($passive);
|
||||
$lastUserId = $instance->getScratch('lastUserId');
|
||||
$lastSessionId = $instance->getScratch('lastSessionId');
|
||||
$lastTimeStamp = $instance->getScratch('lastTimeStamp');
|
||||
$lastAssetId = $instance->getScratch('lastAssetId');
|
||||
$lastUrl = $instance->getScratch('lastUrl');
|
||||
}
|
||||
else {
|
||||
$sth = $session->db->read($passive);
|
||||
my $logLine = $sth->hashRef();
|
||||
$lastUserId = $logLine->{userId};
|
||||
$lastSessionId = $logLine->{sessionId};
|
||||
$lastTimeStamp = $logLine->{timeStamp};
|
||||
$lastAssetId = $logLine->{assetId};
|
||||
$lastUrl = $logLine->{url};
|
||||
}
|
||||
|
||||
$session->db->write('delete from deltaLog'); ##Only if we're starting out
|
||||
my $deltaLog = $session->db->prepare('insert into deltaLog (userId, assetId, delta, timeStamp, url) VALUES (?,?,?,?,?)');
|
||||
|
||||
my $expired = 0;
|
||||
LOG_ENTRY: while (my $logLine = $sth->hashRef()) {
|
||||
$counter++;
|
||||
my $delta = $logLine->{timeStamp} - $lastTimeStamp;
|
||||
if ( $logLine->{userId} eq $lastUserId
|
||||
&& $logLine->{sessionId} eq $lastSessionId
|
||||
&& $delta < $deltaInterval ) {
|
||||
$deltaLog->execute([$lastUserId, $lastAssetId, $delta, $lastTimeStamp, $lastUrl]);
|
||||
}
|
||||
$lastUserId = $logLine->{userId};
|
||||
$lastSessionId = $logLine->{sessionId};
|
||||
$lastTimeStamp = $logLine->{timeStamp};
|
||||
$lastAssetId = $logLine->{assetId};
|
||||
$lastUrl = $logLine->{url};
|
||||
if (time() > $endTime) {
|
||||
$instance->setScratch('lastUserId', $lastUserId);
|
||||
$instance->setScratch('lastSessionId', $lastSessionId);
|
||||
$instance->setScratch('lastTimeStamp', $lastTimeStamp);
|
||||
$instance->setScratch('lastAssetId', $lastAssetId);
|
||||
$instance->setScratch('lastUrl', $lastUrl);
|
||||
$instance->setScratch('counter', $counter);
|
||||
$expired = 1;
|
||||
last LOG_ENTRY;
|
||||
}
|
||||
}
|
||||
|
||||
if ($expired) {
|
||||
return $self->WAITING(1);
|
||||
}
|
||||
|
||||
$instance->deleteScratch('lastUserId');
|
||||
$instance->deleteScratch('lastSessionId');
|
||||
$instance->deleteScratch('lastTimeStamp');
|
||||
$instance->deleteScratch('lastAssetId');
|
||||
$instance->deleteScratch('lastUrl');
|
||||
$instance->deleteScratch('counter');
|
||||
return $self->COMPLETE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
#vim:ft=perl
|
||||
|
|
@ -49,6 +49,11 @@ our $I18N = {
|
|||
lastUpdated => 1230867169,
|
||||
},
|
||||
|
||||
'my sales label' => {
|
||||
message => q{Sales},
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -1190,6 +1190,12 @@ Couldn't open %-s because %-s <br />
|
|||
context => q{Asset Manager label, as in "locked by admin"},
|
||||
},
|
||||
|
||||
'assetHistory' => {
|
||||
message => q{Asset History},
|
||||
lastUpdated => 0,
|
||||
context => q{Admin Console label. Shows the history of assets in this site.},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -231,6 +231,36 @@ our $I18N = {
|
|||
context => q|add the described item to the shopping cart|
|
||||
},
|
||||
|
||||
'form purchase ad title' => {
|
||||
message => q|Ad Title|,
|
||||
lastUpdated => 0,
|
||||
context => q|the title chosen by the buyer for the advertisement|
|
||||
},
|
||||
|
||||
'form purchase ad link' => {
|
||||
message => q|Ad Link|,
|
||||
lastUpdated => 0,
|
||||
context => q|the link the advertisement leads to|
|
||||
},
|
||||
|
||||
'form purchase ad image' => {
|
||||
message => q|Image|,
|
||||
lastUpdated => 0,
|
||||
context => q|the image to be displayed in the ad|
|
||||
},
|
||||
|
||||
'form purchase number of clicks' => {
|
||||
message => q|Number of Clicks|,
|
||||
lastUpdated => 0,
|
||||
context => q|the number of clicks the buyer wishes to purchase|
|
||||
},
|
||||
|
||||
'form purchase number of impressions' => {
|
||||
message => q|Number of Impressions|,
|
||||
lastUpdated => 0,
|
||||
context => q|the number of impressions the user wishes to purchase|
|
||||
},
|
||||
|
||||
'TODO' => {
|
||||
message => q|TODO|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
|
|
@ -372,6 +372,11 @@ listing,|,
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'group to add description' => {
|
||||
message => q|Select the group that is allowed to add listings to this matrix.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'ratings duration description' => {
|
||||
message => q|Select the interval after which old ratings are cleaned out.|,
|
||||
lastUpdated => 0,
|
||||
|
|
@ -418,8 +423,8 @@ listing,|,
|
|||
},
|
||||
|
||||
'max comparisons privileged description' => {
|
||||
message => q|Specifies how many comparisons are allowed in searches and comparisons for users in the privileged group.|,
|
||||
lastUpdated => 0,
|
||||
message => q|Specifies how many comparisons are allowed in searches and comparisons for users who have accounts on the site.|,
|
||||
lastUpdated => 1235681965,
|
||||
},
|
||||
|
||||
'rating timeout description' => {
|
||||
|
|
@ -476,6 +481,16 @@ listing,|,
|
|||
message => q|Select a template to be used to show the listing edit screen.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'screenshots template description' => {
|
||||
message => q|Select a template to be used to show a listing's screenshots.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'screenshots config template description' => {
|
||||
message => q|Select a template for a listing's screenshots configuration.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'categories label' => {
|
||||
message => q|Categories|,
|
||||
|
|
@ -487,6 +502,11 @@ listing,|,
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'group to add label' => {
|
||||
message => q|Group To Add|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'ratings duration label' => {
|
||||
message => q|Ratings Duration|,
|
||||
lastUpdated => 0,
|
||||
|
|
@ -548,8 +568,8 @@ listing,|,
|
|||
},
|
||||
|
||||
'max comparisons privileged label' => {
|
||||
message => q|Maximum Comparisons (For Privileged Users)|,
|
||||
lastUpdated => 0,
|
||||
message => q|Maximum Comparisons (For Registered Users)|,
|
||||
lastUpdated => 1235681967,
|
||||
},
|
||||
|
||||
'rating timeout' => {
|
||||
|
|
@ -602,6 +622,16 @@ listing,|,
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'screenshots template label' => {
|
||||
message => q|Listing Screenshots Template|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'screenshots config template label' => {
|
||||
message => q|Listing Screenshots Config Template|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'edit listing template label' => {
|
||||
message => q|Edit Listing Template|,
|
||||
lastUpdated => 0,
|
||||
|
|
@ -750,6 +780,12 @@ selectBox.</p>|
|
|||
message => q|Hide/show stickied|,
|
||||
},
|
||||
|
||||
'approve or deny label' => {
|
||||
lastUpdated => 0,
|
||||
message => q|Approve/Deny|,
|
||||
context => q|Label for the approve or deny link on the matrix listing detail screen.|,
|
||||
},
|
||||
|
||||
'matrix asset template variables title' => {
|
||||
lastUpdated => 0,
|
||||
message => q|Matrix Asset Template Variables|,
|
||||
|
|
|
|||
|
|
@ -44,6 +44,11 @@ fields below.|,
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'edit label' => {
|
||||
message => q|Edit|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'version description' => {
|
||||
message => q|Enter the version/edition/model number for the product.|,
|
||||
lastUpdated => 0,
|
||||
|
|
@ -221,6 +226,30 @@ it would be best to make sure the names are the same.|,
|
|||
context => q|Description of the form tmpl_var for the template help.|,
|
||||
},
|
||||
|
||||
'canEdit' => {
|
||||
message => q|A boolean indicating whether the user can edit this listing.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Description of the screenshots tmpl_var for the template help.|,
|
||||
},
|
||||
|
||||
'editUrl' => {
|
||||
message => q|The url to this listing's edit screen.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Description of the screenshots tmpl_var for the template help.|,
|
||||
},
|
||||
|
||||
'canApprove' => {
|
||||
message => q|A boolean indicating whether the user can approve or deny this listing.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Description of the screenshots tmpl_var for the template help.|,
|
||||
},
|
||||
|
||||
'approveOrDenyUrl' => {
|
||||
message => q|The url to this listing's approve or deny screen.|,
|
||||
lastUpdated => 0,
|
||||
context => q|Description of the screenshots tmpl_var for the template help.|,
|
||||
},
|
||||
|
||||
'screenshots' => {
|
||||
message => q|This listings screenshots displayed using the ukplayer.|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
|
|
@ -487,8 +487,8 @@ editing an existing Post, and a thread containing the Post exists.|,
|
|||
},
|
||||
|
||||
'userDefined3' => {
|
||||
message => q|The value contained in the first user defined variable.|,
|
||||
lastUpdated => 1150167057,
|
||||
message => q|The value contained in the third user defined variable.|,
|
||||
lastUpdated => 1236354498,
|
||||
},
|
||||
|
||||
'userDefined4' => {
|
||||
|
|
|
|||
|
|
@ -161,12 +161,14 @@ our $I18N = { ##hashref of hashes
|
|||
|
||||
'no results' => {
|
||||
message => q|No results were found.|,
|
||||
context => q|An internationalized label for telling the user that no results were found.|,
|
||||
lastUpdated => 1170549113,
|
||||
},
|
||||
|
||||
'no_results' => {
|
||||
message => q|An internationalized label for telling the user that no results were found.|,
|
||||
lastUpdated => 1170549119,
|
||||
context => q|Template variable in the view method.|,
|
||||
lastUpdated => 1236101532,
|
||||
},
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ use strict;
|
|||
our $I18N = {
|
||||
|
||||
'assetName' => {
|
||||
message => q|Survey|,
|
||||
lastUpdated => 1224686319
|
||||
message => q|Survey (beta)|,
|
||||
lastUpdated => 1236187015
|
||||
},
|
||||
'edit survey' => {
|
||||
message => q|Edit Survey|,
|
||||
|
|
@ -31,6 +31,10 @@ our $I18N = {
|
|||
message => q|View Grade Book|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'delete responses' => {
|
||||
message => q|Delete Responses|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
'continue button' => {
|
||||
message => q|Continue|,
|
||||
lastUpdated => 1224686319
|
||||
|
|
@ -83,7 +87,7 @@ our $I18N = {
|
|||
},
|
||||
|
||||
'section name' => {
|
||||
message => q|Section name:|,
|
||||
message => q|Section title:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'section name description' => {
|
||||
|
|
@ -101,7 +105,7 @@ our $I18N = {
|
|||
lastUpdated => 0
|
||||
},
|
||||
'section custom variable name' => {
|
||||
message => q|Section custom variable name:|,
|
||||
message => q|Section variable name:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'section custom variable name description' => {
|
||||
|
|
@ -110,7 +114,7 @@ our $I18N = {
|
|||
lastUpdated => 0
|
||||
},
|
||||
'section branch goto variable name' => {
|
||||
message => q|Section branch goto variable name:|,
|
||||
message => q|Jump to:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'section branch goto variable name description' => {
|
||||
|
|
@ -222,6 +226,10 @@ our $I18N = {
|
|||
message => q|Question type:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'randomized words' => {
|
||||
message => q|Randomized words:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'question type description' => {
|
||||
message => q|Select this question's field type.|,
|
||||
context => q|Description of the 'question type' field, used as hoverhelp in the edit question dialog.|,
|
||||
|
|
@ -256,21 +264,21 @@ our $I18N = {
|
|||
context => q|Description of the 'allow comment' field, used as hoverhelp in the edit question dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
'cols' => {
|
||||
message => q|Cols:|,
|
||||
'comment cols' => {
|
||||
message => q|Comment Cols:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'cols description' => {
|
||||
message => q|The number of columns of the textarea input.|,
|
||||
message => q|The number of columns used for the comment TextArea input field.|,
|
||||
context => q|Description of the 'cols' field, used as hoverhelp in the edit question dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
'rows' => {
|
||||
message => q|Rows:|,
|
||||
'comment rows' => {
|
||||
message => q|Comment Rows:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'rows description' => {
|
||||
message => q|The number of rows of the textarea input.|,
|
||||
message => q|The number of rows shown for the comment TextArea input field.|,
|
||||
context => q|Description of the 'rows' field, used as hoverhelp in the edit question dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
|
@ -325,11 +333,11 @@ our $I18N = {
|
|||
lastUpdated => 0
|
||||
},
|
||||
'recorded answer' => {
|
||||
message => q|Recorded answer:|,
|
||||
message => q|Answer title:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'recorded answer description' => {
|
||||
message => q|The answer that will be recorded in the database. The recorded answer will be displayed in a multiple choice question's buttons, only if the question's 'Show text in button' property is set to yes. Otherwise the multiple choice buttons will be empty. |,
|
||||
message => q|Text to display inside multiple-choice answer buttons (only if 'Show text in button' is enabled for this question).|,
|
||||
context => q|Description of the 'recorded answer' field, used as hoverhelp in the edit answer dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
|
@ -337,13 +345,22 @@ our $I18N = {
|
|||
message => q|Jump to:|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'jump expression' => {
|
||||
message => q|Jump expression:|,
|
||||
lastUpdated => 1229318805
|
||||
},
|
||||
'jump to description' => {
|
||||
message => q|The section or question with this variable name will be the next to be displayed after this answer.|,
|
||||
context => q|Description of the 'jump to' field, used as hoverhelp in the edit answer dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
'jump expression description' => {
|
||||
message => q|An expression used to control complex branching based user responses to previous questions. A branch expression is made up of a list of rules, one per line, along with a branch target for each rule. |,
|
||||
context => q|Description of the 'jump expression' field, used as hoverhelp in the edit answer dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
'text answer' => {
|
||||
message => q|Text answer|,
|
||||
message => q|TextArea|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'is this the correct answer' => {
|
||||
|
|
@ -363,30 +380,30 @@ our $I18N = {
|
|||
message => q|No|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'min' => {
|
||||
message => q|Min|,
|
||||
'min label' => {
|
||||
message => q|Slider Min|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'min description' => {
|
||||
message => q|Set the min value of this answer for slider type questions.|,
|
||||
message => q|The minimum value of this answer for slider type questions.|,
|
||||
context => q|Description of the 'min' field, used as hoverhelp in the edit answer dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
'max label' => {
|
||||
message => q|Max|,
|
||||
message => q|Slider Max|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'max description' => {
|
||||
message => q|Set the max value of this answer for slider type questions.|,
|
||||
message => q|The maximum value of this answer for slider type questions.|,
|
||||
context => q|Description of the 'max' field, used as hoverhelp in the edit answer dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
'step label' => {
|
||||
message => q|Step|,
|
||||
message => q|Slider Step|,
|
||||
lastUpdated => 1224686319
|
||||
},
|
||||
'step description' => {
|
||||
message => q|Set the step value of this answer for slider type questions.|,
|
||||
message => q|The step value of this answer for slider type questions.|,
|
||||
context => q|Description of the 'step' field, used as hoverhelp in the edit answer dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
|
@ -395,7 +412,7 @@ our $I18N = {
|
|||
lastUpdated => 1224686319
|
||||
},
|
||||
'verbatim description' => {
|
||||
message => q|Set to yes to add an extra text input to the answer, where the user can enter a single line of text.|,
|
||||
message => q|Set to yes to add an extra text input to the answer, where the user can enter a single line of text. Typically used to permit a free-text 'other' response.|,
|
||||
context => q|Description of the 'verbatim' field, used as hoverhelp in the edit answer dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
|
@ -404,7 +421,7 @@ our $I18N = {
|
|||
lastUpdated => 1224686319
|
||||
},
|
||||
'answer value description' => {
|
||||
message => q|Enter a value for this answer.|,
|
||||
message => q|Assign a numeric scores to this answers. Used in question scoring and jump expressions.|,
|
||||
context => q|Description of the 'answer value' field, used as hoverhelp in the edit answer dialog.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
|
@ -429,7 +446,35 @@ our $I18N = {
|
|||
message => q|The template to display the main page of the survey.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'do after timelimit label' => {
|
||||
message => q|Do After Time Limit:|,
|
||||
lastUpdated => 1224686319,
|
||||
context => q|label for the 'do after timelimit' field on the Properties tab of the Survey's edit screen.|,
|
||||
},
|
||||
'do after timelimit hoverHelp' => {
|
||||
message => q|Select what happens after the time limit for finishing the survey has expired.|,
|
||||
lastUpdated => 1231193335,
|
||||
context => q|description of the 'do after timelimit' field on the Properties tab of the Survey's edit
|
||||
screen|,
|
||||
},
|
||||
'exit url label' =>{
|
||||
message => q|Exit URL|,
|
||||
lastUpdated => 0,
|
||||
context => q|Label for the 'exit url' option of the 'do after timelimit' field on the Properties tab of the
|
||||
Survey's edit screen|,
|
||||
},
|
||||
'restart survey label' =>{
|
||||
message => q|Restart Survey|,
|
||||
lastUpdated => 0,
|
||||
context => q|Label for the 'restart survey' option of the 'do after timelimit' field on the Properties tab of the
|
||||
Survey's edit screen|,
|
||||
},
|
||||
'restart message' =>{
|
||||
message => q|The survey was restarted because the time limit for completing the survey was reached.|,
|
||||
lastUpdated => 0,
|
||||
context => q|The message shown to the user taking the survey when the survey is restarted after reaching
|
||||
the time limit for completing the survey. This message is in the 'take survey' template.|,
|
||||
},
|
||||
'Show user their progress' => {
|
||||
message => q|Show user their progress?|,
|
||||
lastUpdated => 0,
|
||||
|
|
@ -489,6 +534,135 @@ our $I18N = {
|
|||
message => q|When the user finishes the surevey, they will be sent to this URL. Leave blank if no special forwarding is required. The gateway setting from the config file will be automatically added to the URL for you.|,
|
||||
lastUpdated => 1233714385,
|
||||
},
|
||||
|
||||
'Overview Report Template' => {
|
||||
message => q|Overview Report Template|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'Overview Report Template help' => {
|
||||
message => q|The template used to display the Overview Report.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'Grabebook Report Template' => {
|
||||
message => q|Grabebook Report Template|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'Grabebook Report Template help' => {
|
||||
message => q|The template used to display the Gradebook Report|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'Survey Edit Template' => {
|
||||
message => q|Survey Edit Template|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'Survey Edit Template help' => {
|
||||
message => q|The template used to display the Survey Edit screen.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'Max user responses' => {
|
||||
message => q|Max user responses|,
|
||||
context => q|The maximum number of times a user may take this survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Max user responses help' => {
|
||||
message => q|The maximum number of times a user may take this survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Survey Overview Template' => {
|
||||
message => q|Survey Overview Template|,
|
||||
context => q|The template that provides an overview of the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Survey Overview Template help' => {
|
||||
message => q|The template that provides an overview of the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Gradebook Template' => {
|
||||
message => q|Gradebook Template|,
|
||||
context => q|The template for displaying the gradebook.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Gradebook Template help' => {
|
||||
message => q|The template for displaying the gradebook.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Edit Survey Template' => {
|
||||
message => q|Edit Survey Template|,
|
||||
context => q|The template for displaying the screen for editing the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Edit Survey Template help' => {
|
||||
message => q|The template for displaying the screen for editing the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Take Survey Template' => {
|
||||
message => q|Take Survey Template|,
|
||||
context => q|The template for displaying the screen where a user takes the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Take Survey Template help' => {
|
||||
message => q|The template used to control the initial Take Survey screen, from which responses are dynamically loaded into.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Questions Template' => {
|
||||
message => q|Questions Template|,
|
||||
context => q|The template for rendering questions in the survey.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Questions Template help' => {
|
||||
message => q|The template used to display individual questions, which are dynamically loaded into the Take Survey page.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Section Edit Template' => {
|
||||
message => q|Section Edit Template|,
|
||||
context => q|The template for adding or editing sections.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Section Edit Template help' => {
|
||||
message => q|The template used to display the Section Edit dialog on the Edit Survey page.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Question Edit Template' => {
|
||||
message => q|Question Edit Template|,
|
||||
context => q|The template for adding or editing questions.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Question Edit Template help' => {
|
||||
message => q|The template used to display the Question Edit dialog on the Edit Survey page.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Answer Edit Template' => {
|
||||
message => q|Answer Edit Template|,
|
||||
context => q|The template for adding or editing answers.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'Answer Edit Template help' => {
|
||||
message => q|The template used to display the Answer Edit dialog on the Edit Survey page.|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
|
||||
'percentage label' => {
|
||||
message => q|Percentage|,
|
||||
|
|
@ -750,9 +924,27 @@ directly inside the answer_loop for other types of questions.|,
|
|||
},
|
||||
|
||||
'templateId' => {
|
||||
message => q|The ID of the template to show the Survey.|,
|
||||
message => q|The ID of the template to show the front page of the Survey.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 1168639537,
|
||||
lastUpdated => 1236891448,
|
||||
},
|
||||
|
||||
'gradebookTemplateId' => {
|
||||
message => q|The ID of the template used to show the gradebook screen.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 1168643669,
|
||||
},
|
||||
|
||||
'responseTemplateId' => {
|
||||
message => q|The ID of the template used to show the Survey Response screen.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 1168643669,
|
||||
},
|
||||
|
||||
'overviewTemplateId' => {
|
||||
message => q|The ID of the template used to show the overview screen.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 1168643669,
|
||||
},
|
||||
|
||||
'groupToTakeSurvey' => {
|
||||
|
|
@ -773,24 +965,6 @@ directly inside the answer_loop for other types of questions.|,
|
|||
lastUpdated => 1168643566,
|
||||
},
|
||||
|
||||
'overviewTemplateId' => {
|
||||
message => q|The ID of the template used to show the overview screen.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 1168643669,
|
||||
},
|
||||
|
||||
'gradebookTemplateId' => {
|
||||
message => q|The ID of the template used to show the gradebook screen.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 1168643669,
|
||||
},
|
||||
|
||||
'responseTemplateId' => {
|
||||
message => q|The ID of the template used to show the Survey Response screen.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 1168643669,
|
||||
},
|
||||
|
||||
'survey questions template title' => {
|
||||
message => q|Survey Questions Template|,
|
||||
context => q|The title of a template Help page.|,
|
||||
|
|
@ -1117,18 +1291,6 @@ section/answer.|,
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'min' => {
|
||||
message => q|The min value of this answer for slider type questions.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'max' => {
|
||||
message => q|The max value of this answer for slider type questions..|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'step' => {
|
||||
message => q|The step value of this answer for slider type questions..|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
|
|
@ -1142,13 +1304,13 @@ section/answer.|,
|
|||
},
|
||||
|
||||
'textCols' => {
|
||||
message => q|The number of columns for textarea answers.|,
|
||||
message => q|The number of columns for TextArea questions.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'textRows' => {
|
||||
message => q|The number of rows for textarea answers.|,
|
||||
message => q|The number of rows for TextArea questions.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
|
@ -1171,6 +1333,18 @@ section/answer.|,
|
|||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'min' => {
|
||||
message => q|The min value of this answer for slider type questions.|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'max' => {
|
||||
message => q|The max value of this answer for slider type questions..|,
|
||||
context => q|Description of a template variable for a template Help page.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,29 @@ our $I18N = {
|
|||
lastUpdated => 1227210876,
|
||||
},
|
||||
|
||||
'account activation template title' => {
|
||||
message => q|WebGUI Authentication Account Activation Mail Template|,
|
||||
lastUpdated => 1230600500,
|
||||
context => q|The title of the help page for the webgui auth welcome message template.|,
|
||||
},
|
||||
|
||||
'account activation template' => {
|
||||
message => q|Account Activation Mail Template|,
|
||||
lastUpdated => 1230600500,
|
||||
context => q|The label for the 'account activation template' field on the Authentication tab of the Settings screen.|,
|
||||
},
|
||||
|
||||
'account activation template help' => {
|
||||
message => q|Select a template for the account activation mail that is sent to new users.|,
|
||||
lastUpdated => 1230600500,
|
||||
context => q|The description of the 'account activation template' field on the Authentication tab of the Settings screen, displayed as hoverhelp.|,
|
||||
},
|
||||
|
||||
'activationUrl' => {
|
||||
message => q|The url to activate the newly created account.|,
|
||||
lastUpdated => 1230600500,
|
||||
},
|
||||
|
||||
'use captcha' => {
|
||||
message => q|Use captcha image?|,
|
||||
lastUpdated => 1078852836
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use strict;
|
|||
our $I18N = {
|
||||
|
||||
'from user preface' => {
|
||||
message => q|You were sent a message from |,
|
||||
message => q|You were sent a message from %s|,
|
||||
lastUpdated => 0
|
||||
},
|
||||
};
|
||||
|
|
|
|||
183
lib/WebGUI/i18n/English/PassiveAnalytics.pm
Normal file
183
lib/WebGUI/i18n/English/PassiveAnalytics.pm
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
package WebGUI::i18n::English::PassiveAnalytics;
|
||||
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
|
||||
'Summarize Passive Analytics' => {
|
||||
message => q|Summarize Passive Analytics|,
|
||||
context => q|The name of this workflow activity.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'pause interval' => {
|
||||
message => q|Pause threshold|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'pause interval help' => {
|
||||
message => q|Set the time between clicks that is interpreted as the user reading the page, as opposed to beginning a new browsing session, or leaving the site.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'default pause interval' => {
|
||||
message => q|Default Pause Threshold|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'default pause interval help' => {
|
||||
message => q|Set the default pause interval displayed the user sees in the Passive Analytics screen.|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
'other' => {
|
||||
message => q|Other|,
|
||||
lastUpdated => 0,
|
||||
context => q|Meaning not like anything in a set. This, that and the other one. Also, a catch all.|
|
||||
},
|
||||
|
||||
'Bucket Passive Analytics' => {
|
||||
message => q|Bucket Passive Analytics|,
|
||||
lastUpdated => 0,
|
||||
context => q|Name of the activity that puts log entries into buckets for analysis.|
|
||||
},
|
||||
|
||||
'Bucket Name' => {
|
||||
message => q|Bucket Name|,
|
||||
lastUpdated => 0,
|
||||
context => q|To name a container, or bucket.|
|
||||
},
|
||||
|
||||
'Bucket Name help' => {
|
||||
message => q|Pick a unique, descriptive short name for this bucket.|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'regexp' => {
|
||||
message => q|Regular expression|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'regexp help' => {
|
||||
message => q|Define a regular expression to pick log entries for this bucket.<br />
|
||||
^ = beginning of url<br />
|
||||
$ = end of url<br />
|
||||
. = any character<br />
|
||||
* = any amount<br />
|
||||
+ = 1 or more<br />
|
||||
? = 0 or 1<br />
|
||||
Meta characters should be backslash-escaped if you want to match them as ordinary text, e.g.<br />
|
||||
home\?func=match, or<br />
|
||||
|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'Passive Analytics' => {
|
||||
message => q|Passive Analytics|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'Passive Analytics Settings' => {
|
||||
message => q|Passive Analytics Settings|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'Edit Rule' => {
|
||||
message => q|Edit Rule|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'Add a bucket' => {
|
||||
message => q|Add a bucket|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'User' => {
|
||||
message => q|User|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'User help' => {
|
||||
message => q|The user who will recieve an email when bucket processing is done.|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'Begin analysis' => {
|
||||
message => q|Begin analysis|,
|
||||
lastUpdated => 0,
|
||||
context => q|Button label to begin analyzing the logs.|
|
||||
},
|
||||
|
||||
'Delete Delta Table?' => {
|
||||
message => q|Delete Delta Table?|,
|
||||
lastUpdated => 0,
|
||||
context => q|Button label to begin analyzing the logs.|
|
||||
},
|
||||
|
||||
'Delete Delta Table? help' => {
|
||||
message => q|Should the delta table be cleaned up after the Passive Analytics analyzer is done?|,
|
||||
lastUpdated => 0,
|
||||
context => q|Button label to begin analyzing the logs.|
|
||||
},
|
||||
|
||||
'Enabled?' => {
|
||||
message => q|Enable Passive Analytics?|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'Enabled? help' => {
|
||||
message => q|Passive Analytics will do no logging until enabled.|,
|
||||
lastUpdated => 0,
|
||||
context => q||
|
||||
},
|
||||
|
||||
'Regular Expression Error:' => {
|
||||
message => q|Regular Expression Error:|,
|
||||
lastUpdated => 0,
|
||||
context => q|Error displayed when a user enters in a bad regular expression. This label will be followed by the error from perl.|
|
||||
},
|
||||
|
||||
'Export bucket data' => {
|
||||
message => q|Export bucket data|,
|
||||
lastUpdated => 0,
|
||||
context => q|URL label to export data in CSV format|,
|
||||
},
|
||||
|
||||
'Export delta data' => {
|
||||
message => q|Export delta data|,
|
||||
lastUpdated => 0,
|
||||
context => q|URL label to export data in CSV format|,
|
||||
},
|
||||
|
||||
'Export raw logs' => {
|
||||
message => q|Export raw logs|,
|
||||
lastUpdated => 0,
|
||||
context => q|URL label to raw log data in CSV format|,
|
||||
},
|
||||
|
||||
'confirm delete rule' => {
|
||||
message => q|Are you sure that you want to delete this rule?|,
|
||||
lastUpdated => 0,
|
||||
context => q|Confirm label in deleting a rule.|,
|
||||
},
|
||||
|
||||
'manage ruleset' => {
|
||||
message => q|Manage Ruleset|,
|
||||
lastUpdated => 0,
|
||||
context => q|Admin console submenu label. Ruleset is a set of rules.|,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
#vim:ft=perl
|
||||
|
|
@ -555,6 +555,12 @@ our $I18N = {
|
|||
context => q|admin function label|
|
||||
},
|
||||
|
||||
'vendor payouts' => {
|
||||
message => q|Vendor payouts|,
|
||||
lastUpdated => 0,
|
||||
context => q|admin function label|
|
||||
},
|
||||
|
||||
'update' => {
|
||||
message => q|Update|,
|
||||
lastUpdated => 0,
|
||||
|
|
@ -1522,6 +1528,23 @@ our $I18N = {
|
|||
context => q|template variable for Cart template|,
|
||||
},
|
||||
|
||||
'cart checkout minimum' => {
|
||||
message => q|Minimum checkout amount|,
|
||||
lastUpdated => 0,
|
||||
context => q|shop setting label|,
|
||||
},
|
||||
|
||||
'cart checkout minimum help' => {
|
||||
message => q|Use this setting to require a minimum cart value to allow users to check out.|,
|
||||
lastUpdated => 0,
|
||||
context => q|shop setting hover help|,
|
||||
},
|
||||
|
||||
'required minimum order amount' => {
|
||||
message => q|Minimum order:|,
|
||||
lastUpdated => 0,
|
||||
context => q|message that is displayed in the cart view screen|,
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -4203,9 +4203,9 @@ LongTruncOk=1</p>
|
|||
},
|
||||
|
||||
'WebGUI password recovery' => {
|
||||
message => q{WebGUI password recovery},
|
||||
message => q{Password recovery},
|
||||
lastUpdated => 0,
|
||||
context => q{Title of the template created by the Site Setup screen},
|
||||
context => q{Subject of the email that is sent for password recovery},
|
||||
},
|
||||
|
||||
'session length' => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
package WebGUI::i18n::English::Workflow_Activity_ExpireIncompleteSurveyResponses;
|
||||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
'name' => {
|
||||
message => q|ExpireIncompleteSurveyResponses|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'Delete expired survey responses' => {
|
||||
message => q|Delete expired survey responses|,
|
||||
context => q|the hover help for the delete responses field|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'delete expired' => {
|
||||
message => q|When ran, every survey response which is expired will be completely removed from the database.|,
|
||||
context => q|the hover help for the delete responses field|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'Email users that responses were deleted' => {
|
||||
message => q|Email users that responses were deleted|,
|
||||
context => q|the hover help for the email users field|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'email users' => {
|
||||
message => q|When a survey response is deleted, should the user be informed of this via email?|,
|
||||
context => q|the hover help for the email users field|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'email template' => {
|
||||
message => q|When an email is sent updating the user that their response has been deleted, this is the text that is sent to them.|,
|
||||
context => q|the hover help for the email template field|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'from' => {
|
||||
message => q|Email from field|,
|
||||
context => q||,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'from mouse over' => {
|
||||
message => q|This is the from field that will show up in the sent email.|,
|
||||
context => q||,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'subject' => {
|
||||
message => q|Email subject field|,
|
||||
context => q||,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'subject mouse over' => {
|
||||
message => q|This is the subject field that will show up in the sent email.|,
|
||||
context => q||,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'Email template sent to user' => {
|
||||
message => q|The template for the email|,
|
||||
context => q||,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
'email template' => {
|
||||
message => q|This is the email template that will be sent to the user|,
|
||||
context => q||,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue