Page 1 of 1

Disable or hide Clone and Add Comments tickets

Posted: 15 Feb 2019, 16:11
by truefriend-cz
Hi all.

I have problem. If i logged as anonymous (reporter) user then show on view_all_bug_page.php select checkbox for tickets where i can operations Clone (to another project) and Add comment/s.

How i can disabled this functions for "reporter" or "Anonymous" in view_all_bug_page.php?

I located place in PHP where is... Have Mantis PHP command for lower role than DEVELOPER?

Thanks

Re: Disable or hide Clone and Add Comments tickets

Posted: 15 Feb 2019, 19:59
by truefriend-cz
My solution is:
changes columns_api.php (1097):

Code: Select all

		$g_checkboxes_exist = true;
		echo '<div class="checkbox no-padding no-margin"><label>';
		printf( '<input type="checkbox" name="bug_arr[]" value="%d" class="ace" />', $p_bug->id );
		echo '<span class="lbl"></span>';
		echo '</label></div>';
to:

Code: Select all

		if ( custom_function_my_group_by_project()) {
			$g_checkboxes_exist = true;
			echo '<div class="checkbox no-padding no-margin"><label>';
			printf( '<input type="checkbox" name="bug_arr[]" value="%d" class="ace" />', $p_bug->id );
			echo '<span class="lbl"></span>';
			echo '</label></div>';
		} else {
			$g_checkboxes_exist = false;
		}
etc.:
custom_function_api.php:

Code: Select all

function custom_function_my_group_by_project(){
	$m_access_level = access_get_project_level();
	$m_group = ( $m_access_level == ADMINISTRATOR || $m_access_level == MANAGER );
	return $m_group;
}