Disable or hide Clone and Add Comments tickets

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
truefriend-cz
Posts: 65
Joined: Jan 08, 2019 2:14 am

Disable or hide Clone and Add Comments tickets

Post by truefriend-cz » Feb 15, 2019 11:11 am

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
Mantis version: 2.19.0, OS: Windows, PHP: 7.3, Charset (PHP, Database): UTF-8, and: little, bad english

truefriend-cz
Posts: 65
Joined: Jan 08, 2019 2:14 am

Re: Disable or hide Clone and Add Comments tickets

Post by truefriend-cz » Feb 15, 2019 2:59 pm

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;
}
Mantis version: 2.19.0, OS: Windows, PHP: 7.3, Charset (PHP, Database): UTF-8, and: little, bad english

Post Reply