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









(:title JITS Main control:)
:version: 20070515

(:author: Jiri Hladuvka, mail at revida dot sk:)

----

The parts of this page are to be included into specific JITS pages as follows:

*into the <Group>.GroupFooter (e.g. [=John.GroupFooter, Bob.GroupFooter, 
Projects.GroupFooter=])\\
insert text:\\
[@(:if equal {*$:PInd} "JITS":)(:include JITS.JITSsnip 
#grpftr#grpftrend:)(:ifend:)@]\\


* into main JITS page (e.g. John.Tasks, Bob.Tasks, Projects.ProjectA, 
Projects.ProjectB) \\
insert text:\\
[@(:include JITS.JITSsnip #mainpage#mainpageend:)(:JITSlevel: main:)@]


*if you wish to have pagelist containing main JITS pages only listed\\
use [@(:pagelist group={$Group} name=-*Recent* $:JITSlevel=main:)@]

----

'''Show "New issue" button, filters controls and a filtered pagelist'''

[@
[[#mainpage]]
>>comment<<
------------------------------------------------
Get params from browser address line 
- ?addthread=[yes | ""] ... create new issue page
- ?jnewcomm=[yes | ""] ... create new comment page
------------------------------------------------
>><<
(:zapget:)
>>comment<<
------------------------------------------------
Show NewIssue Button if param addthread NOT equals to yes
Test existence of filtering vars. If !exist then generate
them when formNew submitted.
------------------------------------------------
>><<
(:zapform key=formNewIssueButton action={*$PageUrl}?addthread=yes:)
(:if equal {*$:JName} "":)
(:zap datapage_1="{*$Group}.{*$Name}" formNewIssueButton:)
(:zap filterG="{*$Group}" formNewIssueButton:)
(:zap JName="{*$Name}" formNewIssueButton:)
(:zap sort="-$:ChngDate" formNewIssueButton:)
(:zap Type="*" formNewIssueButton:)
(:zap Project="*" formNewIssueButton:)
(:zap Status="*" formNewIssueButton:)
(:zap Deadlineinput="next week" formNewIssueButton:)
(:zap Deadline="{(ftime "%F" "November 2nd 2011")}" formNewIssueButton:)
(:zap Priority="*" formNewIssueButton:)
(:zap Person="*" formNewIssueButton:)
(:zap 
savedata_1="filterG,JName,sort,Type,Project,Status,Deadlineinput,Deadline,Priority,Person"
formNewIssueButton:)
(:ifend:)
(:if expr ( !equal {$addthread} "yes" && !equal {$AuthId} "" ) :)
(:input submit value="$[New Issue]" formNewIssueButton:)
(:if expr ( !equal {$addthread} "yes" && equal {$AuthId} "" ) :)
[[{$PageUrl}?action=login|$[Login please] ]]
(:ifend:)
(:zapend:)

>>comment<<
------------------------------------------------
show Admin button
------------------------------------------------
>><<
(:if expr !equal {$addthread} "yes"  && auth admin :)
(:zapform key=formAdminButton :)
(:input hidden nextpage "JITS.JITSadmin" :)
(:zap from="{*$Group}.{*$Name}" formAdminButton :)
(:input hidden passdata from :)
(:input submit value="$[Admin tasks]" :)
(:zapend:)
(:ifend:)
>>comment<<
------------------------------------------------
Show form to create a new issue if param ?addthread=yes 
------------------------------------------------
>><<
(:if equal {$addthread} "yes":)

'''$[New issue]:'''

(:zapform key=formIssue:)
(:zap datapage_2="{*$Group}.#" formIssue:)
(:input hidden nextpage_2="{*$Group}.#" formIssue:)
(:zap 
savedata_2="PInd,JName,ThreadId,DateWritten,CDateWritten,ChngDate,CChngDate,ChngAuth,WrittenBy,Type,Project,Person,Status,Deadline,Deadlineinput,Priority,Summary,Content"
  formIssue:)
(:input hidden addthread " ":)
(:input hidden ThreadId value="{(thread {*$Group})}":) 
(:input hidden WrittenBy value={$AuthId}:)
(:input hidden DateWritten '{(ftime "%Y%m%d%H%M%S" "now" )}':)
(:input hidden CDateWritten '{(ftime "%F %H:%M" "now" )}':)
(:input hidden ChngDate '{(ftime "%Y%m%d%H%M%S" "now" )}':)
(:input hidden CChngDate '{(ftime "%F %H:%M" "now" )}':)
(:input hidden ChngAuth value={$AuthId}:)
(:input hidden Status value="open":)
>>comment<<
------------------------------------------------
- PInd differs JITS pages in a group 
from all other group pages.
- JName keeps main page name (ie John). 
Both used in JITS pagelists and filters.
------------------------------------------------
>><<
(:input hidden PInd value="JITS":)
(:input hidden JName value="{*$Name}":)



(:table border=0:)
(:cellnr:)$[Summary]: 
(:cell:)(:input text Summary size=80:)
(:cellnr:)Author
(:cell:)[[~{$AuthId}]]

(:cellnr:)
$[Type]
(:cell:)
(:include {*$Group}.JITScfg JITS.JITScfg #Type#Typeend:)
$[in project]
(:include {*$Group}.JITScfg JITS.JITScfg #Project#Projectend:)
(:cellnr:)$[Priority]
(:cell:)
(:include {*$Group}.JITScfg JITS.JITScfg #Priority#Priorityend:)
(:cellnr:)$[Person]
(:cell:)
(:include {*$Group}.JITScfg JITS.JITScfg #Person#Personend:)
(:cellnr:)$[Status]
(:include {*$Group}.JITScfg JITS.JITScfg #Status#Statusend:)
(:cellnr:)$[Deadline]:
(:cell:)
(:textarea name=Deadlineinput cols=12 rows=1:) (:textareaend:)
(:cell:)
(:cellnr:)$[Content]: 
(:cell:)(:textarea name=Content cols=80 rows=8:)(:keep 
{*$Content}:)(:textareaend:)
(:cellnr:) 
(:cell:)
(:tableend:) 
(:input hidden Deadline '{(ftime "%F" "{*$:Deadlineinput}")}':)
(:input submit value="$[Submit]" form1:)
(:zapend:)
\\

(:zapform key=fCancel:)
(:zap nextpage="{$PageUrl}" fCancel:)
(:input submit value="$[Cancel]" fCancel:)
(:zapend:)
(:ifend:)

----
>>comment<<
------------------------------------------------
Show form to filter issues and filtered pagelist 
if empty param ?addthread <> yes
------------------------------------------------
>><<
(:if !equal {$addthread} "yes":)
(:include JITS.JITSPgLstS #filters#issuelistend:)
(:ifend:)



\\
\\
%center%'-''[[JITS.JITS|JITS snippets v. {JITS.JITSsnip$:version}]]''-'%%
[[#mainpageend]]
@]

----


'''GROUP FOOTER'''\\
shows issue properties and comments\\
It is possible to switch between show and \\
edit Status, Priority and Content 
using Show|Edit link

[@
[[#grpftr]]

(:zapget:)
>>comment<<
------------------------------------------------
No new Comment. Show/Edit the issue
------------------------------------------------
>><<
(:if expr ( !equal {$jnewcomm} "yes" && !equal {$edicomm} "yes" ) :)
(:zapform key=formShowIssue:)
(:zap datapage_2="{*$Group}.{*$Name}" formShowIssue:)
(:input hidden PInd {*$:PInd}:) 
(:input hidden JName {*$:JName}:) 
(:input hidden ThreadId {*$:ThreadId}:) 
(:input hidden DateWritten {*$:DateWritten}:)
(:input hidden CDateWritten "{*$:CDateWritten}":)
(:input hidden ChngAuth "{*$:ChngAuth}":)
(:input hidden ChngDate '{(ftime "%Y%m%d%H%M%S" "now" )}':)
(:input hidden CChngDate '{(ftime "%F %H:%M" "now" )}':)
(:input hidden WrittenBy {*$:WrittenBy}:)
(:input hidden Summary "{*$:Summary}":)
(:input hidden Type {*$:Type}:)
(:input hidden Project {*$:Project}:)
(:input hidden Deadline {*$:Deadline}:)
(:input hidden Deadlineinput {*$:Deadlineinput}:)
>>right<<
'_JITS for [[{*$:JName}|+]]_'
>><<
(:table border=0:)
(:cellnr:)$[Summary]: 
(:cell:)'''{*$:Summary}'''
(:cellnr:)Author:
(:cell:)[[~{*$:WrittenBy}]]
(:cellnr:)$[date]:
(:cell:){*$:CDateWritten}
(:ifend:)
>>comment<<
------------------------------------------------
Show the Type Project Priority and Status
------------------------------------------------
>><<
(:if expr ( !equal {$jnewcomm} "yes"  &&  !equal {$jedit} "true" && !equal 
{$edicomm} "yes" ) :)

(:cellnr:)$[Type]:
(:cell:){*$:Type}
(:cellnr:)$[in project]:
(:cell:){*$:Project}
(:cellnr:)$[Person]:
(:cell:){*$:Person}
(:cellnr:)$[Deadline]:
(:cell:){(ftime "%F" {*$:Deadlineinput})}
(:cellnr:)$[Priority]:
(:cell:){*$:Priority}
(:cellnr:)$[Status]:
(:cell:){*$:Status}
(:ifend:)
>>comment<<
------------------------------------------------
Edit the Type Project Priority and Status
------------------------------------------------
>><<
(:if expr ( !equal {$jnewcomm} "yes" ) && ( equal {$jedit} "true" ) :)

(:input hidden ChngDate '{(ftime "%Y%m%d%H%M%S" "now" )}':)
(:input hidden CChngDate '{(ftime "%F %H:%M" "now" )}':)
(:input hidden ChngAuth "{$AuthId}":)
(:cellnr:)$[Type]:
(:cell:)(:include {*$Group}.JITScfg JITS.JITScfg #Type#Typeend:)
(:cellnr:)$[in project]:
(:cell:)(:include {*$Group}.JITScfg JITS.JITScfg #Project#Projectend:)
(:cellnr:)$[Person]:
(:cell:)
(:include {*$Group}.JITScfg JITS.JITScfg #Person#Personend:)
(:cellnr:)$[Priority]:
(:cell:)
(:include {*$Group}.JITScfg JITS.JITScfg #Priority#Priorityend:)
(:cellnr:)$[Status]:
(:cell:)
(:include {*$Group}.JITScfg JITS.JITScfg #Status#Statusend:)
(:cellnr:)$[Deadline]:
(:cell:)(:textarea name=Deadlineinput cols=12 rows=1:)(:keep {(ftime "%F" 
"{*$:Deadlineinput}")}:)(:textareaend:)
(:input hidden Deadline '{(ftime "%F" "{*$:Deadlineinput}")}':)
(:cellnr:)
(:ifend:)

>>comment<<
------------------------------------------------
Show the Content
------------------------------------------------
>><<
(:if expr ( !equal {$jnewcomm} "yes"  &&  !equal {$jedit} "true" && !equal 
{$edicomm} "yes" ) :)
(:cellnr:)$[Content]: 
(:cell:)&nbsp;
(:if expr ( !equal {$jnewcomm} "yes"  && !equal {$jedit} "true" && !equal 
{$edicomm} "yes" ) :)
(:cellnr:)&nbsp;
(:cell style="padding-left: 10px; border-left: thin solid ;":){*$:Content}
(:cellnr colspan=2:)
(:ifend:)
>>comment<<
------------------------------------------------
Edit the Content
------------------------------------------------
>><<
(:if expr ( !equal {$jnewcomm} "yes" ) && ( equal {$jedit} "true" ) :)
(:cellnr:)$[Content]: 
(:cell:)&nbsp;
(:cellnr:)
(:cell:)(:textarea name=Content cols=80 rows=8:)(:keep 
{*$:Content}:)(:textareaend:)
(:cellnr:)
(:zap 
savedata_2="PInd,JName,ThreadId,DateWritten,CDateWritten,ChngDate,CChngDate,ChngAuth,WrittenBy,Type,Project,Person,Status,Deadlineinput,Deadline,Priority,Summary,Content"
  formShowIssue:)
(:tableend:)
(:input submit value="$[Save changes]" formShowIssue:)
(:zapend:)

(:zapform key=fCancel:)
(:zap nextpage="{$PageUrl}" fCancel:)
(:input submit value="$[Cancel changes]" fCancel:)
(:zapend:)

(:ifend:)
>>comment<<
------------------------------------------------
End of Show/Edit the Content and the rest of issue properties
------------------------------------------------
>><<

(:table:)
(:tableend:)
(:if expr !equal {$jnewcomm} "yes"  &&  !equal {$jedit} "true" && !equal 
{$edicomm} "yes" && ( equal {$AuthId} {*$:WrittenBy} || auth edit ) :)
>>center<<
'-[[{*$PageUrl}?jedit=true|edit]]-'
>><<
(:ifend:)
(:if expr !equal {$jnewcomm} "yes"  &&  !equal {$jedit} "true" && !equal 
{$edicomm} "yes"  :)
----
'_ Last change/comment on {*$:CChngDate} by [[~{*$:ChngAuth}]]_'
(:ifend:)

>>comment<<
************************************************
Show Comments if empty param ?jnewcomm .
Displays the link to self with parameter ?jnewcomm=yes
and comments list .
------------------------------------------------
>><<
(:if expr ( !equal {$jnewcomm} "yes" && !equal {$AuthId} "" && !equal 
{$edicomm} "yes" ) :)

(:include JITS.JITSsnip #fAddC#fAddCend:)
(:if expr !equal {$jnewcomm} "yes" && !equal {$edicomm} "yes" :)
----
(:table:)
(:tableend:)
Comments:\\
(:include JITS.JITSPgLstS #commlist#commlistend:)
----

(:include JITS.JITSsnip #fAddC#fAddCend:)
(:ifend:)

>>comment<<
------------------------------------------------
Adding new comment page when ?jnewcomm=yes
------------------------------------------------
>><<
(:if equal {$jnewcomm} "yes":)

(:zapform key=formComm:)

(:zap datapage_2="{*$Group}.{*$Name}" formComm:)
(:zap savedata_2="ChngDate,CChngDate,ChngAuth" formComm:)
(:zap ChngDate='{(ftime "%Y%m%d%H%M%S" "now" )}' formComm:)
(:zap CChngDate='{(ftime "%F %H:%M" "now" )}' formComm:)

(:zap ChngAuth="{$AuthId}" formComm:)

(:zap ThreadId="{*$:ThreadId}" formComm:)
(:zap PInd="JITS" formComm:)


(:zap datapage_3="{*$Group}.{*$Name}C+" formComm:)
(:zap savedata_3="PInd,JName,ThreadId,CWrittenBy,CRemark,Ctime,CCtime" 
formComm:)

(:input hidden CWrittenBy value="{$AuthId}":)

(:input hidden Ctime '{(ftime "%Y%m%d%H%M%S" "now" )}':)
(:input hidden CCtime '{(ftime "%F %H:%M" "now" )}':)
(:textarea name=CRemark cols=80 rows=4:)(:textareaend:)

(:input submit value="Submit comment" formComm:)
(:zapend:)

(:zapform key=fCancel:)
(:zap nextpage="{*$Group}.{(substr {*$Name} 0 4)}" fCancel:)
(:input submit value="$[Cancel comment]" fCancel:)
(:zapend:)

(:ifend:)


>>comment<<
------------------------------------------------
Edit comment page when ?edicomm=yes
------------------------------------------------
>><<
(:if equal {$edicomm} "yes":)

(:zapform key=formEditComm:)
(:zap datapage_3="{*$Group}.{*$Name}" formEditComm:)
(:zap savedata_3="PInd,JName,ThreadId,CRemark,Ctime,CCtime" formEditComm:)
(:zap PInd="JITS" formEditComm:)
(:zap ThreadId="{*$:ThreadId}" formEditComm:)
(:zap JName="{*$:JName}" formEditComm:)

(:zap nextpage="{*$Group}.{*$:ThreadId}" formEditComm:)
(:input hidden CWrittenBy value="{$AuthId}":)

(:input hidden Ctime '{(ftime "%Y%m%d%H%M%S" "now" )}':)
(:input hidden CCtime '{(ftime "%F %H:%M" "now" )}':)
(:textarea name=CRemark cols=80 rows=4:)(:keep {*$:CRemark}:)(:textareaend:)

(:input submit value="Save changes" formEditComm:)
(:zapend:)

(:zapform key=fCancel:)
(:zap nextpage="{*$Group}.{(substr {*$Name} 0 4)}" fCancel:)
(:input submit value="$[Cancel changes]" fCancel:)
(:zapend:)

(:ifend:)


\\
\\
%center%'-''[[JITS.JITS|JITS snippets v. {JITS.JITSsnip$:version}]]''-'%%
[[#grpftrend]]

----
(:if false:)
[[#fAddC]]
(:zapform key=fAddC:)
(:zap jnewcomm="yes" fAddC:)
(:input hidden passdata jnewcomm :)
(:input submit value="$[Add comment]" fAddC:)
(:zapend:)
[[#fAddCend]]
(:ifend:)
@]

----
[[#pagefields]]
'''Main issue page fields list'''

||border=1 width=700 cellspacing=0 cellpadding=5
||!var||!description||!examples
||PInd ||always "JITS". Used in pglists to shorten the line and not to list 
other pages then JITS pages||JITS
||JName ||name of the starting (main) JITS page ||John for Tasks.John issues, 
Bob for Tasks.Bob
||ThreadId ||thread number || 10000, 10001
||DateWritten ||issue creation date - timestamp || 1168812685
||CDateWritten ||formated DateWritten || 14.01.2007 23:11
||ChngDate ||issue last change (or add comment) date - timestamp || 1168812685
||CChngDate ||formated ChngDate || 14.01.2007 23:11
||ChngAuth ||AuthId who made changes or added comment||John
||WrittenBy ||issue creator ||TheBoss
||Type ||issue Type listed in [=<Group>.JITScfg part [[#Type]]..[[#Typeend]]=] 
||bug,question...
||Project ||issue Project listed in [=<Group>.JITScfg part 
[[#Project]]..[[#Projectend]]=] ||QualityMgmt, ...
||Status ||issue Status (changeable) listed in [=<Group>.JITScfg part 
[[#Status]]..[[#Statusend]]=] ||Open,Closed...
||Person ||issue Person (changable) listed in [=<Group>.JITScfg part 
[[#Person]]..[[#Personend]]=] || Coryn,Kester...
||Priority ||issue Priority (changeable) listed in [=<Group>.JITScfg part 
[[#Priority]]..[[#Priorityend]]=] ||Low,High...
||Summary ||issue Summary entered when issue created ||My problem with ...
||Content ||issue Content (editable) entered when issue created || This is the 
description of my problem...

----
related pages: (:pagelist group=JITS:) 

ZAP installed versions:
||ZAP: ||{$ZAPversion}
||ZAPextend: ||{$ZAPextendversion}
||ZAPmarkups: ||{$ZAPmarkupsversion}
||ZAPconditionals: ||{$ZAPconditionalsversion}
||ZAPmail: ||{$ZAPmailversion}
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel@pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel

Reply via email to