Exemplo n.º 1
0
 public function run($id)
 {
     $controller = $this->getController();
     //get The job Id
     if (empty($id)) {
         throw new CTKException(Yii::t("job", "The job posting id is mandatory to retrieve the job posting !"));
     }
     if (empty($_POST["mode"])) {
         $mode = "view";
     } else {
         $mode = $_POST["mode"];
     }
     if ($mode == "insert") {
         $job = array();
         $controller->title = Yii::t("job", "New Job Offer");
         $controller->subTitle = Yii::t("job", "Fill the form");
     } else {
         $job = Job::getById($id);
         $controller->title = $job["title"];
         $controller->subTitle = isset($job["description"]) ? $job["description"] : (isset($job["type"]) ? "Type " . $job["type"] : "");
     }
     $tags = json_encode(Tags::getActiveTags());
     $organizations = Authorisation::listUserOrganizationAdmin(Yii::app()->session["userId"]);
     $controller->pageTitle = Yii::t("job", "Job Posting");
     Rest::json(array("result" => true, "content" => $controller->renderPartial("jobSV", array("job" => $job, "tags" => $tags, "organizations" => $organizations, "mode" => $mode), true)));
 }
Exemplo n.º 2
0
 public function run($id, $type)
 {
     $controller = $this->getController();
     $item = PHDB::findOne($type, array("_id" => new MongoId($id)));
     $params = array();
     $params["itemId"] = $id;
     $params['itemType'] = $type;
     //TODO SBAR - it's not beautifull. Refactor soon
     switch ($type) {
         case Person::COLLECTION:
             $controllerId = "person";
             break;
         case Organization::COLLECTION:
             $controllerId = "organization";
             break;
         case Project::COLLECTION:
             $controllerId = "project";
             break;
         case Event::COLLECTION:
             $controllerId = "event";
             break;
         default:
             throw new CTKException("Impossible to manage this type " . $type);
             break;
     }
     if (isset(Yii::app()->session["userId"])) {
         $params["canEdit"] = Authorisation::canEditItem(Yii::app()->session["userId"], $type, $id);
     }
     $params['controllerId'] = $controllerId;
     $params['images'] = Document::getListDocumentsByContentKey($id, $controllerId, Document::DOC_TYPE_IMAGE);
     $controller->title = $item["name"] . "'s Gallery";
     $controller->subTitle = "";
     $controller->render("gallery", $params);
 }
Exemplo n.º 3
0
 public function run($id, $type, $getSub = false)
 {
     $controller = $this->getController();
     $controller->title = "RESSOURCES";
     $controller->subTitle = "Toutes les ressources de nos associations";
     $controller->pageTitle = ucfirst($controller->module->id) . " - " . $controller->title;
     if ($type == Organization::COLLECTION) {
         $organizations = array();
         $organization = Organization::getById($id);
         $organizations[$id] = $organization['name'];
     }
     $documents = Document::getWhere(array("type" => $type, "id" => $id, "contentKey" => array('$exists' => false)));
     if ($getSub && $type == Organization::COLLECTION && Authorisation::canEditMembersData($id)) {
         $subOrganization = Organization::getMembersByOrganizationId($id, Organization::COLLECTION);
         foreach ($subOrganization as $key => $value) {
             $organization = Organization::getById($key);
             $organizations[$key] = $organization['name'];
             $documents = array_merge($documents, Document::getWhere(array("type" => $type, "id" => $key, "contentKey" => array('$exists' => false))));
         }
     }
     $categories = Document::getAvailableCategories($id, $type);
     $params = array("documents" => $documents, "id" => $id, "categories" => $categories, "organizations" => $organizations, "getSub" => $getSub);
     if (Yii::app()->request->isAjaxRequest) {
         echo $controller->renderPartial("documents", $params, true);
     } else {
         $controller->render("documents", $params);
     }
 }
Exemplo n.º 4
0
 public function run($id, $type)
 {
     $controller = $this->getController();
     $params = array();
     $params["type"] = $type;
     $params["itemId"] = $id;
     if (isset(Yii::app()->session["userId"])) {
         $params["canEdit"] = Authorisation::canEditItem(Yii::app()->session["userId"], $type, $id);
     }
     if (Yii::app()->request->isAjaxRequest) {
         echo $controller->renderPartial("photoVideo", $params, true);
     } else {
         $controller->render("photoVideo", $params);
     }
 }
 function initPage()
 {
     //managed public and private sections through a url manager
     if (Yii::app()->controller->id == "admin" && !Yii::app()->session["userIsAdmin"]) {
         throw new CHttpException(403, Yii::t('error', 'Unauthorized Access.'));
     }
     $page = $this->pages[Yii::app()->controller->id][Yii::app()->controller->action->id];
     $pagesWithoutLogin = array("person/login", "person/register", "person/authenticate", "person/activate", "person/sendemail", "person/checkusername", "document/resized");
     $prepareData = true;
     //if (true)//(isset($_SERVER["HTTP_ORIGIN"]) )//&& $_SERVER["REMOTE_ADDR"] == "52.30.32.155" ) //this is an outside call
     //{
     //$host = "meteor.communecter.org";
     //if (strpos("http://".$host, $_SERVER["HTTP_ORIGIN"]) >= 0 || strpos("https://".$host, $_SERVER["HTTP_ORIGIN"]) >= 0 ){
     if (isset($_POST["X-Auth-Token"]) && Authorisation::isMeteorConnected($_POST["X-Auth-Token"])) {
         $prepareData = false;
     } else {
         if (!isset($page["public"]) && !in_array(Yii::app()->controller->id . "/" . Yii::app()->controller->action->id, $pagesWithoutLogin) && !Yii::app()->session["userId"]) {
             Yii::app()->session["requestedUrl"] = Yii::app()->request->url;
             $this->redirect(Yii::app()->createUrl("/" . $this->module->id . "/person/login"));
         }
     }
     if (isset($_GET["backUrl"])) {
         Yii::app()->session["requestedUrl"] = $_GET["backUrl"];
     }
     /*if( !isset(Yii::app()->session['logguedIntoApp']) || Yii::app()->session['logguedIntoApp'] != $this->module->id)
       $this->redirect(Yii::app()->createUrl("/".$this->module->id."/person/logout"));*/
     if ($prepareData) {
         $this->sidebar1 = array_merge(Menu::menuItems(), $this->sidebar1);
         $this->person = Person::getPersonMap(Yii::app()->session["userId"]);
         $this->title = isset($page["title"]) ? $page["title"] : $this->title;
         $this->subTitle = isset($page["subTitle"]) ? $page["subTitle"] : $this->subTitle;
         $this->pageTitle = isset($page["pageTitle"]) ? $page["pageTitle"] : $this->pageTitle;
         $this->notifications = ActivityStream::getNotifications(array("notify.id" => Yii::app()->session["userId"]));
         CornerDev::addWorkLog("communecter", "*****@*****.**", Yii::app()->controller->id, Yii::app()->controller->action->id);
     }
 }
 public function run($id, $type)
 {
     $controller = $this->getController();
     $params = array();
     $events = array();
     if ($type == Organization::COLLECTION) {
         $events = Event::getListCurrentEventsByOrganizationId($id, 3);
         $params["organizationId"] = $id;
     } else {
         if ($type == Person::COLLECTION) {
             $events = Event::getListCurrentEventsByPeopleId($id, 3);
             $params["itemId"] = $id;
         }
     }
     $params["eventsAgenda"] = $events;
     if (isset(Yii::app()->session["userId"])) {
         $params["canEdit"] = Authorisation::canEditItem(Yii::app()->session["userId"], $type, $id);
     }
     if (Yii::app()->request->isAjaxRequest) {
         echo $controller->renderPartial("sliderAgenda", $params, true);
     } else {
         $controller->render("sliderAgenda", $params);
     }
 }
Exemplo n.º 7
0
		<?php 
if (!@$isNotSV) {
    ?>
			<h1><?php 
    echo Yii::t("event", "Add new event", null, Yii::app()->controller->module->id);
    ?>
</h1>
		<?php 
}
?>
		<div class="row">
		<div class="col-md-12">
			<form class="form-event">
			<?php 
$myOrganizationAdmin = Authorisation::listUserOrganizationAdmin(Yii::app()->session["userId"]);
$myProjectAdmin = Authorisation::listProjectsIamAdminOf(Yii::app()->session["userId"]);
?>
			<div class="col-md-6">
				<div class="selectpicker">
					<div class="form-group" id="orgaDrop" name="orgaDrop">
						<h3 class="text-orange"><i class="fa fa-angle-down"></i> <?php 
echo Yii::t("common", "Informations générales");
?>
</h3>
                        <a class="form-control dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="true">
                          	<span id="labelOrga"><?php 
echo Yii::t("event", "Choose an organizer", null, Yii::app()->controller->module->id);
?>
</span><span class="caret"></span>
                        </a>
                        <!--<div class="panel-scroll height-230 ps-container">-->
Exemplo n.º 8
0
<div class="panel panel-white">
  <div class="panel-heading border-light">
    <h4 class="panel-title">Annuaire </h4>
    <div class="panel-tools">
		<?php 
$nbOrganization = isset($members[Organization::COLLECTION]) ? count($members[Organization::COLLECTION]) : 0;
$nbPerson = isset($members[Person::COLLECTION]) ? count($members[Person::COLLECTION]) : 0;
$isAuthorized = false;
if (isset($organization) && isset(Yii::app()->session["userId"])) {
    $isAuthorized = Authorisation::isOrganizationAdmin(Yii::app()->session["userId"], (string) $organization["_id"]);
    if ($isAuthorized) {
        ?>
			<a href="#addMembers" class="addMembersBtn btn btn-xs btn-light-blue tooltips" data-placement="top" data-original-title="Connect People or Organizations that are part of your Organization"><i class="fa fa-plus"></i></a>
		<?php 
    }
}
?>
	</div>
  </div>
  <div class="panel-body no-padding">
    <div class="tabbable no-margin no-padding partition-dark">
      <ul class="nav nav-tabs" id="myTab">
        <li class="<?php 
if ($nbPerson > $nbOrganization) {
    echo "active";
}
?>
">
          <a data-toggle="tab" href="#users_tab_example2">
            <i class="fa fa-user text-red"></i> People <span class="badge badge-red"><?php 
echo $nbPerson;
Exemplo n.º 9
0
	</div>
	</div>
	</div>
</div>


<script type="text/javascript">

	var organizationId = "<?php 
if (isset($organizationId)) {
    echo $organizationId;
}
?>
";
	var listOrgaAdmin = <?php 
echo json_encode(Authorisation::listUserOrganizationAdmin(Yii::app()->session["userId"]));
?>
;
	var parentOrga = [];
	var defaultHours;


	if("undefined" != typeof organizationId && organizationId != ""){
		parentOrga = organizationId;
	}

	$(".daterangepicker").on("hide.daterangepicker", function(){
	 	console.log("ok");
	})

	$(".daterangepicker").on("apply.daterangepicker", function(ev, picker){
Exemplo n.º 10
0
echo $nbComment;
?>
</span>
							</a>
							<!-- end: TIMELINE PANEL -->
						</li>
						<li role="presentation">
							<a href="#entry_community_comments" data-toggle="tab">
								Community Selected <span class="badge badge-yellow"><?php 
echo count($communitySelectedComments);
?>
</span>
							</a>
						</li>
					<?php 
if (Authorisation::canEditEntry(Yii::app()->session["userId"], (string) $context["_id"])) {
    ?>
						<li role="presentation">
							<a href="#entry_abuse" data-toggle="tab">
								Abuse <span class="badge badge-red"><?php 
    echo count($abusedComments);
    ?>
</span>
							</a>
						</li>
					<?php 
}
?>
					</ul>
					<div class="tab-content partition-white">
						<div class="tab-pane active no-padding" id="entry_comments" >
Exemplo n.º 11
0
 public function actionListEvent()
 {
     var_dump(Authorisation::listEventsIamAdminOf(Yii::app()->session["userId"]));
 }
Exemplo n.º 12
0
        if (isset($e["name"])) {
            echo $e["name"];
        }
        ?>
							</a>
						</td>
						<td><?php 
        if (isset($e["type"])) {
            echo $e["type"];
        }
        ?>
</td>
						<td class="center">
							<div class="visible-md visible-lg hidden-sm hidden-xs">
								<?php 
        if (isset(Yii::app()->session["userId"]) && Authorisation::isEventAdmin((string) $e["_id"], Yii::app()->session["userId"])) {
            ?>
								<a href="javascript:;" class="disconnectBtn btn btn-xs btn-red tooltips " data-type="<?php 
            echo PHType::TYPE_EVENTS;
            ?>
" data-id="<?php 
            echo (string) $e["_id"];
            ?>
" data-name="<?php 
            echo (string) $e["name"];
            ?>
" data-placement="left" data-original-title="Unlink event" ><i class=" disconnectBtnIcon fa fa-unlink"></i></a>
								<?php 
        }
        ?>
							</div>
Exemplo n.º 13
0
$cs->registerScriptFile(Yii::app()->theme->baseUrl . '/assets/plugins/wysihtml5/bootstrap-wysihtml5-0.0.2/bootstrap-wysihtml5.js', CClientScript::POS_END, array(), 2);
$cs->registerScriptFile(Yii::app()->theme->baseUrl . '/assets/plugins/wysihtml5/wysihtml5.js', CClientScript::POS_END, array(), 2);
//Data helper
$cs->registerScriptFile($this->module->assetsUrl . '/js/dataHelpers.js', CClientScript::POS_END, array(), 2);
//X-Editable postal Code
$cs->registerScriptFile($this->module->assetsUrl . '/js/postalCode.js', CClientScript::POS_END, array(), 2);
?>
<div class="panel panel-white">
	<div class="panel-heading border-light">
		<h4 class="panel-title"><span><i class="fa fa-info fa-2x text-blue"></i> NEED Description</span></h4>
		<div class="navigator padding-0 text-right">
			<div class="panel-tools">
				<?php 
$edit = false;
if (isset(Yii::app()->session["userId"]) && isset($_GET["id"])) {
    $edit = Authorisation::canEditItem(Yii::app()->session["userId"], $_GET["type"], (string) $_GET["id"]);
}
if ($edit) {
    ?>
				<a href="#" id="editNeedDescription" class="btn btn-xs btn-light-blue tooltips" data-toggle="tooltip" data-placement="top" title="Editer la description" alt=""><i class="fa fa-pencil"></i></a>
        		<?php 
}
?>
			</div>
		</div>
	</div>
	<div class="panel-body padding">
		<a href="#" id="description" data-type="wysihtml5" data-original-title="Enter the need's description" class="editable editable-click">Sed cautela nimia in peiores haeserat plagas, ut narrabimus postea, aemulis consarcinantibus insidias graves apud Constantium, cetera medium principem sed siquid auribus eius huius modi quivis infudisset ignotus, acerbum et inplacabilem et in hoc causarum titulo dissimilem sui.

Vbi curarum abiectis ponderibus aliis tamquam nodum et codicem difficillimum Caesarem convellere nisu valido cogitabat, eique deliberanti cum proximis clandestinis conloquiis et nocturnis qua vi, quibusve commentis id fieret, antequam effundendis rebus pertinacius incumberet confidentia, acciri mollioribus scriptis per simulationem tractatus publici nimis urgentis eundem placuerat Gallum, ut auxilio destitutus sine ullo interiret obstaculo.</a>
	</div>
Exemplo n.º 14
0
 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);
 }
Exemplo n.º 15
0
	    		<?php 
$params = array("organization" => $organization, "tags" => $tags, "images" => $images, "plaquette" => $plaquette, "organizationTypes" => $organizationTypes, "countries" => $countries, "typeIntervention" => $typeIntervention, "publics" => $public);
$this->renderPartial('../pod/ficheInfo', $params);
?>
	    	</div>
	    	<div class="col-sm-12 col-xs-12 documentPod">
	    		<div class="panel panel-white pulsate">
					<div class="panel-heading border-light ">
						<h4 class="panel-title"> <i class='fa fa-cog fa-spin fa-2x icon-big text-center'></i> Loading Documents Section</h4>
						<div class="space5"></div>
					</div>
				</div>
	    		
	    	</div>
	    	<?php 
if (isset($organization) && isset(Yii::app()->session["userId"]) && Authorisation::isOrganizationAdmin(Yii::app()->session["userId"], (string) $organization["_id"])) {
    ?>
			<div class="col-sm-12 col-xs-12">
	    		<?php 
    $this->renderPartial('dashboard/network', array("organization" => $organization, "members" => $members, "organizationTypes" => $organizationTypes));
    ?>
	    	</div>
	    	<?php 
}
?>
	    	
	    	<div class="col-sm-12 col-xs-12 jobPod">
	    		<div class="panel panel-white pulsate">
					<div class="panel-heading border-light ">
						<h4 class="panel-title"> <i class='fa fa-cog fa-spin fa-2x icon-big text-center'></i> Loading Jobs Section</h4>
						<div class="space5"></div>
Exemplo n.º 16
0
<?php

$this->renderPartial('gedSV', array("categories" => $categories));
?>
<div class="row">

  <div class="col-xs-12 docsPanel">
    <div class="panel panel-white">
    	<div class="panel-heading border-light">
			<h4 class="panel-title">Documents</h4>
		</div>
		<div class="panel-tools">
			<?php 
if (isset($id) && isset(Yii::app()->session["userId"]) && Authorisation::isOrganizationAdmin(Yii::app()->session["userId"], $id) && !isset($organization["disabled"])) {
    ?>
				<a href="#genericGED" class="new-file btn btn-xs btn-light-blue tooltips" data-placement="top" data-original-title="Add a File"><i class="fa fa-plus"></i></a>
			<?php 
}
?>
		</div>
		
      <div class="panel-body no-padding">
        <div class="panel-scroll height-230">
          <table class="table table-striped table-hover">
            <tbody class="docsList">
            	<?php 
if (!empty($documents)) {
    foreach ($documents as $doc) {
        ?>
	              	<tr class="file<?php 
        echo $doc['_id'];
Exemplo n.º 17
0
	<div class="panel panel-white">
		<div class="panel-heading border-light">
			<h4 class="panel-title"><i class="fa fa-users fa-2x text-green"></i> Participants</h4>
		</div>
		<div class="panel-tools">
			<?php 
if (Authorisation::isEventAdmin((string) $event['_id'], @Yii::app()->session["userId"])) {
    ?>
				<a href="#newAttendees" class="new-attendees btn btn-xs btn-light-blue tooltips" data-toggle="tooltip" data-placement="top" title="Add attendees" alt="Add attendees"><i class="fa fa-plus"></i> </a>
			<?php 
}
?>
		</div>
		<div class="panel-body no-padding">
			<div class="tabbable no-margin no-padding partition-dark">
				<ul id="myTab" class="nav nav-tabs">
					<li class="active">
						<a href="#users_tab_attending" data-toggle="tab">
							<span><i class="fa fa-child"></i>
							Attending
							</span>
						</a>
					</li>
				</ul>
				<div class="tab-content partition-white">
					<div class="tab-pane padding-bottom-5 active" id="users_tab_attending">
						<div class="panel-scroll height-230 ps-container">
							<table class="table table-striped table-hover">
								<tbody>
									<?php 
Exemplo n.º 18
0
            <a class="panel-expand" href="#">
              <i class="fa fa-expand"></i> <span>Fullscreen</span>
            </a>
          </li>
        </ul>
      </div>
      <a class="btn btn-xs btn-link panel-close" href="#">
        <i class="fa fa-times"></i>
      </a>
    </div>
  </div>
  <div class="panel-body no-padding center orgaDescription">
    <div class="row">
    	<div class="col-md-12">
    	<?php 
$this->renderPartial('../pod/fileupload', array("itemId" => (string) $organization["_id"], "type" => Organization::COLLECTION, "contentId" => Document::IMG_BANNIERE, "show" => "true", "editMode" => Authorisation::isOrganizationAdmin(Yii::app()->session['userId'], $organization["_id"])));
?>
 		</div>   
    </div>	
  </div>
</div>

<script type="text/javascript">

var formDefinition = {
    "jsonSchema" : {
        "title" : "About Pod Form",
        "type" : "object",
        "properties" : {
            "description" :{
            	"inputType" : "textarea",
Exemplo n.º 19
0
 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);
 }
Exemplo n.º 20
0
	    position: relative;
	    height: 100%;
	    width: auto;
	    margin-left: auto;
	    margin-right: auto;
	    max-width: 100%;
	}

	
</style>
<div id="sliderPhotoPod" onresize="javascript:resizeSlider()">
	<div class="panel panel-white">
		<div class="panel-heading border-light"></div>
		<div class="panel-tools">
			<?php 
if (isset($userId) && isset(Yii::app()->session["userId"]) && $userId == Yii::app()->session["userId"] || isset($itemId) && isset(Yii::app()->session["userId"]) && Authorisation::canEditItem(Yii::app()->session["userId"], $type, $itemId) || isset($isAdmin)) {
    ?>
				<a href="#" class="add-photo btn btn-xs btn-light-blue tooltips" data-toggle="tooltip" data-placement="top" title="Add image" alt="Add image"><i class="fa fa-plus"></i></a>
				<a href="#" class="setbgCustom btn btn-xs btn-light-blue " data-class="bgCustom"  title="Set as Background" alt="Set as Background">Set as Background</a>
			<?php 
}
?>
			<a href="#galleryPhoto" class="gallery-photo btn btn-xs btn-light-blue tooltips" data-toggle="tooltip" data-placement="top" title="Show gallery" alt="Show gallery"><i class="fa fa-camera"></i> Show gallery</a>
		</div>
		<div class="panel-body">
			<div class="center">
				<!--<div class="flexslider" id="flexsliderPhoto">
					<ul class="slides" id="slidesPhoto">
						
					</ul>
				</div> -->
Exemplo n.º 21
0
$cs->registerScriptFile(Yii::app()->theme->baseUrl . '/assets/plugins/wysihtml5/bootstrap-wysihtml5-0.0.2/bootstrap-wysihtml5.js', CClientScript::POS_END, array(), 2);
$cs->registerScriptFile(Yii::app()->theme->baseUrl . '/assets/plugins/wysihtml5/wysihtml5.js', CClientScript::POS_END, array(), 2);
//Data helper
$cs->registerScriptFile($this->module->assetsUrl . '/js/dataHelpers.js', CClientScript::POS_END, array(), 2);
//X-Editable postal Code
$cs->registerScriptFile($this->module->assetsUrl . '/js/postalCode.js', CClientScript::POS_END, array(), 2);
?>
<div class="panel panel-white">
	<div class="panel-heading border-light">
		<h4 class="panel-title"><span><i class="fa fa-info fa-2x text-blue"></i> PROJECT INFORMATION</span></h4>
		<div class="navigator padding-0 text-right">
			<div class="panel-tools">
				<?php 
$edit = false;
if (isset(Yii::app()->session["userId"]) && isset($project["_id"])) {
    $edit = Authorisation::canEditItem(Yii::app()->session["userId"], Project::COLLECTION, (string) $project["_id"]);
}
if ($edit) {
    ?>
				<a href="#" id="editProjectDetail" class="btn btn-xs btn-light-blue tooltips" data-toggle="tooltip" data-placement="top" title="Editer le projet" alt=""><i class="fa fa-pencil"></i></a>
        		<?php 
}
?>
			</div>
		</div>
	</div>
	<div class="panel-body no-padding">
			<table class="table table-condensed table-hover" >
				<tbody>
					<tr>
						<td>Intitulé</td>
Exemplo n.º 22
0
 public static function removeRole($memberOfId, $memberOfType, $memberId, $memberType, $role, $userId)
 {
     //0. Check if the $memberOfId and the $memberId exists
     $memberOf = Link::checkIdAndType($memberOfId, $memberOfType);
     $member = Link::checkIdAndType($memberId, $memberType);
     //1.1 the $userId can manage the $memberOf (admin)
     // Or the user can remove himself from a member list of an organization
     if (!Authorisation::isOrganizationAdmin($userId, $memberOfId)) {
         if ($memberId != $userId) {
             throw new CTKException("You are not admin of the Organization : " . $memberOfId);
         }
     }
     //2. Remove the role
     PHDB::update($memberOfType, array("_id" => $memberOf["_id"]), array('$pull' => array("links.members." . $memberId . ".roles" => $role)));
     //3. Remove the role
     PHDB::update($memberType, array("_id" => $member["_id"]), array('$pull' => array("links.memberOf." . $memberOfId . ".roles" => $role)));
     return array("result" => true, "msg" => Yii::t("link", "The member's role has been removed with success", null, Yii::app()->controller->module->id), "memberOfid" => $memberOfId, "memberid" => $memberId);
 }
Exemplo n.º 23
0
    }

</style>
<div class="panel panel-white" id="globProchEvent">
	<div class="panel-heading border-light">
		<h4 class="panel-title text-left text-dark ficheInfoTitle">
			<i class="fa fa-info-circle"></i> Infos générales
		</h4>
	</div>
	<div class="navigator padding-0 text-right">
		<div class="panel-tools">
		<?php 
$edit = false;
if (isset(Yii::app()->session["userId"]) && isset($type) && isset($itemId)) {
    $edit = Authorisation::canEditItem(Yii::app()->session["userId"], $type, $itemId);
}
if ($edit) {
    ?>
			<a href="javascript:" id="editEventDetail" class="btn btn-sm btn-light-blue tooltips" data-toggle="tooltip" data-placement="bottom" title="Editer l'événement" alt=""><i class="fa fa-pencil"></i><span class="hidden-xs"> Éditer les informations</span></a>
			<a href="javascript:" id="editGeoPosition" class="btn btn-sm btn-light-blue tooltips" data-toggle="tooltip" data-placement="bottom" title="Modifiez la position sur la carte" alt=""><i class="fa fa-map-marker"></i><span class="hidden-xs"> Modifier la position</span></a>
			<a href="javascript:" id="removeEvent" class="btn btn-sm btn-red btn-light-red tooltips removeEventBtn" data-toggle="tooltip" data-placement="bottom" title="Delete this event" alt=""><i class="fa fa-times"></i><span class="hidden-xs"> Annuler l'événement</span></a>
    		<?php 
}
?>
		</div>
	</div>
	<div class="panel-body no-padding">
		<div class="col-sm-6 col-xs-12 padding-10">
			<div class="item" id="imgAdherent">
				<?php 
Exemplo n.º 24
0
            ?>
</a></td>
						<td><?php 
            if (isset($jobValue["employmentType"])) {
                echo $jobValue["employmentType"];
            }
            ?>
</td>
						<td><?php 
            if (isset($jobValue["hiringOrganization"]) && isset($jobValue["hiringOrganization"]["name"])) {
                echo $jobValue["hiringOrganization"]["name"];
            }
            ?>
</td>
						<?php 
            if (Authorisation::isJobAdmin($jobId, Yii::app()->session["userId"])) {
                ?>
						<td class="center">
							<div class="visible-md visible-lg hidden-sm hidden-xs">
								<a href="#" class="btn btn-red tooltips delJobButton" data-id="<?php 
                echo $jobId;
                ?>
" data-name="<?php 
                echo isset($jobValue["title"]) ? $jobValue["title"] : "";
                ?>
" data-placement="left" data-original-title="Remove"><i class="fa fa-times"></i></a>
							</div>
						</td>
						<?php 
            }
            ?>
Exemplo n.º 25
0
	<?php 
$isProjectAdmin = false;
if (isset($project["_id"]) && isset(Yii::app()->session["userId"])) {
    $isProjectAdmin = Authorisation::isProjectAdmin((string) $project["_id"], Yii::app()->session["userId"]);
}
?>
	<div class="panel panel-white">
		<div class="panel-heading border-light">
			<h4 class="panel-title"><i class="fa fa-users fa-2x text-green"></i> Contributors</h4>
			<div class="panel-tools">
				<a href="#newContributors" class="new-contributor btn btn-xs btn-light-blue tooltips" data-placement="top" data-original-title="Connect People or Organizations that are part of your Organization"><i class="fa fa-plus"></i></a>
				<div class="dropdown">
					<a class="btn btn-xs dropdown-toggle btn-transparent-grey" data-toggle="dropdown">
						<i class="fa fa-cog"></i>
					</a>
					<ul role="menu" class="dropdown-menu dropdown-light pull-right">
						<li>
							<a href="#" class="panel-collapse collapses"><i class="fa fa-angle-up"></i> 								<span>Collapse</span> </a>
						</li>
						<li>
							<a href="#" class="panel-refresh">
								<i class="fa fa-refresh"></i> <span>Refresh</span>
							</a>
						</li>
						<li>
							<a data-toggle="modal" href="#panel-config" class="panel-config">
								<i class="fa fa-wrench"></i> <span>Configurations</span>
							</a>
						</li>
						<li>
							<a href="#" class="panel-expand">
Exemplo n.º 26
0
	#photoVideo .flexslider .slides img {
	    position: relative;
	    height: 100%;
	    width: auto;
	    margin-left: auto;
	    margin-right: auto;
	    max-width: 100%;
	}

	#video iframe{
		width: 100%;
	}
	
</style>
<?php 
$canEdit = isset($itemId) && isset(Yii::app()->session["userId"]) && $itemId == Yii::app()->session["userId"] || isset($itemId) && isset(Yii::app()->session["userId"]) && Authorisation::isOrganizationAdmin(Yii::app()->session["userId"], $itemId);
?>
<div id="photoVideo">
    <div class="panel panel-white">
	    <div class="panel-heading border-light">
	        <h4 class="panel-title podPhotoVideoTitle"> <i class='fa fa-cog fa-spin fa-2x icon-big text-center'></i> Loading Media</h4>
	    </div>
	    <div class="panel-tools">
		   	<?php 
if ($canEdit) {
    ?>
			   <a href="#" class="add-photoSlider btn btn-xs btn-light-blue tooltips" data-toggle="tooltip" data-placement="top" title="Add an image" alt="Add an image"><i class="fa fa-plus"></i></a>
		    <?php 
}
?>
		    <a href="<?php 
Exemplo n.º 27
0
 /**
  * Update a project field value
  * @param String $projectId The person Id to update
  * @param String $projectFieldName The name of the field to update
  * @param String $projectFieldValue 
  * @param String $isAdmin or $isModerate (including after)
  * @return boolean True if the update has been done correctly. Can throw CTKException on error.
  */
 public static function updateProjectField($projectId, $projectFieldName, $projectFieldValue, $userId)
 {
     if (!Authorisation::canEditItem($userId, self::COLLECTION, $projectId)) {
         throw new CTKException(Yii::t("project", "Can not update this project : you are not authorized to update that project !"));
     }
     $dataFieldName = self::getCollectionFieldNameAndValidate($projectFieldName, $projectFieldValue, $projectId);
     //Specific case :
     //Tags
     if ($dataFieldName == "tags") {
         $projectFieldValue = Tags::filterAndSaveNewTags($projectFieldValue);
     }
     //address
     if ($dataFieldName == "address") {
         if (!empty($projectFieldValue["postalCode"]) && !empty($projectFieldValue["codeInsee"])) {
             $insee = $projectFieldValue["codeInsee"];
             $address = SIG::getAdressSchemaLikeByCodeInsee($insee);
             $set = array("address" => $address, "geo" => SIG::getGeoPositionByInseeCode($insee));
         } else {
             throw new CTKException("Error updating the Project : address is not well formated !");
         }
         //Start Date - End Date
     } else {
         if ($dataFieldName == "startDate" || $dataFieldName == "endDate") {
             date_default_timezone_set('UTC');
             $dt = DateTime::createFromFormat('Y-m-d H:i', $projectFieldValue);
             if (empty($dt)) {
                 $dt = DateTime::createFromFormat('Y-m-d', $projectFieldValue);
             }
             $newMongoDate = new MongoDate($dt->getTimestamp());
             $set = array($dataFieldName => $newMongoDate);
         } else {
             $set = array($dataFieldName => $projectFieldValue);
         }
     }
     //update the project
     PHDB::update(self::COLLECTION, array("_id" => new MongoId($projectId)), array('$set' => $set));
     return array("result" => true, "msg" => "Votre projet a été modifié avec succes", "id" => $projectId);
 }
Exemplo n.º 28
0
 /**
  * Get the authorization for edit an item
  * @param type is the type of item, (organization or event or person or project)
  * @param itemId id of the item we want to edits
  * @return a boolean
  */
 public static function canEditItem($userId, $type, $itemId)
 {
     $res = false;
     if ($type == PHType::TYPE_EVENTS) {
         $res = Authorisation::isEventAdmin($itemId, $userId);
     } else {
         if ($type == PHType::TYPE_PROJECTS) {
             $res = Authorisation::isProjectAdmin($itemId, $userId);
         } else {
             if ($type == Organization::COLLECTION) {
                 $res = Authorisation::isOrganizationAdmin($userId, $itemId);
             } else {
                 if ($type == Person::COLLECTION) {
                     $res = $userId == $itemId;
                 }
             }
         }
     }
     return $res;
 }
Exemplo n.º 29
0
		<div class="panel-tools">
			<?php 
if (isset($organization["_id"]) && isset(Yii::app()->session["userId"]) && Authorisation::isOrganizationAdmin(Yii::app()->session["userId"], $organization["_id"])) {
    ?>
					<a href="#" id="editFicheInfo" class="btn btn-xs btn-light-blue tooltips" data-toggle="tooltip" data-placement="top" title="Editer vos informations" alt=""><i class="fa fa-pencil"></i></a>
			
			<?php 
}
?>
		</div>
	</div>
	<div class="panel-body border-light" id="organizationDetail">
		<div class="row">
			<div class="col-sm-6 col-xs-6">
				<?php 
$this->renderPartial('../pod/fileupload', array("itemId" => (string) $_GET["id"], "type" => Organization::COLLECTION, "resize" => "false", "contentId" => Document::IMG_PROFIL, "editMode" => Authorisation::isOrganizationAdmin(Yii::app()->session["userId"], (string) $organization["_id"])));
?>
			</div>
			<div class="col-sm-6 col-xs-6">
				<div class="row height-155 padding-20">
					<a href="#" id="streetAddress" data-type="text" data-title="Street Address" data-emptytext="Address" class="editable-context editable editable-click">
						<?php 
echo isset($organization["address"]["streetAddress"]) ? $organization["address"]["streetAddress"] : null;
?>
					</a>
					<br>
					<a href="#" id="address" data-type="postalCode" data-title="Postal Code" data-emptytext="Postal Code" class="editable editable-click" data-placement="bottom">
					</a>
					<br>
					<a href="#" id="addressCountry" data-type="select" data-title="Country" data-emptytext="Country" data-original-title="" class="editable editable-click">					
					</a>
Exemplo n.º 30
0
         $contextIcon = "university";
         $contextTitle = Yii::t("common", "DIRECTORY Local network of") . " " . $city["name"];
     } else {
         if (isset($type) && $type == Person::CONTROLLER && isset($person)) {
             Menu::person($person);
             $contextName = Yii::t("common", "Person") . " : " . $person["name"];
             $contextIcon = "user";
             $contextTitle = Yii::t("common", "DIRECTORY of") . " " . $person["name"];
         } else {
             if (isset($type) && $type == PROJECT::CONTROLLER && isset($project)) {
                 //Menu::project( $person );
                 $contextName = Yii::t("common", "Project") . " : " . $project["name"];
                 $contextIcon = "lightbulb-o";
                 $contextTitle = Yii::t("common", "Contributors of project");
                 //." ".$project["name"];
                 if (isset($project["_id"]) && isset(Yii::app()->session["userId"]) && Authorisation::isProjectAdmin($project["_id"], Yii::app()->session["userId"]) == 1) {
                     $manage = 1;
                 }
                 $parentId = $project["_id"];
                 $parentType = Project::COLLECTION;
                 $connectType = "contributors";
                 $projects = array();
                 $events = array();
             }
         }
     }
 }
 /*else
 		$this->toolbarMBZ = array(
 		    array( 'tooltip' => "Add a Person, Organization, Event or Project", "iconClass"=>"fa fa-plus" , "iconSize"=>"" ,"href"=>"<a class='tooltips btn btn-default' href='#' onclick='showPanel(\"box-add\",null,\"ADD SOMETHING TO MY NETWORK\")' ")
 		);*/