-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview_all.php
1700 lines (1565 loc) · 78.1 KB
/
view_all.php
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
<?php
// ReqHeap - a simple requirement management program.
//
// Copyright (C) 2007 Slav Peev , Matthias Gunter
// Programmed by i-nature.com
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// -----------------------------------------------------------------
//
// Page: "View all" - viewimg all requirements
include("ajax.php");
include("ini/txts/".$_SESSION['chlang']."/state.php");
if ( ! isset($action) ) $action = "";
if ($action=="undo")
{
$query22="select count(*), th_current from tree_history where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR) group by th_current";
$rs22 = mysql_query($query22) or die(mysql_error());
if($row22=mysql_fetch_array($rs22))
{
if ($row22[0]>$row22[1])
{
$query2="select * from tree_history where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR) order by th_id desc limit ".$row22[1].",1";
$rs2 = mysql_query($query2) or die(mysql_error());
if($row2=mysql_fetch_array($rs2))
{
$th_parent_new=$row2['th_parent_new'];
$th_parent_new_pos=$row2['th_parent_new_pos'];
$th_parent_old=$row2['th_parent_old'];
$th_parent_old_pos=$row2['th_parent_old_pos'];
$th_r_id=$row2['th_r_id'];
$th_rh_id=$row2['th_rh_id'];
//delete from requirement history
//$query2="delete from requirements_history where r_id=".$th_rh_id;
//mysql_query($query2) or die(mysql_error());
if ($th_parent_new!=$th_parent_old)
{
//changing positions of nodes of the new parent
$query2="update requirements set r_pos=r_pos+1 where r_pos>=".$th_parent_old_pos." and r_parent_id=".$th_parent_old;
$rs2 = mysql_query($query2) or die(mysql_error());
//changing positions of nodes of the old parent
$query2="update requirements set r_pos=r_pos-1 where r_pos>".$th_parent_new_pos." and r_parent_id=".$th_parent_new;
$rs2 = mysql_query($query2) or die(mysql_error());
$query2="update requirements set r_parent_id=".$th_parent_old.", r_pos=".$th_parent_old_pos." where r_id=".$th_r_id;
mysql_query($query2) or die(mysql_error());
}
else //if parent's positions changed only
{
if ($th_parent_old_pos<$th_parent_new_pos) $query2="update requirements set r_pos=r_pos+1 where (r_pos>=".$th_parent_old_pos." and r_pos<".$th_parent_new_pos.") and r_parent_id=".$th_parent_new." and r_p_id=".$_SESSION['projects'];
else $query2="update requirements set r_pos=r_pos-1 where (r_pos<=".$th_parent_old_pos." and r_pos>".$th_parent_new_pos.") and r_parent_id=".$th_parent_new." and r_p_id=".$_SESSION['projects'];
mysql_query($query2) or die(mysql_error());
$query2="update requirements set r_pos=".$th_parent_old_pos." where r_id=".$th_r_id;
mysql_query($query2) or die(mysql_error());
}
//increment current
$query2="update tree_history set th_current=th_current+1 where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR)";
mysql_query($query2) or die(mysql_error());
}
}
else $err=$lng[17][66];
}
else $err=$lng[17][66];
}
if ($action=="redo")
{
$query22="select th_current from tree_history where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR)";
$rs22 = mysql_query($query22) or die(mysql_error());
if($row22=mysql_fetch_array($rs22))
{
if ($row22[0]>0)
{
$query2="select * from tree_history where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR) order by th_id desc limit ".($row22[0]-1).",1";
$rs2 = mysql_query($query2) or die(mysql_error());
if($row2=mysql_fetch_array($rs2))
{
$th_parent_new=$row2['th_parent_new'];
$th_parent_new_pos=$row2['th_parent_new_pos'];
$th_parent_old=$row2['th_parent_old'];
$th_parent_old_pos=$row2['th_parent_old_pos'];
$th_r_id=$row2['th_r_id'];
$th_rh_id=$row2['th_rh_id'];
//insert into requirement history
//$query2="delete from requirements_history where r_id=".$th_rh_id;
//mysql_query($query2) or die(mysql_error());
if ($th_parent_new!=$th_parent_old)
{
//changing positions of nodes of the new parent
$query2="update requirements set r_pos=r_pos+1 where r_pos>=".$th_parent_new_pos." and r_parent_id=".$th_parent_new;
$rs2 = mysql_query($query2) or die(mysql_error());
//changing positions of nodes of the old parent
$query2="update requirements set r_pos=r_pos-1 where r_pos>".$th_parent_old_pos." and r_parent_id=".$th_parent_old;
$rs2 = mysql_query($query2) or die(mysql_error());
$query2="select max(r_pos) from requirements where r_parent_id=".$th_parent_new." and r_p_id=".$_SESSION['projects'];
$rs2 = mysql_query($query2) or die(mysql_error());
if($row2=mysql_fetch_array($rs2)) $max=$row2[0];
if ($max=="") $max=0;
$query2="update requirements set r_parent_id=".$th_parent_new.", r_pos=".($max+1)." where r_id=".$th_r_id;
mysql_query($query2) or die(mysql_error());
}
else //if parent's positions changed only
{
if ($th_parent_old_pos>$th_parent_new_pos) $query2="update requirements set r_pos=r_pos+1 where (r_pos<".$th_parent_old_pos." and r_pos>=".$th_parent_new_pos.") and r_parent_id=".$th_parent_new." and r_p_id=".$_SESSION['projects'];
else $query2="update requirements set r_pos=r_pos-1 where (r_pos>".$th_parent_old_pos." and r_pos<=".$th_parent_new_pos.") and r_parent_id=".$th_parent_new." and r_p_id=".$_SESSION['projects'];
mysql_query($query2) or die(mysql_error());
$query2="update requirements set r_pos=".$th_parent_new_pos." where r_id=".$th_r_id;
mysql_query($query2) or die(mysql_error());
}
//increment current
$query2="update tree_history set th_current=th_current-1 where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR)";
mysql_query($query2) or die(mysql_error());
}
}
else $err=$lng[17][67];
}
else $err=$lng[17][67];
}
if ($action=="update" && $ids!="" && ($r_assigned_u_id!="" || $r_p_id!="" || $r_s_id!="" || $r_release!="" || $r_state!="" || $r_priority!="" || $r_source!=""))
{
//checking if the project is not retired
//history
$query="select r.*,p.p_status from requirements r left outer join projects p on r.r_p_id=p.p_id where r.r_id in (".$ids."0)";
$rs = mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_array($rs))
{
if ($row['p_status']==2) $tmp="<span class='error'>".$lng[17][43]."</span><br><br>";
else
{
$query="insert into requirements_history (r_parent_id, r_p_id,r_release, r_c_id, r_s_id, r_stakeholder, r_glossary, r_keyword, r_u_id, r_assigned_u_id, r_name, r_desc, r_state, r_type_r, r_priority, r_valid, r_link, r_satisfaction, r_dissatisfaction, r_conflicts, r_depends, r_component, r_source, r_risk, r_complexity, r_weight, r_points, r_creation_date, r_change_date, r_accept_date, r_accept_user, r_version, r_save_date, r_save_user, r_parent_id2, r_pos, r_stub, r_keywords, r_userfield1, r_userfield2, r_userfield3, r_userfield4, r_userfield5, r_userfield6) values ('".$row['r_id']."','".escapeChars($row['r_p_id'])."','".escapeChars($row['r_release'])."','".escapeChars($row['r_c_id'])."','".escapeChars($row['r_s_id'])."','".escapeChars($row['r_stakeholder'])."','".escapeChars($row['r_glossary'])."','".escapeChars($row['r_keyword'])."','".escapeChars($row['r_u_id'])."','".$row['r_assigned_u_id']."','".escapeChars($row['r_name'])."','".escapeChars($row['r_desc'])."','".escapeChars($row['r_state'])."','".escapeChars($row['r_type_r'])."','".escapeChars($row['r_priority'])."','".escapeChars($row['r_valid'])."','".escapeChars($row['r_link'])."','".escapeChars($row['r_satisfaction'])."','".escapeChars($row['r_dissatisfaction'])."','".escapeChars($row['r_conflicts'])."','".escapeChars($row['r_depends'])."','".escapeChars($row['r_component'])."','".escapeChars($row['r_source'])."','".escapeChars($row['r_risk'])."','".escapeChars($row['r_complexity'])."','".escapeChars($row['r_weight'])."','".escapeChars($row['r_points'])."','".escapeChars($row['r_creation_date'])."','".escapeChars($row['r_change_date'])."','".escapeChars($row['r_accept_date'])."','".escapeChars($row['r_accept_user'])."','".escapeChars($row['r_version'])."',DATE_ADD( NOW( ) , INTERVAL - ".TIME_DIFF_HOURS." HOUR),'".$_SESSION['uid']."','".escapeChars($row['r_parent_id'])."','".escapeChars($row['r_pos'])."','".escapeChars($row['r_stub'])."','".escapeChars($row['r_keywords'])."','".escapeChars($row['r_userfield1'])."','".escapeChars($row['r_userfield2'])."','".escapeChars($row['r_userfield3'])."','".escapeChars($row['r_userfield4'])."','".escapeChars($row['r_userfield5'])."','".escapeChars($row['r_userfield6'])."')";
mysql_query($query) or die(mysql_error());
//subproject
if ($r_s_id!="") $q.=", r_s_id='".escapeChars($r_s_id)."' ";
//subproject
if ($r_release=="0") $q.=", r_release=''";
elseif ($r_release!="") $q.=", r_release=concat(r_release,'".escapeChars($r_release).",')";
//assigned user
if ($r_assigned_u_id!="") $q.=", r_assigned_u_id='".escapeChars($r_assigned_u_id)."' ";
//project
if ($r_p_id!="") $q.=", r_p_id='".escapeChars($r_p_id)."' ";
//state
//if ($_SESSION['rights']==1 || $_SESSION['rights']==2 || $_SESSION['rights']==3)
if ($r_state!="")
{
//if accepted date and user should be added
if ($r_state=="1" && $row['r_state']!=1) $q.=", r_state='".escapeChars($r_state)."', r_accept_date=DATE_ADD( NOW( ) , INTERVAL - ".TIME_DIFF_HOURS." HOUR), r_accept_user='".$_SESSION['uid']."'";
else $q.=", r_state='".escapeChars($r_state)."'";
}
//priority
if ($r_priority!="") $q.=", r_priority='".escapeChars($r_priority)."' ";
//source
if ($r_source!="") $q.=", r_source='".escapeChars($r_source)."' ";
$query="update requirements set r_version=r_version+1, r_change_date=DATE_ADD( NOW( ) , INTERVAL - ".TIME_DIFF_HOURS." HOUR) ".$q." where r_id=".$row['r_id'];
mysql_query($query) or die(mysql_error());
}
}
}
?>
<?if ( ! isset($tmp) ) $tmp = ""; if ($tmp!="") echo $tmp;?>
<?
//if tree view
if ($_SESSION['_viewalltype']==0)
{
//check if logged
if (!($_SESSION['rights']=="1" || $_SESSION['rights']=="2" || $_SESSION['rights']=="3" || $_SESSION['rights']=="4" || $_SESSION['rights']=="5")) header("Location:index.php");
$current=0;$all_c=0;
//getting info from undo/redoes
$query2="select count(*), th_current from tree_history where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR) group by th_current";
$rs2 = mysql_query($query2) or die(mysql_error());
if($row2=mysql_fetch_array($rs2))
{
$all_c=$row2[0];
$current=$row2[1];
}
if ($current>$all_c)
{
$query2="update tree_history set th_current=".$all_c." where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR)";
mysql_query($query2) or die(mysql_error());
}
?>
<form method="post" action="" name="req">
<input type=hidden name=from value="<?=$from?>">
<input type=hidden name=order value="">
<input type=hidden name=ids value="<?=$ids?>">
<input type=hidden name=action value="">
<input type=hidden name=filter11 value="<?=$filter11?>">
<table border="0" width="100%">
<tr valign="top">
<td valign="top">
<table border="0" cellpadding="2" cellspacing="2" class="content" width="50%">
<tr>
<td valign="top" align="left" class="gray" nowrap>
<?=$lng[17][3]?>: <select name=filter1>
<option value="">--
<?
//users list
$query4="select u_name, u_id from users where u_rights in (0,1,2,3,4,5) order by u_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
echo "<option value='".$row4['u_id']."'>".htmlspecialchars($row4['u_name']);
}
?>
</select>
<script>
for (i=0;i<document.forms.req.filter1.length;i++)
if (document.forms.req.filter1.options[i].value=='<?=$filter1?>')
document.forms.req.filter1.options[i].selected=true;
</script>
<?=$lng[17][16]?>: <select name=filter2>
<option value="">--
<?//state list
include("ini/txts/".$_SESSION['chlang']."/state.php");
echo makeSelect($state_array,$r_state);
?>
</select>
<script>
for (i=0;i<document.forms.req.filter2.length;i++)
if (document.forms.req.filter2.options[i].value=='<?=$filter2?>')
document.forms.req.filter2.options[i].selected=true;
</script>
<?=$lng[17][5]?>: <select name=filter4>
<option value="">--
<option value='1'>1 <?=$lng[15][101]?>
<option value='2'>2
<option value='3'>3
<option value='4'>4
<option value='5'>5
<option value='6'>6
<option value='7'>7
<option value='8'>8
<option value='9'>9
<option value='10'>10 <?=$lng[15][102]?>
</select>
<script>
for (i=0;i<document.forms.req.filter4.length;i++)
if (document.forms.req.filter4.options[i].value=='<?=$filter4?>')
document.forms.req.filter4.options[i].selected=true;
</script>
<?=$lng[17][4]?>:
<select name="filter6">
<option value="">--
<?
//users list
$query4="select u_name, u_id from users where u_rights in (0,1,2,3,4,5) order by u_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if ($row4['u_id']==$filter6) echo "<option value='".$row4['u_id']."' selected>".htmlspecialchars($row4['u_name']);
else echo "<option value='".$row4['u_id']."'>".htmlspecialchars($row4['u_name']);
}
?>
</select>
<?=$lng[17][36]?>:
<select name="filter7">
<option value="">--
<?
//releases list
//$query4="select * from releases order by r_name asc";
$query4="select r.* from releases r left outer join project_releases pr on r.r_id=pr.pr_r_id where (pr.pr_p_id in ('".$project_list."') or r.r_global=1 ) order by r.r_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if ($row4['r_id']==$filter7) echo "<option value='".$row4['r_id']."' selected>".htmlspecialchars($row4['r_name']);
else echo "<option value='".$row4['r_id']."'>".htmlspecialchars($row4['r_name']);
}
?>
</select>
</td>
</tr>
<tr>
<td align="left" class="gray" nowrap valign="top">
<?=$lng[17][42]?>: <select name=filter8>
<option value="">--
<?
//components list
//$query4="select * from components order by c_name asc";
$query4="select c.* from components c left outer join project_components pco on c.c_id=pco.pco_c_id where (pco.pco_p_id in ('".$project_list."') or c.c_global=1 ) order by c.c_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if ($row4['c_id']==$filter8) echo "<option value='".$row4['c_id']."' selected>".htmlspecialchars($row4['c_name']);
else echo "<option value='".$row4['c_id']."'>".htmlspecialchars($row4['c_name']);
}
?>
</select>
<script>
for (i=0;i<document.forms.req.filter8.length;i++)
if (document.forms.req.filter8.options[i].value=='<?=$filter8?>')
document.forms.req.filter8.options[i].selected=true;
</script>
<?=$lng[17][45]?>: <select name=filter9>
<option value="0"><?=$lng[17][46]?>
<option value="1"><?=$lng[17][47]?>
<option value="2"><?=$lng[17][51]?>
</select>
<script>
for (i=0;i<document.forms.req.filter9.length;i++)
if (document.forms.req.filter9.options[i].value=='<?=$filter9?>')
document.forms.req.filter9.options[i].selected=true;
</script>
<?=$lng[17][48]?>: <select name=filter10>
<option value="0"><?=$lng[17][49]?>
<option value="1"><?=$lng[17][50]?>
</select>
<script>
for (i=0;i<document.forms.req.filter10.length;i++)
if (document.forms.req.filter10.options[i].value=='<?=$filter10?>')
document.forms.req.filter10.options[i].selected=true;
</script>
<?=$lng[2][35]?>: <select name=filter18>
<option value="">--
<?
//test cases list
//$query4="select * from cases order by c_name asc";
$query4="select c.* from cases c left outer join project_cases pc on c.c_id=pc.pc_c_id where (pc.pc_p_id in ('".$project_list."') or c.c_global=1 ) order by c.c_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if ($row4['c_id']==$filter18) echo "<option value='".$row4['c_id']."' selected>".htmlspecialchars($row4['c_name']);
else echo "<option value='".$row4['c_id']."'>".htmlspecialchars($row4['c_name']);
}
?>
</select>
<script>
for (i=0;i<document.forms.req.filter18.length;i++)
if (document.forms.req.filter18.options[i].value=='<?=$filter18?>')
document.forms.req.filter18.options[i].selected=true;
</script>
</td>
</tr>
<tr valign="top">
<td align="left" class="gray" nowrap valign="top">
<table border=0 cellspacing=0 cellpadding=0>
<tr valign="top">
<td valign="top" rowspan="2">
<?=$lng[17][52]?>:
</td>
<td rowspan="2">
<select name=filter11_tmp multiple size=3>
<?
//keywords list
//$query4="select * from keywords order by k_name asc";
$query4="select k.* from keywords k left outer join project_keywords pk on k.k_id=pk.pk_k_id where (pk.pk_p_id in ('".$project_list."') or k.k_global=1 ) order by k.k_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if (strstr(",".$filter11,",".$row4['k_id'].",")) echo "<option value='".$row4['k_id']."' selected>".htmlspecialchars($row4['k_name']);
else echo "<option value='".$row4['k_id']."'>".htmlspecialchars($row4['k_name']);
}
?>
</select>
<script>
for (i=0;i<document.forms.req.filter11.length;i++)
if (document.forms.req.filter11.options[i].value=='<?=$filter11?>')
document.forms.req.filter11.options[i].selected=true;
</script>
</td>
<td>
<img src="x.gif" width=8 height=1><?=$lng[17][53]?> <input type="radio" name="filter12" value="<?=$lng[17][53]?>" <?if ($filter12=="" || $filter12==$lng[17][53]) echo "checked";?>>
</td>
<td rowspan="2">
<?=$lng[17][55]?>:
<select name=filter13>
<option value="">--
<option value="1"><?=$lng[17][56]?>
<option value="2"><?=$lng[17][57]?>
<option value="3"><?=$lng[17][58]?>
<option value="5"><?=$lng[17][60]?>
<option value="6"><?=$lng[17][61]?>
</select>
<script>
for (i=0;i<document.forms.req.filter13.length;i++)
if (document.forms.req.filter13.options[i].value=='<?=$filter13?>')
document.forms.req.filter13.options[i].selected=true;
</script>
</td>
<td rowspan="2">
<?=$lng[17][72]?>: <select name=filter14>
<option value="">--
<?
//users list
$query4="select u_name, u_id from users order by u_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if ($row4['u_id']==$filter14) echo "<option value='".$row4['u_id']."' selected>".htmlspecialchars($row4['u_name']);
else echo "<option value='".$row4['u_id']."'>".htmlspecialchars($row4['u_name']);
}
?>
</select>
</td>
</tr>
<tr>
<td>
<?=$lng[17][54]?> <input type="radio" name="filter12" value="<?=$lng[17][54]?>"<?if ($filter12==$lng[17][54]) echo "checked";?>>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" class="gray" nowrap valign="top">
<?=$lng[17][73]?>: <input type="text" size=2 name="filter15_3" value="<?=stripslashes(htmlspecialchars($filter15_3))?>"> <?=$lng[17][83]?> <input type="text" size=2 name="filter15_1" value="<?=stripslashes(htmlspecialchars($filter15_1))?>">(<?=$lng[17][74]?>) <input type="text" size=2 name="filter15_2" value="<?=stripslashes(htmlspecialchars($filter15_2))?>">(<?=$lng[17][75]?>)
<?=$lng[17][18]?>: <input type="text" size=30 name="filter5" value="<?=stripslashes(htmlspecialchars($filter5))?>"> <input type="submit" onclick="if (!sub_search()) return false;" value="<?=$lng[17][17]?>"> <input type="button" onclick="document.location.href='index.php?inc=view_all'" value="<?=$lng[17][79]?>">
</td>
</tr>
</table>
</td>
</tr>
<tr valign="top">
<td>
<br>
</td>
</tr>
</table>
<?
//sortable columns
if ($order=="") $order="r_change_date desc";
//search
if ($filter1!="") $search.=" and r.r_u_id=".$filter1;
if ($filter2!="") $search.=" and r.r_state=".$filter2;
if ($filter4!="") $search.=" and r.r_priority=".$filter4;
if ($filter5!="")
{
$query4="select * from comments where c_text like('%".escapeChars($filter5)."%')";
$rs4 = mysql_query($query4) or die(mysql_error());
$new_pr29="(0";
while($row4=mysql_fetch_array($rs4))
{
$new_pr29.=",".$row4['c_r_id'];
}
$new_pr29.=")";
//$search.=" and r.r_id in ".$new_pr29;
$search.=" and (r.r_id in ".$new_pr29." or (r.r_desc like ('%".escapeChars($filter5)."%') or r.r_source like ('%".escapeChars($filter5)."%') or r.r_name like ('%".escapeChars($filter5)."%') or r.r_userfield1 like ('%".escapeChars($filter5)."%') or r.r_userfield2 like ('%".escapeChars($filter5)."%') or r.r_userfield3 like ('%".escapeChars($filter5)."%') or r.r_userfield4 like ('%".escapeChars($filter5)."%') or r.r_userfield5 like ('%".escapeChars($filter5)."%') or r.r_userfield6 like ('%".escapeChars($filter5)."%')))";
}
if ($filter6!="") $search.=" and r.r_assigned_u_id=".$filter6;
if ($filter7!="")
{
$search.=" and CONCAT(',',r.r_release) like ('%,".$filter7.",%')";
/*$query4="select * from project_releases where pr_r_id=".$filter7;
$rs4 = mysql_query($query4) or die(mysql_error());
$new_pr="(0";
while($row4=mysql_fetch_array($rs4))
{
$new_pr.=",".$row4['pr_p_id'];
}
$new_pr.=")";
$search.=" and r.r_p_id in ".$new_pr;*/
}
if ($filter8!="") $search.=" and CONCAT(',',r.r_component) like ('%,".$filter8.",%')";
if ($filter9=="1") $search.=" and r.r_stub=".$filter9;
elseif ($filter9=="2") $search.=" and r.r_stub=".$filter9;
if ($filter10=="1")
{
$query4="select * from comments where c_question=1";
$rs4 = mysql_query($query4) or die(mysql_error());
$new_pr2="(0";
while($row4=mysql_fetch_array($rs4))
{
$new_pr2.=",".$row4['c_r_id'];
}
$new_pr2.=")";
$search.=" and r.r_id in ".$new_pr2;
}
if ($filter11!="")
{
$cnt_k=0;
$search.=" and (";
$kwrds = explode(",", $filter11);
while (list ($key, $val) = each ($kwrds))
{
if ($val!="")
{
if ($cnt_k==0) $search.=" CONCAT(',',r.r_keywords) like ('%,".$val.",%')";
else $search.=" ".$filter12." CONCAT(',',r.r_keywords) like ('%,".$val.",%')";
$cnt_k++;
}
}
$search.=")";
}
if ($filter13!="")
{
if ($filter13==1) $search.=" and r.r_u_id='0'";
elseif ($filter13==2) $search.=" and r.r_assigned_u_id='0'";
elseif ($filter13==3) $search.=" and r.r_component=''";
//elseif ($filter13==4) $search.=" and r.r_assigned_u_id='0'";
elseif ($filter13==5) $search.=" and r.r_keywords=''";
elseif ($filter13==6) $search.=" and r.r_c_id=''";
}
if ($filter14!="")
{
$query4="select * from comments where c_u_id=".$filter14;
$rs4 = mysql_query($query4) or die(mysql_error());
$new_pr29="(0";
while($row4=mysql_fetch_array($rs4))
{
$new_pr29.=",".$row4['c_r_id'];
}
$new_pr29.=")";
$search.=" and r.r_id in ".$new_pr29;
}
if ($filter15_3!="") $search.=" and (r.r_id=".$filter15_3.")";
else
{
if ($filter15_1!="" && $filter15_2!="") $search.=" and (r.r_id>=".$filter15_1." and r.r_id<=".$filter15_2.")";
if ($filter15_1!="" && $filter15_2=="") $search.=" and r.r_id>=".$filter15_1;
if ($filter15_1=="" && $filter15_2!="") $search.=" and r.r_id<=".$filter15_2;
}
if ($filter18!="") $search.=" and CONCAT(',',r.r_c_id) like ('%,".$filter18.",%')";
//paging query, number of results (from the param.php file) per page displayed
$paging=$PPAGE;
$query="select count(*) from requirements r left outer join projects p on r.r_p_id=p.p_id where r.r_p_id in (".$project_list.")".$search;
$rs = mysql_query($query) or die(mysql_error());
if($row=mysql_fetch_array($rs)) $all_count=$row[0];
if ($from=="") $from=0;
if ($from+$paging>$all_count) $cnt2=$all_count;
else $cnt2=$from+$paging;
//getting requirements - recently modified
$cnt=0;
$r_ids=",";
$query="select r.* from requirements r left outer join projects p on r.r_p_id=p.p_id left outer join users u on r.r_u_id=u.u_id left outer join users u2 on r.r_assigned_u_id=u2.u_id where r.r_p_id in (".$project_list.") ".$search;
$rs = mysql_query($query) or die(mysql_error());
while($row=mysql_fetch_array($rs)) $r_ids.=$row['r_id'].",";
$pieces = explode(",", $r_ids);
while (list ($key, $val) = each ($pieces)) if ($val!="") $parent_ids.=",".checkTree($val);
?>
<input type=hidden name=viewalltype value="tree">
<input type=hidden name=srch value="<?=$search?>">
</form>
<table border=0 width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top" width="40%">
<?if ($err!="") echo "<span class='error'>".$err."</span><br><br>";?>
<?
/* $query2="select * from tree_history where th_u_id=".$_SESSION['uid']." and th_p_id=".$_SESSION['projects']." and th_date>=DATE_SUB(now(), INTERVAL 1 HOUR)";
$rs2 = mysql_query($query2) or die(mysql_error());
while($row2=mysql_fetch_array($rs2))
{
echo $row2['th_r_id']." - ".$row2['th_parent_old']." - ".$row2['th_parent_old_pos']." - ".$row2['th_parent_new']." - ".$row2['th_parent_new_pos']." - ".$row2['th_current']."<br>";
}
echo "<br>";
$query2="select * from requirements where r_p_id=20 order by r_pos asc";
$rs2 = mysql_query($query2) or die(mysql_error());
while($row2=mysql_fetch_array($rs2))
{
echo $row2['r_id']."(".$row2['r_name'].") - ".$row2['r_pos']."<br>";
}
echo "<br>";
*/
?>
<form action="" name="undo_form" method="post">
<input type="hidden" name="par_id" value="<?=$par_id?>">
<input type="hidden" name="inc" value="view_all">
<input type="hidden" name="action" value="">
<input type=hidden name=filter1 value="<?=$filter1?>">
<input type=hidden name=filter2 value="<?=$filter2?>">
<input type=hidden name=filter4 value="<?=$filter4?>">
<input type=hidden name=filter5 value="<?=$filter5?>">
<input type=hidden name=filter6 value="<?=$filter6?>">
<input type=hidden name=filter7 value="<?=$filter7?>">
<input type=hidden name=filter8 value="<?=$filter8?>">
<input type=hidden name=filter9 value="<?=$filter9?>">
<input type=hidden name=filter10 value="<?=$filter10?>">
<input type=hidden name=filter11 value="<?=$filter11?>">
<input type=hidden name=filter12 value="<?=$filter12?>">
<input type=hidden name=filter13 value="<?=$filter13?>">
<input type=hidden name=filter14 value="<?=$filter14?>">
<input type=hidden name=filter15_1 value="<?=$filter15_1?>">
<input type=hidden name=filter15_2 value="<?=$filter15_2?>">
<input type=hidden name=filter15_3 value="<?=$filter15_3?>">
</form>
<?if ($parent_ids!="") {?>
<img src="img/x.gif" width="5" height="1"><input type="button" value="<?=$lng[17][64]?>" onclick="document.forms['undo_form'].action.value='undo';document.forms['undo_form'].submit();">
<input type="button" value="<?=$lng[17][65]?>" onclick="document.forms['undo_form'].action.value='redo';document.forms['undo_form'].submit();">
<br><br>
<?}?>
<script src="dhtmlxTree/codebase/dhtmlxcommon.js"></script>
<script src="dhtmlxTree/codebase/dhtmlxtree.js"></script>
<div id="treeboxbox_tree" style="width:200;height:200">
<?if ($parent_ids!="") {?>
<table border=0 width="100%"><tr><td nowrap><?=$lng[17][62]?><br/></td></tr></table>
</div>
<?}?>
<script>
function myDragHandler(idFrom,idTo){
//if we return false then drag&drop be aborted
//alert(idTo);
x_submitOrder(idTo, idFrom, showData);
//document.getElementById(row.id).style.background='#FCBABA';
return true;
}
<?php
//include ajax generated javascript functions
sajax_show_javascript();
?>
function showData(q) {
//var now = new Date();
//document.getElementById('debug').innerHTML="<br>Categories order was updated successfully.<br>"+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds()+"";
}
tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
tree.enableThreeStateCheckboxes(true);
tree.setImagePath("dhtmlxTree/codebase/imgs/");
//enable Drag&Drop
tree.enableDragAndDrop(1);
//tree.enableSmartRendering(true);
tree.enableCheckBoxes(1);
//set my Drag&Drop handler
tree.setDragHandler(myDragHandler);
//tree.loadXML("dhtmlxTree/samples/events/tree.xml");
</script>
<?
//if ($parent_ids=="") $query="select * from requirements where r_p_id in (".$project_list.") and r_parent_id=0 order by r_pos asc";
//else
$query="select * from requirements where r_p_id in (".$project_list.") and r_id in (0".$parent_ids.") and r_parent_id=0 order by r_pos asc";
$rs = mysql_query($query) or die(mysql_error());
$cnt3=0;
while($row=mysql_fetch_array($rs))
{
$cnt3++;
$arr[]=$cnt3."|".$row['r_id'];
getTree2($row['r_id'],$cnt3,$arr);
}
$tmpOrder="";
while ($cnt3>0 && list ($key, $val) = each ($arr))
{
$query="select r.*, date_format(r.r_creation_date, '%d.%m.%Y %H:%i') as d1, date_format(r.r_change_date, '%d.%m.%Y %H:%i') as d2, p.p_id,p.p_name,u.u_name,u2.u_name as u_name2 from requirements r left outer join projects p on r.r_p_id=p.p_id left outer join users u on r.r_u_id=u.u_id left outer join users u2 on r.r_assigned_u_id=u2.u_id where r_id=".substr($val,strpos($val,"|")+1)." and r.r_p_id in (".$project_list.") order by r_change_date desc";
$rs = mysql_query($query) or die(mysql_error());
if($row=mysql_fetch_array($rs))
{
$cnt++;
if (mktime (0,0,0,date("m"),date("d")-2,date("Y")) < mktime (0,0,0,substr($row['d2'],3,2),substr($row['d2'],0,2),substr($row['d2'],6,4))) $new=1;
else $new=0;
//setting row colours
$cl=$state_colors_array[$row['r_state']];
$req_id=$row['r_id'];
$tmpOrder.=$req_id."|";
$match="";
if (strstr($r_ids,",".$req_id.",") && $search!="") $match=" style='color:red'";
?>
<script>
tree.insertNewChild(<?=$row['r_parent_id']?>,<?=$row['r_id']?>,"<a href='index.php?inc=view_requirement&r_id=<?=$row['r_id']?>' <?=$match?>><?=htmlspecialchars($row['r_name'])?></a> (<a onclick=document.location.href='index.php?inc=view_all&par_id=<?=$row['r_parent_id']?>'><?=$lng[17][70]?></a>)",0,0,0,0,"");
</script>
<? }
}
?>
<script>
tree.closeAllItems(0);
</script><?
if ($par_id=="") $par_id=0;
$query="select * from requirements where r_id=".$par_id;
$rs = mysql_query($query) or die(mysql_error());
if($row=mysql_fetch_array($rs)) $parent_name=$row['r_name'];
if($parent_name=="") $parent_name="root";
?>
</td>
<td width="60%" valign="top" align="left">
<?if ($parent_ids=="") {echo "<br/><span class='error'>".$lng[17][82]."</span><br/><br/>";}else{?>
<br><img src="img/x.gif" width="1" height="20"><br/><?=$lng[17][69]?><br/><br/>
<table border="0" cellpadding="2" cellspacing="2" class="content" id="table-1">
<tr class="">
<td nowrap colspan="7"><?=$lng[17][71]?>: <?=htmlspecialchars($parent_name)?></td>
</tr>
<tr class="light_blue">
<td nowrap> </td>
<td nowrap> <?=$lng[17][2]?></td>
<td nowrap> <?=$lng[17][7]?></td>
<td nowrap> <?=$lng[17][36]?></td>
<td nowrap> <?=$lng[17][3]?></td>
<td nowrap> <?=$lng[17][6]?></td>
<td nowrap> <?=$lng[17][8]?></td>
</tr>
<?
$query="select * from requirements where r_p_id in (".$project_list.") and r_parent_id=".$par_id." order by r_pos asc";
$rs = mysql_query($query) or die(mysql_error());
$cnt3=0;
while($row=mysql_fetch_array($rs))
{
$cnt3++;
$arr[]=$cnt3."|".$row['r_id'];
getTree2($row['r_id'],$cnt3,$arr);
}
$tmpOrder="";
while ($cnt3>0 && list ($key, $val) = each ($arr))
{
$query="select r.*, date_format(r.r_creation_date, '%d.%m.%Y %H:%i') as d1, date_format(r.r_change_date, '%d.%m.%Y %H:%i') as d2, p.p_id,p.p_name,u.u_name,u2.u_name as u_name2 from requirements r left outer join projects p on r.r_p_id=p.p_id left outer join users u on r.r_u_id=u.u_id left outer join users u2 on r.r_assigned_u_id=u2.u_id where r_id=".substr($val,strpos($val,"|")+1)." and r.r_parent_id=".$par_id." and r.r_p_id in (".$project_list.") ".$search." order by r_pos asc";
$rs = mysql_query($query) or die(mysql_error());
if($row=mysql_fetch_array($rs))
{
$cnt++;
if (mktime (0,0,0,date("m"),date("d")-2,date("Y")) < mktime (0,0,0,substr($row['d2'],3,2),substr($row['d2'],0,2),substr($row['d2'],6,4))) $new=1;
else $new=0;
$tmpOrder.=$row['r_id']."|";
?>
<tr id="<?=$row['r_id']?>" name="<?=substr($val,0,strpos($val,"|"))?>" class="blue" style="background-color:white;">
<td valign="middle" align=right><img src="dhtmlxTree/codebase/imgs/leaf.gif" align="middle"></td>
<td valign="middle"> <?=$new?"<b>":""?><?=htmlspecialchars($row['r_name'])?><?=$new?"</b>":""?></td>
<td valign="middle"> <a href="index.php?inc=view_project&p_id=<?=$row['p_id']?>"><?=$new?"<b>":""?><?=htmlspecialchars($row['p_name'])?><?=$new?"</b>":""?></a></td>
<td valign="middle">
<?
$query2="select r.*, date_format(r.r_date, '%d.%m.%Y') as d1, date_format(r.r_released_date, '%d.%m.%Y') as d2 from project_releases pr left outer join releases r on pr.pr_r_id=r.r_id where pr.pr_p_id='".$row['p_id']."' order by r.r_name asc";
$rs2 = mysql_query($query2) or die(mysql_error());
while($row2=mysql_fetch_array($rs2))
{
echo "<a href='index.php?inc=view_release&r_id=".$row2['r_id']."'>".htmlspecialchars($row2['r_name'])."</a>";
echo "; ";
}
?>
</td>
<td valign="middle"> <?=$new?"<b>":""?><?=htmlspecialchars($row['u_name'])?><?=$new?"</b>":""?></td>
<td valign="middle" width="110"> <?=$new?"<b>":""?><?=htmlspecialchars($row['d1'])?><?=$new?"</b>":""?></td>
<td valign="middle" width="110"> <?=$new?"<b>":""?><?=($row['d2']!="00.00.0000 00:00")?$row['d2']:"(".$row['d1'].")"?><?=$new?"</b>":""?></td>
</tr>
<?
}
}
?>
</table>
<?}?>
</td>
</tr>
</table>
<?
}
else //if normal view selected
{
$query="select * from requirements where r_p_id in (".$project_list.") and r_parent_id=0 order by r_pos asc";
$rs = mysql_query($query) or die(mysql_error());
$cnt45=0;
while($row=mysql_fetch_array($rs))
{
$cnt45++;
$arr45[]=$cnt45."|".$row['r_id'];
$arr45_1[]=$row['r_id'];
getTree2_1($row['r_id'],$cnt45,$arr45,$arr45_1);
}
?>
<form method="post" action="" name="req">
<input type=hidden name=from value="<?=$from?>">
<input type=hidden name=order value="">
<input type=hidden name=ids value="<?=$ids?>">
<input type=hidden name=action value="">
<input type=hidden name=filter11 value="<?=$filter11?>">
<table border="0" width="100%">
<tr valign="top">
<td valign="top">
<table border="0" cellpadding="2" cellspacing="2" class="content" width="50%">
<tr>
<td valign="top" align="left" class="gray" nowrap>
<?=$lng[17][3]?>: <select name=filter1>
<option value="">--
<?
//users list
$query4="select u_name, u_id from users where u_rights in (0,1,2,3,4,5) order by u_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
echo "<option value='".$row4['u_id']."'>".htmlspecialchars($row4['u_name']);
}
?>
</select>
<script>
for (i=0;i<document.forms.req.filter1.length;i++)
if (document.forms.req.filter1.options[i].value=='<?=$filter1?>')
document.forms.req.filter1.options[i].selected=true;
</script>
<?=$lng[17][16]?>: <select name=filter2>
<option value="">--
<?//state list
include("ini/txts/".$_SESSION['chlang']."/state.php");
if ( ! isset($r_state) ) $r_state="";
echo makeSelect($state_array,$r_state);
?>
</select>
<script>
for (i=0;i<document.forms.req.filter2.length;i++)
if (document.forms.req.filter2.options[i].value=='<?=$filter2?>')
document.forms.req.filter2.options[i].selected=true;
</script>
<?=$lng[17][5]?>: <select name=filter4>
<option value="">--
<option value='1'>1 <?=$lng[15][101]?>
<option value='2'>2
<option value='3'>3
<option value='4'>4
<option value='5'>5
<option value='6'>6
<option value='7'>7
<option value='8'>8
<option value='9'>9
<option value='10'>10 <?=$lng[15][102]?>
</select>
<script>
for (i=0;i<document.forms.req.filter4.length;i++)
if (document.forms.req.filter4.options[i].value=='<?=$filter4?>')
document.forms.req.filter4.options[i].selected=true;
</script>
<?=$lng[17][4]?>:
<select name="filter6">
<option value="">--
<?
//users list
$query4="select u_name, u_id from users where u_rights in (0,1,2,3,4,5) order by u_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
if ( ! isset($filter6) ) $filter6="";
while($row4=mysql_fetch_array($rs4))
{
if ($row4['u_id']==$filter6) echo "<option value='".$row4['u_id']."' selected>".htmlspecialchars($row4['u_name']);
else echo "<option value='".$row4['u_id']."'>".htmlspecialchars($row4['u_name']);
}
?>
</select>
<?=$lng[17][36]?>:
<select name="filter7">
<option value="">--
<?
//releases list
//$query4="select * from releases order by r_name asc";
$query4="select r.* from releases r left outer join project_releases pr on r.r_id=pr.pr_r_id where (pr.pr_p_id in ('".$project_list."') or r.r_global=1 ) order by r.r_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if ($row4['r_id']==$filter7) echo "<option value='".$row4['r_id']."' selected>".htmlspecialchars($row4['r_name']);
else echo "<option value='".$row4['r_id']."'>".htmlspecialchars($row4['r_name']);
}
?>
</select>
</td>
</tr>
<tr>
<td align="left" class="gray" nowrap valign="top">
<?=$lng[17][42]?>: <select name=filter8>
<option value="">--
<?
//components list
//$query4="select * from components order by c_name asc";
$query4="select c.* from components c left outer join project_components pco on c.c_id=pco.pco_c_id where (pco.pco_p_id in ('".$project_list."') or c.c_global=1 ) order by c.c_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if ($row4['c_id']==$filter8) echo "<option value='".$row4['c_id']."' selected>".htmlspecialchars($row4['c_name']);
else echo "<option value='".$row4['c_id']."'>".htmlspecialchars($row4['c_name']);
}
?>
</select>
<script>
for (i=0;i<document.forms.req.filter8.length;i++)
if (document.forms.req.filter8.options[i].value=='<?=$filter8?>')
document.forms.req.filter8.options[i].selected=true;
</script>
<?=$lng[17][45]?>: <select name=filter9>
<option value="0"><?=$lng[17][46]?>
<option value="1"><?=$lng[17][47]?>
<option value="2"><?=$lng[17][51]?>
</select>
<script>
for (i=0;i<document.forms.req.filter9.length;i++)
if (document.forms.req.filter9.options[i].value=='<?=$filter9?>')
document.forms.req.filter9.options[i].selected=true;
</script>
<?=$lng[17][48]?>: <select name=filter10>
<option value="0"><?=$lng[17][49]?>
<option value="1"><?=$lng[17][50]?>
</select>
<script>
for (i=0;i<document.forms.req.filter10.length;i++)
if (document.forms.req.filter10.options[i].value=='<?=$filter10?>')
document.forms.req.filter10.options[i].selected=true;
</script>
<?=$lng[2][35]?>: <select name=filter18>
<option value="">--
<?
//test cases list
//$query4="select * from cases order by c_name asc";
$query4="select c.* from cases c left outer join project_cases pc on c.c_id=pc.pc_c_id where (pc.pc_p_id in ('".$project_list."') or c.c_global=1 ) order by c.c_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if ($row4['c_id']==$filter18) echo "<option value='".$row4['c_id']."' selected>".htmlspecialchars($row4['c_name']);
else echo "<option value='".$row4['c_id']."'>".htmlspecialchars($row4['c_name']);
}
?>
</select>
<script>
for (i=0;i<document.forms.req.filter18.length;i++)
if (document.forms.req.filter18.options[i].value=='<?=$filter18?>')
document.forms.req.filter18.options[i].selected=true;
</script>
</td>
</tr>
<tr valign="top">
<td align="left" class="gray" nowrap valign="top">
<table border=0 cellspacing=0 cellpadding=0>
<tr valign="top">
<td valign="top" rowspan="2">
<?=$lng[17][52]?>:
</td>
<td rowspan="2">
<select name=filter11_tmp multiple size=3>
<?
//keywords list
//$query4="select * from keywords order by k_name asc";
$query4="select k.* from keywords k left outer join project_keywords pk on k.k_id=pk.pk_k_id where (pk.pk_p_id in ('".$project_list."') or k.k_global=1 ) order by k.k_name asc";
$rs4 = mysql_query($query4) or die(mysql_error());
while($row4=mysql_fetch_array($rs4))
{
if (strstr(",".$filter11,",".$row4['k_id'].",")) echo "<option value='".$row4['k_id']."' selected>".htmlspecialchars($row4['k_name']);