<?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">-->
/** * Return true if the user is Admin of the project * A user can be admin of an project if : * 1/ He is attendee + admin of the project * 2/ He is admin of an organization organizing a project (not include) * 3/ He is admin of an organization that can edit it members (canEditMembers flag) (not include) * and the organizations members is organizing the project * @param String $projectId The projectId to check if the userId is admin of * @param String $userId The userId to get the authorisation of * @return boolean True if the user isAdmin, False else */ public static function isProjectAdmin($projectId, $userId) { $res = false; $listProject = Authorisation::listProjectsIamAdminOf($userId); if (isset($listProject[(string) $projectId])) { $res = true; } return $res; }