Hi Grant, On 07/12/2010 05:28 PM, Sales, G. (Grant) wrote:
== Shift Turnover Logs ==
{{velocity}} #set($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='ShiftLog.ShiftLogClass' and obj.name<>'ShiftLog.ShiftLogTemplate' order by doc.creationDate desc") ##set($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='ShiftLog.ShiftLogClass' and obj.name<>'ShiftLog.ShiftLogTemplate'") #set($results = $xwiki.searchDocuments($sql))
I suppose $results contains the expected items, right? You can test by displaying $item in the following loop.
#if($results.empty) No Shift Logs has been created yet! #else #foreach ($item in $results)
#if($doc.title != "ShiftLogSheet")
Are you sure you want to test the $doc.title? $doc is the current document (e.g. the document containing this velocity code). This test is not affected by the loop and thus executing it in each loop doesn't seem right. Maybe you should test $item (a document name) or $ShiftLog.title .
#set($ShiftLog = $xwiki.getDocument($item))
* [[${ShiftLog.display("question").replace("<p>", "").replace("</p>", "")}>>${item}]]
$xwiki.getDocument($doc.getAuthor()).getObject('XWiki.XWikiUsers').getPr operty('email').getValue()
This line displays the same thing in all the loops. Maybe you wanted to write $ShiftLog.getAuthor() instead of $doc.getAuthor() ? Hope this helps, Marius
#end #end #end {{/velocity}} ))) )))
All I want to do is display who edited the file last. All this is currently doing is showing who made the Shift Log.WebHome
Thanks, Grant
Grant Sales Security Operations Analyst ING 111 Washington Ave South Minneapolis, MN 55401 Tel: 612.342.7889 Fax: 612.342.3428 Cell: 320.761.0966 Email: [email protected] www.ing-usa.com ING. Your future. Made easier. (r)
---------------------------------------------------------
NOTICE: The information contained in this electronic mail message is confidential and intended only for certain recipients. If you are not an intended recipient, you are hereby notified that any disclosure, reproduction, distribution or other use of this communication and any attachments is strictly prohibited. If you have received this communication in error, please notify the sender by reply transmission and delete the message without copying or disclosing it.
============================================================================================ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs