/**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $id, $noteId)
 {
     $projectNote = $this->repository->skipPresenter()->find($id);
     $projectId = $projectNote->project_id;
     if ($this->checkProjectNotePermissions($projectId) == false) {
         return ['error' => 'Access Forbidden'];
     }
     return $this->service->update($request->all(), $noteId);
 }
 public function update(array $data, $id)
 {
     try {
         $this->validator->with($data)->passesOrFail();
         return $this->repository->update($data, $id);
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     }
 }
 public function destroy($id)
 {
     try {
         $this->repository->find($id);
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => 'Projeto não encontrado.'];
     }
     return $this->repository->delete($id);
 }
 public function destroy($noteId)
 {
     try {
         $this->repository->delete($noteId);
     } catch (ValidatorException $e) {
         return response()->json(['error' => true, 'message' => $e->getMessageBag()]);
     } catch (ModelNotFoundException $e) {
         return response()->json(['error' => true, 'message1' => $e->getMessage(), 'message2' => 'Project Note ID ' . $noteId . ' nao encontrado.']);
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id, $noteId)
 {
     return $this->repository->findWhere(['project_id' => $id, 'id' => $noteId]);
     //correção para não usar o Transform no Angular
     /*
        $result = $this->repository->findWhere(['project_id' => $id, 'id' => $noteId]);
        if (isset($result['data']) && count($result['data']) == 1){
            $result = [
                'data' => $result['data'][0];
            ];
        }
        return $result;
     */
 }
 /**
  * Delete the project task
  *
  * @param  integer $id   project id
  * @return json
  */
 public function delete($id)
 {
     if ($this->repository->delete($id)) {
         return ['error' => false, 'message' => 'Task deletada com sucesso'];
     }
     return ['error' => true, 'message' => 'Não foi possível deletar a task'];
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $taskId)
 {
     $projectTask = $this->repository->skipPresenter()->find($id);
     $projectId = $projectTask->project_id;
     if (!$this->checkProjectTaskPermissions($projectId)) {
         return ['error' => 'Access Forbidden'];
     }
     return $this->service->delete($taskId);
 }
 /**
  * Delete the project note
  *
  * @param  integer $id   project id
  * @return json
  */
 public function delete($id)
 {
     try {
         $this->repository->delete($id);
         return ['success' => true];
     } catch (\Exception $e) {
         return ["error" => true, "message" => $e->getMessage()];
     }
 }
 public function getFileName($id)
 {
     $projectFile = $this->repository->find($id);
     return $projectFile->getFileName();
 }
 public function delete($fileId)
 {
     $model = $this->repository->skipPresenter()->find($fileId);
     $this->storage->delete($fileId . "." . $model->extension);
     return $this->repository->delete($fileId);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($projectId, $fileId)
 {
     return ['success' => $this->service->delete($fileId)];
 }
 public function delete($id)
 {
     $projectMember = $this->repository->skipPresenter()->find($id);
     return $projectMember->delete();
 }
Beispiel #13
0
 public function hasRepo($name = 'main')
 {
     return null !== ProjectRepository::check($this, $name);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id, $noteId)
 {
     $this->repository->delete($noteId);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     return ['success' => $this->service->delete($id)];
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($projectId, $taskId)
 {
     return ['success' => $this->repository->delete($taskId)];
 }
Beispiel #17
0
<?php

if (empty($project_list)) {
    ?>
  <div class="container alert alert-danger text-center" role="alert">
    <h1>No Projects created by this user</h1>
  </div>
<?php 
}
$projectrepository = new ProjectRepository();
foreach ($project_list as $project) {
    $req_list = $this->projectrepository->get_requirements($project->getProject_id(), $project);
    $project->setRequirement($req_list);
    $org_list = $this->projectrepository->get_organization($project->getProject_id(), $project);
    $project->setOrganization($org_list);
    ?>
<div class="container-fluid">
	<div class="row">
  <div class="col-sm-1 col-md-4">
    <div class="thumbnail">
      <img src="<?php 
    echo $project->getBanner_image();
    ?>
" style="height:200px">
      <div class="caption">
        <h2><?php 
    echo $project->getTitle();
    ?>
</h2>
        <p>
        	 <b>Organization : </b><br/><?php 
Beispiel #18
0
<?php

require 'ProjectArchiver.php';
require 'ProjectReopener.php';
require '../TablePrinter.php';
require 'Project.php';
require 'ProjectRepository.php';
$repo = new ProjectRepository();
$projects = $repo->all();
// Add 'New Developer' to all projects
foreach ($projects as $project) {
    $project->addCollaborator('New Developer');
}
$tp = new TablePrinter(['Project', 'Status', 'Collaborators']);
foreach ($projects as $p) {
    $tp->addRow($p->getName(), $p->getStatus(), $p->getCollaborators());
}
echo $tp->output();
 public function delete($id)
 {
     return $this->repository->delete($id);
 }
Beispiel #20
0
 /**
  * Display details of a proposal.
  *
  * @param Request $request
  * @param int     $proposalId
  *
  * @return Response
  */
 public function view(Request $request, $proposalId)
 {
     return view('admin.proposals.view', ['proposal' => $this->proposals->byId($proposalId)]);
 }