Implemented RFE 10253 - Select DataForm HTMLArea Rich Text Editor - Provides ability to specify the Rich Editor to be used for htmlArea fields on a given DataForm Wobject
This commit is contained in:
parent
b877e8fa05
commit
b361e5db9c
4 changed files with 50 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
|||
transactions. (Martin Kamerbeek / Oqapi )
|
||||
- Added better Survey Expression Engine validation warnings
|
||||
- added #9203: Survey Visualization
|
||||
- rfe #10253: add ability to select the htmlArea Rich Text Editor for DataForm
|
||||
- Added: United States Postal Service Shipping Driver.
|
||||
- Refactored transaction tmpl_var generation into WebGUI::Shop::Transaction. ( Martin Kamerbeek / Oqapi )
|
||||
- rfe #9906: Inbox Filtering
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ fixDefaultPostReceived($session);
|
|||
addEuVatDbColumns( $session );
|
||||
addShippingDrivers( $session );
|
||||
addTransactionTaxColumns( $session );
|
||||
addDataFormColumns($session);
|
||||
addListingsCacheTimeoutToMatrix( $session );
|
||||
addSurveyFeedbackTemplateColumn( $session );
|
||||
installCopySender($session);
|
||||
|
|
@ -142,6 +143,19 @@ sub addTransactionTaxColumns {
|
|||
|
||||
}
|
||||
|
||||
sub addDataFormColumns {
|
||||
my $session = shift;
|
||||
print "\tAdding column to store htmlArea Rich Editor in DataForm Table ..." unless $quiet;
|
||||
|
||||
my $sth = $session->db->read( 'show columns in DataForm where field = "htmlAreaRichEditor"' );
|
||||
if ($sth->rows() == 0) { # only add column if it is not already there
|
||||
$session->db->write( 'alter TABLE `DataForm` add column `htmlAreaRichEditor` varchar(22) default "**Use_Default_Editor**"' );
|
||||
}
|
||||
|
||||
print "Done\n" unless $quiet;
|
||||
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
sub addSurveyFeedbackTemplateColumn {
|
||||
my $session = shift;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ use WebGUI::DateTime;
|
|||
use WebGUI::User;
|
||||
use WebGUI::Group;
|
||||
use WebGUI::AssetCollateral::DataForm::Entry;
|
||||
use WebGUI::Form::SelectRichEditor;
|
||||
use JSON ();
|
||||
|
||||
our @ISA = qw(WebGUI::Asset::Wobject);
|
||||
|
|
@ -72,6 +73,9 @@ sub _createForm {
|
|||
elsif ( $class->isa('WebGUI::Form::List') ) {
|
||||
delete $param{size};
|
||||
}
|
||||
elsif ( $type eq 'HTMLArea' && $data->{htmlAreaRichEditor} ne '**Use_Default_Editor**') {
|
||||
$param{richEditId} = $data->{htmlAreaRichEditor} ;
|
||||
}
|
||||
return $class->new($self->session, \%param);
|
||||
}
|
||||
|
||||
|
|
@ -220,6 +224,12 @@ sub definition {
|
|||
my $definition = shift;
|
||||
my $i18n = WebGUI::International->new($session,"Asset_DataForm");
|
||||
my %properties;
|
||||
|
||||
# populate hash of Rich Editors and add an entry to the list to use the default
|
||||
my $selectRichEditor = WebGUI::Form::SelectRichEditor->new($session,{}) ;
|
||||
my $richEditorOptions = $selectRichEditor->getOptions() ;
|
||||
$richEditorOptions->{'**Use_Default_Editor**'} = "Use Default Rich Editor" ;
|
||||
|
||||
tie %properties, 'Tie::IxHash';
|
||||
%properties = (
|
||||
templateId => {
|
||||
|
|
@ -231,6 +241,14 @@ sub definition {
|
|||
hoverHelp => $i18n->get('82 description'),
|
||||
afterEdit => 'func=edit',
|
||||
},
|
||||
htmlAreaRichEditor =>{
|
||||
fieldType=>"selectBox",
|
||||
defaultValue=>0,
|
||||
options=>$richEditorOptions,
|
||||
tab=>'display',
|
||||
label=>$i18n->get('htmlAreaRichEditor'),
|
||||
hoverHelp=>$i18n->get('htmlAreaRichEditor description'),
|
||||
},
|
||||
emailTemplateId => {
|
||||
fieldType => "template",
|
||||
defaultValue => 'PBtmpl0000000000000085',
|
||||
|
|
@ -686,6 +704,11 @@ sub getRecordTemplateVars {
|
|||
my $hidden
|
||||
= ($field->{status} eq 'hidden' && !$session->var->isAdminOn)
|
||||
|| ($field->{isMailField} && !$self->get('mailData'));
|
||||
|
||||
# populate Rich Editor field if the field is an HTMLArea
|
||||
if ($field->{type} eq "HTMLArea") {
|
||||
$field->{htmlAreaRichEditor} = $self->get("htmlAreaRichEditor") ;
|
||||
}
|
||||
my $form = $self->_createForm($field, $value);
|
||||
$value = $form->getValueAsHtml;
|
||||
my %fieldProperties = (
|
||||
|
|
|
|||
|
|
@ -2,6 +2,18 @@ package WebGUI::i18n::English::Asset_DataForm;
|
|||
use strict;
|
||||
|
||||
our $I18N = {
|
||||
'htmlAreaRichEditor' => {
|
||||
message => q|HTML Area Rich Editor|,
|
||||
lastUpdated => 0,
|
||||
context => 'label for HTMLArea field Rich Editor selector.',
|
||||
},
|
||||
|
||||
'htmlAreaRichEditor description' => {
|
||||
message => q|Select the Rich Editor you want to use for HTML Area fields.|,
|
||||
lastUpdated => 0,
|
||||
context => 'hover help for HTMLArea field Rich Editor selector.',
|
||||
},
|
||||
|
||||
'delete file' => {
|
||||
message => q|Delete Attached File|,
|
||||
lastUpdated => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue