Wiki source code of ClassSheetAssignments
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) | ||
| 2 | #set( $doc1new = $xwiki.getDocument("${doc.space}.${class}ClassSheet").isNew()) | ||
| 3 | #set( $doc2new = $xwiki.getDocument("${doc.space}.${class}ClassTemplate").isNew()) | ||
| 4 | #if (!$defaultweb) | ||
| 5 | #set($defaultweb = "Main") | ||
| 6 | #end | ||
| 7 | #if (!$defaultparent) | ||
| 8 | #set($defaultparent = "${doc.space}.${class}Class") | ||
| 9 | #end | ||
| 10 | |||
| 11 | #if (!($doc1new||$doc2new)) | ||
| 12 | |||
| 13 | 1.1 Create Your Response | ||
| 14 | |||
| 15 | To create your response, you should first choose a name for it (it's a good idea to have your group-name in the name) | ||
| 16 | |||
| 17 | <form action="" id="newdoc" method="post"> | ||
| 18 | <div> | ||
| 19 | <input type="hidden" name="parent" value="${defaultparent}"/> | ||
| 20 | <input type="hidden" name="template" value="${doc.space}.${class}ClassTemplate"/> | ||
| 21 | <input type="hidden" name="sheet" value="1"/> | ||
| 22 | <input type="hidden" name="webname" value="${defaultweb}" size="8"/> | ||
| 23 | Document: <input type="text" name="name" value="${doc.title}-$xwiki.getUserName($context.getUser(), false)"/> | ||
| 24 | <br/> | ||
| 25 | <br/> | ||
| 26 | ## TODO: remove this onclick | ||
| 27 | <input type="button" value="Create this document" onclick='if (updateName(this.form.name)) {this.form.action="../../inline/" + this.form.webname.value + "/" + this.form.name.value; this.form.submit(); }'/> | ||
| 28 | </div> | ||
| 29 | </form> | ||
| 30 | |||
| 31 | 1.1 Existing documents | ||
| 32 | |||
| 33 | #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='${doc.space}.${class}Class' and obj.name<>'${doc.space}.${class}ClassTemplate'") | ||
| 34 | |||
| 35 | #set ($legacyRawb6bc427928_1 = $services.query.hql($sql).execute()) | ||
| 36 | #set ($legacyVisibleb6bc427928_1 = []) | ||
| 37 | #foreach ($legacyEntryb6bc427928_1 in $legacyRawb6bc427928_1) | ||
| 38 | #if ($xwiki.hasAccessLevel('view', $xcontext.user, $legacyEntryb6bc427928_1)) | ||
| 39 | #set ($legacyVisibilityDiscard = $legacyVisibleb6bc427928_1.add($legacyEntryb6bc427928_1)) | ||
| 40 | #end | ||
| 41 | #end | ||
| 42 | #foreach ($item in $legacyVisibleb6bc427928_1) | ||
| 43 | * [$item] | ||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | #end | ||
| 48 | |||
| 49 | |||
| 50 | #if ($doc2new) | ||
| 51 | <form action="$xwiki.getURL("${doc.space}.${class}ClassTemplate","edit")" method="post"> | ||
| 52 | <div> | ||
| 53 | <input type="hidden" name="parent" value="${doc.space}.${class}Class"/> | ||
| 54 | <input type="hidden" name="template" value="XWiki.ClassItemTemplate"/> | ||
| 55 | <input type="hidden" name="sheet" value="1"/> | ||
| 56 | <input type="submit" value="Create the document template"/> | ||
| 57 | </div> | ||
| 58 | </form> | ||
| 59 | |||
| 60 | #end | ||
| 61 | |||
| 62 | #end |