-
Notifications
You must be signed in to change notification settings - Fork 623
Expand file tree
/
Copy pathreqTcAssign.tpl
More file actions
248 lines (224 loc) · 8.83 KB
/
reqTcAssign.tpl
File metadata and controls
248 lines (224 loc) · 8.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
{*
TestLink Open Source Project - http://testlink.sourceforge.net/
@filesource reqTCAssign.tpl
assign REQ to one test case
*}
{$cfg_section=$smarty.template|basename|replace:".tpl":"" }
{config_load file="input_dimensions.conf" section=$cfg_section}
{lang_get var="labels"
s="please_select_a_req,test_case,req_title_assign,btn_close,
warning_req_tc_assignment_impossible,req_spec,warning,
req_title_assigned,check_uncheck_all_checkboxes,version,
version_short,reqLinkingDisabledAfterExec,yourRoleHasReqLinkingDisabled,
req_msg_norequirement,btn_unassign,req_title_unassigned,
check_uncheck_all_checkboxes,req_msg_norequirement,btn_assign,
req_doc_id,req,scope,assigned_by,timestamp,requirement"}
{include file="inc_head.tpl" openHead="yes"}
{include file="inc_jsCheckboxes.tpl"}
{include file="inc_del_onclick.tpl"}
<script type="text/javascript">
var please_select_a_req="{$labels.please_select_a_req|escape:'javascript'}";
var alert_box_title = "{$labels.warning|escape:'javascript'}";
function check_action_precondition(form_id,action) {
if(checkbox_count_checked(form_id) <= 0) {
alert_message(alert_box_title,please_select_a_req);
return false;
}
return true;
}
/**
*
*/
function refreshAndClose(tcase_id,callback) {
if(callback == 'a') {
target = fRoot+'lib/testcases/archiveData.php?tcase_id=' + tcase_id + '&show_mode=';
window.opener.location.href = target;
} else {
window.opener.location.reload(true);
}
window.close();
}
</script>
</head>
{$msgReqLinkingEnabled = ''}
{$reqLinkingEnabled = 0}
{if $gui->req_tcase_link_management}
{$reqLinkingEnabled = 1}
{$msgReqLinkingEnabled = $labels.yourRoleHasReqLinkingDisabled}
{/if}
{if $tlCfg->testcase_cfg->reqLinkingDisabledAfterExec == 1 &&
$gui->tcaseHasBeenExecuted == 1}
{$reqLinkingEnabled = 0}
{$msgReqLinkingEnabled = $labels.reqLinkingDisabledAfterExec}
{/if}
<body>
{$sep = $smarty.const.TITLE_SEP}
{$tcIdentity = "{$gui->tcTitle|escape} "}
{$tcIdentity = "$tcIdentity [{$labels.version_short}{$gui->tcVersion}]"}
<h1 class="title">
{$labels.test_case} {$sep} {$tcIdentity}
</h1>
<div class="workBack">
{include file="inc_update.tpl" user_feedback=$gui->user_feedback}
{if $gui->arrReqSpec eq "" }
{$labels.warning_req_tc_assignment_impossible}
{else}
<h2>{$labels.req_title_assign} {$sep} {$tcIdentity}</h2>
<form id="SRS_switch" name="SRS_switch" method="post">
<input type="hidden" name="form_token" id="form_token" value="{$gui->form_token}" />
{if $gui->tcase_id != 0}
<input type="hidden" name="tcase_id" id="tcase_id" value="{$gui->tcase_id}" />
<input type="hidden" name="callback" id="callback" value="{$gui->callback}" />
{/if}
<p><span class="labelHolder">{$labels.req_spec}</span>
<select name="idSRS" id="idSRS" class="idSRS" onchange="form.submit()">
<option></option>
{html_options options=$gui->arrReqSpec selected=$gui->selectedReqSpec}
</select></p>
</form>
{if $gui->showCloseButton}
<form name="closeMeTop">
<div class="groupBtn">
<input type="button" value="{$labels.btn_close}"
onclick="refreshAndClose({$gui->tcase_id},'{$gui->callback}');" />
</div>
</form>
{/if}
</div>
<div class="workBack">
<h2>{$labels.req_title_assigned}</h2>
{if $gui->assignedReq ne ""}
<form id="reqList" method="post">
<input type="hidden" name="form_token" id="form_token" value="{$gui->form_token}" />
<div id="div_assigned_req">
{* used as memory for the check/uncheck all checkbox javascript logic *}
<input type="hidden" name="memory_assigned_req"
id="memory_assigned_req" value="0" />
<input type="hidden" name="idSRS" value="{$gui->selectedReqSpec}" />
<table class="simple_tableruler">
<tr>
<th align="center" style="width: 5px;background-color:#005498;">
<img src="{$tlImages.toggle_all}"
onclick='cs_all_checkbox_in_div("div_assigned_req","assigned_req","memory_assigned_req");'
title="{$labels.check_uncheck_all_checkboxes}" />
</th>
<th>{$labels.req_doc_id}</th>
<th>{$labels.req}</th>
<th>{$labels.scope}</th>
<th>{$labels.assigned_by}</th>
<th>{$labels.timestamp}</th>
</tr>
{section name=row loop=$gui->assignedReq}
{$cbDisabled = 0}
{* Has become complex & weird!! *}
{* can_be_removed check LINK STATUS *}
{if $tlCfg->reqTCLinks->freezeLinkOnNewREQVersion == TRUE }
{if $gui->assignedReq[row].can_be_removed == 0 }
{$cbDisabled = 1}
{/if}
{/if}
{if $reqLinkingEnabled == 0}
{$cbDisabled = 1}
{/if}
<tr>
<td>
{if $cbDisabled == 1}
{else}
<input type="checkbox"
id="assigned_req{$gui->assignedReq[row].link_id}" value="{$gui->assignedReq[row].link_id}"
name="link_id[{$gui->assignedReq[row].link_id}]" />
{/if}
</td>
<td><span class="bold">{$gui->assignedReq[row].req_doc_id|escape}</span></td>
<td><span class="bold"><a href="lib/requirements/reqView.php?requirement_id={$gui->assignedReq[row].id}">
{$gui->assignedReq[row].title|escape}</a></span></td>
<td>{if $gui->reqEditorType == 'none'}{$gui->assignedReq[row].scope|nl2br}{else}{$gui->assignedReq[row].scope|strip_tags|strip|truncate:#SCOPE_SHORT_TRUNCATE#}{/if}</td>
<td>{$gui->assignedReq[row].coverage_author}</td>
<td>{localize_timestamp ts=$gui->assignedReq[row].coverage_ts}</td>
</tr>
{sectionelse}
<tr><td></td><td><span class="bold">{$labels.req_msg_norequirement}</span></td></tr>
{/section}
</table>
</div>
{if $smarty.section.row.total > 0 && $reqLinkingEnabled}
<div class="groupBtn">
<input type="submit" name="unassign" value="{$labels.btn_unassign}"
onclick="return check_action_precondition('reqList','unassign');"/>
</div>
{/if}
{if $reqLinkingEnabled == 0}
<div class="groupBtn">
{$msgReqLinkingEnabled}
</div>
{/if}
</form>
{/if}
</div>
{if $reqLinkingEnabled == 0}
<div class="groupBtn">
{$msgReqLinkingEnabled}
</div>
{/if}
{if $gui->unassignedReq ne "" && $reqLinkingEnabled == 1}
<div class="workBack">
<h2>{$labels.req_title_unassigned}</h2>
<form id="reqList2" method="post">
<input type="hidden" name="form_token" id="form_token" value="{$gui->form_token}" />
<div id="div_free_req">
{* used as memory for the check/uncheck all checkbox javascript logic *}
<input type="hidden" name="memory_free_req"
id="memory_free_req" value="0" />
<input type="hidden" name="idSRS" value="{$gui->selectedReqSpec}" />
<table class="simple_tableruler">
<tr>
<th align="center" style="width: 5px;background-color:#005498;">
<img src="{$tlImages.toggle_all}"
onclick='cs_all_checkbox_in_div("div_free_req",
"free_req","memory_free_req");'
title="{$labels.check_uncheck_all_checkboxes}" />
</th>
<th>{lang_get s="req_doc_id"}</th>
<th>{lang_get s="req"}</th>
<th>{lang_get s="scope"}</th>
</tr>
{section name=row2 loop=$gui->unassignedReq}
{$freeReq = $gui->unassignedReq[row2]}
<tr>
<td><input type="checkbox"
id="free_req{$freeReq.id}" value="{$freeReq.id}"
name="req_id[{$freeReq.id}]" /></td>
<td><span class="bold">{$freeReq.req_doc_id|escape}</span></td>
<td><span class="bold"><a href="lib/requirements/reqView.php?requirement_id={$freeReq.id}&req_version_id={$freeReq.version_id}">
{$freeReq.title|escape} [{$labels.version_short}{$freeReq.version}] </a></span></td>
<td>{if $gui->reqEditorType == 'none'}{$freeReq.scope|nl2br}{else}{$freeReq.scope|strip_tags|strip|truncate:#SCOPE_SHORT_TRUNCATE#}{/if}</td>
</tr>
{sectionelse}
<tr><td></td><td><span class="bold">{$labels.req_msg_norequirement}</span></td></tr>
{/section}
</table>
</div>
<div class="groupBtn">
<input type="submit" name="assign" value="{$labels.btn_assign}"
onclick="return check_action_precondition('reqList2','assign');"/>
</div>
</form>
</div>
{/if}
{/if}
{if $gui->showCloseButton}
<form name="closeMe">
<div class="groupBtn">
<input type="button" value="{$labels.btn_close}"
onclick="refreshAndClose({$gui->tcase_id},'{$gui->callback}');" />
</div>
</form>
{/if}
<script type="text/javascript">
jQuery( document ).ready(function() {
jQuery(".idSRS").chosen({ width: "70%", search_contains: true });
});
</script>
</body>
</html>