public function show($id)
 {
     try {
         $iteration = Iterations::findOrFail($id);
         $iterations = Iterations::where('projectid', '=', $iteration->projectid)->get();
         $project = Project::findOrFail($iteration->projectid);
         $issues = Issue::where('iterationid', '=', $id)->get();
         //$issues = $iteration->issues;
         $countIssues = sizeof($issues);
         $categories = Category::all();
         $idCategory = 0;
         $totalPoints = $issues->sum('points');
         $materiales = Material::all();
         $personal = PersonalType::all();
         $team = Teams::where('projectid', '=', $project->id)->get()->first();
         $members = DB::table('memberof')->where('teamid', '=', $team->id)->get();
         $hasmembers = sizeof($members) > 0 ? true : false;
         $users = array();
         foreach ($members as $member) {
             $users[] = User::findOrFail($member->usersid);
             echo $hasmembers;
         }
         $this->layout->content = View::make('layouts.iterations.show')->with('iteration', $iteration)->with('iterations', $iterations)->with('issues', $issues)->with('categories', $categories)->with('idCategory', $idCategory)->with('countIssues', $countIssues)->with('totalPoints', $totalPoints)->with('project', $project)->with('materiales', $materiales)->with('personal', $personal)->with('hasmembers', $hasmembers)->with('members', $members)->with('users', $users)->with('message', '');
     } catch (Illuminate\Database\Eloquent\ModelNotFoundException $e) {
         return Redirect::to('/projects/')->with('message', 'Error al crear la iteración');
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $personalType = PersonalType::find($id);
     if (sizeof($personalType->tasks) < 1) {
         $personalType->delete();
         return Redirect::to('/personalType')->with('message', 'Registro eliminado')->with('organizacion', app('organization'));
     } else {
         return Redirect::to('/personalType')->with('error', 'El registro ya se encuentra como gasto dentro de las actividades.');
     }
 }
예제 #3
0
    ?>
        <br><strong><?php 
    echo 'Grupo: Profesor';
    ?>
</strong>
        <?php 
    echo link_to(' Ver perfil', '@teacher_show?id=' . $teacher->getId(), array('target' => '_blank'));
    ?>
<br>
      <?php 
}
?>

      <?php 
foreach ($person->getPersonals() as $personal) {
    ?>

        <br><strong><?php 
    echo 'Grupo: ' . PersonalType::toString($personal->getPersonalType());
    ?>
</strong>
        <?php 
    echo link_to(' Ver perfil', $personal->retrieveRouteForShow() . '?id=' . $personal->getId(), array('target' => '_blank'));
    ?>
<br><br>

      <?php 
}
?>
    </td>
  </tr>