diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index ff177c898..d71e243f4 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -162,6 +162,7 @@ sub page { WebGUI::ErrorHandler::warn("The notFound page failed to be created!"); $output = "An error was encountered while processing your request."; } + $output = "An error was encountered while processing your request." unless $output ne ''; } return $output; } diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index d3ed68d59..e8a432a93 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -1412,6 +1412,21 @@ sub www_add { } +#------------------------------------------------------------------- + +=head2 www_ajaxInlineView ( ) + +Returns the view() method of the asset object if the requestor canView. + +=cut + +sub www_ajaxInlineView { + my $self = shift; + return WebGUI::Privilege::noAccess() unless $self->canView; + return $self->view; +} + + #------------------------------------------------------------------- =head2 www_edit ( ) diff --git a/lib/WebGUI/Asset/Wobject/Dashboard.pm b/lib/WebGUI/Asset/Wobject/Dashboard.pm index a973a9e98..89d4d1d23 100644 --- a/lib/WebGUI/Asset/Wobject/Dashboard.pm +++ b/lib/WebGUI/Asset/Wobject/Dashboard.pm @@ -61,7 +61,8 @@ sub definition { }, mapFieldId =>{ fieldType=>"text", - defaultValue=>'' + defaultValue=>'', + noFormPost=>1, } ); push(@{$definition}, { @@ -87,6 +88,7 @@ sub getEditForm { my $tabform = $self->SUPER::getEditForm; my $i18n = WebGUI::International->new("Asset_Dashboard"); $tabform->getTab("display")->template( + -name=>"templateId", -value=>$self->getValue('templateId'), -namespace=>"Dashboard", -label=>$i18n->get('dashboard template field label'), @@ -177,6 +179,7 @@ sub view { } my @found; + my $newStuff; my $showPerformance = WebGUI::ErrorHandler::canShowPerformanceIndicators(); foreach my $position (@positions) { my @assets = split(",",$position); @@ -185,24 +188,24 @@ sub view { if ($asset eq $child->getId) { unless (isIn($asset,@hidden) || !($child->canView)) { WebGUI::Style::setRawHeadTags($child->getExtraHeadTags); - my $t = [Time::HiRes::gettimeofday()] if ($showPerformance); - my $view = $child->view; - $view .= "Asset:".Time::HiRes::tv_interval($t) if ($showPerformance); - $child->{_properties}{title} = $child->getShortcut->get("title") if (ref $child eq 'WebGUI::Asset::Shortcut'); - if ($i > $numPositions) { + $child->{_properties}{title} = $child->getTitle; + $child->{_properties}{title} = $child->getShortcut->getTitle if (ref $child eq 'WebGUI::Asset::Shortcut'); + if ($i == 1 || $i > $numPositions) { push(@{$vars{"position1_loop"}},{ id=>$child->getId, - content=>$view, - dashletTitle=>$child->get("title"), + content=>'', #so things in the New Content bar don't display. + dashletTitle=>$child->{_properties}{title}, shortcutUrl=>$child->getUrl, canPersonalize=>$self->canPersonalize, canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getUserPrefs) > 0)) }); + $newStuff .= 'available_dashlets["'.$child->getId.'"]=\''.$child->getUrl.'\';'; + } else { push(@{$vars{"position".$i."_loop"}},{ id=>$child->getId, - content=>$view, - dashletTitle=>$child->get("title"), + content=>$child->view, + dashletTitle=>$child->{_properties}{title}, shortcutUrl=>$child->getUrl, canPersonalize=>$self->canPersonalize, canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getUserPrefs) > 0)) @@ -219,14 +222,11 @@ sub view { foreach my $child (@{$children}) { unless (isIn($child->getId, @found)||isIn($child->getId,@hidden)) { if ($child->canView) { - my $t = [Time::HiRes::gettimeofday()] if ($showPerformance); - my $view = $child->view; - $view .= "Asset:".Time::HiRes::tv_interval($t) if ($showPerformance); $child->{_properties}{title} = $child->getShortcut->get("title") if (ref $child eq 'WebGUI::Asset::Shortcut'); push(@{$vars{"position1_loop"}},{ id=>$child->getId, - content=>$view, - dashletTitle=>$child->get("title"), + content=>'', + dashletTitle=>$child->getTitle, shortcutUrl=>$child->getUrl, canPersonalize=>$self->canPersonalize, canEditUserPrefs=>(($session{user}{userId} ne '1') && (ref $child eq 'WebGUI::Asset::Shortcut') && (scalar($child->getUserPrefs) > 0)) @@ -238,6 +238,8 @@ sub view { $vars{"dragger.init"} = ' '; return $self->processTemplate(\%vars, $templateId); diff --git a/lib/WebGUI/Asset/Wobject/EventsCalendar.pm b/lib/WebGUI/Asset/Wobject/EventsCalendar.pm index 34acf334e..2bfcff9a0 100644 --- a/lib/WebGUI/Asset/Wobject/EventsCalendar.pm +++ b/lib/WebGUI/Asset/Wobject/EventsCalendar.pm @@ -96,8 +96,9 @@ The number of seconds since January 1, 1970. =cut sub epochToArray { + my $timeZone = $session{user}{timeZone} || "America/Chicago"; use DateTime; - return split / /, DateTime->from_epoch( epoch =>shift, time_zone=>{$session{user}{timeZone} || "America/Chicago"})->strftime("%Y %m %d %H %M %S"); + return map {$_ += 0} split / /, DateTime->from_epoch( epoch =>shift, time_zone=>$timeZone)->strftime("%Y %m %d %H %M %S"); } diff --git a/lib/WebGUI/Help/Asset_Shortcut.pm b/lib/WebGUI/Help/Asset_Shortcut.pm index 7d902b952..7eccc305d 100644 --- a/lib/WebGUI/Help/Asset_Shortcut.pm +++ b/lib/WebGUI/Help/Asset_Shortcut.pm @@ -42,6 +42,10 @@ our $HELP = { }, ], related => [ + { + tag => 'field add/edit', + namespace => 'Asset_Shortcut' + }, { tag => 'wobjects using', namespace => 'Wobject' @@ -68,6 +72,10 @@ our $HELP = { tag => 'wobjects using', namespace => 'Wobject' }, + { + tag => 'shortcut add/edit', + namespace => 'Asset_Shortcut' + }, { tag => 'template language', namespace => 'Asset_Template' diff --git a/lib/WebGUI/Operation/User.pm b/lib/WebGUI/Operation/User.pm index ea36e6598..20a561c3b 100644 --- a/lib/WebGUI/Operation/User.pm +++ b/lib/WebGUI/Operation/User.pm @@ -296,8 +296,8 @@ sub www_editUser { if ($session{form}{$data->{fieldName}}) { $default = $session{form}{$data->{fieldName}}; } - elsif ($session{user}{$data->{fieldName}}) { - $default = $session{user}{$data->{fieldName}}; + elsif ($u->profileField($data->{fieldName})) { + $default = $u->profileField($data->{fieldName}); } else { $default = WebGUI::Operation::Shared::secureEval($data->{dataDefault}); diff --git a/lib/WebGUI/i18n/English/Asset_Shortcut.pm b/lib/WebGUI/i18n/English/Asset_Shortcut.pm index 6bc320b03..e2b65077e 100644 --- a/lib/WebGUI/i18n/English/Asset_Shortcut.pm +++ b/lib/WebGUI/i18n/English/Asset_Shortcut.pm @@ -360,13 +360,13 @@ The word "Shortcut".
lastUpdated => 1133619940, }, - 'Label for This Field' => { - message => q|Label for This Field|, + 'field add/edit title' => { + message => q|Add/Edit User Preference|, lastUpdated => 1133619940, }, - 'Label for This Field' => { - message => q|Label for This Field|, + 'field add/edit body' => { + message => q|User Preferences are the key to personalization of a Shortcut, and the key to creating a personalized dashboard. You can create a user preference field of one of four types: text, textArea, checkList, and selectList. If yours is a list type, you can put the possible choices in the Possible Choices box, and each one will be its own entry in a list of that type (select: choose one, or check: choose none or any or all).
You can use a user preference field to generate a list of templates from which the user can pick, a choice of some kind of other preference, such as US or metric units format, or any other kind of user preference. User Preference fields are asset-(shortcut-)specific, whereas user profile fields are site-wide. The user preference fields will be exposed to your override fields in the format ##userPref:myUserPrefField##, and will be exposed everywhere else as normal template variables (