Exemplo n.º 1
0
/**
 * Handle on prepare project overview event
 *
 * @param NamedList $tabs
 * @param User $logged_user
 * @param Project $project
 * @param array $tabs_settings
 * @param string $interface
 */
function frosso_project_tab_handle_on_project_tabs(&$tabs, &$logged_user, &$project, &$tabs_settings, $interface)
{
    if ($interface == AngieApplication::INTERFACE_DEFAULT && Tasks::canAccess($logged_user, $project, false) && in_array('fred_pt', $tabs_settings)) {
        $tabs->addBefore('fred_pt', array('text' => "Fred PT", 'url' => Router::assemble('frosso_tab_route', array('project_slug' => $project->getSlug())), 'icon' => $interface == AngieApplication::INTERFACE_DEFAULT ? AngieApplication::getImageUrl('icons/16x16/tasks-tab-icon.png', TASKS_MODULE) : AngieApplication::getImageUrl('icons/listviews/tasks.png', TASKS_MODULE, AngieApplication::INTERFACE_PHONE)), 'calendar');
    }
    // if
}
 /**
  * Prepare controller
  */
 function __before()
 {
     parent::__before();
     if (!Tasks::canAccess($this->logged_user, $this->active_project)) {
         $this->response->forbidden();
     }
     // if
     // load project tabs
     //$project_tabs = $this->active_project->getTabs($this->logged_user, AngieApplication::INTERFACE_DEFAULT);
     $this->wireframe->tabs->setCurrentTab('fred_gc');
     $this->wireframe->breadcrumbs->add('frosso_gc_route', lang('FRosso GC'), Router::assemble('frosso_gc_route', array('project_slug' => $this->active_project->getSlug())));
 }
Exemplo n.º 3
0
/**
 * @param Project $project
 * @param Milestone $milestone
 * @param User $user
 * @param NamedList $sections
 * @param string $interface
 */
function frosso_handle_on_milestone_sections(&$project, &$milestone, &$user, &$sections, $interface)
{
    //uncomment these lines to add a new tab, instead
    if (Tasks::canAccess($user, $project)) {
        Router::assemble('milestone_tasks', array('project_slug' => $project->getSlug(), 'milestone_id' => $milestone->getId()));
        //   		$section = array(
        //         'text' => lang('FRed'),
        //         'url' => Router::assemble('tasks_frosso', array('project_slug' => $project->getSlug(), 'milestone_id' => $milestone->getId())),
        //         'options' => array(),
        //       );
        //       $sections->add('frosso', $section);
    }
    // if
}