[pmwiki-devel] JITS in pmwiki question

smith at mpia-hd.mpg.de smith at mpia-hd.mpg.de
Wed Nov 5 06:47:02 CST 2008


Hi all,


I'm setting up a TaskManager for our group on our pmwiki using the  JITS
package. So far, it's working nicely, but I'm trying to
customize the package to handle the inclusion of a task deadline -  a date
on which each task is due. Although I feel this should be possible and
that I'm very close to solving it, I've become completely stuck
and I'm writing to the list in the hope that someone can give me some
pointers. I should say I'm not really a big expert with
the markup, so I appreciate if you can keep your answers to a basic level


I've found it quite easy to insert a textarea box to take a string
specifying a date, and this can then be saved to the task page where it is
accessible to the various page lists - so this works and can provide a
solution.

However, I hoped to go further and format an inputted string into a date 
using the ftime function. Here, I have had problems.

Although I can set up a text box and read and store a string, and I can also
set up a new variable holding a date formatted with ftime, but I can't 
actually get ftime to format the date held in the user input variable. 
I've tried to do this for about two days now, and it seems clear that it
should be entirely possible, but I've run out of ideas, hence this email.

Plan A:

This is my preferred option. I thought it would be possible to read in  a
variable from a textarea, which I call Deadlineinput, and convert it in
JITS.JITSsnip to a formatted date with ftime. Reading in the variable is
no problem, however, converting it is - the variable Deadlineinput seems
not to be accessible from anywhere in JITS.JITSsnip. I'm not sure if I
just have the wrong syntax, but I treat the variable in the same way as
other variables are treated and it seems to work for them.

I attach my JITS.JITSsnip file which reads in the Deadlineinput and
tried to pass it to a new variable called Deadline made wih ftime.
The result of this is that it writes in the issue file;

(:Deadline: 2008-11-05:)
(:Deadlineinput: 17.03.2006:)

i.e. the inputted date is not converted to the correct date in 'Deadline'
but rather to today's date.


Plan B

This is what I have now. The variable Deadlineinput is read and stored, and
whenever it's displayed it's converted to a formated date, e.g.
in JITScfgS. The main problem with this is that it's not possible
to sort on it (I try to sort on a variable generated from ftime,
I've also tried sorting directly on the output of ftime, but that didn't
work either.
(from JITScfgS file);

[@
[[#Orderby]]
(:input hidden localDeadline='{(ftime "%F" "{$:Deadlineinput}")}':)
.
. other input select lines
.
(:input select name="sort" value="$:localDeadline" label="Deadline":)

This solution doesn't in fact work.



Obviously, I'd greatly appreciate any and all help with this.
I suspect the solution is simple, but I'm missing it due to
my general lack of experience.

- Kester Smith









-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: jits3.txt
Url: http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20081105/20a3f4a1/attachment.txt 


More information about the pmwiki-devel mailing list