Example #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     try {
         $statusCode = 200;
         //			$response = [
         //				'Age List'  => []
         //			];
         $actions = Action::all();
         foreach ($actions as $action) {
             //
             $response['Actions List'][] = ['id' => $action->id, 'Action' => $action->action];
         }
         //			$response=$gender;
     } catch (Exception $e) {
         $statusCode = 400;
     } finally {
         return Response::json($response, $statusCode);
     }
 }
 public function createAction($idbp)
 {
     $objectives = DB::table('objectives as o')->join('goals as g', function ($join) use($idbp) {
         $join->on('o.goal_id', '=', 'g.id')->where('g.bpid', '=', $idbp);
     })->distinct()->pluck('o.name');
     $action = Action::all();
     $groups = Group::lists('name');
     $user = User::lists('name');
     $counted = count($action) + 1;
     $selectedUsers = array();
     $selectedGroups = array();
     $users = User::lists('name', 'id');
     $progress = ['0' => 'Not Started', '1' => 'In Progress', '2' => 'Done'];
     return view('businessPlan.createAction', compact('objectives', 'counted', 'groups', 'user', 'idbp', 'users', 'selectedUsers', 'selectedGroups', 'progress'));
 }
Example #3
0
            </div>
            <div class="panel-body small-panel-body">
                <?php 
$myDept = Auth::user()->department;
$myTeam = Auth::user()->team;
$myTasks = array();
$alltasks = \App\Task::all();
foreach ($alltasks as $sometask) {
    $owners = explode("__,__", $sometask->owner);
    $collaborators = explode("__,__", $sometask->collaborators);
    if (in_array($myTeam, $owners) || in_array($myDept, $owners) || in_array($myTeam, $collaborators) || in_array($myDept, $collaborators)) {
        $myTasks[] = $sometask;
    }
}
$myActions = array();
$allactions = \App\Action::all();
foreach ($allactions as $someaction) {
    $owners = explode("__,__", $someaction->owner);
    $collaborators = explode("__,__", $someaction->collaborators);
    if (in_array($myTeam, $owners) || in_array($myDept, $owners) || in_array($myTeam, $collaborators) || in_array($myDept, $collaborators)) {
        $myActions[] = $someaction;
    }
}
?>
                <table id="table-edit" class="table table-striped table-bordered table-hover tablesorter mywork-table">
                    <thead>
                    <tr>
                        <th>Description</th>
                        <th class="mw-table-due">Due</th>
                        <th class="mw-table-owner">Owner</th>
                        <th class="mw-table-lead">Lead</th>
 /**
  * Show the form for editing the specified Module.
  * @param  int $id
  * @return Response
  */
 public function edit($id)
 {
     if (!AuthcheckController::checkAuth(Sentinel::forceCheck(), ['module.update'], 'Modulos', 'alterar')) {
         return redirect()->back();
     } else {
         $module = $this->moduleRepository->find($id);
         if (empty($module)) {
             Flash::error('Module not found');
             return redirect(route('modules.index'));
         }
         $actions = \App\Action::all();
         $actionb = \DB::table('action_module')->where('module_id', $id)->get(['action_id']);
         return view('modules.edit', compact('actions'), compact('actionb'))->with('module', $module);
     }
 }
Example #5
0
 public function generate()
 {
     ini_set("max_execution_time", 0);
     if (Auth::user()->role == "Project Manager") {
         $activities = Activity::whereIn('action', array('Created', 'Deleted', 'Updated'))->where(function ($query) {
             return $query->where('action', '!=', 'Created')->orWhere('type', '!=', 'Deliverable');
         })->where('user_id', Auth::user()->id)->get();
         $projects = Project::where('user_id', Auth::user()->id)->get();
         $projectids = array_pluck($projects, 'id');
         $milestones = Milestone::whereIn('project_id', $projectids)->get();
         $accomplishments = Accomplishment::whereIn('project_id', $projectids)->get();
         $issues = Issue::whereIn('project_id', $projectids)->get();
         $risks = Risk::whereIn('project_id', $projectids)->get();
         $expenses = Expense::whereIn('project_id', $projectids)->get();
         $actions = Action::whereIn('project_id', $projectids)->get();
         $deliverables = Deliverable::whereIn('project_id', $projectids)->get();
         $business_project_team_members = BusinessProjectTeamMember::whereIn('project_id', $projectids)->get();
         $technical_project_team_members = TechnicalProjectTeamMember::whereIn('project_id', $projectids)->get();
         $support_team_members = SupportTeamMember::whereIn('project_id', $projectids)->get();
         return view('audit.generate', compact('activities', 'projects', 'milestones', 'accomplishments', 'issues', 'risks', 'expenses', 'actions', 'deliverables', 'business_project_team_members', 'technical_project_team_members', 'support_team_members'));
     } elseif (Auth::user()->role == "System Administrator") {
         $activities = Activity::whereIn('action', array('Created', 'Deleted', 'Updated'))->where(function ($query) {
             return $query->where('action', '!=', 'Created')->orWhere('type', '!=', 'Deliverable');
         })->get();
         $projects = Project::all();
         $milestones = Milestone::all();
         $accomplishments = Accomplishment::all();
         $issues = Issue::all();
         $risks = Risk::all();
         $users = User::all();
         $expenses = Expense::all();
         $actions = Action::all();
         $deliverables = Deliverable::all();
         $business_project_team_members = BusinessProjectTeamMember::all();
         $technical_project_team_members = TechnicalProjectTeamMember::all();
         $support_team_members = SupportTeamMember::all();
         return view('audit.generate', compact('activities', 'projects', 'milestones', 'accomplishments', 'issues', 'risks', 'users', 'expenses', 'actions', 'deliverables', 'business_project_team_members', 'technical_project_team_members', 'support_team_members'));
     } else {
         flash()->error('You are not authorized to proceed.');
         return redirect()->action('ProjectsController@index');
     }
 }