diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt
index e7d8c9ebb..631f721b6 100644
--- a/docs/changelog/7.x.x.txt
+++ b/docs/changelog/7.x.x.txt
@@ -9,6 +9,7 @@
- Fixed a limit bug in the asset discovery service.
- Fixed #8853: link to manageWorkflows is broken
- Fixed #8890: meta_loop in post form not working (United Knowledge)
+ - rfe #740: Thingy Pre-Text (SDH Consulting Group)
7.6.1
- changed: the list of extensions for the export system to pass through
diff --git a/docs/upgrades/packages-7.6.2/templates_thingy-default-edit-thing.wgpkg b/docs/upgrades/packages-7.6.2/templates_thingy-default-edit-thing.wgpkg
new file mode 100644
index 000000000..ebe8233cb
Binary files /dev/null and b/docs/upgrades/packages-7.6.2/templates_thingy-default-edit-thing.wgpkg differ
diff --git a/docs/upgrades/upgrade_7.6.1-7.6.2.pl b/docs/upgrades/upgrade_7.6.1-7.6.2.pl
index 3a1955c40..047d45bd2 100644
--- a/docs/upgrades/upgrade_7.6.1-7.6.2.pl
+++ b/docs/upgrades/upgrade_7.6.1-7.6.2.pl
@@ -30,6 +30,7 @@ my $session = start(); # this line required
# upgrade functions go here
repairManageWorkflows($session);
+addPreTextToThingyFields($session);
finish($session); # this line required
@@ -55,6 +56,13 @@ sub repairManageWorkflows {
print "DONE!\n" unless $quiet;
}
+sub addPreTextToThingyFields {
+ my $session = shift;
+ print "\tAdding a pre-text property to Thingy fields... " unless $quiet;
+ $session->db->write('ALTER TABLE `Thingy_fields` ADD pretext varchar(255)');
+ print "DONE!\n" unless $quiet;
+}
+
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm
index 6097facb5..86e10b335 100644
--- a/lib/WebGUI/Asset/Wobject/Thingy.pm
+++ b/lib/WebGUI/Asset/Wobject/Thingy.pm
@@ -634,7 +634,13 @@ sub getEditFieldForm {
});
$f->raw($self->getHtmlWithModuleWrapper($dialogPrefix."_defaultValue_module",$defaultValueForm,
$i18n->get('default value label'),$i18n->get('default value description')));
-
+
+ $f->text(
+ -name=>"pretext",
+ -value=>$field->{pretext},
+ -label=>$i18n->get('pretext label'),
+ -hoverHelp=>$i18n->get('pretext description'),
+ );
$f->text(
-name=>"subtext",
-value=>$field->{subtext},
@@ -1603,6 +1609,9 @@ sub www_editThing {
else{
$formElement = $self->getFormElement($field);
}
+ if ($field->{pretext}){
+ $formElement = ''.$field->{pretext}.'
'.$formElement;
+ }
if ($field->{subtext}){
$formElement .= '
'.$field->{subtext}.'';
}
@@ -1997,6 +2006,7 @@ sub www_editFieldSave {
fieldType=>$fieldType,
defaultValue=>$defaultValue,
possibleValues=>$self->session->form->process("possibleValues"),
+ pretext=>$self->session->form->process("pretext"),
subtext=>$self->session->form->process("subtext"),
status=>$self->session->form->process("status"),
size=>$self->session->form->process("size"),
@@ -2030,6 +2040,9 @@ sub www_editFieldSave {
else{
$formElement = $self->getFormElement(\%properties);
}
+ if ($properties{pretext}){
+ $formElement = ''.$properties{pretext}.'
'.$formElement;
+ }
if ($properties{subtext}){
$formElement .= '
'.$properties{subtext}.'';
}
@@ -2243,6 +2256,7 @@ sub editThingData {
"isHidden" => $hidden,
"isVisible" => ($field{status} eq "visible" && !$hidden),
"isRequired" => ($field{status} eq "required" && !$hidden),
+ "pretext" => $field{pretext},
"subtext" => $field{subtext},
);
push(@field_loop, { map {("field_".$_ => $fieldProperties{$_})} keys(%fieldProperties) });
diff --git a/lib/WebGUI/Help/Asset_Thingy.pm b/lib/WebGUI/Help/Asset_Thingy.pm
index b22965e02..f54af9999 100644
--- a/lib/WebGUI/Help/Asset_Thingy.pm
+++ b/lib/WebGUI/Help/Asset_Thingy.pm
@@ -73,6 +73,7 @@ our $HELP = {
{ 'name' => 'field_name' },
{ 'name' => 'field_value' },
{ 'name' => 'field_subtext' },
+ { 'name' => 'field_pretext' },
],
},
{ 'name' => 'listOfThings',
diff --git a/lib/WebGUI/i18n/English/Asset_Thingy.pm b/lib/WebGUI/i18n/English/Asset_Thingy.pm
index ebfd5e681..8c34c7df3 100644
--- a/lib/WebGUI/i18n/English/Asset_Thingy.pm
+++ b/lib/WebGUI/i18n/English/Asset_Thingy.pm
@@ -464,15 +464,28 @@ this field using a hash, then the default value has to be a key in that hash, an
lastUpdated => 1031514049
},
- 'subtext description' => {
- message => q|An extension of the label, this is additional information such as a description of what should go in the field or optional instructions for the field.|,
- lastUpdated => 1133811301,
+ 'subtext description' => {
+ message => q|An extension of the label, this is additional information such as a description of what should
+go in the field or optional instructions for the field. It will be displayed below/after the form element.|,
+ lastUpdated => 1224518799,
+ },
+
+ 'pretext label' => {
+ message => q|Pre-text|,
+ lastUpdated => 1224518799,
+ },
+
+ 'pretext description' => {
+ message => q|An extra extension of the label, this is additional information such as a description of what should
+go in the field or optional instructions for the field. It will be displayed above/before the form element.|,
+ lastUpdated => 1224518799,
},
'fieldstatus hidden label' => {
message => q|Hidden|,
lastUpdated => 1031514049
},
+
'fieldstatus visible label' => {
message => q|Visible|,
lastUpdated => 1031514049
@@ -812,9 +825,16 @@ field.|,
lastUpdated => 1104630516,
},
+ 'field_pretext' => {
+ message => q|An extra description of the field so that users know what to put in the field. To be
+displayed above/before the form element.|,
+ lastUpdated => 1224518799,
+ },
+
'field_subtext' => {
- message => q|A description of the field so that users know what to put in the field.|,
- lastUpdated => 1104630516,
+ message => q|A description of the field so that users know what to put in the field. To be displayed
+below/after the form element.|,
+ lastUpdated => 1224518799,
},
'form_start' => {
diff --git a/www/extras/wobject/Thingy/thingy.css b/www/extras/wobject/Thingy/thingy.css
index c38862de7..b939f1b58 100644
--- a/www/extras/wobject/Thingy/thingy.css
+++ b/www/extras/wobject/Thingy/thingy.css
@@ -26,4 +26,7 @@ li.list1 {
border:1px solid #7EA6B2;
}
-
+.formPretext {
+ font-family: helvetica, arial;
+ font-size: 11px;
+}