@@ -25,7 +25,7 @@ function register() {
25
25
$ this ->description = 'Time tracking plugin that supports entering date worked, time and notes. Also includes limited permissions per user. ' ;
26
26
$ this ->page = 'config_page ' ;
27
27
28
- $ this ->version = '1.0.4 ' ;
28
+ $ this ->version = '1.0.5 ' ;
29
29
$ this ->requires = array (
30
30
'MantisCore ' => '1.2.0 '
31
31
);
@@ -71,6 +71,9 @@ function view_bug_time( $p_event, $p_bug_id ) {
71
71
$ query_pull_timerecords = "SELECT * FROM $ table WHERE bug_id = $ p_bug_id ORDER BY timestamp DESC " ;
72
72
} else if ( access_has_bug_level ( plugin_config_get ( 'admin_own_threshold ' ), $ p_bug_id ) ) {
73
73
$ query_pull_timerecords = "SELECT * FROM $ table WHERE bug_id = $ p_bug_id and user = $ t_user_id ORDER BY timestamp DESC " ;
74
+ } else {
75
+ // User has no access
76
+ return ;
74
77
}
75
78
76
79
$ result_pull_timerecords = db_query ( $ query_pull_timerecords );
@@ -81,23 +84,20 @@ function view_bug_time( $p_event, $p_bug_id ) {
81
84
$ result_pull_hours = db_query ( $ query_pull_hours );
82
85
$ row_pull_hours = db_fetch_array ( $ result_pull_hours );
83
86
84
- if ( (access_has_bug_level ( plugin_config_get ( 'admin_own_threshold ' ), $ p_bug_id ) )
85
- || (access_has_bug_level ( plugin_config_get ( 'view_others_threshold ' ), $ p_bug_id ) ) ) {
86
-
87
87
?>
88
88
89
89
90
90
<a name="timerecord" id="timerecord" /><br />
91
91
92
92
<?php
93
- collapse_open ( 'timerecord ' );
93
+ collapse_open ( 'timerecord ' );
94
94
?>
95
95
<table class="width100" cellspacing="1">
96
96
<tr>
97
97
<td colspan="6" class="form-title">
98
98
<?php
99
- collapse_icon ( 'timerecord ' );
100
- echo plugin_lang_get ( 'title ' );
99
+ collapse_icon ( 'timerecord ' );
100
+ echo plugin_lang_get ( 'title ' );
101
101
?>
102
102
</td>
103
103
</tr>
@@ -112,8 +112,8 @@ function view_bug_time( $p_event, $p_bug_id ) {
112
112
113
113
114
114
<?php
115
- if ( access_has_bug_level ( plugin_config_get ( 'admin_own_threshold ' ), $ p_bug_id ) ) {
116
- $ current_date = explode ("- " , date ("Y-m-d " ));
115
+ if ( access_has_bug_level ( plugin_config_get ( 'admin_own_threshold ' ), $ p_bug_id ) ) {
116
+ $ current_date = explode ("- " , date ("Y-m-d " ));
117
117
?>
118
118
119
119
@@ -139,10 +139,10 @@ function view_bug_time( $p_event, $p_bug_id ) {
139
139
</form>
140
140
141
141
<?php
142
- } # END Access Control
142
+ } # END Access Control
143
143
144
- for ( $ i =0 ; $ i < $ num_timerecords ; $ i ++ ) {
145
- $ row = db_fetch_array ( $ result_pull_timerecords );
144
+ for ( $ i =0 ; $ i < $ num_timerecords ; $ i ++ ) {
145
+ $ row = db_fetch_array ( $ result_pull_timerecords );
146
146
?>
147
147
148
148
@@ -154,29 +154,29 @@ function view_bug_time( $p_event, $p_bug_id ) {
154
154
<td><div align="center"><?php echo date ( config_get ("complete_date_format " ), strtotime ($ row ["timestamp " ])); ?> </div></td>
155
155
156
156
<?php
157
- $ user = auth_get_current_user_id ();
158
- if ( ($ user == $ row ["user " ] && access_has_bug_level ( plugin_config_get ( 'admin_own_threshold ' ), $ p_bug_id ) )
159
- || access_has_bug_level ( plugin_config_get ( 'admin_threshold ' ), $ p_bug_id ) ) {
157
+ $ user = auth_get_current_user_id ();
158
+ if ( ($ user == $ row ["user " ] && access_has_bug_level ( plugin_config_get ( 'admin_own_threshold ' ), $ p_bug_id ) )
159
+ || access_has_bug_level ( plugin_config_get ( 'admin_threshold ' ), $ p_bug_id ) ) {
160
160
?>
161
161
162
162
163
163
<td><a href="<?php echo plugin_page ('delete_record ' ) ?> &bug_id=<?php echo $ p_bug_id ; ?> &delete_id=<?php echo $ row ["id " ]; ?> <?php echo form_security_param ( 'plugin_TimeTracking_delete_record ' ) ?> "><?php echo plugin_lang_get ( 'delete ' ) ?>
164
164
</a></td>
165
165
166
166
<?php
167
- }
168
- else {
167
+ }
168
+ else {
169
169
?>
170
170
<td> </td>
171
171
172
172
<?php
173
- }
173
+ }
174
174
?>
175
175
</tr>
176
176
177
177
178
178
<?php
179
- } # End for loop
179
+ } # End for loop
180
180
?>
181
181
182
182
@@ -191,7 +191,7 @@ function view_bug_time( $p_event, $p_bug_id ) {
191
191
</table>
192
192
193
193
<?php
194
- collapse_closed ( 'timerecord ' );
194
+ collapse_closed ( 'timerecord ' );
195
195
?>
196
196
197
197
<table class="width100" cellspacing="1">
@@ -204,9 +204,8 @@ function view_bug_time( $p_event, $p_bug_id ) {
204
204
</table>
205
205
206
206
<?php
207
- collapse_end ( 'timerecord ' );
207
+ collapse_end ( 'timerecord ' );
208
208
209
- } # Add access
210
209
} # function end
211
210
212
211
function schema () {
0 commit comments