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 )
|
transactions. (Martin Kamerbeek / Oqapi )
|
||||||
- Added better Survey Expression Engine validation warnings
|
- Added better Survey Expression Engine validation warnings
|
||||||
- added #9203: Survey Visualization
|
- added #9203: Survey Visualization
|
||||||
|
- rfe #10253: add ability to select the htmlArea Rich Text Editor for DataForm
|
||||||
- Added: United States Postal Service Shipping Driver.
|
- Added: United States Postal Service Shipping Driver.
|
||||||
- Refactored transaction tmpl_var generation into WebGUI::Shop::Transaction. ( Martin Kamerbeek / Oqapi )
|
- Refactored transaction tmpl_var generation into WebGUI::Shop::Transaction. ( Martin Kamerbeek / Oqapi )
|
||||||
- rfe #9906: Inbox Filtering
|
- rfe #9906: Inbox Filtering
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ fixDefaultPostReceived($session);
|
||||||
addEuVatDbColumns( $session );
|
addEuVatDbColumns( $session );
|
||||||
addShippingDrivers( $session );
|
addShippingDrivers( $session );
|
||||||
addTransactionTaxColumns( $session );
|
addTransactionTaxColumns( $session );
|
||||||
|
addDataFormColumns($session);
|
||||||
addListingsCacheTimeoutToMatrix( $session );
|
addListingsCacheTimeoutToMatrix( $session );
|
||||||
addSurveyFeedbackTemplateColumn( $session );
|
addSurveyFeedbackTemplateColumn( $session );
|
||||||
installCopySender($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 {
|
sub addSurveyFeedbackTemplateColumn {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ use WebGUI::DateTime;
|
||||||
use WebGUI::User;
|
use WebGUI::User;
|
||||||
use WebGUI::Group;
|
use WebGUI::Group;
|
||||||
use WebGUI::AssetCollateral::DataForm::Entry;
|
use WebGUI::AssetCollateral::DataForm::Entry;
|
||||||
|
use WebGUI::Form::SelectRichEditor;
|
||||||
use JSON ();
|
use JSON ();
|
||||||
|
|
||||||
our @ISA = qw(WebGUI::Asset::Wobject);
|
our @ISA = qw(WebGUI::Asset::Wobject);
|
||||||
|
|
@ -72,6 +73,9 @@ sub _createForm {
|
||||||
elsif ( $class->isa('WebGUI::Form::List') ) {
|
elsif ( $class->isa('WebGUI::Form::List') ) {
|
||||||
delete $param{size};
|
delete $param{size};
|
||||||
}
|
}
|
||||||
|
elsif ( $type eq 'HTMLArea' && $data->{htmlAreaRichEditor} ne '**Use_Default_Editor**') {
|
||||||
|
$param{richEditId} = $data->{htmlAreaRichEditor} ;
|
||||||
|
}
|
||||||
return $class->new($self->session, \%param);
|
return $class->new($self->session, \%param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -220,6 +224,12 @@ sub definition {
|
||||||
my $definition = shift;
|
my $definition = shift;
|
||||||
my $i18n = WebGUI::International->new($session,"Asset_DataForm");
|
my $i18n = WebGUI::International->new($session,"Asset_DataForm");
|
||||||
my %properties;
|
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';
|
tie %properties, 'Tie::IxHash';
|
||||||
%properties = (
|
%properties = (
|
||||||
templateId => {
|
templateId => {
|
||||||
|
|
@ -231,6 +241,14 @@ sub definition {
|
||||||
hoverHelp => $i18n->get('82 description'),
|
hoverHelp => $i18n->get('82 description'),
|
||||||
afterEdit => 'func=edit',
|
afterEdit => 'func=edit',
|
||||||
},
|
},
|
||||||
|
htmlAreaRichEditor =>{
|
||||||
|
fieldType=>"selectBox",
|
||||||
|
defaultValue=>0,
|
||||||
|
options=>$richEditorOptions,
|
||||||
|
tab=>'display',
|
||||||
|
label=>$i18n->get('htmlAreaRichEditor'),
|
||||||
|
hoverHelp=>$i18n->get('htmlAreaRichEditor description'),
|
||||||
|
},
|
||||||
emailTemplateId => {
|
emailTemplateId => {
|
||||||
fieldType => "template",
|
fieldType => "template",
|
||||||
defaultValue => 'PBtmpl0000000000000085',
|
defaultValue => 'PBtmpl0000000000000085',
|
||||||
|
|
@ -686,6 +704,11 @@ sub getRecordTemplateVars {
|
||||||
my $hidden
|
my $hidden
|
||||||
= ($field->{status} eq 'hidden' && !$session->var->isAdminOn)
|
= ($field->{status} eq 'hidden' && !$session->var->isAdminOn)
|
||||||
|| ($field->{isMailField} && !$self->get('mailData'));
|
|| ($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);
|
my $form = $self->_createForm($field, $value);
|
||||||
$value = $form->getValueAsHtml;
|
$value = $form->getValueAsHtml;
|
||||||
my %fieldProperties = (
|
my %fieldProperties = (
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,18 @@ package WebGUI::i18n::English::Asset_DataForm;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
our $I18N = {
|
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' => {
|
'delete file' => {
|
||||||
message => q|Delete Attached File|,
|
message => q|Delete Attached File|,
|
||||||
lastUpdated => 0,
|
lastUpdated => 0,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue