1<div id="taskdetails">
2  <form action="{CreateUrl('details', $task_details['task_id'])}" id="taskeditform" enctype="multipart/form-data" method="post">
3	 <div>
4		<h2 class="summary severity{Req::val('task_severity', $task_details['task_severity'])}">
5		  <a href="{CreateUrl('details', $task_details['task_id'])}">FS#{$task_details['task_id']}</a> -
6		  <input class="text severity{Req::val('task_severity', $task_details['task_severity'])}" type="text"
7			name="item_summary" size="80" maxlength="100"
8			value="{Req::val('item_summary', $task_details['item_summary'])}" />
9		</h2>
10		<input type="hidden" name="action" value="details.update" />
11        <input type="hidden" name="edit" value="1" />
12		<input type="hidden" name="task_id" value="{$task_details['task_id']}" />
13		<input type="hidden" name="edit_start_time" value="{Req::val('edit_start_time', time())}" />
14
15		<div id="fineprint">
16		  {L('attachedtoproject')}:
17		  <select name="project_id">
18			{!tpl_options($fs->projects, Req::val('project_id', $proj->id))}
19		  </select>
20		  <br />
21		  {L('openedby')} {!tpl_userlink($task_details['opened_by'])}
22		  - {!formatDate($task_details['date_opened'], true)}
23		  <?php if ($task_details['last_edited_by']): ?>
24		  <br />
25		  {L('editedby')}  {!tpl_userlink($task_details['last_edited_by'])}
26		  - {formatDate($task_details['last_edited_time'], true)}
27		  <?php endif; ?>
28		</div>
29
30        <table><tr><td id="taskfieldscell"><?php // small layout table ?>
31
32		<div id="taskfields">
33		  <table class="taskdetails">
34			<tr>
35			 <td><label for="tasktype">{L('tasktype')}</label></td>
36			 <td>
37				<select id="tasktype" name="task_type">
38				 {!tpl_options($proj->listTaskTypes(), Req::val('task_type', $task_details['task_type']))}
39				</select>
40			 </td>
41			</tr>
42			<tr>
43			 <td><label for="category">{L('category')}</label></td>
44			 <td>
45				<select id="category" name="product_category">
46				 {!tpl_options($proj->listCategories(), Req::val('product_category', $task_details['product_category']))}
47				</select>
48			 </td>
49			</tr>
50			<tr>
51			 <td><label for="status">{L('status')}</label></td>
52			 <td>
53				<select id="status" name="item_status">
54				 {!tpl_options($proj->listTaskStatuses(), Req::val('item_status', $task_details['item_status']))}
55				</select>
56			 </td>
57			</tr>
58			<tr>
59			 <td><label>{L('assignedto')}</label></td>
60			 <td>
61                <?php if ($user->perms('edit_assignments')): ?>
62
63				<input type="hidden" name="old_assigned" value="{$old_assigned}" />
64                <?php $this->display('common.multiuserselect.tpl'); ?>
65                <?php else: ?>
66                    <?php if (empty($assigned_users)): ?>
67                     {L('noone')}
68                     <?php else:
69                     foreach ($assigned_users as $userid):
70                     ?>
71                     {!tpl_userlink($userid)}<br />
72                     <?php endforeach;
73                     endif; ?>
74                <?php endif; ?>
75			 </td>
76			</tr>
77			<tr>
78			 <td><label for="os">{L('operatingsystem')}</label></td>
79			 <td>
80				<select id="os" name="operating_system">
81				 {!tpl_options($proj->listOs(), Req::val('operating_system', $task_details['operating_system']))}
82				</select>
83			 </td>
84			</tr>
85			<tr>
86			 <td><label for="severity">{L('severity')}</label></td>
87             <td>
88				<select id="severity" name="task_severity">
89				 {!tpl_options($fs->severities, Req::val('task_severity', $task_details['task_severity']))}
90				</select>
91			 </td>
92			</tr>
93			<tr>
94			 <td><label for="priority">{L('priority')}</label></td>
95			 <td>
96				<select id="priority" name="task_priority">
97				 {!tpl_options($fs->priorities, Req::val('task_priority', $task_details['task_priority']))}
98				</select>
99			 </td>
100			</tr>
101			<tr>
102			 <td><label for="reportedver">{L('reportedversion')}</label></td>
103			 <td>
104				<select id="reportedver" name="reportedver">
105				{!tpl_options($proj->listVersions(false, 2, $task_details['product_version']), Req::val('reportedver', $task_details['product_version']))}
106				</select>
107			 </td>
108			</tr>
109			<tr>
110			 <td><label for="dueversion">{L('dueinversion')}</label></td>
111			 <td>
112				<select id="dueversion" name="closedby_version">
113				 <option value="0">{L('undecided')}</option>
114				 {!tpl_options($proj->listVersions(false, 3), Req::val('closedby_version', $task_details['closedby_version']))}
115				</select>
116			 </td>
117			</tr>
118			<tr>
119			 <td><label for="duedate">{L('duedate')}</label></td>
120			 <td id="duedate">
121                {!tpl_datepicker('due_date', '', Req::val('due_date', $task_details['due_date']))}
122			 </td>
123			</tr>
124			<tr>
125			 <td><label for="percent">{L('percentcomplete')}</label></td>
126			 <td>
127				<select id="percent" name="percent_complete">
128				 <?php $arr = array(); for ($i = 0; $i<=100; $i+=10) $arr[$i] = $i.'%'; ?>
129				 {!tpl_options($arr, Req::val('percent_complete', $task_details['percent_complete']))}
130				</select>
131			 </td>
132			</tr>
133            <?php if ($user->can_change_private($task_details)): ?>
134            <tr>
135              <td><label for="private">{L('private')}</label></td>
136              <td>
137                {!tpl_checkbox('mark_private', Req::val('mark_private', $task_details['mark_private']), 'private')}
138              </td>
139            </tr>
140            <?php endif; ?>
141		  </table>
142		</div>
143
144        </td><td style="width:100%">
145
146		<div id="taskdetailsfull">
147          <h3 class="taskdesc">{L('details')}</h3>
148        <?php $attachments = $proj->listTaskAttachments($task_details['task_id']);
149          $this->display('common.editattachments.tpl', 'attachments', $attachments); ?>
150
151          <?php if ($user->perms('create_attachments')): ?>
152          <div id="uploadfilebox">
153            <span style="display: none"><?php // this span is shown/copied in javascript when adding files ?>
154              <input tabindex="5" class="file" type="file" size="55" name="usertaskfile[]" />
155                <a href="javascript://" tabindex="6" onclick="removeUploadField(this);">{L('remove')}</a><br />
156            </span>
157            <noscript>
158                <span>
159                  <input tabindex="5" class="file" type="file" size="55" name="usertaskfile[]" />
160                    <a href="javascript://" tabindex="6" onclick="removeUploadField(this);">{L('remove')}</a><br />
161                </span>
162            </noscript>
163          </div>
164          <button id="uploadfilebox_attachafile" tabindex="7" type="button" onclick="addUploadFields()">
165            {L('uploadafile')} ({L('max')} {$fs->max_file_size} {L('MiB')})
166          </button>
167          <button id="uploadfilebox_attachanotherfile" tabindex="7" style="display: none" type="button" onclick="addUploadFields()">
168             {L('attachanotherfile')} ({L('max')} {$fs->max_file_size} {L('MiB')})
169          </button>
170          <?php endif; ?>
171          <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?>
172          <div class="hide preview" id="preview"></div>
173          <?php endif; ?>
174          {!TextFormatter::textarea('detailed_desc', 15, 70, array('id' => 'details'), Req::val('detailed_desc', $task_details['detailed_desc']))}
175          <br />
176          <?php if ($user->perms('add_comments') && (!$task_details['is_closed'] || $proj->prefs['comment_closed'])): ?>
177              <button type="button" onclick="showstuff('edit_add_comment');this.style.display='none';">{L('addcomment')}</button>
178              <div id="edit_add_comment" class="hide">
179              <label for="comment_text">{L('comment')}</label>
180
181              <?php if ($user->perms('create_attachments')): ?>
182              <div id="uploadfilebox_c">
183                <span style="display: none"><?php // this span is shown/copied in javascript when adding files ?>
184                  <input tabindex="5" class="file" type="file" size="55" name="userfile[]" />
185                    <a href="javascript://" tabindex="6" onclick="removeUploadField(this, 'uploadfilebox_c');">{L('remove')}</a><br />
186                </span>
187              </div>
188              <button id="uploadfilebox_c_attachafile" tabindex="7" type="button" onclick="addUploadFields('uploadfilebox_c')">
189                {L('uploadafile')} ({L('max')} {$fs->max_file_size} {L('MiB')})
190              </button>
191              <button id="uploadfilebox_c_attachanotherfile" tabindex="7" style="display: none" type="button" onclick="addUploadFields('uploadfilebox_c')">
192                 {L('attachanotherfile')} ({L('max')} {$fs->max_file_size} {L('MiB')})
193              </button>
194              <?php endif; ?>
195
196              <textarea accesskey="r" tabindex="8" id="comment_text" name="comment_text" cols="50" rows="10"></textarea>
197              </div>
198          <?php endif; ?>
199		  <p class="buttons">
200              <button type="submit" accesskey="s" onclick="return checkok('{#$baseurl}javascript/callbacks/checksave.php?time={time()}&amp;taskid={$task_details['task_id']}', '{#L('alreadyedited')}', 'taskeditform')">{L('savedetails')}</button>
201              <?php if (defined('FLYSPRAY_HAS_PREVIEW')): ?>
202              <button tabindex="9" type="button" onclick="showPreview('details', '{#$baseurl}', 'preview')">{L('preview')}</button>
203              <?php endif; ?>
204              <button type="reset">{L('reset')}</button>
205          </p>
206		</div>
207
208        </td></tr></table>
209
210	 </div>
211     <div class="clear"></div>
212  </form>
213</div>
214