[Rt-commit] rt branch, 4.2/select-cfvs-datetime, created. rt-4.1.8-313-g15762e6

Alex Vandiver alexmv at bestpractical.com
Fri May 17 15:43:07 EDT 2013


The branch, 4.2/select-cfvs-datetime has been created
        at  15762e6329609bcb3f0693c6951bf4d015e438d3 (commit)

- Log -----------------------------------------------------------------
commit 12eabde6d96ef64e97c94c29f8f96782a03efeb6
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri May 17 05:12:14 2013 -0400

    Provide a type="" even for basic text inputs, for ease of JS selection

diff --git a/share/html/Elements/SelectCustomFieldValue b/share/html/Elements/SelectCustomFieldValue
index 1afb513..22ebaaf 100644
--- a/share/html/Elements/SelectCustomFieldValue
+++ b/share/html/Elements/SelectCustomFieldValue
@@ -58,7 +58,7 @@
 </select>
 % }
 % else {
-<input name="<%$Name%>" size="20" value="<% $Default %>" />
+<input name="<%$Name%>" size="20" value="<% $Default %>" type="text" />
 % }
 <%args>
 $Name => undef

commit 15762e6329609bcb3f0693c6951bf4d015e438d3
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri May 17 05:12:58 2013 -0400

    Push logic for dealing with selecting date(time)? CFs into SelectCustomFieldValue, for reuse

diff --git a/share/html/Elements/SelectCustomFieldValue b/share/html/Elements/SelectCustomFieldValue
index 22ebaaf..cd3829e 100644
--- a/share/html/Elements/SelectCustomFieldValue
+++ b/share/html/Elements/SelectCustomFieldValue
@@ -56,8 +56,9 @@
 <option value="<%$value->Name%>"<% ($value->Name eq $Default) ? q[ selected="selected"] : ''%>><%$value->Name%></option>
 % }
 </select>
-% }
-% else {
+% } elsif ($CustomField->Type =~ /^Date(Time)?$/) {
+<& /Elements/SelectDate, ShowTime => ($1 ? 1 : 0), Name => $Name, Value => $Default &>
+% } else {
 <input name="<%$Name%>" size="20" value="<% $Default %>" type="text" />
 % }
 <%args>
diff --git a/share/html/Search/Elements/PickCFs b/share/html/Search/Elements/PickCFs
index 247b6c1..c422e9d 100644
--- a/share/html/Search/Elements/PickCFs
+++ b/share/html/Search/Elements/PickCFs
@@ -98,20 +98,11 @@ while ( my $CustomField = $CustomFields->Next ) {
     }
 
     # Value
-    if ($CustomField->Type =~ /^Date(Time)?$/) {
-        my $is_datetime = $1 ? 1 : 0;
-        $line{'Value'} = {
-            Type => 'component',
-            Path => '/Elements/SelectDate',
-            Arguments => { $is_datetime ? (ShowTime => 1) : (ShowTime => 0), },
-        };
-    } else {
-        $line{'Value'} = {
-            Type => 'component',
-            Path => '/Elements/SelectCustomFieldValue',
-            Arguments => { CustomField => $CustomField },
-        };
-    }
+    $line{'Value'} = {
+        Type => 'component',
+        Path => '/Elements/SelectCustomFieldValue',
+        Arguments => { CustomField => $CustomField },
+    };
 
     push @lines, \%line;
 }

-----------------------------------------------------------------------


More information about the Rt-commit mailing list