/**
  * set activity identifier
  */
 public function setIdentifier()
 {
     $reportingOrg = $this->organizationModel->find($this->orgId)->reporting_org;
     $reportingOrgIdentifier = $reportingOrg[0]['reporting_organization_identifier'];
     $activityIdentifier = $this->activity['activity_identifier'];
     $this->activityData['identifier'] = ["activity_identifier" => $activityIdentifier, 'iati_identifier_text' => sprintf('%s-%s', $reportingOrgIdentifier, $activityIdentifier)];
 }
 /**
  * return all organization data
  */
 public function get()
 {
     $id = request()->segment(2);
     $orgData = OrgData::where('organization_id', $id)->first()->toArray();
     $orgData['reporting_org'] = Organization::find($id)->reporting_org;
     return $orgData;
 }
 /**
  * return activity data with results and transactions
  * @param int $id
  */
 private function getActivityData($id)
 {
     $activityData = Activity::find($id);
     if ($activityData) {
         $activityData = $activityData->toArray();
         $reportingOrg = Organization::find($activityData['organization_id'])->reporting_org;
         $results = ActivityResult::where('activity_id', $id)->get()->toArray();
         $transactions = Transaction::where('activity_id', $id)->get()->toArray();
         $documentLinks = ActivityDocumentLink::where('activity_id', $id)->get()->toArray();
         $activityData['results'] = $results;
         $activityData['transactions'] = $transactions;
         $activityData['document_link'] = $documentLinks;
         $activityData['reporting_organization'] = $reportingOrg;
     }
     return $activityData;
 }
Ejemplo n.º 4
0
 public function edit($id)
 {
     $organization = Organization::find($id);
     return view('backend.organizations.edit')->with(compact('organization'));
 }
 /**
  * @param $id
  * @return model
  */
 public function getOrganization($id)
 {
     return $this->org->find($id);
 }