public static function getAccessTable($ug, $type = '', $include_reports = true) { $html = ''; switch ($type) { case 'projects': $html = ' <table class="listingDataTable"> <tr> <td><b>' . t::__('Projects') . ':</b></td> <td>' . UsersGroups::getAccessNameByKey($ug->getAllowManageProjects()) . '</td> </tr> <tr> <td>' . t::__('Comments') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageProjects()) . '</td> </tr> </table> <table class="listingDataTable">' . ($include_reports ? '<tr> <td>' . t::__('Projects Reports') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageProjects()) . '</td> </tr>' : '') . ' </table>'; break; case 'tasks': $html = ' <table class="listingDataTable"> <tr> <td ><b>' . t::__('Tasks') . ':</b></td> <td>' . UsersGroups::getAccessNameByKey($ug->getAllowManageTasks()) . '</td> </tr> <tr> <td>' . t::__('Comments') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageTasks()) . '</td> </tr> </table>' . ($include_reports ? '<table class="listingDataTable"> <tr> <td>' . t::__('Tasks Reports') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageTasks()) . '</td> </tr> <tr> <td>' . t::__('Gantt Chart') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageTasks()) . '</td> </tr> <tr> <td>' . t::__('Time Report') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageTasks()) . '</td> </tr> <tr> <td>' . t::__('Personal Time Report') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageTasks()) . '</td> </tr> </table>' : ''); break; case 'tickets': $html = ' <table class="listingDataTable"> <tr> <td style="font-size: 11px;"><b>' . t::__('Tickets') . ':</b></td> <td>' . UsersGroups::getAccessNameByKey($ug->getAllowManageTickets()) . '</td> </tr> <tr> <td>' . t::__('Comments') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageTickets()) . '</td> </tr> </table>' . ($include_reports ? '<table class="listingDataTable"> <tr> <td>' . t::__('Tickets Reports') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageTickets()) . '</td> </tr> </table>' : ''); break; case 'discussions': $html = ' <table class="listingDataTable"> <tr> <td><b>' . t::__('Discussions') . ':</b></td> <td>' . UsersGroups::getAccessNameByKey($ug->getAllowManageDiscussions()) . '</td> </tr> <tr> <td>' . t::__('Comments') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageDiscussions()) . '</td> </tr> </table>' . ($include_reports ? '<table class="listingDataTable"> <tr> <td>' . t::__('Discussions Reports') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageDiscussions()) . '</td> </tr> </table>' : ''); break; case 'extra': $html = ' <table class="listingDataTable"> <tr> <td><b>' . t::__('Configuration') . ':</b></td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageConfiguration()) . '</td> </tr> <tr> <td>' . t::__('Users') . ':</td> <td>' . UsersGroups::getAccessNameByValue($ug->getAllowManageUsers()) . '</td> </tr> </table>'; break; } $html = str_replace('<td>', '<td style="white-space:normal">', $html); return $html; }