forked from mantisbt/mantisbt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolumns_api.php
1691 lines (1528 loc) · 55.2 KB
/
columns_api.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
# MantisBT - A PHP based bugtracking system
# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT. If not, see <http://www.gnu.org/licenses/>.
/**
* Columns API
*
* @package CoreAPI
* @subpackage ColumnsAPI
* @copyright Copyright 2000 - 2002 Kenzaburo Ito - [email protected]
* @copyright Copyright 2002 MantisBT Team - [email protected]
* @link http://www.mantisbt.org
*
* @uses access_api.php
* @uses bug_api.php
* @uses category_api.php
* @uses config_api.php
* @uses constant_inc.php
* @uses custom_field_api.php
* @uses date_api.php
* @uses error_api.php
* @uses event_api.php
* @uses file_api.php
* @uses helper_api.php
* @uses icon_api.php
* @uses lang_api.php
* @uses prepare_api.php
* @uses print_api.php
* @uses project_api.php
* @uses sponsorship_api.php
* @uses string_api.php
*/
require_api( 'access_api.php' );
require_api( 'bug_api.php' );
require_api( 'category_api.php' );
require_api( 'columns_api.php' );
require_api( 'config_api.php' );
require_api( 'constant_inc.php' );
require_api( 'custom_field_api.php' );
require_api( 'date_api.php' );
require_api( 'error_api.php' );
require_api( 'event_api.php' );
require_api( 'file_api.php' );
require_api( 'helper_api.php' );
require_api( 'icon_api.php' );
require_api( 'lang_api.php' );
require_api( 'prepare_api.php' );
require_api( 'print_api.php' );
require_api( 'project_api.php' );
require_api( 'sponsorship_api.php' );
require_api( 'string_api.php' );
/**
* Filters an array of columns based on configuration options. The filtering can remove
* columns whose features are disabled.
*
* @param array $p_columns The columns proposed for display.
* @return array The columns array after removing the disabled features.
*/
function columns_filter_disabled( array $p_columns ) {
$t_columns = array();
$t_enable_profiles = ( config_get( 'enable_profiles' ) == ON );
foreach ( $p_columns as $t_column ) {
switch( $t_column ) {
case 'os':
case 'os_build':
case 'platform':
if( ! $t_enable_profiles ) {
continue 2;
}
break;
case 'eta':
if( config_get( 'enable_eta' ) == OFF ) {
continue 2;
}
break;
case 'projection':
if( config_get( 'enable_projection' ) == OFF ) {
continue 2;
}
break;
case 'build':
if( config_get( 'enable_product_build' ) == OFF ) {
continue 2;
}
break;
case 'sponsorship_total':
if( config_get( 'enable_sponsorship' ) == OFF ) {
continue 2;
}
break;
default:
# don't filter
break;
}
$t_columns[] = $t_column;
} # continued 2
return $t_columns;
}
/**
* Get a list of standard columns.
* @param boolean $p_enabled_columns_only Default true, if false returns all columns regardless of configuration settings.
* @return array of column names
*/
function columns_get_standard( $p_enabled_columns_only = true ) {
$t_reflection = new ReflectionClass( 'BugData' );
$t_columns = $t_reflection->getDefaultProperties();
$t_columns['selection'] = null;
$t_columns['edit'] = null;
$t_columns['notes'] = null;
$t_columns['tags'] = null;
# Overdue icon column (icons appears if an issue is beyond due_date)
$t_columns['overdue'] = null;
# The following fields are used internally and don't make sense as columns
unset( $t_columns['_stats'] );
unset( $t_columns['profile_id'] );
unset( $t_columns['sticky'] );
unset( $t_columns['loading'] );
# legacy field
unset( $t_columns['duplicate_id'] );
$t_column_names = array_keys( $t_columns );
if( $p_enabled_columns_only ) {
$t_column_names = columns_filter_disabled( $t_column_names );
}
return $t_column_names;
}
/**
* Allow plugins to define a set of class-based columns, and register/load
* them here to be used by columns_api.
* @return array Mapping of column name to column object
*/
function columns_get_plugin_columns() {
static $s_column_array = null;
if( is_null( $s_column_array ) ) {
$s_column_array = array();
$t_all_plugin_columns = event_signal( 'EVENT_FILTER_COLUMNS' );
foreach( $t_all_plugin_columns as $t_plugin => $t_plugin_columns ) {
foreach( $t_plugin_columns as $t_callback => $t_plugin_column_array ) {
if( is_array( $t_plugin_column_array ) ) {
foreach( $t_plugin_column_array as $t_column_item ) {
if( is_object( $t_column_item ) && $t_column_item instanceof MantisColumn ) {
$t_column_object = $t_column_item;
} elseif( class_exists( $t_column_item ) && is_subclass_of( $t_column_item, 'MantisColumn' ) ) {
$t_column_object = new $t_column_item();
} else {
continue;
}
$t_column_name = mb_strtolower( $t_plugin . '_' . $t_column_object->column );
$s_column_array[$t_column_name] = $t_column_object;
}
}
}
}
}
return $s_column_array;
}
/**
* Get all columns for existing custom_fields
* @return string Array of column names
*/
function columns_get_custom_fields() {
static $t_col_names = null;
if( isset( $t_col_names ) ) {
return $t_col_names;
}
$t_all_cfids = custom_field_get_ids();
$t_col_names = array();
foreach( $t_all_cfids as $t_id ) {
$t_col_names[] = column_get_custom_field_column_name( $t_id );
}
return $t_col_names;
}
/**
* Get all columns active for the current system.
* This includes standard, custom fields, and plugin columns.
* Columns for disabled modules are removed from this list, according to system
* configuration.
*
* This function cannot check on current user/project, so it can be used by core
* in potential unlogged-in scenarios.
* @return array Array of column names
*/
function columns_get_all_active_columns() {
$t_columns = array_merge(
columns_get_standard(),
array_keys( columns_get_plugin_columns() ),
columns_get_custom_fields()
);
return columns_filter_disabled( $t_columns );
}
/**
* Returns true if the specified $p_column is a plugin column.
* @param string $p_column A column name.
* @return boolean
*/
function column_is_plugin_column( $p_column ) {
$t_plugin_columns = columns_get_plugin_columns();
return isset( $t_plugin_columns[$p_column] );
}
/**
* Get all accessible columns for the current project / current user.
* @param integer $p_project_id A project identifier.
* @return array array of columns
* @access public
*/
function columns_get_all( $p_project_id = null ) {
$t_columns = columns_get_standard();
# add plugin columns
$t_columns = array_merge( $t_columns, array_keys( columns_get_plugin_columns() ) );
# Add project custom fields to the array. Only add the ones for which the current user has at least read access.
if( $p_project_id === null ) {
$t_project_id = helper_get_current_project();
} else {
$t_project_id = $p_project_id;
}
# Get custom fields from this project and sub-projects
$t_projects = user_get_all_accessible_projects( null, $t_project_id );
$t_related_custom_field_ids = custom_field_get_linked_ids( $t_projects );
foreach( $t_related_custom_field_ids as $t_id ) {
$t_cfdef = custom_field_get_definition( $t_id );
$t_projects_to_check = array_intersect( $t_projects, custom_field_get_project_ids( $t_id ) );
if( access_has_any_project_level( (int)$t_cfdef['access_level_r'], $t_projects_to_check ) ) {
$t_columns[] = column_get_custom_field_column_name( $t_id );
}
}
return $t_columns;
}
/**
* Checks if the specified column is an extended column. Extended columns are native columns that are
* associated with the issue but are saved in mantis_bug_text_table.
* @param string $p_column The column name.
* @return boolean true for extended; false otherwise.
* @access public
*/
function column_is_extended( $p_column ) {
switch( $p_column ) {
case 'description':
case 'steps_to_reproduce':
case 'additional_information':
return true;
default:
return false;
}
}
/**
* Checks if the specified column is a custom field column.
* @param string $p_column The column name.
* @return boolean True if its a custom field column
*/
function column_is_custom_field( $p_column ) {
$t_cf_columns = columns_get_custom_fields();
return in_array( $p_column, $t_cf_columns );
}
/**
* Checks if the specified column can be sorted
* @param string $p_column The column name.
* @return boolean True if the column can be sorted
*/
function column_is_sortable( $p_column ) {
# custom fields are always sortable
if( column_is_custom_field( $p_column ) ) {
return true;
}
# plugin fields contains a 'sortable' property
if( column_is_plugin_column( $p_column ) ) {
$t_plugin_columns = columns_get_plugin_columns();
$t_plugin_obj = $t_plugin_columns[$p_column];
return $t_plugin_obj->sortable;
}
#standard fields: define exceptions here
switch( $p_column ) {
case 'selection':
case 'edit':
case 'bugnotes_count':
case 'attachment_count':
case 'tags':
case 'overdue':
case 'additional_information':
case 'description':
case 'notes':
case 'steps_to_reproduce':
return false;
}
# after all exceptions, return true as default
return true;
}
/**
* Given a column name from the array of columns to be included in a view, this method checks if
* the column is a custom column and if so returns its name. Note that for custom fields, then
* provided names will have the "custom_" prefix, where the returned ones won't have the prefix.
*
* @param string $p_column Column name.
* @return string The custom field column name or null if the specific column is not a custom field or invalid column.
* @access public
*/
function column_get_custom_field_name( $p_column ) {
if( strncmp( $p_column, 'custom_', 7 ) === 0 ) {
return mb_substr( $p_column, 7 );
}
return null;
}
/**
* Returns the name of a column corresponding to a custom field, providing the id as parameter.
*
* @param integer $p_cf_id Custom field id
* @return string The column name
*/
function column_get_custom_field_column_name( $p_cf_id ) {
$t_def = custom_field_get_definition( $p_cf_id );
if( $t_def ) {
return 'custom_' . $t_def['name'];
} else {
return null;
}
}
/**
* Converts a string of comma separate column names to an array.
*
* @param string $p_string Comma separate column name (not case sensitive).
* @return array The array with all column names lower case.
* @access public
*/
function columns_string_to_array( $p_string ) {
$t_columns = explode( ',', $p_string );
$t_count = count( $t_columns );
for( $i = 0; $i < $t_count; $i++ ) {
$t_columns[$i] = trim( $t_columns[$i] );
}
return $t_columns;
}
/**
* Gets the localized title for the specified column. The column can be native or custom.
* The custom fields must contain the 'custom_' prefix.
*
* @param string $p_column The column name.
* @return string The column localized name.
* @access public
*/
function column_get_title( $p_column ) {
$t_custom_field = column_get_custom_field_name( $p_column );
if( $t_custom_field !== null ) {
$t_field_id = custom_field_get_id_from_name( $t_custom_field );
if( $t_field_id === false ) {
$t_custom_field = '@' . $t_custom_field . '@';
} else {
$t_def = custom_field_get_definition( $t_field_id );
$t_custom_field = lang_get_defaulted( $t_def['name'] );
}
return $t_custom_field;
}
$t_plugin_columns = columns_get_plugin_columns();
if( isset( $t_plugin_columns[$p_column] ) ) {
$t_column_object = $t_plugin_columns[$p_column];
return $t_column_object->title;
}
switch( $p_column ) {
case 'attachment_count':
return lang_get( 'attachments' );
case 'bugnotes_count':
return '#';
case 'category_id':
return lang_get( 'category' );
case 'edit':
return '';
case 'handler_id':
return lang_get( 'assigned_to' );
case 'last_updated':
return lang_get( 'updated' );
case 'os_build':
return lang_get( 'os_version' );
case 'project_id':
return lang_get( 'email_project' );
case 'reporter_id':
return lang_get( 'reporter' );
case 'selection':
return '';
case 'sponsorship_total':
return sponsorship_get_currency();
case 'version':
return lang_get( 'product_version' );
case 'view_state':
return lang_get( 'view_status' );
default:
return lang_get_defaulted( $p_column );
}
}
/**
* Checks an array of columns for duplicate or invalid fields.
*
* @param string $p_field_name The logic name of the array being validated. Used when triggering errors.
* @param array $p_columns_to_validate The array of columns to validate.
* @param array $p_columns_all The list of all valid columns.
* @return boolean
* @access public
*/
function columns_ensure_valid( $p_field_name, array $p_columns_to_validate, array $p_columns_all ) {
$t_columns_all_lower = array_map( 'mb_strtolower', $p_columns_all );
# Check for invalid fields
foreach( $p_columns_to_validate as $t_column ) {
if( !in_array( mb_strtolower( $t_column ), $t_columns_all_lower ) ) {
error_parameters( $p_field_name, $t_column );
trigger_error( ERROR_COLUMNS_INVALID, ERROR );
return false;
}
}
# Check for duplicate fields
$t_columns_no_duplicates = array();
foreach( $p_columns_to_validate as $t_column ) {
$t_column_lower = mb_strtolower( $t_column );
if( in_array( $t_column, $t_columns_no_duplicates ) ) {
error_parameters( $p_field_name, $t_column );
trigger_error( ERROR_COLUMNS_DUPLICATE, ERROR );
} else {
$t_columns_no_duplicates[] = $t_column_lower;
}
}
return true;
}
/**
* Validates an array of column names and removes ones that are not valid. The validation
* is not case sensitive.
*
* @param array $p_columns The array of column names to be validated.
* @param array $p_columns_all The array of all valid column names.
* @return array The array of valid column names found in $p_columns.
* @access public
*/
function columns_remove_invalid( array $p_columns, array $p_columns_all ) {
$t_columns_all_lower = array_values( array_map( 'mb_strtolower', $p_columns_all ) );
$t_columns = array();
foreach( $p_columns as $t_column ) {
if( in_array( mb_strtolower( $t_column ), $t_columns_all_lower ) ) {
$t_columns[] = $t_column;
}
}
return $t_columns;
}
/**
* Print table header for selection column
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_selection( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-selection">   </th>';
}
/**
* Print table header for edit column
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_edit( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-edit">   </th>';
}
/**
* Print table header for column ID
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_id( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-id">';
print_view_bug_sort_link( lang_get( 'id' ), 'id', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'id' );
echo '</th>';
}
/**
* Print table header for column project id
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_project_id( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-project-id">';
print_view_bug_sort_link( lang_get( 'email_project' ), 'project_id', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'project_id' );
echo '</th>';
}
/**
* Print table header for column reporter id
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_reporter_id( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-reporter">';
print_view_bug_sort_link( lang_get( 'reporter' ), 'reporter_id', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'reporter_id' );
echo '</th>';
}
/**
* Print table header for column handler id
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_handler_id( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-assigned-to">';
print_view_bug_sort_link( lang_get( 'assigned_to' ), 'handler_id', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'handler_id' );
echo '</th>';
}
/**
* Print table header for column priority
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_priority( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-priority">';
# Use short label only when displaying icons
$t_label = lang_get( config_get( 'show_priority_text' ) ? 'priority' : 'priority_abbreviation' );
print_view_bug_sort_link( $t_label, 'priority', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'priority' );
echo '</th>';
}
/**
* Print table header for column reproducibility
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_reproducibility( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-reproducibility">';
print_view_bug_sort_link( lang_get( 'reproducibility' ), 'reproducibility', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'reproducibility' );
echo '</th>';
}
/**
* Print table header for column projection
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_projection( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-projection">';
print_view_bug_sort_link( lang_get( 'projection' ), 'projection', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'projection' );
echo '</th>';
}
/**
* Print table header for column ETA
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_eta( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-eta">';
print_view_bug_sort_link( lang_get( 'eta' ), 'eta', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'eta' );
echo '</th>';
}
/**
* Print table header for column resolution
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_resolution( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-resolution">';
print_view_bug_sort_link( lang_get( 'resolution' ), 'resolution', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'resolution' );
echo '</th>';
}
/**
* Print table header for column fixed in version
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_fixed_in_version( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-fixed-in-version">';
print_view_bug_sort_link( lang_get( 'fixed_in_version' ), 'fixed_in_version', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'fixed_in_version' );
echo '</th>';
}
/**
* Print table header for column tags
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_tags( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-tags">' . lang_get('tags') . '</th>';
}
/**
* Print table header for column target version
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_target_version( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-target-version">';
print_view_bug_sort_link( lang_get( 'target_version' ), 'target_version', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'target_version' );
echo '</th>';
}
/**
* Print table header for column view state
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_view_state( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-view-state">';
$t_view_state_text = lang_get( 'view_status' );
$t_view_state_icon = ' <i class="fa fa-lock" title="' . $t_view_state_text . '"></i>';
print_view_bug_sort_link( $t_view_state_icon, 'view_state', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'view_state' );
echo '</th>';
}
/**
* Print table header for column OS
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_os( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-os">';
print_view_bug_sort_link( lang_get( 'os' ), 'os', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'os' );
echo '</th>';
}
/**
* Print table header for column OS Build
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_os_build( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-os-build">';
print_view_bug_sort_link( lang_get( 'os_version' ), 'os_build', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'os_build' );
echo '</th>';
}
/**
* Print table header for column Build
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_build( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
if( $p_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
echo '<th class="column-build">';
print_view_bug_sort_link( lang_get( 'build' ), 'build', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'build' );
echo '</th>';
} else {
echo lang_get( 'build' );
}
}
/**
* Print table header for column Platform
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_platform( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-platform">';
print_view_bug_sort_link( lang_get( 'platform' ), 'platform', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'platform' );
echo '</th>';
}
/**
* Print table header for column version
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_version( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-version">';
print_view_bug_sort_link( lang_get( 'product_version' ), 'version', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'version' );
echo '</th>';
}
/**
* Print table header for column date submitted
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_date_submitted( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-date-submitted">';
print_view_bug_sort_link( lang_get( 'date_submitted' ), 'date_submitted', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'date_submitted' );
echo '</th>';
}
/**
* Print table header for column attachment count
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_attachment_count( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
$t_attachment_count_text = lang_get( 'attachment_count' );
$t_attachment_count_icon = "<i class=\"fa fa-paperclip blue\" title=\"$t_attachment_count_text\" ></i>";
echo "\t" . '<th class="column-attachments">' . $t_attachment_count_icon . '</th>' . "\n";
}
/**
* Print table header for column category
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_category_id( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-category">';
print_view_bug_sort_link( lang_get( 'category' ), 'category_id', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'category_id' );
echo '</th>';
}
/**
* Prints Category column header
* The actual column is 'category_id', this function is just here for backwards
* compatibility
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_category( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
trigger_error( ERROR_GENERIC, WARNING );
print_column_title_category_id( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE );
}
/**
* Print table header for column sponsorship total
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_sponsorship_total( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo "\t<th class=\"column-sponsorship\">";
print_view_bug_sort_link( sponsorship_get_currency(), 'sponsorship_total', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'sponsorship_total' );
echo "</th>\n";
}
/**
* Print table header for column severity
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_severity( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-severity">';
print_view_bug_sort_link( lang_get( 'severity' ), 'severity', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'severity' );
echo '</th>';
}
/**
* Print table header for column status
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_status( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-status">';
print_view_bug_sort_link( lang_get( 'status' ), 'status', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'status' );
echo '</th>';
}
/**
* Print table header for column last updated
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_last_updated( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-last-modified">';
print_view_bug_sort_link( lang_get( 'updated' ), 'last_updated', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'last_updated' );
echo '</th>';
}
/**
* Print table header for column summary
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_summary( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-summary">';
print_view_bug_sort_link( lang_get( 'summary' ), 'summary', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'summary' );
echo '</th>';
}
/**
* Print table header for column bugnotes count
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_bugnotes_count( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-bugnotes-count"> <i class="fa fa-comments blue"></i> </th>';
}
/**
* Print table header for column description
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/
function print_column_title_description( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {
echo '<th class="column-description">';
echo lang_get( 'description' );
echo '</th>';
}
/**
* Print table header for notes column.
*
* @param string $p_sort Sort.
* @param string $p_dir Direction.
* @param integer $p_columns_target See COLUMNS_TARGET_* in constant_inc.php.
* @return void
* @access public
*/