Added ability to pass caller assetId to RenderThingMacro

This commit is contained in:
Chris Hanson 2011-06-14 14:11:02 -05:00
parent a2425bdbc4
commit 995eb34b5a
3 changed files with 5 additions and 2 deletions

View file

@ -1,4 +1,5 @@
7.10.19 7.10.19
- Added ability to pass caller assetId to RenderThingMacro
7.10.18 7.10.18
- fixed #12138: Version tag gets create by entering and direct leaving - fixed #12138: Version tag gets create by entering and direct leaving

View file

@ -3933,6 +3933,7 @@ sub www_viewThingData {
my $thingId = shift || $session->form->process('thingId'); my $thingId = shift || $session->form->process('thingId');
my $thingDataId = shift || $session->form->process('thingDataId'); my $thingDataId = shift || $session->form->process('thingDataId');
my $templateId = shift || $session->form->process('templateId'); my $templateId = shift || $session->form->process('templateId');
my $callerAssetId = shift || $session->form->process('callerAssetId');
my $var = $self->get; my $var = $self->get;
my $url = $self->getUrl; my $url = $self->getUrl;
my $i18n = WebGUI::International->new($self->session, "Asset_Thingy"); my $i18n = WebGUI::International->new($self->session, "Asset_Thingy");
@ -3945,6 +3946,7 @@ sub www_viewThingData {
$var->{"addThing_url"} = $session->url->append($url, 'func=editThing;thingId=new'); $var->{"addThing_url"} = $session->url->append($url, 'func=editThing;thingId=new');
$var->{"manage_url"} = $session->url->append($url, 'func=manage'); $var->{"manage_url"} = $session->url->append($url, 'func=manage');
$var->{"thing_label"} = $thingProperties->{label}; $var->{"thing_label"} = $thingProperties->{label};
$var->{"callerAssetId"} = $callerAssetId;
if($self->hasPrivileges($thingProperties->{groupIdEdit})){ if($self->hasPrivileges($thingProperties->{groupIdEdit})){
$var->{"edit_url"} = $session->url->append($url,'func=editThingData;thingId=' $var->{"edit_url"} = $session->url->append($url,'func=editThingData;thingId='

View file

@ -38,7 +38,7 @@ Optional. Specifies the templateId or template url to use. If omitted, the def
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub process { sub process {
my ($session, $thingDataUrl, $templateHint ) = @_; my ($session, $thingDataUrl, $templateHint, $callerAssetId ) = @_;
my $i18n = WebGUI::International->new($session, 'Macro_RenderThingData'); my $i18n = WebGUI::International->new($session, 'Macro_RenderThingData');
return $i18n->get('no template') if !$templateHint; return $i18n->get('no template') if !$templateHint;
@ -57,7 +57,7 @@ sub process {
return ( $i18n->get('bad url') . $thingDataUrl ) if !$thing || !$thingId || !$thingDataId; return ( $i18n->get('bad url') . $thingDataUrl ) if !$thing || !$thingId || !$thingDataId;
# Render # Render
my $output = $thing->www_viewThingData( $thingId, $thingDataId, $templateHint ); my $output = $thing->www_viewThingData( $thingId, $thingDataId, $templateHint, $callerAssetId );
# FIX: Temporary solution (broken map due to template rendering <script> tags) # FIX: Temporary solution (broken map due to template rendering <script> tags)
return $i18n->get('bad tags') if $output =~ /script>/; return $i18n->get('bad tags') if $output =~ /script>/;