From 9e2ec505c0abb073673018ab11bf4ea56589cd59 Mon Sep 17 00:00:00 2001 From: Yung Han Khoe Date: Mon, 20 Oct 2008 16:08:09 +0000 Subject: [PATCH] added rfe #740: Thingy Pre-Text --- docs/changelog/7.x.x.txt | 1 + .../templates_thingy-default-edit-thing.wgpkg | Bin 0 -> 1886 bytes docs/upgrades/upgrade_7.6.1-7.6.2.pl | 8 +++++ lib/WebGUI/Asset/Wobject/Thingy.pm | 16 +++++++++- lib/WebGUI/Help/Asset_Thingy.pm | 1 + lib/WebGUI/i18n/English/Asset_Thingy.pm | 30 +++++++++++++++--- www/extras/wobject/Thingy/thingy.css | 5 ++- 7 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 docs/upgrades/packages-7.6.2/templates_thingy-default-edit-thing.wgpkg 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 0000000000000000000000000000000000000000..ebe8233cb916d2c8c0cb682e7aba70ec0719ffb4 GIT binary patch literal 1886 zcmV-k2ch^MiwFP!000001MOICa~d}g=5v0bQeiyOgs7ST}h{t?!bfp=}7I#{$>*60YnysBu{F|*-yW#4cLGV zL{|XJA(?m_b53Hqb&1#(3g?6#(@X?}lAe}>NpBoe!QzPby7j~usb^O7@1o(5a3EsY zCnCbu;;fNl5^@Fr*(KCS_8Xu{#?ByzFx5u9E>956_4yn{5oTcFml0&oo@Wh}HM@1G z3CIoJZhh8RbwVg^N^W32W+V~7k@do*Hnai-XPj|Z7&KPblPjs!vY5DL4c&RfoS2Of zmGM_0 zhN;MTHAZb+eLj^IVl(ro=G)RS{mv-8kbF%l3ameZO^fjZR2L0d}jT) zgDjI&fiiIzN3f@KMzNRy>BR#gKP;4J{Onb~9na+D zLLS&hlna)Qt;U7Wi4T@Y{d!`tngcEhWW~Q0EfflgM;C)x0s&Bi(`uQ1dce?L;Xc;lSXf_P@$J7 zB2y|iyf|^N7wZl9x#=cngpEreo?RkJxV4}Lrg)X4Z<));8et3gnu;Tn6|Iu_>_jW- zgWa&C`0qJgVH0k(k-QoLyN#Q;)v-?)Twtzjh8b3i_fnaPCt7liNfUvb+~KuWvrFrU zdG!(#V5C@1W=n#dC#P`(!Pu*X~=mQYka<@#xk0QKzFGE}c$4 zdzf2s)n<4xLv*^XN1-00%Fuy+!F%fTSbFm5rN3KK*{fV$W0XqUP7y8@BynmcurvIE zByVFuCSd!Gv)ywy`D5OKFYGYJU0zH{aw{N0uglFV04Wqf!+O|j%#GpN* zmbr$tPUm(1k2k9v&Y*YlJc`E`O1Y~pH=gWU$ny&J%KDhwtH|$UE_*&6JVrM@*Ed)k zi@F{%%@WhWFx`_aP~Y6!+>?a{k9c{7)#)dHKd#k2!a;U)=zYp^@;mDf#E&DW5$uAH zRcT>#AAf|bCzDULnnGY1CHxJLV)Clc-6A|osB*mBd{lG0yY1awXmUF_!SE$)=P^An z9kQSSeemF!?>l`UXdj{Rg{d1inw4mF0l;~r!{PyVEU35wx YY&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; +}