function wiki_add_project_tab() { if (use_permitted(logged_user(), active_project(), 'wiki')) { add_tabbed_navigation_item(PROJECT_TAB_WIKI, 'wiki', get_url('wiki', 'index')); } // if }
function tickets_my_tasks_dropdown() { if (use_permitted(logged_user(), active_project(), 'tickets')) { echo '<li class="header"><a href="' . get_url('tickets', 'index') . '">' . lang('tickets') . '</a></li>'; if (ProjectTicket::canAdd(logged_user(), active_project())) { echo '<li><a href="' . get_url('tickets', 'add_ticket') . '">' . lang('add ticket') . '</a></li>'; } // if } // if }
function form_my_tasks_dropdown() { if (use_permitted(logged_user(), active_project(), 'forms')) { echo '<li class="header"><a href="' . get_url('form', 'index') . '">' . lang('forms') . '</a></li>'; if (ProjectForm::canAdd(logged_user(), active_project())) { echo '<li><a href="' . get_url('form', 'add') . '">' . lang('add form') . '</a></li>'; } // if } // if }
function files_my_tasks_dropdown() { if (use_permitted(logged_user(), active_project(), 'files')) { echo '<li class="header"><a href="' . get_url('files', 'index') . '">' . lang('files') . '</a></li>'; if (ProjectFile::canAdd(logged_user(), active_project())) { echo '<li><a href="' . get_url('files', 'add_file') . '">' . lang('add file') . '</a></li>'; } // if if (ProjectFolder::canAdd(logged_user(), active_project())) { echo '<li><a href="' . get_url('files', 'add_folder') . '">' . lang('add folder') . '</a></li>'; } // if } // if }
function project_tabbed_navigation_filter($items) { $pass = array(); foreach ($items as &$item) { if (use_permitted(logged_user(), active_project(), $item->getID())) { $pass[] = $item; } else { if ($item->getId() == 'overview') { $pass[] = $item; } if ($item->getId() == 'links') { // links are outside of permissions setup currently $pass[] = $item; } } } return $pass; }
/** * Prepare dashboard tabbed navigation * * @access public * @param string $selected ID of selected tab * @return null */ function dashboard_tabbed_navigation($selected = DASHBOARD_TAB_OVERVIEW) { trace(__FILE__, 'dashboard_tabbed_navigation'); add_tabbed_navigation_item(DASHBOARD_TAB_OVERVIEW, 'overview', get_url('dashboard', 'index')); add_tabbed_navigation_item(DASHBOARD_TAB_MY_PROJECTS, 'my projects', get_url('dashboard', 'my_projects')); if (use_permitted(logged_user(), active_project(), 'tasks')) { add_tabbed_navigation_item(DASHBOARD_TAB_MY_TASKS, 'my tasks', get_url('dashboard', 'my_tasks')); } // if add_tabbed_navigation_item(DASHBOARD_TAB_WEEKLY_SCHEDULE, 'weekly schedule', get_url('dashboard', 'weekly_schedule')); add_tabbed_navigation_item(DASHBOARD_TAB_CONTACTS, 'contacts', get_url('dashboard', 'contacts')); trace(__FILE__, 'dashboard_tabbed_navigation:plugin hook'); // PLUGIN HOOK plugin_manager()->do_action('add_dashboard_tab'); // PLUGIN HOOK trace(__FILE__, 'dashboard_tabbed_navigation:set_selected'); tabbed_navigation_set_selected($selected); }
<?php trace(__FILE__, 'ProjectMessage::project_tabbed_navigation()'); project_tabbed_navigation(); trace(__FILE__, 'ProjectMessage::canAdd'); if (ProjectMessage::canAdd(logged_user(), active_project())) { add_page_action(lang('add message'), get_url('message', 'add')); } // if trace(__FILE__, 'ProjectTaskList::canAdd'); if (ProjectTaskList::canAdd(logged_user(), active_project())) { add_page_action(lang('add task list'), get_url('task', 'add_list')); } // if trace(__FILE__, 'ProjectMilestone::canAdd'); if (ProjectMilestone::canAdd(logged_user(), active_project())) { add_page_action(lang('add milestone'), get_url('milestone', 'add')); } // if //trace(__FILE__,'project.canChangePermissions()'); //if (active_project()->canChangePermissions(logged_user())) { // add_page_action(lang('permissions'), get_url('project', 'permissions')); //} // if trace(__FILE__, 'plugin hook'); // PLUGIN HOOK plugin_manager()->do_action('project_overview_page_actions'); // PLUGIN HOOK if (use_permitted(logged_user(), active_project(), 'tasks')) { add_page_action(lang('download task lists'), get_url('project', 'download_task_lists')); }
?> <?php } // foreach ?> </ul> <?php } // if ?> </div> <?php trace(__FILE__, 'body searchBox'); ?> <?php if (use_permitted(logged_user(), active_project(), 'search')) { ?> <div id="searchBox"> <form action="<?php echo active_project()->getSearchUrl(); ?> " method="get"> <div> <?php $search_field_default_value = lang('search') . '...'; $search_field_attrs = array('onfocus' => 'if (value == \'' . $search_field_default_value . '\') value = \'\'', 'onblur' => 'if (value == \'\') value = \'' . $search_field_default_value . '\''); ?> <?php echo input_field('search_for', array_var($_GET, 'search_for', $search_field_default_value), $search_field_attrs); ?> <button type="submit"><?php
function reports_add_project_tab() { if (use_permitted(logged_user(), active_project(), 'reports')) { add_tabbed_navigation_item(PROJECT_TAB_REPORTS, 'reports', get_url('reports', 'index')); } }