[rt-devel] CustomFieldValues editing

Jeroen Ruigrok/asmodai asmodai at wxs.nl
Thu Mar 6 20:37:27 EST 2003


I started on the work to get CustomFieldValues editing going, but I am
kind of stuck in some ways.

The attached patch sets up the HTML for editing.

I am kind of stumped how to proceed to make this really update the
database.  I can easily write SQL statements, but the way this code is
built up, well, let me put it this way, friendly is not quite an
adequate description.  (Sorry Jesse :) )

I saw that the CustomFieldValues reuse the CustomField code.
Am I on the right track if I say that I could use the
ProcessCustomFieldUpdates() function in Web.pm for this?  Or do I need
to write a whole new function?

Also, I wanted to make the SIZE arguments to the INPUT tags dynamically
sizeable.  With normal direct SQL I can do this easily with SELECT
COUNT(), but this has got me confused.  I saw DBIx::SearchBuilder has a
Count method, however, this probably needs an equivalent method such
as Values() before you can use it in the HTML.  Or am I wrong here?

-- 
Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / a capoeirista
PGP fingerprint: 2D92 980E 45FE 2C28 9DB7  9D88 97E6 839B 2EAC 625B
http://www.tendra.org/   | http://www.in-nomine.org/~asmodai/diary/
Look at his Soul, still searching for salvation...
-------------- next part --------------
diff -ruN rt-2-1-80/html/Admin/Elements/EditCustomFieldValues rt-2-1-80-new/html/Admin/Elements/EditCustomFieldValues
--- rt-2-1-80/html/Admin/Elements/EditCustomFieldValues	Thu Mar  6 08:30:40 2003
+++ rt-2-1-80-new/html/Admin/Elements/EditCustomFieldValues	Fri Mar  7 02:25:42 2003
@@ -26,11 +26,11 @@
 <ul>
 % while (my $v = $values->Next) {
 <li>
-<font size=-1 color="#336699"><%$v->SortOrder%>:</font>
-<input type="checkbox" name="CustomField-<%$CustomField->Id%>-DeleteValue" value="<%$v->id%>">
-<%$v->Name%>
+<INPUT TYPE="checkbox" NAME="CustomField-<%$CustomField->Id%>-DeleteValue" VALUE="<%$v->id%>">
+<INPUT NAME="SortOrder" VALUE="<%$v->SortOrder%>" SIZE="2">:
+<INPUT NAME="Name" VALUE="<%$v->Name%>" SIZE="20">
 % if ($v->Description) {
-<i>(<%$v->Description%>)</i>
+<INPUT NAME="Description" VALUE="<%$v->Description%>" SIZE="50">
 % }
 </li>
 % }


More information about the Rt-devel mailing list