]> git.uio.no Git - usit-rt.git/blobdiff - share/html/Elements/EditCustomField
Upgrade to 4.2.2
[usit-rt.git] / share / html / Elements / EditCustomField
index e8de7afb1d2eea6953804c3db50a8fae6d95775c..3645cc07985416609a0b2009b452fdf78181207c 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -55,18 +55,23 @@ unless ( $Type ) {
 }
 
 my $Values;
-if ( $Object && $Object->id ) {
-    $NamePrefix ||= join '-', 
-        'Object', ref($Object), $Object->Id, 'CustomField', '';
+if ( $Object ) {
+    $Grouping =~ s/\W//g if $Grouping;
+    $NamePrefix ||= join '-',
+        'Object', ref($Object), ($Object->Id || ''),
+        'CustomField' . ($Grouping ? ":$Grouping" : ""),
+        '';
 
-    $Values = $Object->CustomFieldValues( $CustomField->id );
-    $Values->Columns(
-        qw( id CustomField ObjectType ObjectId Disabled Content
-        ContentType ContentEncoding SortOrder Creator Created
-        LastUpdatedBy LastUpdated )
-    );
-    # Don't take care of $Values if there isn't values inside
-    undef ( $Values ) unless ( $Values->Count );
+    if ( $Object->Id ) {
+        $Values = $Object->CustomFieldValues( $CustomField->id );
+        $Values->Columns(
+            qw( id CustomField ObjectType ObjectId Disabled Content
+            ContentType ContentEncoding SortOrder Creator Created
+            LastUpdatedBy LastUpdated )
+        );
+        # Don't take care of $Values if there isn't values inside
+        undef ( $Values ) unless ( $Values->Count );
+    }
 }
 
 # Always fill $Default with submited values if it's empty
@@ -106,6 +111,7 @@ return $m->comp(
 );
 </%INIT>
 <%ARGS>
+$Grouping    => undef
 $Object      => undef
 $CustomField => undef
 $NamePrefix  => undef