当前位置: 首页>>代码示例>>PHP>>正文


PHP Organization::getPublicData方法代码示例

本文整理汇总了PHP中Organization::getPublicData方法的典型用法代码示例。如果您正苦于以下问题:PHP Organization::getPublicData方法的具体用法?PHP Organization::getPublicData怎么用?PHP Organization::getPublicData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Organization的用法示例。


在下文中一共展示了Organization::getPublicData方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $events = array();
     $organization = Organization::getPublicData($id);
     if (isset($organization["links"]["events"])) {
         foreach ($organization["links"]["events"] as $key => $value) {
             $event = Event::getPublicData($key);
             $events[$key] = $event;
         }
     }
     foreach ($organization["links"]["members"] as $newId => $e) {
         if ($e["type"] == Organization::COLLECTION) {
             $member = Organization::getPublicData($newId);
         } else {
             $member = Person::getPublicData($newId);
         }
         if (isset($member["links"]["events"])) {
             foreach ($member["links"]["events"] as $key => $value) {
                 $event = Event::getPublicData($key);
                 $events[$key] = $event;
             }
         }
     }
     Rest::json($events);
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:25,代码来源:GetCalendarAction.php

示例2: run

 /**
  * 
  */
 public function run($id)
 {
     $controller = $this->getController();
     $params = array();
     //get The organization Id
     if (empty($id)) {
         throw new CTKException(Yii::t("organisation", "The Parent organization doesn't exist !"));
     }
     $params["parentOrganization"] = Organization::getPublicData($id);
     $lists = Lists::get(array("organisationTypes", "typeIntervention", "public"));
     if (!isset($lists["organisationTypes"]) || !isset($lists["typeIntervention"]) || !isset($lists["public"])) {
         throw new CTKException(Yii::t("organisation", Yii::t("organisation", "Missing List data in 'lists' collection, must have organisationTypes, typeIntervention, public")));
     }
     $params["types"] = $lists["organisationTypes"];
     $params["listTypeIntervention"] = $lists["typeIntervention"];
     $params["listPublic"] = $lists["public"];
     $params["tags"] = Tags::getActiveTags();
     $controller->layout = "//layouts/mainSimple";
     $controller->render("join", $params);
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:23,代码来源:JoinAction.php

示例3: run

 /**
  * 
  */
 public function run($id)
 {
     $controller = $this->getController();
     //get The organization Id
     if (empty($id)) {
         throw new CTKException("The organization id is mandatory to retrieve the organization !");
     }
     $organization = Organization::getPublicData($id);
     $controller->pageTitle = ucfirst($controller->module->id) . " - " . $controller->title;
     //Get this organizationEvent
     $events = array();
     if (isset($organization["links"]["events"])) {
         foreach ($organization["links"]["events"] as $key => $value) {
             $event = Event::getPublicData($key);
             $events[$key] = $event;
         }
     }
     //récupère les données de certains type de membres (TODO : à compléter)
     if (isset($organization["links"]["members"])) {
         foreach ($organization["links"]["members"] as $key => $value) {
             if ($value["type"] == 'organizations' || $value["type"] == 'organization' || $value["type"] == 'association' || $value["type"] == 'NGO') {
                 $publicData = Organization::getPublicData($key);
             }
             //if($value["type"] == 'citoyens')		 { $publicData = Person::getPublicData($key); }
             $addData = array("geo", "tags", "name", "description", "typeIntervention", "public");
             //"typeIntervention", "public" GRANDDIR only
             foreach ($addData as $data) {
                 if (!empty($publicData[$data])) {
                     $organization["links"]["members"][$key][$data] = $publicData[$data];
                 }
             }
         }
     }
     //Manage random Organization
     $organizationMembers = Organization::getMembersByOrganizationId($id, Organization::COLLECTION);
     $randomOrganizationId = array_rand($organizationMembers);
     $randomOrganization = Organization::getById($randomOrganizationId);
     $controller->render("sig", array("randomOrganization" => $randomOrganization, "organization" => $organization, "events" => $events, "members" => $organizationMembers));
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:42,代码来源:SigAction.php

示例4: run

 /**
  * Dashboard Organization
  */
 public function run($id)
 {
     $controller = $this->getController();
     if (empty($id)) {
         throw new CTKException(Yii::t("organisation", "The organization id is mandatory to retrieve the organization !"));
     }
     $organization = Organization::getPublicData($id);
     $events = Organization::listEventsPublicAgenda($id);
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->subTitle = isset($organization["shortDescripion"]) ? $organization["shortDescripion"] : "";
     $controller->pageTitle = $controller->title . " - " . $controller->subTitle;
     $params = array("organization" => $organization);
     $params["events"] = $events;
     //Same content Key base as the dashboard
     $contentKeyBase = Yii::app()->controller->id . ".dashboard";
     $params["contentKeyBase"] = $contentKeyBase;
     $limit = array(Document::IMG_PROFIL => 1, Document::IMG_MEDIA => 5);
     $images = Document::getListDocumentsURLByContentKey($id, $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
     $params["images"] = $images;
     $documents = Document::getWhere(array("type" => Organization::COLLECTION, "id" => $id));
     $params["documents"] = $documents;
     $contextMap = array();
     $contextMap["organization"] = $organization;
     $contextMap["events"] = array();
     $contextMap["organizations"] = array();
     $contextMap["people"] = array();
     $organizations = Organization::getMembersByOrganizationId($id, Organization::COLLECTION);
     $people = Organization::getMembersByOrganizationId($id, Person::COLLECTION);
     foreach ($organizations as $key => $value) {
         $newOrga = Organization::getById($key);
         array_push($contextMap["organizations"], $newOrga);
     }
     if (isset($organization["links"]) && isset($organization["links"]["members"])) {
         $equipe = array();
         $ca = array();
         $bureau = array();
         foreach ($organization["links"]["members"] as $key => $value) {
             if ($value["type"] == PHType::TYPE_CITOYEN && isset($value["roles"])) {
                 $person = Person::getById($key);
                 if (!empty($person)) {
                     if (in_array("Bureau", $value["roles"])) {
                         $bureau[$key] = $person;
                     }
                     if (in_array("Conseil d'administration", $value["roles"])) {
                         $ca[$key] = $person;
                     }
                     if (in_array("Equipe", $value["roles"])) {
                         $equipe[$key] = $person;
                     }
                 }
             }
         }
         if (count($equipe) > 0) {
             $params["equipe"] = $equipe;
         }
         if (count($ca) > 0) {
             $params["ca"] = $ca;
         }
         if (count($bureau) > 0) {
             $params["bureau"] = $bureau;
         }
     }
     foreach ($events as $key => $value) {
         $newEvent = Event::getById($key);
         array_push($contextMap["events"], $newEvent);
     }
     foreach ($people as $key => $value) {
         $newCitoyen = Person::getById($key);
         array_push($contextMap["people"], $newCitoyen);
     }
     $params["contextMap"] = $contextMap;
     $params["countries"] = OpenData::getCountriesList();
     $lists = Lists::get(array("organisationTypes"));
     $params["organizationTypes"] = $lists["organisationTypes"];
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->render("dashboard1", $params);
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:80,代码来源:Dashboard1Action.php

示例5: run

 /**
  * Dashboard Organization
  */
 public function run($id)
 {
     $controller = $this->getController();
     if (empty($id)) {
         throw new CTKException(Yii::t("organisation", "The organization id is mandatory to retrieve the organization !"));
     }
     $organization = Organization::getPublicData($id);
     $events = Organization::listEventsPublicAgenda($id);
     $members = array("citoyens" => array(), "organizations" => array());
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->subTitle = isset($organization["shortDescripion"]) ? $organization["shortDescripion"] : "";
     $controller->pageTitle = "Organization " . $controller->title . " - " . $controller->subTitle;
     if (isset($organization["_id"]) && isset(Yii::app()->session["userId"]) && Link::isLinked((string) $organization["_id"], Organization::COLLECTION, Yii::app()->session["userId"])) {
         $controller->toolbarMBZ = array("<li id='linkBtns'><a href='javascript:;' class='removeMemberBtn text-red tooltips' data-name='" . $organization["name"] . "' data-memberof-id='" . $organization["_id"] . "' data-member-type='" . Person::COLLECTION . "' data-member-id='" . Yii::app()->session["userId"] . "' data-placement='top' data-original-title='Remove from my Organizations' ><i class='disconnectBtnIcon fa fa-unlink'></i>NOT MEMBER</a></li>");
     } else {
         $controller->toolbarMBZ = array("<li id='linkBtns'><a href='javascript:;' class='connectBtn tooltips ' id='addMeAsMemberInfo' data-placement='top' data-original-title='I'm member of this organization' ><i class=' connectBtnIcon fa fa-link '></i>I'M MEMBER</a></li>");
     }
     $contentKeyBase = Yii::app()->controller->id . "." . Yii::app()->controller->action->id;
     $limit = array(Document::IMG_PROFIL => 1, Document::IMG_MEDIA => 5);
     $images = Document::getListDocumentsURLByContentKey($id, $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
     $params = array("organization" => $organization);
     $params["contentKeyBase"] = $contentKeyBase;
     $params["images"] = $images;
     $params["events"] = $events;
     $contextMap = array();
     $contextMap["organization"] = $organization;
     $contextMap["events"] = array();
     $contextMap["organizations"] = array();
     $contextMap["people"] = array();
     $organizations = Organization::getMembersByOrganizationId($id, Organization::COLLECTION);
     $people = Organization::getMembersByOrganizationId($id, Person::COLLECTION);
     foreach ($organizations as $key => $value) {
         $newOrga = Organization::getById($key);
         array_push($contextMap["organizations"], $newOrga);
         array_push($members["organizations"], $newOrga);
     }
     foreach ($events as $key => $value) {
         $newEvent = Event::getById($key);
         array_push($contextMap["events"], $newEvent);
     }
     foreach ($people as $key => $value) {
         $newCitoyen = Person::getById($key);
         $profil = Document::getLastImageByKey($key, Person::COLLECTION, Document::IMG_PROFIL);
         if ($profil != "") {
             $newCitoyen["imagePath"] = $profil;
         }
         array_push($contextMap["people"], $newCitoyen);
         array_push($members["citoyens"], $newCitoyen);
     }
     $params["members"] = $members;
     $params["contextMap"] = $contextMap;
     //list
     $params["tags"] = Tags::getActiveTags();
     $lists = Lists::get(array("public", "typeIntervention", "organisationTypes"));
     $params["public"] = $lists["public"];
     $params["organizationTypes"] = $lists["organisationTypes"];
     $params["typeIntervention"] = $lists["typeIntervention"];
     $params["countries"] = OpenData::getCountriesList();
     //Plaquette de présentation
     $listPlaquette = Document::listDocumentByCategory($id, Organization::COLLECTION, Document::CATEGORY_PLAQUETTE, array('created' => 1));
     $params["plaquette"] = reset($listPlaquette);
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->render("dashboard", $params);
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:67,代码来源:DashboardAction.php

示例6: actionSimple

 public function actionSimple()
 {
     $this->layout = "//layouts/mainSimple";
     $params = array();
     //get The person Id
     $id = Yii::app()->session["userId"];
     /* **************************************
      *  PERSON
      ***************************************** */
     $person = Person::getPublicData($id);
     $this->title = (isset($person["name"]) ? $person["name"] : "") . "'s Directory";
     $this->subTitle = isset($person["description"]) ? $person["description"] : "";
     $this->pageTitle = ucfirst($this->module->id) . " - " . $this->title;
     /* **************************************
      *  EVENTS
      ***************************************** */
     $events = Authorisation::listEventsIamAdminOf($id);
     $eventsAttending = Event::listEventAttending($id);
     foreach ($eventsAttending as $key => $value) {
         $eventId = (string) $value["_id"];
         if (!isset($events[$eventId])) {
             $events[$eventId] = $value;
         }
     }
     //TODO - SBAR : Pour le dashboard person, affiche t-on les événements des associations dont je suis memebre ?
     //Get the organization where i am member of;
     /* **************************************
      *  ORGANIZATIONS
      ***************************************** */
     $organizations = array();
     if (isset($person["links"]) && isset($person["links"]["memberOf"])) {
         foreach ($person["links"]["memberOf"] as $key => $member) {
             $organization;
             if ($member['type'] == Organization::COLLECTION) {
                 $organization = Organization::getPublicData($key);
                 $profil = Document::getLastImageByKey($key, Organization::COLLECTION, Document::IMG_PROFIL);
                 if ($profil != "") {
                     $organization["imagePath"] = $profil;
                 }
                 array_push($organizations, $organization);
             }
             if (isset($organization["links"]["events"])) {
                 foreach ($organization["links"]["events"] as $keyEv => $valueEv) {
                     $event = Event::getPublicData($keyEv);
                     $profil = Document::getLastImageByKey($keyEv, Event::COLLECTION, Document::IMG_PROFIL);
                     if ($profil != "") {
                         $event["imagePath"] = $profil;
                     }
                     $events[$keyEv] = $event;
                 }
             }
         }
         //$randomOrganizationId = array_rand($subOrganizationIds);
         //$randomOrganization = Organization::getById( $subOrganizationIds[$randomOrganizationId] );
         //$params["randomOrganization"] = $randomOrganization;
     }
     /* **************************************
      *  PEOPLE
      ***************************************** */
     $people = array();
     if (isset($person["links"]) && isset($person["links"]["knows"])) {
         foreach ($person["links"]["knows"] as $key => $member) {
             if ($member['type'] == Person::COLLECTION) {
                 $citoyen = Person::getPublicData($key);
                 $profil = Document::getLastImageByKey($key, Person::COLLECTION, Document::IMG_PROFIL);
                 if ($profil != "") {
                     $citoyen["imagePath"] = $profil;
                 }
                 array_push($people, $citoyen);
             }
         }
     }
     /* **************************************
      *  PROJECTS
      ***************************************** */
     $projects = array();
     if (isset($person["links"]["projects"])) {
         foreach ($person["links"]["projects"] as $key => $value) {
             $project = Project::getPublicData($key);
             array_push($projects, $project);
         }
     }
     $params["person"] = $person;
     $params["organizations"] = $organizations;
     $params["projects"] = $projects;
     $params["events"] = $events;
     $params["people"] = $people;
     $this->render("index", $params);
 }
开发者ID:zourite,项目名称:communecter,代码行数:89,代码来源:DefaultController.php

示例7: run

 public function run($insee = null)
 {
     $controller = $this->getController();
     //get The person Id
     if (empty($id)) {
         if (empty(Yii::app()->session["userId"])) {
             $controller->redirect(Yii::app()->homeUrl);
         } else {
             $id = Yii::app()->session["userId"];
         }
     }
     $person = Person::getPublicData($id);
     $contentKeyBase = Yii::app()->controller->id . "." . Yii::app()->controller->action->id;
     $limit = array(Document::IMG_PROFIL => 1, Document::IMG_MEDIA => 5);
     $images = Document::getListDocumentsURLByContentKey($id, $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
     $params = array("person" => $person);
     $params['images'] = $images;
     $params["contentKeyBase"] = $contentKeyBase;
     $controller->sidebar1 = array(array('label' => "ACCUEIL", "key" => "home", "iconClass" => "fa fa-home", "href" => "communecter/person/dashboard/id/" . $id));
     $controller->title = "City Dashboard : " . $insee;
     $controller->subTitle = isset($person["description"]) ? $person["description"] : "";
     $controller->pageTitle = ucfirst($controller->module->id) . " - Informations publiques de " . $controller->title;
     //Get Projects
     $projects = array();
     if (isset($person["links"]["projects"])) {
         foreach ($person["links"]["projects"] as $key => $value) {
             $project = Project::getPublicData($key);
             array_push($projects, $project);
         }
     }
     //Get the Events
     $events = Authorisation::listEventsIamAdminOf($id);
     $eventsAttending = Event::listEventAttending($id);
     foreach ($eventsAttending as $key => $value) {
         $eventId = (string) $value["_id"];
         if (!isset($events[$eventId])) {
             $events[$eventId] = $value;
         }
     }
     $tags = PHDB::findOne(PHType::TYPE_LISTS, array("name" => "tags"), array('list'));
     //TODO - SBAR : Pour le dashboard person, affiche t-on les événements des associations dont je suis memebre ?
     //Get the organization where i am member of;
     $organizations = array();
     if (isset($person["links"]) && isset($person["links"]["memberOf"])) {
         foreach ($person["links"]["memberOf"] as $key => $member) {
             $organization;
             if ($member['type'] == Organization::COLLECTION) {
                 $organization = Organization::getPublicData($key);
                 $profil = Document::getLastImageByKey($key, Organization::COLLECTION, Document::IMG_PROFIL);
                 if ($profil != "") {
                     $organization["imagePath"] = $profil;
                 }
                 array_push($organizations, $organization);
             }
             if (isset($organization["links"]["events"])) {
                 foreach ($organization["links"]["events"] as $keyEv => $valueEv) {
                     $event = Event::getPublicData($keyEv);
                     $events[$keyEv] = $event;
                 }
             }
         }
         //$randomOrganizationId = array_rand($subOrganizationIds);
         //$randomOrganization = Organization::getById( $subOrganizationIds[$randomOrganizationId] );
         //$params["randomOrganization"] = $randomOrganization;
     }
     $people = array();
     if (isset($person["links"]) && isset($person["links"]["knows"])) {
         foreach ($person["links"]["knows"] as $key => $member) {
             $citoyen;
             if ($member['type'] == PHType::TYPE_CITOYEN) {
                 $citoyen = Person::getPublicData($key);
                 $profil = Document::getLastImageByKey($key, Person::COLLECTION, Document::IMG_PROFIL);
                 if ($profil != "") {
                     $citoyen["imagePath"] = $profil;
                 }
                 array_push($people, $citoyen);
             }
         }
     }
     $params["tags"] = $tags;
     $params["organizations"] = $organizations;
     $params["projects"] = $projects;
     $params["events"] = $events;
     $params["people"] = $people;
     $params["insee"] = $insee;
     $controller->render("dashboard", $params);
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:87,代码来源:IndexAction.php

示例8: run

 /**
  * Dashboard Organization
  */
 public function run($id)
 {
     $controller = $this->getController();
     //get The organization Id
     if (empty($id)) {
         throw new CTKException(Yii::t("organisation", "The organization id is mandatory to retrieve the organization !"));
     }
     $organization = Organization::getPublicData($id);
     $params = array("organization" => $organization);
     $controller->title = isset($organization["name"]) ? $organization["name"] : "";
     $controller->subTitle = isset($organization["shortDescripion"]) ? $organization["shortDescripion"] : "";
     $controller->pageTitle = ucfirst($controller->module->id) . " - Informations publiques de " . $controller->title;
     //Same content Key base as the dashboard
     $contentKeyBase = Yii::app()->controller->id . ".dashboard";
     $params["contentKeyBase"] = $contentKeyBase;
     if (isset($organization["links"]) && isset($organization["links"]["members"])) {
         $memberData;
         $subOrganizationIds = array();
         $members = array("citoyens" => array(), "organizations" => array());
         foreach ($organization["links"]["members"] as $key => $member) {
             if ($member['type'] == Organization::COLLECTION) {
                 array_push($subOrganizationIds, $key);
                 $memberData = Organization::getPublicData($key);
                 array_push($members[Organization::COLLECTION], $memberData);
             } elseif ($member['type'] == PHType::TYPE_CITOYEN) {
                 $memberData = Person::getPublicData($key);
                 array_push($members[PHType::TYPE_CITOYEN], $memberData);
             }
         }
         if (count($subOrganizationIds) != 0) {
             $randomOrganizationId = array_rand($subOrganizationIds);
             $randomOrganization = Organization::getById($subOrganizationIds[$randomOrganizationId]);
             //Load the images
             $limit = array(Document::IMG_PROFIL => 1, Document::IMG_LOGO => 1);
             $images = Document::getListDocumentsURLByContentKey((string) $randomOrganization["_id"], $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
             $randomOrganization["images"] = $images;
             $params["randomOrganization"] = $randomOrganization;
         }
         $params["members"] = $members;
     }
     $limit = array(Document::IMG_PROFIL => 1, Document::IMG_MEDIA => 5);
     $images = Document::getListDocumentsURLByContentKey($id, $contentKeyBase, Document::DOC_TYPE_IMAGE, $limit);
     $params["images"] = $images;
     $events = Organization::listEventsPublicAgenda($id);
     $params["events"] = $events;
     $lists = Lists::get(array("organisationTypes"));
     $params["organizationTypes"] = $lists["organisationTypes"];
     $contextMap = array();
     $contextMap["organization"] = $organization;
     $contextMap["events"] = array();
     $contextMap["organizations"] = array();
     $contextMap["people"] = array();
     $organizations = Organization::getMembersByOrganizationId($id, Organization::COLLECTION);
     $people = Organization::getMembersByOrganizationId($id, Person::COLLECTION);
     foreach ($organizations as $key => $value) {
         $newOrga = Organization::getById($key);
         array_push($contextMap["organizations"], $newOrga);
     }
     foreach ($events as $key => $value) {
         $newEvent = Event::getById($key);
         array_push($contextMap["events"], $newEvent);
     }
     foreach ($people as $key => $value) {
         $newCitoyen = Person::getById($key);
         array_push($contextMap["people"], $newCitoyen);
     }
     $params["contextMap"] = $contextMap;
     $controller->render("dashboardMember", $params);
 }
开发者ID:CivicTechFR,项目名称:PixelHumain,代码行数:72,代码来源:DashboardMemberAction.php


注:本文中的Organization::getPublicData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。