View Full Version : how do you specify TaskCustomFields ???
nitroushhh
27-05-04, 03:19 AM
Hi,
I see in the tasks module that there is the facility to add custom fields by adding data to the sysvals table. But I've not been able to work out the format from the comments in the code.
Could someone give me an example of what to put in the sysval table to add something simple like field 'fred' as a 'text' field please.
Nitroushhh.
rezaakhmoo
17-06-04, 03:29 AM
Dear Nitroushhh,
I actually had the same problem, hoping to find an answer from this site, but since I saw that noone had replied to your inquiry, I got a bit disappointed. So, I just spent a lot of hours trying to figure it out myself, so here it is:
Actually, the example that is given in the code (file: dotproject/modules/tasks/addedit.php line: 641 &642) is not completely correct. If you change the (s:22:"Quote number") piece to (s:12:"Quote number"), then it will work. Here's what I figured out about the syntax of the "serialized" array that needs to be entered into the TaskCustomFields (I'm going to use an example to address your 'fred' example that you requested:
0|a:3:{s:4:"name";s:4:"fred";s:4:"type";s:4:"text";s:7:"options";s:9:"size="10"";}
0 --> (key) represents the number of custom fields, this would be the first one, if you have another, it would be 1, etc.
-----------
|a:3: --> 3 represents the number of records within your array. For example, we have 3 records, "name", "type", & "options". If you wanted to use the "selects" record also, then you would specify that as: |a:4: instead.
-----------
{s:4:"name";s:4:"fred";.....} --> This part represents the actual records within the array. The format is as such: {s:n:"key";s:n:"value";....}, where s stands for size, n is the actual length of the item in "" (which includes spaces, quotes, etc.), the array key, followed by ";", and the array value using the same format. So, according to the example about, the "unserialized" version of it would be:
array['name']='fred'
array['type']='text'
array['options']='size="10"'
I hope this helps. I had a bit of a more difficult time trying to get the "select" type working, if you are interested, I can give an example of that too.
reza.
Actually guys, I developed an online custom fields editor. You can access it in the system's configuration module under the link: Custom field editor.
There you'll be able to edit Companies and tasks custom fields in an easy way.
In the CVS version there is a bug using single quotes; so avoid (for now) using them.
lindsaym
08-07-04, 05:09 AM
Hi,
Just started using dotProject but I love it already! Anyway, I need to change the fields for the Tasks and I can't seem to find the link to the Custom Field Editor that you are talking about. Could you help me out? Thanks!
~Lindsay~
ajdonnison
08-07-04, 08:38 AM
It will be in the CVS version, download that and you should be on your way.
lindsaym
08-07-04, 11:20 PM
I know I sound like a total n00b but can you explain how to get the CVS version? I read up on it a little bit, but I couldn't seem to get the CVS client I downloaded to work. I'm not very skilled at command line stuff. Sorry to be so clueless...I'm young and still learning this stuff! Thanks :)
Hi Lindsay,
Please go there and find a Basic Introduction to CVS and SourceForge.net (SF.net) Project CVS Services (http://sourceforge.net/docman/display_doc.php?docid=14033&group_id=1)
Personnally I recommend TortoiseCVS (http://tortoisecvs.sourceforge.net/) for your CVS client.
I'm now to the point of trying to use TaskCustomFields, and it's fighting me 8)
I've followed the examples in the source code, and that listed above, and what I see on my task list is a single colon (:)
Anybody seen this?
Can you give some examples of "select" type format.
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.