2 * submissionCategoryForm.tpl
4 * Copyright (c) 2003-2008 John Willinsky
5 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
7 * Form to create/modify a press category.
9 * $Id: submissionCategoryForm.tpl,v 1.4 2009/07/30 23:16:15 tylerl Exp $
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}" />
18 <script type="text/javascript">
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() {
36 {foreach from=$assignedEditors item=editorEntry}
37 {assign var=editor value=$editorEntry.user}
39 if (!document.category.canReview{/literal}{$editor->getId()}{literal}.checked && !document.category.canEdit{/literal}{$editor->getId()}{literal}.checked) {
42 {/literal}{/foreach}{literal}
44 alert({/literal}'{translate|escape:"jsparam" key="manager.arrangement.form.mustAllowPermission"}'{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">
64 <td colspan="3" class="headseparator"> </td>
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>
72 <td colspan="3" class="headseparator"> </td>
74 {foreach from=$unassignedEditors item=editor}
76 <td>{$editor->getUsername()|escape}</td>
77 <td>{$editor->getFullName()|escape}</td>
79 <a class="action" href="javascript:addEditor({$editor->getId()})">{translate key="common.add"}</a>
84 <td colspan="3" class="nodata">{translate key="common.none"}</td>
88 <td colspan="3" class="endseparator"> </td>
92 <h4>{translate key="manager.categories.assigned"}</h4>
94 <table width="100%" class="listing" id="assignedCategoryEditors">
96 <td colspan="5" class="headseparator"> </td>
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>
106 <td colspan="5" class="headseparator"> </td>
108 {foreach from=$assignedEditors item=editorEntry}
109 {assign var=editor value=$editorEntry.user}
110 <input type="hidden" name="assignedEditorIds[]" value="{$editor->getId()|escape}" />
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>
117 <a class="action" href="javascript:removeEditor({$editor->getId()})">{translate key="common.remove"}</a>
122 <td colspan="5" class="nodata">{translate key="common.none"}</td>
126 <td colspan="5" class="endseparator"> </td>