/**
  * @param Request $request
  * @param         $contractId
  */
 public function show(Request $request, $contractId)
 {
     try {
         $page = $request->input('page', '1');
         $contract = $this->annotation->getContractPagesWithAnnotations($contractId);
         $status = $this->annotation->getStatus($contractId);
         $pages = $contract->pages;
     } catch (\Exception $e) {
         return back()->withError($e->getMessage());
     }
     return view('annotations.show', compact('contract', 'pages', 'page', 'status'));
 }
Пример #2
0
 /**
  * Execute the console command.
  */
 public function fire()
 {
     $contracts = $this->contract->all();
     foreach ($contracts as $contract) {
         if ($contract->metadata_status == "published") {
             $this->elastic->postMetadata($contract->id);
             $this->info(sprintf('Contract %s : Metadata Indexed.', $contract->id));
         }
         if ($contract->text_status == "published") {
             $this->elastic->postText($contract->id);
             $this->info(sprintf('Contract %s : Text Indexed.', $contract->id));
         }
         if ($this->annotations->getStatus($contract->id) == "published") {
             $this->elastic->postAnnotation($contract->id);
             $this->info(sprintf('Contract %s : Annotations Indexed.', $contract->id));
         }
     }
 }
 /**
  * Display specified contract
  *
  * @return Response
  */
 public function show($id)
 {
     $contract = $this->contract->findWithAnnotations($id);
     if (!$contract) {
         abort('404');
     }
     $translatedFrom = [];
     if (isset($contract->metadata->translated_from) && !empty($contract->metadata->translated_from)) {
         $translatedFrom = $this->contract->getcontracts($contract->metadata->translated_from);
     }
     $supportingDocument = $this->contract->getSupportingDocuments($contract->id);
     $status = $this->contract->getStatus($id);
     $annotationStatus = $this->annotation->getStatus($id);
     $annotations = $contract->annotations;
     $contract->metadata_comment = $this->comment->getLatest($contract->id, Comment::TYPE_METADATA);
     $contract->text_comment = $this->comment->getLatest($contract->id, Comment::TYPE_TEXT);
     $contract->annotation_comment = $this->comment->getLatest($contract->id, Comment::TYPE_ANNOTATION);
     return view('contract.show', compact('contract', 'status', 'annotations', 'annotationStatus', 'translatedFrom', 'supportingDocument'));
 }