diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b46dafd48..4100408fa 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,6 +4,8 @@ - New Profile Account module added providing a better interface for users to view and update their profile - New Inbox Account module added providing a better interface into WebGUI's various messaging systems - New Friends Account module added providing a better interface into WebGUI's friends system + - rfe: Event hover detail exclusions (#8761) + - rfe: Database Link test (#513) - The Display Account and My Purchases interfaces have been added to the new Account system - Added a new macro which returns the self deactivation link if the setting is enabled. - Added a new macro which returns the back to site link diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 235a06735..895b6bc1e 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -986,6 +986,7 @@ sub getEditForm { my $drawMethod = $properties->{$fieldName}{customDrawMethod}; if ($drawMethod) { $params{value} = $self->$drawMethod(\%params); + delete $params{name}; # don't want readOnly to generate a hidden field $params{fieldType} = "readOnly"; } diff --git a/lib/WebGUI/Asset/Sku/EMSTicket.pm b/lib/WebGUI/Asset/Sku/EMSTicket.pm index 93df02bc1..512483ef0 100644 --- a/lib/WebGUI/Asset/Sku/EMSTicket.pm +++ b/lib/WebGUI/Asset/Sku/EMSTicket.pm @@ -181,8 +181,8 @@ sub drawLocationField { my $options = $self->session->db->buildHashRef("select distinct(location) from EMSTicket left join asset using (assetId) where parentId=? order by location",[$self->get('parentId')]); return WebGUI::Form::combo($self->session, { - name => $params->{name}, - value => $self->get($params->{name}), + name => 'location', + value => $self->get('location'), options => $options, }); } @@ -268,10 +268,10 @@ sub getEditForm { } $form->getTab("properties")->DateTime( name => "startDate", - defaultValue => $date->toDatabase, label => $i18n->get("add/edit event start date"), hoverHelp => $i18n->get("add/edit event start date help"), timeZone => $self->getParent->get("timezone"), + defaultValue => $date->toDatabase, value => $self->get("startDate"), ); return $form; diff --git a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm index 5be779f33..ab9dd2d08 100644 --- a/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm +++ b/lib/WebGUI/Asset/Wobject/EventManagementSystem.pm @@ -184,7 +184,25 @@ sub getBadgeGroups { =head2 getEventMetaFields ( ) -Returns an arrayref of hash references of the metadata fields. +Returns an arrayref of hash references of the metadata fields. Each hash in the array has the following fields: + +fieldId - the GUID for this field. + +assetId - the EMS that this field is attached to. + +label - the human readable name for this field. + +dataType - the form field type for this field. + +visible - whether or not this field should display in public views. + +required - whether or not this field must be filled out as part of editing the ticket/event. + +possibleValues - a list of values that may be used to create this form field if it's a list type. + +defaultValues - a list of default values that may be used to create this form field. + +sequenceNumber - the order in which this field should be displayed relative to other fields. =cut @@ -192,6 +210,7 @@ sub getEventMetaFields { my $self = shift; return $self->session->db->buildArrayRefOfHashRefs("select * from EMSEventMetaField where assetId=? order by sequenceNumber, assetId",[$self->getId]); } + #------------------------------------------------------------------- =head2 getEventFieldsForImport () @@ -1165,8 +1184,11 @@ className='WebGUI::Asset::Sku::EMSTicket' and state='published' and revisionDate my $data = $ticket->get('eventMetaData'); $data = '{}' if ($data eq ""); my $meta = JSON->new->utf8->decode($data); - foreach my $field (keys %{$meta}) { - $description .= '

'.$field.': '.$meta->{$field}.'

' unless ($meta->{$field} eq ""); + foreach my $field (@{$self->getEventMetaFields}) { + my $label = $field->{label}; + if ($field->{visible} && $meta->{$label} ne "") { + $description .= '

'.$label.': '.$meta->{$label}.'

'; + } } my $date = WebGUI::DateTime->new($session, mysql => $ticket->get('startDate')) ->set_time_zone($self->get("timezone")) diff --git a/lib/WebGUI/Operation/DatabaseLink.pm b/lib/WebGUI/Operation/DatabaseLink.pm index b56fde329..99ad326c5 100644 --- a/lib/WebGUI/Operation/DatabaseLink.pm +++ b/lib/WebGUI/Operation/DatabaseLink.pm @@ -14,6 +14,7 @@ use strict; use Tie::CPHash; use WebGUI::AdminConsole; use WebGUI::DatabaseLink; +use WebGUI::Exception; use WebGUI::International; =head1 NAME @@ -281,7 +282,8 @@ sub www_editDatabaseLinkSave { } if ($session->form->process("dlid") eq "new") { WebGUI::DatabaseLink->create($session,$params); - } else { + } + else { WebGUI::DatabaseLink->new($session,$session->form->process("dlid"))->set($params); } return www_listDatabaseLinks($session); @@ -300,11 +302,10 @@ sub www_listDatabaseLinks { my $session = shift; return $session->privilege->adminOnly() unless canView($session); my $links = WebGUI::DatabaseLink->getList($session); - my $output = ''; + my $output = '
'; my $i18n = WebGUI::International->new($session); foreach my $id (keys %{$links}) { -# $output .= ''; - $output .= ''; - $output .= ''; + $output .= '
'.$i18n->get(1076).'
'; + $output .= '
'; if ($id ne '0') { $output .= $session->icon->delete('op=deleteDatabaseLinkConfirm;dlid='.$id,'',$i18n->get(988)) .$session->icon->edit('op=editDatabaseLink;dlid='.$id) @@ -314,10 +315,23 @@ sub www_listDatabaseLinks { $output .= $session->icon->edit('op=editDatabaseLink;dlid='.$id); } $output .= ''.$links->{$id}.'
'.$links->{$id}.''; + my $connection = eval {WebGUI::DatabaseLink->new($session,$id)->db}; + my $e; + if (($e = WebGUI::Error->caught) || $@ || not defined $connection) { + $output .= $i18n->get('70'); + if (defined $e) { + $output .= ': '.$e->error; + } } - $output .= '
'; - return _submenu($session,$output); + else { + $output .= $i18n->get('ok'); + $connection->disconnect; + } + $output .=''; + } + $output .= ''; + return _submenu($session,$output); } diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index 7ea560700..c2c009969 100755 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -2,6 +2,12 @@ package WebGUI::i18n::English::WebGUI; use strict; our $I18N = { + 'ok' => { + message => q|OK|, + context => q|used by database link and other things to give a message to the user that a test passed|, + lastUpdated => 0, + }, + 'is editable' => { message => q|Is Editable?|, context => q|group property|,