示例#1
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">
示例#2
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;
 }
示例#3
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\")' ")
 		);*/
示例#4
0
 public static function project($project)
 {
     if (!is_array(Yii::app()->controller->toolbarMBZ)) {
         Yii::app()->controller->toolbarMBZ = array();
     }
     $id = (string) $project["_id"];
     //SEE DISCUSSION ROOMS
     //-----------------------------
     //self::entry("left",  null,"See Project Discussion","comments-o","/rooms/index/type/projects/id/".$id,"rooms","index",null );
     //SEND MESSAGE
     //-----------------------------
     //self::entry("left", null,"Post Something","envelope-o",null,null,null,"new-news");
     //HOME
     //-----------------------------
     self::entry("left", 'showAjaxPanel', Yii::t("common", 'General information about this project'), Yii::t("common", 'Details'), 'home', '/project/detail/id/' . $id, "project", "detail");
     //SEE TIMELINE
     //-----------------------------
     self::entry("left", 'showAjaxPanel', Yii::t("common", "Read all news publicated by this project"), Yii::t("common", 'Activity'), "rss", "/news/index/type/projects/id/" . $id . "?isNotSV=1", "news", "index", null);
     //DIRECTORY
     //-----------------------------
     self::entry("left", 'showAjaxPanel', Yii::t("common", "Project contributors"), Yii::t("common", 'Contributors'), 'connectdevelop', '/project/directory/id/' . $id . '?tpl=directory2&isNotSV=1', "project", "directory");
     if (!Authorisation::isProjectAdmin($id, Yii::app()->session["userId"])) {
         self::entry("right", 'onclick', Yii::t("common", "Declare me as admin of this project"), Yii::t("common", "Become admin"), 'fa fa-user-plus becomeAdminBtn', "declareMeAsAdmin('" . $id . "','" . Project::COLLECTION . "','" . Yii::app()->session["userId"] . "','" . $project["name"] . "')", null, null);
     }
 }