-
Notifications
You must be signed in to change notification settings - Fork 623
Expand file tree
/
Copy pathtestlink_library.js
More file actions
1991 lines (1615 loc) · 43.5 KB
/
testlink_library.js
File metadata and controls
1991 lines (1615 loc) · 43.5 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// TestLink Open Source Project - http://testlink.sourceforge.net/
// This script is distributed under the GNU General Public License 2 or later.
//
// @filesource testlink_library.js
//
// Javascript functions commonly used through the GUI
// Rule: DO NOT ADD FUNCTIONS FOR ONE USING
//
// @used This library is automatically loaded with inc_header.tpl
//
//
// ----- Development Notes --------------------------------------------------------------
//
// @global variables:
// fRoot
// menuUrl
// args
//
// value to this variables is assigned using different smarty templates,
// like inc_head.tpl
//
// Attention:
// window.open() - on Firefox is window name contains blank nothing happens (no good)
// on I.E. => generates a bug - BE CAREFUL
//
// @internal revisions
// @since 1.9.13
/*
function: focusInputField
args :
returns:
*/
function focusInputField(id,selectIt) {
var f = document.getElementById(id);
if (f) {
f.focus();
if(selectIt) {
f.select();
}
}
}
/*
function: show help <div> tag with absolute position or right site ow window
arg: localized text of help
returns: N/A
*/
function show_help(text)
{
// set workframe window for navigator pane
if(window.name == "treeframe"){
var mywindows = window.parent.frames["workframe"].document;
} else {
var mywindows = window.document;
}
var myElement = mywindows.getElementById("tlhelp");
if(myElement == null)
{
var mybody = mywindows.getElementsByTagName("body").item(0);
var newdiv = mywindows.createElement('div');
newdiv.setAttribute('id', 'tlhelp');
newdiv.setAttribute('onclick', 'javascript: close_help()');
mybody.appendChild(newdiv);
myElement = mywindows.getElementById("tlhelp");
}
myElement.innerHTML = text;
}
function close_help()
{
// set workframe window for navigator pane
if(window.name == "treeframe"){
var mywindows = window.parent.frames["workframe"].document;
} else {
var mywindows = window.document;
}
var d = mywindows.getElementsByTagName("body").item(0);
var olddiv = mywindows.getElementById('tlhelp');
d.removeChild(olddiv);
}
/*
function: open_popup
args :
returns:
*/
function open_popup(page) {
var windowCfg="left=350,top=50,screenX=350,screenY=50,fullscreen=no,resizable=yes," +
"toolbar=no,status=no,menubar=no,scrollbars=yes,directories=no,location=no," +
"width=600,height=500";
window.open(page, "_blank",windowCfg);
}
// test specification related functions
/*
function: ST
Show Test case
args :
returns:
IMPORTANT NOTICE: see Development Notes on TOP of this document for info regarding args
*/
function ST(id,version)
{
var _FUNCTION_NAME_='ST';
var action_url=fRoot+menuUrl+"?version_id="+version+"&level=testcase&id="+id+args;
// alert(_FUNCTION_NAME_ + " " +action_url);
parent.workframe.location = action_url;
}
/*
function: STS
Show Test Suite
args :
returns:
*/
function STS(id)
{
var _FUNCTION_NAME_='STS';
var action_url = fRoot+menuUrl+"?level=testsuite&id="+id+args;
// alert(args);
parent.workframe.location = action_url;
}
/*
function: SP
args :
returns:
*/
function SP()
{
var action_url = fRoot+menuUrl;
parent.workframe.location = action_url;
}
/**
* EXecution DaShboard (EXDS)
*/
function EXDS() {
var action_url = fRoot+'lib/execute/execDashboard.php';
parent.workframe.location = action_url;
}
/*
function: EP
printing of Test Specification
args :
returns:
*/
function EP(id) {
// menuUrl 99% => archiveData.php
// can be planAddTC.php
var _FUNCTION_NAME_="EP";
// get checkboxes status
var pParams = tree_getPrintPreferences();
var action_url = fRoot+menuUrl+"?print_scope=test_specification" + "&edit=testproject" +
"&level=testproject&containerType=testproject&id="+id+args+"&"+pParams;
// alert(_FUNCTION_NAME_ + " " +action_url);
parent.workframe.location = action_url;
}
/*
function: Edit Test Suite or launch print
args :
returns:
rev :
*/
function ETS(id) {
// menuUrl 99% => archiveData.php
// get checkboxes status
var _FUNCTION_NAME_="ETS";
var pParams = tree_getPrintPreferences();
var action_url=fRoot+menuUrl+"?print_scope=test_specification" +
"&edit=testsuite&level=testsuite&" +
"containerType=testsuite&id="+id+args+"&"+pParams;
// alert(_FUNCTION_NAME_ + " " +action_url);
parent.workframe.location = action_url;
}
/*
function: Edit Test case
args :
returns:
*/
function ET(id,v)
{
// get checkboxes status
var _FUNCTION_NAME_="ET";
var my_location = fRoot+menuUrl+"?version_id="+v+"&edit=testcase&id="+id+args;
// alert(_FUNCTION_NAME_ + " " +my_location);
parent.workframe.location = my_location;
}
/* Generate doc: a selected Test Suite from Test Specification */
function TPROJECT_PTS(id)
{
var pParams = tree_getPrintPreferences();
parent.workframe.location = fRoot+menuUrl+"?type=testspec&level=testsuite&id="+id+args+"&"+pParams;
}
/* Generate doc: all Test Specification */
function TPROJECT_PTP(id)
{
var pParams = tree_getPrintPreferences();
parent.workframe.location = fRoot+menuUrl+"?type=testspec&level=testproject&id="+id+args+"&"+pParams;
}
/* Generate doc: a selected Test Tase from Test Specification */
function TPROJECT_PTC(id)
{
parent.workframe.location = fRoot+menuUrl+"?type=testspec&level=tc&id="+id+args;
}
/* Generate doc: all Req Specs, complete project */
function TPROJECT_PTP_RS(id)
{
var pParams = tree_getPrintPreferences();
parent.workframe.location = fRoot+menuUrl+"?type=reqspec&level=testproject&id="+id+args+"&"+pParams;
}
/* Generate doc: one Req Spec (with children) */
function TPROJECT_PRS(id)
{
var pParams = tree_getPrintPreferences();
parent.workframe.location = fRoot+menuUrl+"?type=reqspec&level=reqspec&id="+id+args+"&"+pParams;
}
/*
function: Edit Rec Spec or launch print
args :
returns:
rev :
*/
function ERS(id)
{
// get checkboxes status
var _FUNCTION_NAME_="ERS";
var pParams = tree_getPrintPreferences();
var action_url=fRoot+menuUrl+"?print_scope=test_specification" +
"&edit=reqspeccoverage&level=reqspec&id="+id+args+"&"+pParams;
// alert(_FUNCTION_NAME_ + " " +action_url);
parent.workframe.location = action_url;
}
/*
function: Edit Rec or launch print
args :
returns:
rev :
*/
function ER(id)
{
// get checkboxes status
var _FUNCTION_NAME_="ER";
var pParams = tree_getPrintPreferences();
var action_url=fRoot+menuUrl+"?print_scope=test_specification" +
"&edit=reqcoverage&level=requirement&id="+id+args+"&"+pParams;
// alert(_FUNCTION_NAME_ + " " +action_url);
parent.workframe.location = action_url;
}
/*
function: TPLAN_PTS
Test PLAN Print Test Suite
args :
returns:
*/
function TPLAN_PTS(id) {
var pParams = tree_getPrintPreferences();
parent.workframe.location = fRoot+menuUrl+"?level=testsuite&id="+id+args+"&"+pParams;
}
/*
function: TPLAN_PTP
Test PLAN Print Test Plan
*/
function TPLAN_PTP(id) {
var pParams = tree_getPrintPreferences();
var my_location = fRoot+menuUrl+"?level=testproject&id="+id+args+"&"+pParams;
parent.workframe.location = my_location;
}
/*
function: TPLAN_PTC
Test PLAN Print Test Case
*/
function TPLAN_PTC(id)
{
var my_location = fRoot+menuUrl+"?level=tc&id="+id+args;
parent.workframe.location = my_location;
}
function showOrHideElement(oid,hide)
{
var obj = document.getElementById(oid);
var displayValue = "";
if (!obj)
{
return;
}
if(hide)
{
displayValue = "none";
}
obj.style.display = displayValue;
}
/**
* Display a confirmation dlg before modifying roles
*
* @return bool return true if the user confirmed, false else
*
**/
function modifyRoles_warning()
{
var ret=false;
if (confirm(warning_modify_role))
{
ret=true;
}
return ret;
}
/**
*
* @param string feature the feature, could be testplan or product
**/
function changeFeature(feature)
{
var tmp = document.getElementById('featureSel');
var fID = '';
if (!tmp)
{
return;
}
fID = tmp.value;
if(fID)
{
location = fRoot+"lib/usermanagement/usersAssign.php?featureType="+feature+"&featureID="+fID;
}
}
/**
*
*/
function openFileUploadWindow(id,tableName) {
var windowCfg="width=510,height=300,resizable=yes,dependent=yes";
window.open(fRoot+"lib/attachments/attachmentupload.php?id="+id+"&tableName="+tableName,
"FileUpload",windowCfg);
}
/*
function:
args : object id
returns:
*/
function deleteAttachment_onClick(btn,txt,id)
{
if (btn == 'yes')
{
var windowCfg="width=510,height=150,resizable=yes,dependent=yes";
window.open(fRoot+"lib/attachments/attachmentdelete.php?id="+id,
"Delete",windowCfg);
}
}
function attachmentDlg_onUnload()
{
if (attachmentDlg_bNoRefresh)
{
attachmentDlg_bNoRefresh = false;
return;
}
try
{
if (attachmentDlg_refWindow == top.opener)
{
top.opener.location = attachmentDlg_refLocation;
}
}
catch(e)
{}
attachmentDlg_refWindow = null;
attachmentDlg_refLocation = null;
}
function attachmentDlg_onLoad()
{
attachmentDlg_refWindow = null;
attachmentDlg_refLocation = null;
try
{
attachmentDlg_refWindow = top.opener;
attachmentDlg_refLocation = top.opener.location;
if (attachmentDlg_refWindow.attachment_reloadOnCancelURL)
{
attachmentDlg_refLocation = attachmentDlg_refWindow.attachment_reloadOnCancelURL;
}
}
catch(e)
{}
}
function attachmentDlg_onSubmit(allowEmptyTitle)
{
var bSuccess = true;
attachmentDlg_bNoRefresh = true;
if (!allowEmptyTitle)
{
var titleField = document.getElementById('title');
if (isWhitespace(titleField.value))
{
var aForm = document.getElementById('aForm');
alert_message(alert_box_title,warning_empty_title);
selectField(aForm, 'title');
bSuccess = false;
}
}
return bSuccess;
}
/*
function: confirm_and_submit
args :
returns:
*/
function confirm_and_submit(msg,form_id,field_id,field_value,action_field_id,action_field_value)
{
if (confirm(msg))
{
var f = document.getElementById(form_id);
if (f)
{
var field = document.getElementById(field_id);
if (field)
{
field.value = field_value;
}
var field_a = document.getElementById(action_field_id);
if (field_a)
{
field_a.value = action_field_value;
}
f.submit();
}
}
}
/*
function: tree_getPrintPreferences
args :
returns:
rev :
ATTENTION:
this work in symbiosis with init_checkboxes() - printDocOptions.php
Symbiosis (from Ancient Greek σύν "together" and βίωσις "living")
*/
function tree_getPrintPreferences() {
var params = [];
var fields = printPreferences.split(',');
for (var idx= 0;idx < fields.length;idx++) {
var v = tree_getCheckBox(fields[idx]);
if (v) {
params.push(v);
}
}
var f = document.getElementById('format');
if(f) {
params.push("format="+f.value);
}
var bx = document.getElementById('build_id');
if(bx) {
params.push("build_id="+bx.value);
}
var bx = document.getElementById('with_user_assignment');
if(bx) {
var vv = 0;
if(bx.checked) {
vv = 1;
}
params.push("with_user_assignment=" + vv);
}
params = params.join('&'); // from array to string
return params;
}
/**
* @used-by tree_getPrintPreferences
*/
function tree_getCheckBox(id)
{
var cb = document.getElementById('cb'+id);
if (cb && cb.checked)
{
return id+'=y';
}
return null;
}
/**
*
*/
function open_script_add_window(tproject_id,tplan_id,tcversion_id,user_action)
{
l2l = "lib/testcases/scriptAdd.php?user_action=" + user_action +
"&tcversion_id="+tcversion_id +"&tproject_id=" + tproject_id +
"&tplan_id=" + tplan_id;
switch(user_action)
{
case 'create':
wh = "width=700,height=580";
break;
default:
wh = "width=610,height=650";
break;
}
window.open(fRoot+l2l,"script_add",wh+",resizable=yes,dependent=yes");
}
/**
*
*/
function open_bug_add_window(tproject_id,tplan_id,tcversion_id,exec_id,tcstep_id,user_action)
{
l2l = "lib/execute/bugAdd.php?user_action=" + user_action +
"&tcversion_id="+tcversion_id +"&tproject_id=" + tproject_id +
"&tplan_id=" + tplan_id + "&exec_id="+exec_id + "&tcstep_id="+tcstep_id;
switch(user_action)
{
case 'create':
wh = "width=700,height=400";
break;
default:
wh = "width=510,height=400";
break;
}
window.open(fRoot+l2l,"bug_add",wh+",resizable=yes,dependent=yes");
}
/**
*
*/
function open_bug_note_add_window(bug_id,tproject_id,tcversion_id,exec_id,user_action)
{
link2launch = "lib/execute/bugAdd.php?user_action=" + user_action + "&tcversion_id="+tcversion_id +
"&tproject_id=" + tproject_id + "&exec_id="+exec_id + "&bug_id=" + bug_id;
window.open(fRoot+link2launch,"bug_add_note","width=510,height=270,resizable=yes,dependent=yes");
}
function bug_dialog()
{
this.refWindow = null;
this.refLocation = null;
this.NoRefresh = false;
}
function std_dialog(additional) {
this.refWindow = null;
this.refLocation = null;
this.refAdditional=additional;
this.NoRefresh = false;
}
function dialog_onSubmit(odialog) {
// In this way we do not do refresh.
odialog.NoRefresh = true;
return true;
}
function dialog_onLoad(odialog)
{
odialog.refWindow = null;
odialog.refLocation = null;
try
{
odialog.refWindow = top.opener;
odialog.refLocation = top.opener.location;
if(odialog.refAdditional != undefined)
{
// Only add odialog.refAdditional if not already present
// IMPORTANT
// cast to string, is neeed to avoid issues with
// str.replace() => will return undefined
var haystack = String(odialog.refLocation);
var needle = String(odialog.refAdditional);
odialog.refLocation = haystack.replace(needle,'');
odialog.refLocation += odialog.refAdditional;
// alert(odialog.refLocation);
}
}
catch(e)
{}
}
function dialog_onUnload(odialog)
{
if (odialog.NoRefresh)
{
odialog.NoRefresh = false;
return;
}
try
{
if (odialog.refWindow == top.opener)
{
top.opener.location = odialog.refLocation;
}
}
catch(e)
{}
odialog.refWindow = null;
odialog.refLocation = null;
}
/**
* Calls the bug delete page when the 'yes' button in the delete confirmation dialog
* was clicked
*
* @param btn string id of the button clicked
* @param text string not used
* @param combinedBugID string like <executionID-tcStepID-bugID>
*/
function deleteBug(btn,text,combinedBugID)
{
var idx;
var executionID;
var tcStepID;
var bugID;
var target;
if (btn != 'yes')
{
return;
}
idx = combinedBugID.indexOf('-');
if (idx < 0)
{
return;
}
executionID = combinedBugID.substr(0,idx);
target = combinedBugID.substr(idx+1);
idx = target.indexOf('-');
tcStepID = target.substr(0,idx)
// TICKET 4814: bug deletion may fails if bugID string contains special characters ('#', '&' , ...)
// bugID string may contain special characters :
// must escape it to get correct bugID value in bugDelete.php
bugID = escape(target.substr(idx+1));
window.open(fRoot+"lib/execute/bugDelete.php?exec_id="+executionID+"&tcstep_id="+tcStepID+"&bug_id="+bugID,
"DeleteBug","width=510,height=150,resizable=yes,dependent=yes");
}
/**
* Calls the script link delete page when the 'yes' button in the delete confirmation dialog
* was clicked
*
* @param btn string id of the button clicked
* @param text string not used
* @param combinedScriptID string like <tprojectID:tcversionID-scriptID>
*/
function deleteScript(btn,text,combinedScriptID)
{
var idx1;
var idx2;
var tprojectID;
var tcversionID;
var scriptID;
if (btn != 'yes')
{
return;
}
idx1 = combinedScriptID.indexOf(':');
idx2 = combinedScriptID.indexOf('-');
if (idx1 < 0 || idx2 < 0)
{
return;
}
tprojectID = combinedScriptID.substr(0,idx1)
tcversionID = combinedScriptID.substr(idx1+1,idx2)
scriptID = escape(combinedScriptID.substr(idx2+1));
window.open(fRoot+"lib/testcases/scriptDelete.php?tproject_id="+tprojectID+"&tcversion_id="+tcversionID+"&script_id="+scriptID,
"DeleteScript","width=510,height=150,resizable=yes,dependent=yes");
}
// seems is not used => do more checks and remove
function planRemoveTC(warning_msg)
{
var cbs = document.getElementsByTagName('input');
var bRemoveTC = false;
var len = cbs.length;
for (var i = 0;i < len;i++)
{
var item = cbs[i];
if (item.type == 'checkbox' && item.checked && item.name.substring(0,17) == "remove_checked_tc")
{
bRemoveTC = true;
break;
}
}
if (bRemoveTC)
{
if (!confirm(warning_msg))
return false;
}
return true;
}
/**
* Open the overview over all Test Cases assigned to a user in a popup window.
* @author Andreas Simon
* @param user_id
* @param build_id
* @param tplan_id
*/
function openAssignmentOverviewWindow(user_id, build_id, tplan_id) {
var url = "lib/testcases/tcAssignedToUser.php";
url += "?user_id=" + user_id + "&build_id=" + build_id + "&tplan_id=" + tplan_id;
// 20101008 - asimon - BUGID 3311
var width = getCookie("AssignmentOverviewWidth");
var height = getCookie("AssignmentOverviewHeight");
if (width == null)
{
var width = "800";
}
if (height == null)
{
var height = "600";
}
var windowCfg = "width="+width+",height="+height+",resizable=yes,scrollbars=yes,dependent=yes";
window.open(fRoot+url, '_blank', windowCfg);
}
/**
* Open testcase description in a popup window.
* @author Andreas Simon
* @param tc_id
*/
function openTCEditWindow(tcase_id,tcversion_id) {
var url = "lib/testcases/archiveData.php?edit=testcase&id=" + tcase_id + "&tcversion_id=" + tcversion_id;
var width = getCookie("TCEditPopupWidth");
var height = getCookie("TCEditPopupHeight");
if (width == null)
{
var width = "800";
}
if (height == null)
{
var height = "600";
}
var windowCfg = "width="+width+",height="+height+",resizable=yes,scrollbars=yes,dependent=yes";
window.open(fRoot+url, '_blank', windowCfg);
}
/**
* Open testcase for execution in a popup window.
* @author Andreas Simon
* @param tc_id
* @param tcversion_id
* @param build_id
* @param tplan_id
* @param platform_id
*/
function openExecutionWindow(tc_id, tcversion_id, build_id, tplan_id, platform_id, whoiam)
{
var url = "lib/execute/execSetResults.php?" + "version_id=" + tcversion_id +
"&level=testcase&id=" + tc_id + "&tplan_id=" + tplan_id +
"&setting_build=" + build_id + "&setting_platform=" + platform_id +
"&caller=" + whoiam;
var width = getCookie("TCExecPopupWidth");
var height = getCookie("TCExecPopupHeight");
if (width == null)
{
var width = "800";
}
if (height == null)
{
var height = "600";
}
var windowCfg = "width="+width+",height="+height+",resizable=yes,scrollbars=yes,dependent=yes";
window.open(fRoot+url, '_blank', windowCfg);
}
/*
function: open_help_window
args :
returns:
*/
function open_help_window(help_page,locale)
{
var windowCfg='';
windowCfg="left=350,top=50,screenX=350,screenY=50,fullscreen=no,resizable=yes," +
"toolbar=no,status=no,menubar=no,scrollbars=yes,directories=no," +
"location=no,width=400,height=650";
window.open(fRoot+"lib/general/show_help.php?help="+help_page+"&locale="+locale,"_blank",windowCfg);
}
/*
function: openTCaseWindow
args: tcase_id: test case id
tcversion_id: test case version id
show_mode: string used on testcase.show() to manage refresh
logic of frames when Edit Test case page is closed.
This argument was added to allow automatic referesh
of frames when user uses the feature that allows
edit a test case while execution it.
returns:
rev :
*/
function openTCaseWindow(tcase_id,tcversion_id,show_mode) {
var feature_url = "lib/testcases/archiveData.php";
feature_url +="?allow_edit=0&show_mode="+show_mode+"&edit=testcase&id="+
tcase_id+"&tcversion_id="+tcversion_id;
var width = getCookie("TCEditPopupWidth");
var height = getCookie("TCEditPopupHeight");
if (width == null) {
var width = "800";
}
if (height == null) {
var height = "600";
}
var windowCfg = "width="+width+",height="+height+",resizable=yes,scrollbars=yes,dependent=yes";
// second parameter(window name) with spaces caused bug on IE
window.open(fRoot+feature_url,"TestCaseSpec",windowCfg);
}
/**
* open a specific version of a requirement in a popup window
*
* @param req_id Requirement ID
* @param req_version_id Requirement Version ID
* @param anchor string with anchor name
*/
function openLinkedReqVersionWindow(req_id, req_version_id, anchor) {
if (anchor == null) {
anchor = '';
} else {
anchor = '#' + anchor;
}
var windowCfg='';
var feature_url = "lib/requirements/reqView.php";
feature_url += "?showReqSpecTitle=1&requirement_id=" + req_id + "&req_version_id=" + req_version_id + anchor;
var width = getCookie("ReqPopupWidth");
var height = getCookie("ReqPopupHeight");
if (width == null) {
var width = "800";
}
if (height == null) {
var height = "600";
}
var windowCfg = "width="+width+",height="+height+",resizable=yes,scrollbars=yes,dependent=yes";
window.open(fRoot+feature_url,"Requirement",windowCfg);
}
/**
* open a requirement in a popup window
*
* @param req_id Requirement ID
* @param anchor string with anchor name