Commit 21136dc5 authored by thomas craipeau's avatar thomas craipeau

Merge branch 'anatole'

parents 8235754a 8f02d5aa
......@@ -183,60 +183,53 @@
<?php
} else {
?>
<div>
<div>
<label>
<h4 style="color:<?php echo ($titleColor) ? $titleColor : "black"; ?>"><?php echo $label.$editQuestionBtn.$editParamsBtn.$editBtnL?></h4>
<?php echo $info ?>
</label>
</div>
<table class="table table-bordered table-hover directoryTable" id="<?php echo $kunik?>">
<thead>
<?php
if( count($answers)>0 ){ ?>
<tr>
<?php
if( count($answers)>0 ){
foreach ($properties as $i => $inp) {
if (isset($inp["placeholder"])){
echo "<th>".$inp["placeholder"]."</th>";
}
} ?>
<?php } ?>
foreach ($properties as $i => $inp) {
echo "<th>".$inp["label"]."</th>";
} ?>
</tr>
<?php } ?>
</thead>
<tbody class="directoryLines">
<?php
$ct = 0;
if(isset($answers)){
foreach ($answers as $q => $a) {
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($i == "location"){
} else {
echo "<td>";
if(isset($a[$i])) {
if($i == "pointGPS"){
//$nameM = $a["localisation"];
$lat = $a["pointGPS"]["latitude"];
$lon = $a["pointGPS"]["longitude"];
echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"];
//echo implode(",", $a["pointGPS"]);
echo '<span class="pull-right" style= "margin-right : 5px;"><a id="showActeurLocation" href="javascript:;" onclick=""><i class="fa fa-map-o" aria-hidden="true"></i></a></span>';
}
else if(is_array($a[$i])){
echo implode(",", $a["port"]);
}
else{
echo $a[$i];
if(is_array($a[$i])){
echo implode(",", $a[$i]);
} else {
if($i == "site") {
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else {
echo $a[$i];
}
}
}
echo "</td>";
}
}
echo "</tr>";
echo "</tr>";
}
}
......@@ -244,6 +237,7 @@
</tbody>
</table>
<?php } ?>
......@@ -289,8 +283,7 @@
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
location.reload();
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -353,8 +346,7 @@
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
location.reload();
urlCtrl.loadByHash(location.hash);
} );
}
......
......@@ -378,8 +378,7 @@
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
location.reload();
urlCtrl.loadByHash(location.hash);
} );
}
......
ù<?php if($answer){
<?php if($answer){
?>
<div class="form-group">
......
......@@ -19,6 +19,37 @@
}
}
}
$communityLinks = Element::getByTypeAndId($this->costum["contextType"],$this->costum["contextId"]);
$partenaire = false;
foreach ($communityLinks["links"]["members"] as $memberId => $memberValue) {
if(isset(Yii::app()->session["userId"])){
if($memberId != ""){
if($memberId == Yii::app()->session["userId"]){
if(isset($memberValue["roles"])){
foreach ($memberValue["roles"] as $rolesId => $rolesValue) {
if($rolesValue == "Partenaire"){
$partenaire = true;
}
}
}
}
}
}
}
$adminStatus = false;
if (isset($this->costum["admins"])) {
if(is_array($this->costum["admins"])){
foreach ($this->costum["admins"] as $key => $value) {
if($key == Yii::app()->session["userId"]){
$adminStatus = true;
}
}
}
}
$paramsData = [
......@@ -125,7 +156,13 @@
foreach ($properties as $i => $inp) {
if (isset($inp["label"])){
echo "<th>".$inp["label"]."</th>";
if ($inp["label"] == "contact") {
if($canEditForm || $partenaire){
echo "<th>".$inp["label"]."</th>";
}
} else {
echo "<th>".$inp["label"]."</th>";
}
}
}
?>
......@@ -140,31 +177,26 @@
foreach ($answers as $q => $a) {
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($i != "location" && $i != "file"){
if($i == "contact"){
if($canEditForm || $partenaire){
echo "<th>".$a[$i]."</th>";
}
}
elseif($i != "location" && $i != "file"){
echo "<td>";
if(isset($a[$i])) {
if($i == "pointGPS"){
//$nameM = $a["localisation"];
$lat = $a["pointGPS"]["latitude"];
$lon = $a["pointGPS"]["longitude"];
echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"];
//echo implode(",", $a["pointGPS"]);
echo '<span class="pull-right" style= "margin-right : 5px;"><a id="showActeurLocation" href="javascript:;" onclick=""><i class="fa fa-map-o" aria-hidden="true"></i></a></span>';
}
else if($i == "contact"){
if($canEdit){
echo $a[$i];
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a[$i]);
} else {
if($i == "site") {
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else {
echo $a[$i];
}
}
}
else if(is_array($a[$i])){
echo implode(",", $a[$i]);
}
else{
echo $a[$i];
}
}
echo "</td>";
echo "</td>";
}
}
......@@ -238,23 +270,30 @@
<table style="font-size: 14px !important;">
<thead>
<tr>
<?php
if( count($answers)>0 ){ ?>
<?php
<tr>
<?php
foreach ($properties as $i => $inp) {
if (isset($inp["label"])){
echo "<th>".$inp["label"]."</th>";
}
}
?>
foreach ($properties as $i => $inp) {
if (isset($inp["label"])){
if ($inp["label"] == "contact") {
if($canEdit or $partenaire){
echo "<th>".$inp["label"]."</th>";
}
} else {
echo "<th>".$inp["label"]."</th>";
}
}
}
?>
</tr>
<?php
}
?>
</tr>
</thead>
<tbody class="directoryLines">
......@@ -264,31 +303,26 @@
foreach ($answers as $q => $a) {
echo "<tr id='".$kunik.$q."' class='".$kunik."Line'>";
foreach ($properties as $i => $inp) {
if($i != "location" && $i != "file"){
if($i == "contact"){
if($canEdit or $partenaire){
echo "<td>".$a[$i]."</td>";
}
}
elseif($i != "location" and $i != "file"){
echo "<td>";
if(isset($a[$i])) {
if($i == "pointGPS"){
//$nameM = $a["localisation"];
$lat = $a["pointGPS"]["latitude"];
$lon = $a["pointGPS"]["longitude"];
echo $a["pointGPS"]["latitude"]." / ".$a["pointGPS"]["longitude"];
//echo implode(",", $a["pointGPS"]);
echo '<span class="pull-right" style= "margin-right : 5px;"><a id="showActeurLocation" href="javascript:;" onclick=""><i class="fa fa-map-o" aria-hidden="true"></i></a></span>';
}
else if($i == "contact"){
if($canEdit){
echo $a[$i];
if(isset($a[$i])) {
if(is_array($a[$i])){
echo implode(",", $a[$i]);
} else {
if($i == "site") {
echo "<a href='".$a[$i]."'>".$a[$i]."</a>";
}
else {
echo $a[$i];
}
}
}
else if(is_array($a[$i])){
echo implode(",", $a[$i]);
}
else{
echo $a[$i];
}
}
echo "</td>";
echo "</td>";
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment