baseline
[omp.pkp.sfu.ca.git] / templates / manager / submissionCategory / submissionCategoryEditorForm.tpl
blob6415821a39d5e3c5e356d158e5edc68e54d20976
1 {**
2  * submissionCategoryForm.tpl
3  *
4  * Copyright (c) 2003-2008 John Willinsky
5  * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
6  *
7  * Form to create/modify a press category.
8  *
9  * $Id: submissionCategoryForm.tpl,v 1.4 2009/07/30 23:16:15 tylerl Exp $
10  *}
12 <form name="category" method="post" action="{url op="updateSubmissionCategoryEditors" path=$arrangementId}" onsubmit="return checkEditorAssignments()">
13 <input type="hidden" name="editorAction" value="" />
14 <input type="hidden" name="userId" value="" />
15 <input type="hidden" name="arrangementType" value="{$smarty.const.CATEGORY_ARRANGEMENT}" />
17 {literal}
18 <script type="text/javascript">
19 <!--
21 function addEditor(editorId) {
22         document.category.editorAction.value = "addEditor";
23         document.category.userId.value = editorId;
24         document.category.submit();
27 function removeEditor(editorId) {
28         document.category.editorAction.value = "removeEditor";
29         document.category.userId.value = editorId;
30         document.category.submit();
33 function checkEditorAssignments() {
34         var isOk = true;
35         {/literal}
36         {foreach from=$assignedEditors item=editorEntry}
37         {assign var=editor value=$editorEntry.user}
38         {literal}
39                 if (!document.category.canReview{/literal}{$editor->getId()}{literal}.checked && !document.category.canEdit{/literal}{$editor->getId()}{literal}.checked) {
40                         isOk = false;
41                 }
42         {/literal}{/foreach}{literal}
43         if (!isOk) {
44                 alert({/literal}'{translate|escape:"jsparam" key="manager.arrangement.form.mustAllowPermission"}'{literal});
45                 return false;
46         }
47         return true;
50 // -->
51 </script>
52 {/literal}
54 {include file="common/formErrors.tpl"}
57 <h3>{translate key="user.role.submissionCategoryEditors"}</h3>
58 {url|assign:"categoryEditorsUrl" op="people" path="acquisitionsEditors"|to_array}
59 <p><span class="instruct">{translate key="manager.categories.categoryEditorInstructions" categoryEditorsUrl=$categoryEditorsUrl}</span></p>
60 <h4>{translate key="manager.categories.unassigned"}</h4>
62 <table width="100%" class="listing" id="unassignedCategoryEditors">
63         <tr>
64                 <td colspan="3" class="headseparator">&nbsp;</td>
65         </tr>
66         <tr valign="top" class="heading">
67                 <td width="20%">{translate key="user.username"}</td>
68                 <td width="60%">{translate key="user.name"}</td>
69                 <td width="20%" align="right">{translate key="common.action"}</td>
70         </tr>
71         <tr>
72                 <td colspan="3" class="headseparator">&nbsp;</td>
73         </tr>
74         {foreach from=$unassignedEditors item=editor}
75                 <tr valign="top">
76                         <td>{$editor->getUsername()|escape}</td>
77                         <td>{$editor->getFullName()|escape}</td>
78                         <td align="right">
79                                 <a class="action" href="javascript:addEditor({$editor->getId()})">{translate key="common.add"}</a>
80                         </td>
81                 </tr>
82         {foreachelse}
83                 <tr>
84                         <td colspan="3" class="nodata">{translate key="common.none"}</td>
85                 </tr>
86         {/foreach}
87         <tr>
88                 <td colspan="3" class="endseparator">&nbsp;</td>
89         </tr>
90 </table>
92 <h4>{translate key="manager.categories.assigned"}</h4>
94 <table width="100%" class="listing" id="assignedCategoryEditors">
95         <tr>
96                 <td colspan="5" class="headseparator">&nbsp;</td>
97         </tr>
98         <tr valign="top" class="heading">
99                 <td width="20%">{translate key="user.username"}</td>
100                 <td width="40%">{translate key="user.name"}</td>
101                 <td width="10%" align="center">{translate key="submission.review"}</td>
102                 <td width="10%" align="center">{translate key="submission.editing"}</td>
103                 <td width="20%" align="right">{translate key="common.action"}</td>
104         </tr>
105         <tr>
106                 <td colspan="5" class="headseparator">&nbsp;</td>
107         </tr>
108         {foreach from=$assignedEditors item=editorEntry}
109                 {assign var=editor value=$editorEntry.user}
110                 <input type="hidden" name="assignedEditorIds[]" value="{$editor->getId()|escape}" />
111                 <tr valign="top">
112                         <td>{$editor->getUsername()|escape}</td>
113                         <td>{$editor->getFullName()|escape}</td>
114                         <td align="center"><input type="checkbox" {if $editorEntry.canReview}checked="checked"{/if} name="canReview{$editor->getId()}" /></td>
115                         <td align="center"><input type="checkbox" {if $editorEntry.canEdit}checked="checked"{/if} name="canEdit{$editor->getId()}" /></td>
116                         <td align="right">
117                                 <a class="action" href="javascript:removeEditor({$editor->getId()})">{translate key="common.remove"}</a>
118                         </td>
119                 </tr>
120         {foreachelse}
121                 <tr>
122                         <td colspan="5" class="nodata">{translate key="common.none"}</td>
123                 </tr>
124         {/foreach}
125         <tr>
126                 <td colspan="5" class="endseparator">&nbsp;</td>
127         </tr>
128 </table>
130 </form>