Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote branch 'main/WebGUI8' into WebGUI8
  • Loading branch information
daviddelikat committed Jan 27, 2012
2 parents 5d2dfc2 + 4ea362b commit 2ac222f
Show file tree
Hide file tree
Showing 198 changed files with 1,647 additions and 33,762 deletions.
8 changes: 4 additions & 4 deletions README
Expand Up @@ -8,10 +8,10 @@ To try this out:
3) Copy etc/WebGUI.conf.original to www.whatever.com.conf; edit it and set dbuser, dbpass,
dsn, and uploadsPath (eg to /data/domains/www.example.com/public/uploads/)
4) Set WEBGUI_CONFIG to point at your new config file
4) $ wgd reset --upgrade
5) $ cd /data/WebGUI (or whereever you unpacked it)
6) $ rsync -r -a (or cp -a) /data/WebGUI/www/extras /data/domains/www.example.com/public/
7) $ export PERL5LIB='/data/WebGUI/lib'
5) $ export PERL5LIB='/data/WebGUI/lib'
6) $ wgd reset --upgrade
7) $ cd /data/WebGUI (or whereever you unpacked it)
8) $ rsync -r -a (or cp -a) /data/WebGUI/www/extras /data/domains/www.example.com/public/

To start it:

Expand Down
3 changes: 0 additions & 3 deletions app.psgi
Expand Up @@ -16,9 +16,6 @@
use strict;
use Plack::Builder;

use FindBin;
use lib "$FindBin::Bin/lib";

use WebGUI::Paths -inc;
use WebGUI::Config;
use WebGUI::Fork;
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog/7.x.x.txt
@@ -1,4 +1,8 @@
7.10.25

7.10.24
- fixed #12318: asset error causes asset manager to fail
- fixed #12308: error message used scalar as reference
- fixed #12256: Calendar Search doesn't show admin controls
- fixed #12268: Point of sale form missing from cart screen.
- fixed #12201: AssetReport - no selects.
Expand All @@ -7,6 +11,10 @@
- fixed Passive Analytics, UI, Progress Bar, server load.
- fixed #12303: Survey custom multiple choice question types
- fixed #12304: Surven packages do not include custom question types
- fixed #12309: Some child assets ignore visitor cache timeouts
- fixed possible values and default values on EMS submission.
- fixed #12312: Shop account plugin has unrendered macro
- fixed #12315: Remove yui tests from git repo.

7.10.23
- fixed #12225: Stock asset, multiple instances on a page
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/8.x.x.txt
Expand Up @@ -3,4 +3,5 @@
- Replaced the existing caching mechanism with memcached, which results in a 400% improvement to cache speed. See migration.txt for API changes and gotcha.txt for prereq changes.
- Added "hot sessions" so sessions interact with the database less.
- Added Facebook Auth and FacebookLogin macro.
- Removed the WebGUI statistics program and code.

8 changes: 8 additions & 0 deletions docs/gotcha.txt
Expand Up @@ -36,6 +36,14 @@ save you many hours of grief.

* WebGUI 8 does not support HTTP Basic Authentication any longer.

* Support for server-side spell checking in the Rich Editor TinyMCE has been removed.

7.10.24
--------------------------------------------------------------------
* WebGUI now depends on Business::OnlinePayment::AuthorizeNet. This version
should install automatically via the testEnvironment.pl script, or the
perl-standard CPAN module.

7.10.23
--------------------------------------------------------------------
* The default_search2 template had a bad template attachment pointing to
Expand Down
5 changes: 5 additions & 0 deletions docs/migration.txt
Expand Up @@ -422,3 +422,8 @@ getEditForm now returns a WebGUI::FormBuilder object
Show Performance Indicators
==========================
This setting is removed, as the Plack debug console shows this for us.

WebGUI::Asset::Wobject::Survey
==========================
The surveyJSON method conflicted with the new Moose accessor. In WebGUI 8,
the old surveyJSON is called getSurveyJSON.
24 changes: 0 additions & 24 deletions etc/WebGUI.conf.original
Expand Up @@ -278,13 +278,6 @@
"url" : "^PageUrl(\"\",func=manageClipboard);",
"title" : "^International(948,WebGUI);"
},
"statistics" : {
"icon" : "statistics.gif",
"uiLevel" : 1,
"url" : "^PageUrl(\"\",op=viewStatistics);",
"title" : "^International(437,WebGUI);",
"groupSetting" : "groupIdAdminStatistics"
},
"users" : {
"icon" : "users.gif",
"uiLevel" : 5,
Expand Down Expand Up @@ -973,23 +966,6 @@
"WebGUI::Image::Graph::XYGraph::Line"
],

# Here you can define the dictionaries that are available through the tinyMCE spellchecker. You should set
# id to the name the dictionary is known by ASpell (eg. en or en_US or nl), use the name parameter to set
# the name the dictionary is displayed with in tinyMCE. To set the default dictionary please set the 'default'
# parameter.

#"availableDictionaries" : [
# {
# "id" : "en_US",
# "name" : "English",
# "default" : "1"
# },
# {
# "id" : "nl",
# "name" : "Dutch"
# }
#],

# Optional script to run upon successful login. The script can contain macros
# ex: /data/WebGUI/sbin/doLogin.pl --configFile=dev.localhost.localdomain.conf --loginPage=^PageUrl();

Expand Down
11 changes: 11 additions & 0 deletions lib/WebGUI.pm
Expand Up @@ -134,6 +134,17 @@ sub call {
}
}

=head2 handle ($session)
Process the list of content handlers from the config file and then evaluate any Template objects which
may have been returned.
=head3 $session
A WebGUI::Session object.
=cut

sub handle {
my ( $self, $session ) = @_;

Expand Down
2 changes: 2 additions & 0 deletions lib/WebGUI/Asset/EMSSubmission.pm
Expand Up @@ -391,6 +391,8 @@ sub www_editSubmission {
$fields->{$fieldId}{fieldType} = $metaField->{dataType};
$fields->{$fieldId}{name} = $fieldId;
$fields->{$fieldId}{value} = $self->get($fieldId) if $self;
$fields->{$fieldId}{options} = $metaField->{possibleValues};
$fields->{$fieldId}{defaultValue} = $metaField->{defaultValues};
}
}

Expand Down
8 changes: 8 additions & 0 deletions lib/WebGUI/Asset/Event.pm
Expand Up @@ -399,6 +399,14 @@ sub dateSet {

#-------------------------------------------------------------------

=head2 duration ( )
Returns a DateTime::Duration object that represents the difference in time between the end
and start times of the event.
=cut


sub duration {
my $self = shift;
return $self->getDateTimeEnd - $self->getDateTimeStart;
Expand Down
14 changes: 0 additions & 14 deletions lib/WebGUI/Asset/RichEdit.pm
Expand Up @@ -259,7 +259,6 @@ override getEditForm => sub {
'save' => $i18n->get('save'),
'preview' => $i18n->get('preview'),
'print' => $i18n->get('print'),
'spellchecker' => $i18n->get('Server Side Spell Checker'),
'code' => $i18n->get('code'),
'fullscreen' => $i18n->get('fullscreen'),
'help' => $i18n->get('help'),
Expand Down Expand Up @@ -308,9 +307,6 @@ override getEditForm => sub {
name=>"toolbarRow3",
checked=>$checked3
}).'</td><td>';
if ($key eq 'spellchecker' && !($self->session->config->get('availableDictionaries'))) {
$buttonGrid .= $i18n->get('no dictionaries');
}
$buttonGrid .= '</td>
</tr>
';
Expand Down Expand Up @@ -377,13 +373,6 @@ sub getConfig {
wg_userIsVisitor => $self->session->user->isVisitor ? JSON::true() : JSON::false(),
);
foreach my $button (@toolbarButtons) {
if ( $button eq "spellchecker" && $self->session->config->get('availableDictionaries') ) {
push( @plugins, "-wgspellchecker" );
$config{spellchecker_rpc_url} = $self->session->url->gateway( '', "op=spellCheck" );
$config{spellchecker_languages} = join( ',',
map { ( $_->{default} ? '+' : '' ) . $_->{name} . '=' . $_->{id} }
@{ $self->session->config->get('availableDictionaries') } );
}
push( @plugins, "table" ) if ( $button eq "tablecontrols" );
push( @plugins, "save" ) if ( $button eq "save" );
push( @plugins, "advhr" ) if ( $button eq "advhr" );
Expand Down Expand Up @@ -475,9 +464,6 @@ sub getLoadPlugins {
my ( $self ) = @_;
my %loadPlugins;
for my $button ( $self->getAllButtons ) {
if ( $button eq 'spellchecker' ) {
$loadPlugins{wgspellchecker} = $self->session->url->extras("tinymce-webgui/plugins/wgspellchecker/editor_plugin.js");
}
if ( $button eq 'wginsertimage' ) {
$loadPlugins{wginsertimage} = $self->session->url->extras("tinymce-webgui/plugins/wginsertimage/editor_plugin.js");
}
Expand Down
5 changes: 3 additions & 2 deletions lib/WebGUI/Asset/Template.pm
Expand Up @@ -731,9 +731,10 @@ sub process {
my $output;
eval { $output = $parser->process($template, $self->param); };
if (my $e = Exception::Class->caught) {
$session->log->error(sprintf "Error processing template: %s, %s, %s", $self->getUrl, $self->getId, $e->error);
my $message = ref $e ? $e->error : $e;
$session->log->error(sprintf "Error processing template: %s, %s, %s", $self->getUrl, $self->getId, $message);
my $i18n = WebGUI::International->new($session, 'Asset_Template');
$output = sprintf $i18n->get('template error').$e->error, $self->getUrl, $self->getId;
$output = sprintf $i18n->get('template error').$message, $self->getUrl, $self->getId;
}

# Process the style template
Expand Down
11 changes: 7 additions & 4 deletions lib/WebGUI/Asset/Wobject/Calendar.pm
Expand Up @@ -1126,7 +1126,7 @@ sub viewList {
);

### Build the event vars
my $dtLast = $dtStart; # The DateTime of the last event
my $dtLast = WebGUI::DateTime->new(0); # The DateTime of the last event
EVENT: for my $event (@events) {
next EVENT unless $event && $event->canView();
my ( %eventVar, %eventDate )
Expand All @@ -1135,12 +1135,15 @@ sub viewList {
# Add the change flags
my $dt = $event->getDateTimeStart;
if ( $dt->year > $dtLast->year ) {
$eventVar{ new_year } = 1;
$eventVar{ new_year } = 1;
$eventVar{ new_month } = 1;
$eventVar{ new_day } = 1;
}
if ( $dt->month > $dtLast->month ) {
elsif ( $dt->month > $dtLast->month ) {
$eventVar{ new_month } = 1;
$eventVar{ new_day } = 1;
}
if ( $dt->day > $dtLast->day ) {
elsif ( $dt->day > $dtLast->day ) {
$eventVar{ new_day } = 1;
}

Expand Down
51 changes: 49 additions & 2 deletions lib/WebGUI/Asset/Wobject/Survey.pm
Expand Up @@ -1372,7 +1372,7 @@ sub view {
my $responseDetails = $self->getResponseDetails || {};

# Add lastResponse template vars
for my $tv qw(endDate complete restart timeout timeoutRestart) {
for my $tv (qw(endDate complete restart timeout timeoutRestart)) {
$var->{"lastResponse\u$tv"} = $responseDetails->{$tv};
}
$var->{lastResponseFeedback} = $responseDetails->{templateText};
Expand Down Expand Up @@ -2158,7 +2158,7 @@ sub takenCount {
my $sql = 'select count(*) from Survey_response where';
$sql .= ' assetId = ' . $self->session->db->quote($self->getId);
$sql .= ' and isComplete = ' . $self->session->db->quote($isComplete);
for my $o qw(userId ipAddress) {
for my $o (qw(userId ipAddress)) {
if (my $o_value = $opts{$o}) {
$sql .= " and $o = " . $self->session->db->quote($o_value);
}
Expand Down Expand Up @@ -2430,6 +2430,53 @@ sub export {

#-------------------------------------------------------------------

=head2 exportAssetData ()
Extend the base method to include custom question types added to this Survey.
=cut

sub exportAssetData {
my $self = shift;
my $asset_data = $self->SUPER::exportAssetData();
my $questions = $self->getSurveyJSON->questions();
my $multiple_choice = $self->getSurveyJSON->multipleChoiceTypes();
my %question_types = ();
my $get_question = $self->session->db->prepare('select answers from Survey_questionTypes where questionType=?');
foreach my $question (@{ $questions }) {
my $type = $question->{questionType};
next unless $multiple_choice->{$type};
next if $question_types{$type};
$get_question->execute([$type]);
my ($answers) = $get_question->array();
$question_types{$type} = $answers;
}
#my $question_types = $self->db->buildArrayRefOfHashRefs('select * from Survey_questionTypes');
$get_question->finish;
$asset_data->{question_types} = \%question_types;
return $asset_data;
}

#-------------------------------------------------------------------

=head2 importAssetCollateralData ($data)
Extend the base method to include custom question types added to this Survey.
=cut

sub importAssetCollateralData {
my $self = shift;
my $data = shift;
$self->SUPER::importAssetCollateralData($data);
my $custom_types = $data->{question_types};
while (my ($question, $answer) = each %{ $custom_types }) {
$self->session->db->write("INSERT INTO Survey_questionTypes VALUES(?,?) ON DUPLICATE KEY UPDATE answers = ?",[$question,$answer,$answer]);
}
}

#-------------------------------------------------------------------

=head2 www_exportSimpleResults ()
Exports transposed results as CSV (or tabbed depending on the C<format> form param)
Expand Down
2 changes: 1 addition & 1 deletion lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm
Expand Up @@ -169,7 +169,7 @@ sub addType {
my $questionType = shift;
my $address = shift;
my $question = $self->question($address);
my $ansString = $question->{answers} ? to_json $question->{answers} : {};
my $ansString = $question->{answers} ? to_json $question->{answers} : '{}';
$self->session->db->write("INSERT INTO Survey_questionTypes VALUES(?,?) ON DUPLICATE KEY UPDATE answers = ?",[$questionType,$ansString,$ansString]);
$question->{questionType} = $questionType;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/WebGUI/AssetExportHtml.pm
Expand Up @@ -157,6 +157,10 @@ This scratch variable is used by the Widget Macro.
Takes a hashref of arguments, containing the following keys:
=head3 depth
How many levels deep to export.
=head3 quiet
Boolean. To be or not to be quiet with our output. Defaults to false.
Expand Down
13 changes: 8 additions & 5 deletions lib/WebGUI/Auth.pm
Expand Up @@ -1169,8 +1169,10 @@ sub www_displayLogin {
$vars->{title} = $i18n->get(66);
my $action;
if ($self->session->setting->get("encryptLogin")) {
$action = $self->session->url->page(undef,1);
$action =~ s/http:/https:/;
my $uri = URI->new($self->session->url->page(undef,1));
$uri->scheme('https');
$uri->host_port($uri->host);
$action = $uri->as_string;
}
use WebGUI::Form::Password;
use WebGUI::Form::Hidden;
Expand Down Expand Up @@ -1241,9 +1243,10 @@ sub www_login {
$self->session->scratch->delete("redirectAfterLogin");
}
elsif ($self->session->setting->get('encryptLogin')) {
my $currentUrl = $self->session->url->page(undef,1);
$currentUrl =~ s/^https:/http:/;
$self->session->response->setRedirect($currentUrl);
my $currentUrl = URI->new($self->session->url->page(undef,1));
$currentUrl->scheme('http');
$currentUrl->port($self->session->config->get('webServerPort') || 80);
$self->session->response->setRedirect($currentUrl->canonical->as_string);
}

# Get open version tag. This is needed if we want
Expand Down
12 changes: 12 additions & 0 deletions lib/WebGUI/Command/changeIobStatus.pm
Expand Up @@ -14,6 +14,12 @@ use WebGUI::Command -command;
use strict;
use warnings;

=head2 opt_spec
Return a set of options to WebGUI::Command so that it knows how to process command line options.
=cut

sub opt_spec {
return (
[ 'configFile=s', 'The WebGUI config file to use. This parameter is required.'],
Expand All @@ -26,6 +32,12 @@ sub opt_spec {
);
}

=head2 validate_args
Check for mandatory command line options
=cut

sub validate_args {
my ($self, $opt, $args) = @_;
if (! $opt->{configfile}) {
Expand Down

0 comments on commit 2ac222f

Please sign in to comment.