profilSocial.php 38.2 KB
Newer Older
Kgneo's avatar
Kgneo committed
1
2
<?php 
	HtmlHelper::registerCssAndScriptsFiles( 
Kgneo's avatar
Kgneo committed
3
		array(  //'/css/onepage.css',
Kgneo's avatar
Kgneo committed
4
5
6
				'/vendor/colorpicker/js/colorpicker.js',
				'/vendor/colorpicker/css/colorpicker.css',
				'/css/default/directory.css',	
Clément Damiens's avatar
   
Clément Damiens committed
7
				//'/js/comments.js',
Kgneo's avatar
Kgneo committed
8
				'/css/profilSocial.css',
Clément Damiens's avatar
   
Clément Damiens committed
9
				'/css/calendar.css',
Raphael's avatar
Raphael committed
10
		) , 
Kgneo's avatar
Kgneo committed
11
	Yii::app()->theme->baseUrl. '/assets');
Kgneo's avatar
Kgneo committed
12

13
14
15
16
 $cssAnsScriptFilesModule = array(
    '/js/default/calendar.js',
  );
  HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
Raphael's avatar
Raphael committed
17

Kgneo's avatar
Kgneo committed
18
19
20
	$cssAnsScriptFilesTheme = array(
		"/plugins/jquery-cropbox/jquery.cropbox.css",
		"/plugins/jquery-cropbox/jquery.cropbox.js",
Raphael's avatar
Raphael committed
21
22
23
24
		// SHOWDOWN
		'/plugins/showdown/showdown.min.js',
		//MARKDOWN
		'/plugins/to-markdown/to-markdown.js',
Tibor Katelbach's avatar
Tibor Katelbach committed
25
		'/plugins/jquery.qrcode/jquery-qrcode.min.js',
26
27
28
		'/plugins/fullcalendar/fullcalendar/fullcalendar.min.js',
        '/plugins/fullcalendar/fullcalendar/fullcalendar.css', 
        '/plugins/fullcalendar/fullcalendar/locale/'.Yii::app()->language.'.js',
29
30
31
32
33
        "/plugins/d3/d3.js",
        "/plugins/d3/d3-flextree.js",
        "/plugins/d3/view.mindmap.js",
        "/plugins/d3/view.mindmap.css",
        
Clément Damiens's avatar
   
Clément Damiens committed
34
35
	);
	HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesTheme, Yii::app()->request->baseUrl);
Kgneo's avatar
Kgneo committed
36
	
Tibor Katelbach's avatar
Tibor Katelbach committed
37
	//$id = $_GET['id'];
Kgneo's avatar
Kgneo committed
38
	$imgDefault = $this->module->assetsUrl.'/images/thumbnail-default.jpg';
Clément Damiens's avatar
   
Clément Damiens committed
39

Kgneo's avatar
Kgneo committed
40
41
42
43
44
45
46
47
	
	//récupération du type de l'element
    $typeItem = (@$element["typeSig"] && $element["typeSig"] != "") ? $element["typeSig"] : "";
    if($typeItem == "") $typeItem = @$element["type"] ? $element["type"] : "item";
    if($typeItem == "people") $typeItem = "citoyens";
    
    $typeItemHead = $typeItem;
    if($typeItem == "organizations" && @$element["type"]) $typeItemHead = $element["type"];
Kgneo's avatar
Kgneo committed
48
49
    
    if(strpos($typeItem, "place.")!==false){
Kgneo's avatar
Kgneo committed
50
51
    	$typeItem = "place";
    }
Kgneo's avatar
Kgneo committed
52
    
Kgneo's avatar
Kgneo committed
53
54
55
56
57
    //icon et couleur de l'element
    $icon = Element::getFaIcon($typeItemHead) ? Element::getFaIcon($typeItemHead) : "";
    $iconColor = Element::getColorIcon($typeItemHead) ? Element::getColorIcon($typeItemHead) : "";

    $useBorderElement = false;
Clément Damiens's avatar
Clément Damiens committed
58
59
    $pageConfig=(@Yii::app()->session['paramsConfig']["element"]) ? Yii::app()->session['paramsConfig']["element"] : null;
    $addConfig=(@Yii::app()->session['paramsConfig']["add"]) ? Yii::app()->session['paramsConfig']["add"] : null; 
Kgneo's avatar
Kgneo committed
60
    if(@Yii::app()->params["front"]) $front = Yii::app()->params["front"];
Raph El's avatar
Raph El committed
61
62
63
64

    $layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
$me = isset(Yii::app()->session['userId']) ? Person::getById(Yii::app()->session['userId']) : null;
$this->renderPartial( $layoutPath.'modals.'.Yii::app()->params["CO2DomainName"].'.mainMenu', array("me"=>$me) );
Kgneo's avatar
Kgneo committed
65
66
?>
<style>
Kgneo's avatar
Kgneo committed
67
	
Kgneo's avatar
Kgneo committed
68
69
70
71
72
73
74
 	hr.angle-down::after {
        display: none;
    }
    hr.angle-down{
        border-top: 0px solid #ccc;
        margin-bottom:10px!important;
    }
Kgneo's avatar
up    
Kgneo committed
75
76
77
78
79
80

<?php if($typeItem != "citoyens"){ ?>
	.section-create-page{
		display: none;
	}
<?php } ?>
Kgneo's avatar
Kgneo committed
81
82
83
84
85
86

<?php if($typeItem == "events"){ ?>
	.hide-event{
		display: none;
	}
<?php } ?>
Kgneo's avatar
Kgneo committed
87

88
89
90
91
92
<?php if($typeItem == "place"){ ?>
	.hide-place{
		display: none;
	}
<?php } ?>
Kgneo's avatar
Kgneo committed
93

Raph El's avatar
Raph El committed
94
95
96
97
98
99
.grayscale{
  filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
  -moz-filter: grayscale(100%);
}

Kgneo's avatar
Kgneo committed
100
101
#ajax-modal .modal-content,
#formContact .modal-content{
Kgneo's avatar
Kgneo committed
102
	/*background-color: rgba(0,0,0,0.6);*/
Kgneo's avatar
Kgneo committed
103
}
Kgneo's avatar
Kgneo committed
104
105
#ajax-modal .container,
#formContact .container{
Kgneo's avatar
Kgneo committed
106
107
108
	background-color: white;
	border-radius: 4px;
}
Kgneo's avatar
Kgneo committed
109
110
#ajax-modal.portfolio-modal,
#formContact.portfolio-modal {
Kgneo's avatar
Kgneo committed
111
	background-color: transparent;
Kgneo's avatar
Kgneo committed
112
}/*
Kgneo's avatar
Kgneo committed
113
#ajax-modal .close-modal .lr,
Kgneo's avatar
Kgneo committed
114
115
116
#ajax-modal .close-modal .rl,
#formContact .close-modal .lr,
#formContact .close-modal .rl{
Kgneo's avatar
Kgneo committed
117
	background-color: #fff;
Kgneo's avatar
Kgneo committed
118
}*/
Kgneo's avatar
Kgneo committed
119

Kgneo's avatar
up live    
Kgneo committed
120
121
122
#btn-show-activity-onmap{
    width:100%;
}
Kgneo's avatar
Kgneo committed
123

Kgneo's avatar
Kgneo committed
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#central-container #content-results-profil .coop-wraper{
	width:31%!important;
	margin: 0 1% 15px 0 !important;
	border:1px solid #229296!important;
	padding:0px;
}

#central-container #content-results-profil .coop-wraper .searchEntity.coopPanelHtml{
	border:0px !important;
}

#central-container #content-results-profil .coop-wraper .searchEntity.coopPanelHtml .all-coop-detail{
	display:none;
}

#central-container #content-results-profil .coop-wraper .searchEntity.coopPanelHtml .panel-title{
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	max-width: 75%;
	display: inline-block;
	margin-top:7px;
	font-size: 13px;
}
Kgneo's avatar
Kgneo committed
148
/*
Kgneo's avatar
Kgneo committed
149
150
151
#central-container #content-results-profil button.openCoopPanelHtml .hidden-xs,
#central-container button.switchDirectoryView{
	display: none;
Kgneo's avatar
Kgneo committed
152
}*/
Kgneo's avatar
Kgneo committed
153
154
155
156
157
158
159
160



@media screen and (max-width: 992px) {
	#central-container #content-results-profil .coop-wraper.col-sm-12{
		width:48%!important;
	}
}
Sylvain Barbot's avatar
Sylvain Barbot committed
161
162
</style>

Kgneo's avatar
Kgneo committed
163
164
165
<?php 
	$auth = Authorisation::canParticipate(Yii::app()->session['userId'], $type, (string)$element["_id"]);

Raph El's avatar
Raph El committed
166
	// if (Authorisation::canDeleteElement((String)$element["_id"], $type, Yii::app()->session["userId"]) && !@$deletePending) 
Raph El's avatar
Raph El committed
167
	$this->renderPartial('../element/confirmDeleteModal', array("id" =>(String)$element["_id"], "type"=>$type)); 
Raph El's avatar
Raph El committed
168
	?>
169
<?php 
Tibor Katelbach's avatar
Tibor Katelbach committed
170
	if (@$element["status"] == "deletePending" && Authorisation::isElementAdmin((String)$element["_id"], $type, Yii::app()->session["userId"])) $this->renderPartial('co2.views.element.confirmDeletePendingModal', array(	"element"=>$element)); ?>
Sylvain Barbot's avatar
Sylvain Barbot committed
171

Clément Damiens's avatar
   
Clément Damiens committed
172
173
    <!-- <section class="col-lg-offset-1 col-lg-10 col-md-12 col-sm-12 col-xs-12 header" id="header"></section> -->
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 no-padding">	
Kgneo's avatar
Kgneo committed
174
    <!-- Header -->
175
176
    <section class="col-md-12 col-sm-12 col-xs-12" id="social-header" 
    	<?php if (!@$element["profilBannereUrl"] || (@$element["profilBannereUrl"] && empty($element["profilBannereUrl"]))){ ?> 
Kgneo's avatar
Kgneo committed
177
    		style=" background: url('<?php echo Yii::app()->theme->baseUrl. '/assets/img/background-onepage/connexion-lines.jpg';?>') center bottom;"
178
    	<?php } ?>>
Clément Damiens's avatar
   
Clément Damiens committed
179
        <div id="topPosKScroll"></div>
Kgneo's avatar
Kgneo committed
180
181
182
183
184
185
    	<?php if(@$edit==true && false) { ?>
    	<button class="btn btn-default btn-sm pull-right margin-right-15 margin-top-70 hidden-xs btn-edit-section" 
    			data-id="#header">
	        <i class="fa fa-cog"></i>
	    </button>
	    <?php } ?>
Kgneo's avatar
pu    
Kgneo committed
186
187
        
        <?php 
Tibor Katelbach's avatar
Tibor Katelbach committed
188
	    	$this->renderPartial('co2.views.element.banner', 
Kgneo's avatar
pu    
Kgneo committed
189
190
191
192
193
194
195
196
197
198
199
200
			        			array(	"iconColor"=>$iconColor,
			        					"icon"=>$icon,
			        					"type"=>$type,
			        					"element"=>$element,
			        					"linksBtn"=>$linksBtn,
			        					"elementId"=>(string)$element["_id"],
			        					"elementType"=>$type,
			        					"elementName"=> $element["name"],
			        					"edit" => @$edit,
			        					"openEdition" => @$openEdition) 
			        			); 
		?>
201
202
203
		


Kgneo's avatar
Kgneo committed
204

Kgneo's avatar
up DDA    
Kgneo committed
205
	    <div class="col-lg-2 col-md-3 col-sm-3 hidden-xs no-padding" style="bottom:-31px; position: absolute;">
Kgneo's avatar
Kgneo committed
206
		<?php 	if(@$element["profilMediumImageUrl"] && !empty($element["profilMediumImageUrl"]))
Clément Damiens's avatar
Clément Damiens committed
207
208
209
210
					 $images=array(
					 	"medium"=>$element["profilMediumImageUrl"],
					 	"large"=>$element["profilImageUrl"]
					 );
Kgneo's avatar
Kgneo committed
211
212
				else $images="";	
				
Tibor Katelbach's avatar
Tibor Katelbach committed
213
				$this->renderPartial('co2.views.pod.fileupload', 
Kgneo's avatar
Kgneo committed
214
								array("itemId" => (string) $element["_id"],
Clément Damiens's avatar
Clément Damiens committed
215
									  "itemName" => $element["name"],
Kgneo's avatar
Kgneo committed
216
217
218
219
220
221
222
223
224
									  "type" => $type,
									  "resize" => false,
									  "contentId" => Document::IMG_PROFIL,
									  "show" => true,
									  "editMode" => $edit,
									  "image" => $images,
									  "openEdition" => $openEdition) ); 
		?>

Kgneo's avatar
Kgneo committed
225
		</div>
Kgneo's avatar
Kgneo committed
226
    </section>
Kgneo's avatar
Kgneo committed
227
    
Kgneo's avatar
up DDA    
Kgneo committed
228
    <div class="col-md-9 col-sm-9 col-lg-10 col-xs-12 pull-right sub-menu-social no-padding">
Kgneo's avatar
Kgneo committed
229

Clément Damiens's avatar
Clément Damiens committed
230
    	<div class="btn-group btn-left inline">
Kgneo's avatar
Kgneo committed
231
232
233
234
235

    	  <?php 
    	  	$imgDefault = $this->module->assetsUrl.'/images/thumbnail-default.jpg';
			$thumbAuthor =  @$element['profilThumbImageUrl'] ? 
		                      Yii::app()->createUrl('/'.@$element['profilThumbImageUrl']) 
236
		                      : $this->module->assetsUrl.'/images/thumbnail-default.jpg';
Kgneo's avatar
Kgneo committed
237
    	  ?>
238
239
240
241
    	  <button type="button" class="btn btn-default bold menu-left-min visible-xs" onclick="menuLeftShow();">
		  		<i class="fa fa-bars"></i>
		  </button>
		  <img class="pull-left visible-xs" src="<?php echo $thumbAuthor; ?>" height=45>
Kgneo's avatar
Kgneo committed
242
    	  <div class="identity-min">
243
244
	    	  <img class="pull-left hidden-xs" src="<?php echo $thumbAuthor; ?>" height=45>
	    	  <div class="pastille-type-element bg-<?php echo $iconColor; ?> pull-left"></div>
Kgneo's avatar
Kgneo committed
245
			  <div class="col-lg-1 col-md-2 col-sm-2 col-xs-5 pull-left no-padding">
Kgneo's avatar
Kgneo committed
246
247
248
249
250
251
252
	    	  	<div class="text-left padding-left-15" id="second-name-element">
					<span id="nameHeader">
						<h5 class="elipsis"><?php echo @$element["name"]; ?></h5>
					</span>	
				</div>
	    	  </div>
    	  </div>
253
		  <button type="button" class="btn btn-default bold hidden-xs btn-start-mystream">
Clément Damiens's avatar
Clément Damiens committed
254
		  		<i class="fa fa-rss"></i> <?php echo Yii::t("common","Newspaper"); ?>
Kgneo's avatar
Kgneo committed
255
256
		  </button>

Kgneo's avatar
Kgneo committed
257
		  <?php if((@Yii::app()->session["userId"] && $isLinked==true) || @Yii::app()->session["userId"] == $element["_id"]){ ?>
Kgneo's avatar
Kgneo committed
258
		  <button type="button" class="btn btn-default bold hidden-xs btn-start-notifications hidden">
Kgneo's avatar
Kgneo committed
259
260
		  	<i class="fa fa-bell"></i> 
		  	<span class="hidden-xs hidden-sm">
Kgneo's avatar
Kgneo committed
261
262
263
		  		<?php if (@Yii::app()->session["userId"] == $element["_id"]) 
		  					echo Yii::t("common","My notif<span class='hidden-md'>ication</span>s"); 
		  			  else  echo Yii::t("common","Notif<span class='hidden-md'>ication</span>s"); ?>
Kgneo's avatar
Kgneo committed
264
265
266
267
268
		  	</span>
		  	<span class="badge notifications-countElement <?php if(!@$countNotifElement || (@$countNotifElement && $countNotifElement=="0")) echo 'badge-transparent hide'; else echo 'badge-success'; ?>">
		  		<?php echo @$countNotifElement ?>
		  	</span>
		  </button>
Kgneo's avatar
Kgneo committed
269
270
		  <?php } ?>

Clément Damiens's avatar
Clément Damiens committed
271
		  
272
		  <?php if(@Yii::app()->session["userId"] && Yii::app()->params['rocketchatEnabled'] )
Clément Damiens's avatar
Clément Damiens committed
273
			if( 
Kgneo's avatar
up dda    
Kgneo committed
274
	  			($type==Person::COLLECTION) ||
275
276
277
	  			//admins can create rooms
	  			( Authorisation::canEditItem(Yii::app()->session['userId'], $type, $id) ) ||
	  			//simple members can join only when admins had created
278
	  			( Link::isLinked((string)$element["_id"],$type,Yii::app()->session["userId"]))  )
Clément Damiens's avatar
   
Clément Damiens committed
279
280
281
282
283
284
	  			{
	  				if(@$element["slug"])
						//todo : elements members of
	  					$loadChat = $element["slug"];
	  				else
	  					$createSlugBeforeChat=true;
Kgneo's avatar
up dda    
Kgneo committed
285
	  				//todo : elements members of
286
	  				$loadChat = StringHelper::strip_quotes($element["name"]);
Kgneo's avatar
up dda    
Kgneo committed
287
288
	  				//people have pregenerated rooms so allways available 
	  				$hasRC = (@$element["hasRC"] || $type == Person::COLLECTION ) ? "true" : "false";
Tibor Katelbach's avatar
Tibor Katelbach committed
289
	  				$canEdit = ( @$openEdition && $openEdition ) ? "true" : "false";
290
	  				//Authorisation::canEditItem(Yii::app()->session['userId'], $type, $id) );
Tibor Katelbach's avatar
Tibor Katelbach committed
291
292
	  				if($type == Person::COLLECTION)
	  				{
Kgneo's avatar
up dda    
Kgneo committed
293
294
295
	  				 	$loadChat = (string)$element["username"];
	  					if( (string)$element["_id"]==@Yii::app()->session["userId"] )
	  						$loadChat = "";
Tibor Katelbach's avatar
Tibor Katelbach committed
296
297
		  			}
		  			$chatColor = (@$element["hasRC"] || $type == Person::COLLECTION ) ? "text-red" : "";
Tibor Katelbach's avatar
Tibor Katelbach committed
298

Tibor Katelbach's avatar
Tibor Katelbach committed
299
		  			if( Yii::app()->params['rocketchatMultiEnabled'] && $type != Person::COLLECTION )
Tibor Katelbach's avatar
Tibor Katelbach committed
300
301
	  				{
			  		?>
Clément Damiens's avatar
   
Clément Damiens committed
302
			  			<div class="btn-group " id="">
Tibor Katelbach's avatar
Tibor Katelbach committed
303
							<ul class="nav navbar-nav">
Clément Damiens's avatar
   
Clément Damiens committed
304
								<li class="dropdown dropdown-profil-menu-params">
Tibor Katelbach's avatar
Tibor Katelbach committed
305
306
307
308
309
310
311
312
									<button type="button" class="btn btn-default bold">
										<?php if(@Yii::app()->session["userId"] && $edit==true){ ?>
							  			<i class="fa fa-comments"></i> <span class="hidden-xs hidden-sm"><?php echo Yii::t("cooperation", "Chat"); ?>
							  			<?php }else{ ?>
							  			<i class="fa fa-chevron-down"></i>
							  			<?php } ?>
							  			</span>
							  		</button> 
Clément Damiens's avatar
   
Clément Damiens committed
313
							  		<ul class="dropdown-menu arrow_box menu-params dropdown-profil-menu-params">
Tibor Katelbach's avatar
Tibor Katelbach committed
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405

						  			<?php
						  			if( $hasRC && @$element["tools"]["chat"] )
						  			{ 
							  			if( @$element["tools"]["chat"]["int"] )
			  							{
			  								?>
								  				<li class="text-left bold padding-5">
									               	Interne
									            </li>
								  			<?php
								  			foreach (@$element["tools"]["chat"]["int"] as $key => $chat) 
								  			{ ?>
								  				<li class="text-left">
									               	<a href="" class="btn-open-chatEl bg-white" data-name-el="<?php echo $element["name"]; ?>" data-username="<?php echo Yii::app()->session['user']['name']; ?>" data-slug="<?php echo $chat["name"]; ?>" data-type-el="<?php echo $type; ?>"  data-open="<?php echo ( strpos ( $chat["url"] , "/channel/") === false ) ? "false" : "true"; ?>"  data-hasRC="true" data-id="<?php echo (string)$element["_id"]; ?>">
									                    <i class="fa fa-comments"></i> <?php echo $chat["name"]; ?> 
									                    <?php if( strpos ( $chat["url"] , "/channel/") === false ) 
									                    		echo "<i class='fa fa-lock'></i>"; ?>
									                </a>
									            </li>
								  			<?php
								  			} 
								  			?>
								  			<script type="text/javascript">
								  				$(".btn-open-chatEl").click( function(){
											    	var nameElo = $(this).data("name-el");
											    	var idEl = $(this).data("id");
											    	var usernameEl = $(this).data("username");
											    	var slugEl = $(this).data("slug");
											    	var typeEl = dyFInputs.get($(this).data("type-el")).col;
											    	var openEl = $(this).data("open");
											    	var hasRCEl = ( $(this).data("hasRC") ) ? true : false;
											    	alert(nameElo +" | "+typeEl +" | "+openEl +" | "+hasRCEl);
											    	var ctxData = {
											    		name : nameElo,
											    		type : typeEl,
											    		id : idEl
											    	}
											    	if(typeEl == "citoyens")
											    		ctxData.username = usernameEl;
											    	else if(slugEl)
											    		ctxData.slug = slugEl;
											    	rcObj.loadChat(nameElo ,typeEl ,openEl ,hasRCEl, ctxData );
											    } );
								  			</script>
								  			<?php
								  		} 

								  		if( @$element["tools"]["chat"]["ext"] )
			  							{
			  								?>
								  				<li class="text-left bold padding-5">
									               	Externe
									            </li>
								  			<?php
								  			foreach ($element["tools"]["chat"]["ext"] as $key => $chat) 
								  			{ ?>
								  				<li class="text-left">
									               	<a href="<?php echo $chat["url"]; ?>" target="_blank" class="bg-white">
									                    <i class="fa fa-comments"></i> <?php echo $chat["name"]; ?> <i class="fa fa-external-link"></i>
									                </a>
									            </li>
								  			<?php
								  			}
							  			} ?>

							  			<li class="text-left text-red">
							  			<br>
							               	<a href="javascript:dyFObj.openForm('chat','sub')" class="">
							                    <i class="fa fa-plus-circle text-red"></i> <?php echo Yii::t("common","New Channel") ?>
							                </a>
							            </li>

			  			<?php
			  			} else {
		  	    		?>
					  	  	<li class="text-left text-red">
								  <a href="javascript:;" onclick="javascript:rcObj.loadChat('<?php echo $loadChat;?>','<?php echo $type?>',<?php echo $canEdit;?>,<?php echo $hasRC;?>, contextData )" class=" <?php echo $chatColor;?>" id="open-rocketChat">
								  		<i class="fa fa-plus-circle text-red"></i> <?php echo Yii::t("common","New Channel") ?>
								  </a>
							</li>

			  			<?php } ?>
			  			
						        </ul>
						    </li>
						</ul>
					</div>    

				<?php } else { ?>

				<button type="button" onclick="javascript:rcObj.loadChat('<?php echo $loadChat;?>','<?php echo $type?>',<?php echo $canEdit;?>,<?php echo $hasRC;?>, contextData )" class="btn btn-default bold hidden-xs <?php echo $chatColor;?>" 
Clément Damiens's avatar
   
Clément Damiens committed
406
			  		  id="open-rocketChat" style="border-right:0px!important;">
Tibor Katelbach's avatar
Tibor Katelbach committed
407
408
			  		<i class="fa fa-comments elChatNotifs"></i> <?php echo Yii::t("cooperation", "Chat"); 
			  		?>
Tibor Katelbach's avatar
Tibor Katelbach committed
409
				</button>
Tibor Katelbach's avatar
Tibor Katelbach committed
410

Tibor Katelbach's avatar
Tibor Katelbach committed
411
				<?php } ?>
Kgneo's avatar
up dda    
Kgneo committed
412
413
		  <?php } ?>

Kgneo's avatar
Kgneo committed
414
415
		  <?php if(@Yii::app()->session["userId"])
		  		if( $type == Organization::COLLECTION || $type == Project::COLLECTION ){ ?>
Kgneo's avatar
Kgneo committed
416
		  <button type="button" class="btn btn-default bold hidden-xs letter-turq" data-toggle="modal" data-target="#modalCoop" 
Kgneo's avatar
Kgneo committed
417
		  		  id="open-co-space" style="border-right:0px!important;">
Kgneo's avatar
Kgneo committed
418
		  		<i class="fa fa-connectdevelop"></i> <?php echo Yii::t("cooperation", "CO-space"); ?>
Kgneo's avatar
Kgneo committed
419
420
421
422
		  </button>
		  <?php } ?>


Kgneo's avatar
Kgneo committed
423
424
		  <?php if(@Yii::app()->session["userId"])
		  		if( ($type!=Person::COLLECTION && ((@$edit && $edit) || (@$openEdition && $openEdition))) || 
Kgneo's avatar
Kgneo committed
425
		  			($type==Person::COLLECTION && (string)$element["_id"]==@Yii::app()->session["userId"])){ ?>
Kgneo's avatar
Kgneo committed
426
427
428

			
		  
Kgneo's avatar
Kgneo committed
429
		  <button type="button" class="btn btn-default bold letter-green hidden-xs" 
Kgneo's avatar
Kgneo committed
430
		  		  id="open-select-create" style="border-right:0px!important;">
Kgneo's avatar
up    
Kgneo committed
431
		  		<i class="fa fa-plus-circle fa-2x"></i> <?php //echo Yii::t("common", "Créer") ?>
Kgneo's avatar
Kgneo committed
432
		  </button>
Kgneo's avatar
Kgneo committed
433
		  <?php } ?>
Kgneo's avatar
Kgneo committed
434
435
		</div>
		
Clément Damiens's avatar
Clément Damiens committed
436
		
Kgneo's avatar
Kgneo committed
437
		<div class="btn-group pull-right">
Clément Damiens's avatar
Clément Damiens committed
438
439
440
441
442
443
444
			<?php if(isset(Yii::app()->session["userId"]) && $typeItem!=Person::COLLECTION){ ?>
		  		<button 	class='btn btn-default bold btn-share letter-green' style="border:0px!important;"
							data-ownerlink='share' data-id='<?php echo $element["_id"]; ?>' data-type='<?php echo $typeItem; ?>' 
	                    	data-isShared='false'>
	                    	<i class='fa fa-share'></i> <span class="hidden-xs"><?php echo Yii::t("common","Share") ?></span>
	          	</button>
	         <?php } ?>
Kgneo's avatar
Kgneo committed
445
			<?php 
Clément Damiens's avatar
Clément Damiens committed
446
			$role = Role::getRolesUserId(@Yii::app()->session["userId"]) ; 
Kgneo's avatar
Kgneo committed
447
448
			if($element["_id"] == Yii::app()->session["userId"] && 
			   (Role::isSuperAdmin($role) || Role::isSourceAdmin($role) )) { ?>
Kgneo's avatar
Kgneo committed
449
			  <!--<button type="button" class="btn btn-default bold lbh" data-hash="#admin">
Kgneo's avatar
Kgneo committed
450
			  	<i class="fa fa-user-secret"></i> <span class="hidden-xs hidden-sm hidden-md">Admin</span>
Kgneo's avatar
Kgneo committed
451
			  </button>-->
Kgneo's avatar
Kgneo committed
452
			
Kgneo's avatar
Kgneo committed
453
454
			  <button type="button" class="btn btn-default bold tooltips" data-placement="left" 
						data-original-title="super admin" id="btn-superadmin">
Kgneo's avatar
Kgneo committed
455
456
457
			  	<i class="fa fa-grav letter-red"></i> <span class="hidden-xs hidden-sm hidden-md"></span>
			  </button>
			  <?php } ?>
Clément Damiens's avatar
   
Clément Damiens committed
458
459
				<ul class="nav navbar-nav" id="paramsMenu">
					<li class="dropdown dropdown-profil-menu-params">
Clément Damiens's avatar
Clément Damiens committed
460
					<button type="button" class="btn btn-default bold">
Clément Damiens's avatar
   
Clément Damiens committed
461
462
463
						<?php if(@Yii::app()->session["userId"] && $edit==true){ ?>
			  			<i class="fa fa-cogs"></i> <span class="hidden-xs hidden-sm"><?php echo Yii::t("common", "Settings"); ?>
			  			<?php }else{ ?>
Clément Damiens's avatar
Clément Damiens committed
464
			  			<i class="fa fa-chevron-down"></i>
Clément Damiens's avatar
   
Clément Damiens committed
465
466
			  			<?php } ?>
			  			</span>
Clément Damiens's avatar
Clément Damiens committed
467
468
			  		</button> 
			  		<!--<button type="button" class="btn btn-default bold">
Kgneo's avatar
Kgneo committed
469
						<i class="fa fa-chevron-down"></i>
Clément Damiens's avatar
Clément Damiens committed
470
			  		</button>-->
471
			  		<ul class="dropdown-menu arrow_box menu-params">
Clément Damiens's avatar
Clément Damiens committed
472
	                	<?php  
Raph El's avatar
Raph El committed
473
474
475
476
477
	            		if(@Yii::app()->session["userId"] && $edit==true){ 

	            			if($type ==Person::COLLECTION){ ?>

		            			<li class="text-left">
Raph El's avatar
Raph El committed
478
									<a href="#settings.page.myAccount" class="lbh bg-white">
Raph El's avatar
Raph El committed
479
480
481
482
483
484
										<i class="fa fa-cogs"></i> <?php echo Yii::t("common", "My parameters") ; ?>
									</a>
								</li>

					<?php 	} else {  ?>
		            			<li class="text-left">
485
									<a href="#settings.page.confidentialityCommunity?slug=<?php echo $element['slug'] ; ?>" id="" class="lbh bg-white ">
Raph El's avatar
Raph El committed
486
487
488
489
										<i class="fa fa-cogs"></i> <?php echo Yii::t("common", "Confidentiality params"); ?>
										</a>
								</li>

Raph El's avatar
Raph El committed
490
491
								<li class="text-left">
									<a href="#settings.page.notificationsCommunity?slug=<?php echo $element['slug'] ; ?>" class="lbh bg-white">
Clément Damiens's avatar
   
Clément Damiens committed
492
										<i class="fa fa-bell"></i> <?php echo Yii::t("common", "Notifications preferences"); ?>
Raph El's avatar
Raph El committed
493
494
495
									</a>
								</li>

Raph El's avatar
Raph El committed
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
								<li class="text-left">
									<a href="javascript:;" onclick="updateSlug();" id="" class="bg-white">
										<i class="fa fa-id-badge"></i> <?php echo Yii::t("common", "Edit slug"); ?>
										</a>
					            </li>

					            <li class="text-left">
									<a href='javascript:' id="downloadProfil">
										<i class='fa fa-download'></i> <?php echo Yii::t("common", "Download your profil") ?>
									</a>
								</li>

					<?php 	}

						} ?>
Clément Damiens's avatar
   
Clément Damiens committed
511
						
Kgneo's avatar
Kgneo committed
512
513
514
						<li>
							<a href="javascript:;" onclick="showDefinition('qrCodeContainerCl',true)">
								<i class="fa fa-qrcode"></i> <?php echo Yii::t("common","QR Code") ?>
515
516
							</a>
						</li>
Kgneo's avatar
Kgneo committed
517

Raph El's avatar
Raph El committed
518
519
520
			  			<?php 

			  			if($type !=Person::COLLECTION){ 
Raphael's avatar
Hotfix    
Raphael committed
521

Raph El's avatar
Raph El committed
522
523
			  				if($openEdition==true){ ?>
				  				
Raphael's avatar
Hotfix    
Raphael committed
524
525
526
527
528
				  				<li class="text-left">
									<a href="javascript:;" class="btn-show-activity">
										<i class="fa fa-history"></i> <?php echo Yii::t("common","History")?> 
									</a>
								</li>
Raph El's avatar
Raph El committed
529
530
				<?php 		} 
						} else { 
531

Raph El's avatar
Raph El committed
532
							if(@Yii::app()->session["userId"] && $edit==true){ ?>
533

Raph El's avatar
Raph El committed
534
535
536
537
538
				            	<li class="text-left">
									<a href='javascript:;' onclick='rcObj.settings();' >
										<i class='fa fa-comments'></i> <?php echo Yii::t("common","Chat Settings"); ?>
									</a>
					            </li>
Raph El's avatar
Raph El committed
539

Raph El's avatar
Raph El committed
540
541
542
543
544
545
546
547
548
549
550
551
								<li class="text-left">
					               	<a href='javascript:;' onclick='loadMD()' >
										<i class='fa fa-file-text-o'></i> <?php echo Yii::t("common","Markdown Version"); ?>
									</a>
					            </li>
								
								<li class="text-left">
									<a href='javascript:;' onclick='loadMindMap()' >
										<i class='fa fa-sitemap'></i> <?php echo Yii::t("common","Mindmap View"); ?>
									</a>
					            </li>
					<?php 	}
552

Raph El's avatar
Raph El committed
553
				            if(	Preference::showPreference($element, $type, "directory", Yii::app()->session["userId"])) {
Raph El's avatar
Raph El committed
554
		               			// $urlNetwork = Element::getUrlMyNetwork((string)$element["_id"], $type); ?>
Raph El's avatar
Modif    
Raph El committed
555

Raph El's avatar
Raph El committed
556
557
558
		               			<!-- <li class="text-left">
					               	<a href='<?php //echo $urlNetwork; ?>' target='_blanck'>
										<i class='fa fa-map'></i> <?php //echo Yii::t("common","My network"); ?>
Raph El's avatar
Modif    
Raph El committed
559
									</a>
Raph El's avatar
Raph El committed
560
					            </li> -->
Raph El's avatar
Raph El committed
561
562
					<?php 	} 
			        	} ?>
Raph El's avatar
Raph El committed
563
564
565
566
567
568
569
570
571
572
						<li class="text-left">
							<a href='javascript:;' onclick='co.graph()' >
								<i class='fa fa-share-alt'></i> <?php echo Yii::t("common","Graph View"); ?>
							</a>
						</li>
						<li class="text-left">
							<a href='javascript:;' onclick="javascript:window.print();" >
								<i class='fa fa-print'></i> <?php echo Yii::t("home","Print out") ?>
							</a>
						</li>
Raph El's avatar
Raph El committed
573

Raph El's avatar
Raph El committed
574
575
576
577
578
579
580
581
582
583
584
585
586
						<?php 
						if ( Authorisation::canDeleteElement( (String)$element["_id"], $type, Yii::app()->session["userId"]) && 
							!@$deletePending && 
							!empty(Yii::app()->session["userId"]) && 
							$type != Person::COLLECTION	) { ?>

				  			<li class="text-left">
								<a href="javascript:;" id="btn-delete-element" class="bg-white text-red" data-toggle="modal">
									<i class="fa fa-trash"></i> 
									<?php echo Yii::t("common", "Delete {what}", array("{what}"=> Yii::t("common","this ".Element::getControlerByCollection($type)))); ?>
								</a>
				            </li>

Raph El's avatar
Raph El committed
587
			            <?php } ?>
Kgneo's avatar
Kgneo committed
588
			  		</ul>
Kgneo's avatar
Kgneo committed
589
590
591
592
593
		  		</li>
		  	</ul>
		</div>
	</div>

Kgneo's avatar
Kgneo committed
594
	
Kgneo's avatar
Kgneo committed
595
596
	<!-- <div id="div-reopen-menu-left-container" class="col-xs-12 col-sm-3 col-md-3 col-lg-2 hidden"> -->
		<!-- <button id="reopen-menu-left-container" class="btn btn-default">
Kgneo's avatar
up DDA    
Kgneo committed
597
			<i class="fa fa-arrow-left"></i> <span class="hidden-sm hidden-xs"> Retour au </span>menu principal
Kgneo's avatar
Kgneo committed
598
		</button> -->
Kgneo's avatar
up DDA    
Kgneo committed
599
600
601
		<!-- <button id="refresh-coop-rooms" class="btn btn-default pull-right">
			<i class="fa fa-refresh"></i>
		</button> -->
Kgneo's avatar
Kgneo committed
602
		<!-- <hr>
Kgneo's avatar
up DDA    
Kgneo committed
603
		<h4 class="letter-turq"><i class="fa fa-connectdevelop"></i> Espaces co<span class="hidden-sm">opératifs</span></h4>
Kgneo's avatar
Kgneo committed
604
 -->
Kgneo's avatar
Kgneo committed
605
		
Kgneo's avatar
Kgneo committed
606
	    
Kgneo's avatar
up dda    
Kgneo committed
607

Kgneo's avatar
Kgneo committed
608
609
610
611
612
613
614
615
	<?php //render of modal for coop spaces 
		$params = array(  "element" => @$element, 
                            "type" => @$type, 
                            "edit" => @$edit,
                            "thumbAuthor"=>@$thumbAuthor,
                            "openEdition" => $openEdition,
                            "iconColor" => $iconColor
                        );
Kgneo's avatar
Kgneo committed
616

Tibor Katelbach's avatar
Tibor Katelbach committed
617
    	$this->renderPartial('dda.views.co.pod.modals', $params ); 
Kgneo's avatar
Kgneo committed
618
    ?>
Kgneo's avatar
Kgneo committed
619

Kgneo's avatar
up DDA    
Kgneo committed
620
	<div id="menu-left-container" class="col-xs-12 col-sm-3 col-md-3 col-lg-2 profilSocial hidden-xs" 
Kgneo's avatar
Kgneo committed
621
			style="margin-top:40px;padding: 5px;">  		
Kgneo's avatar
Kgneo committed
622
	    <?php $params = array(  "element" => @$element, 
Kgneo's avatar
Kgneo committed
623
624
                                "type" => @$type, 
                                "edit" => @$edit,
625
626
                                "isLinked" => @$isLinked,
                                "countNotifElement"=>@$countNotifElement,
Clément Damiens's avatar
   
Clément Damiens committed
627
                                "invitedMe" => @$invitedMe,
Kgneo's avatar
Kgneo committed
628
                                "openEdition" => $openEdition,
Clément Damiens's avatar
Clément Damiens committed
629
630
                                "linksBtn" => $linksBtn,
                                "themeParams"=>@Yii::app()->session['paramsConfig']
Kgneo's avatar
Kgneo committed
631
632
                                );

Tibor Katelbach's avatar
Tibor Katelbach committed
633
	    	$this->renderPartial('co2.views.pod.menuLeftElement', $params ); 
Kgneo's avatar
Kgneo committed
634
	    ?>
Kgneo's avatar
Kgneo committed
635
	</div>
Clément Damiens's avatar
Clément Damiens committed
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
	<?php $addElement=array(
        Organization::TYPE_GROUP => array(
            "label"=>Yii::t("common","Group"),
            "icon"=>"fa-circle-o",
            "formType"=>"organization",
            "type"=>Organization::COLLECTION,
            "formSubType"=>Organization::TYPE_GROUP,
            "color"=> "turq",
            "description"=>Yii::t("form","Create a group<br>Share your interest<br>Speak Diffuse Have fun"),           
            "typeAllow"=>array(Person::COLLECTION)        
        ),
        Organization::TYPE_NGO => array(
            "label"=>Yii::t("common","NGO"),
            "icon"=>"fa-group",
            "formType"=>"organization",
            "type"=>Organization::COLLECTION,
            "formSubType"=>Organization::TYPE_NGO,
            "color"=>"green",
            "description"=>Yii::t("form", "Make visible your NGO<br>Manage the community<br>Share your news"),           
            "typeAllow"=>array(Person::COLLECTION)
        ),
        Organization::TYPE_BUSINESS => array(
            "label"=>Yii::t("common","Local business"),
            "icon"=>"fa-industry",
            "formType"=>"organization",
            "type"=>Organization::COLLECTION,
            "formSubType"=>Organization::TYPE_BUSINESS,
            "color"=>"azure",
            "description"=>Yii::t("form", "Make visible your company<br>Find new customer<br>Manage your contacts"),           
            "typeAllow"=>array(Person::COLLECTION)
        ),
        Organization::TYPE_GOV => array(
            "label"=>Yii::t("common","Government Organization"),
            "icon"=>"fa-university",
            "formType"=>"organization",
            "formSubType"=>Organization::TYPE_GOV,
            "color"=> "red",
            "description"=>Yii::t("form", "Town hall, schools, etc...<br>Share your news<br>Share events"),           
            "typeAllow"=>array(Person::COLLECTION)
        ),
        "contacts" => array(
            "label"=>Yii::t("common","Contact"),
            "icon"=>"fa-envelope",
            "formType"=>"contactPoint",
            "color"=> "blue",
            "description"=>Yii::t("form", "Define roles of everyone<br>Communicate easily<br>Internal and external"),
            "typeAllow"=>array(Person::COLLECTION, Organization::COLLECTION, Project::COLLECTION)
        ),
        Project::COLLECTION => array(
            "label"=>Yii::t("common","Project"),
            "icon"=>Project::ICON,
            "formType"=>"project",
            "color"=> "purple",
            "description"=>Yii::t("form", "Make visible a project<br>Find support<br>Build a community"),
            "typeAllow"=>array(Person::COLLECTION, Organization::COLLECTION, Project::COLLECTION)
        ),
        Event::COLLECTION => array(
            "label"=>Yii::t("common","Event"),
            "icon"=>Event::ICON,
            "formType"=>"event",
            "description"=> Yii::t("form", "Diffuse an event<br>Invite attendees<br>Communicate to your network"),
            "color"=> "orange",
            "typeAllow"=>array(Person::COLLECTION, Organization::COLLECTION, Project::COLLECTION)
        ),
        Classified::COLLECTION => array(
            "label"=>Yii::t("common","Classified"),
            "icon"=>Classified::ICON,
            "formType"=>"classifieds",
            "color"=> "azure",
            "description"=>Yii::t("form","Create a classified ad<br>To share To give To sell To rent<br>Material Property Job"),
            "typeAllow"=>array(Person::COLLECTION, Organization::COLLECTION, Project::COLLECTION)
        ),
        Classified::TYPE_RESSOURCES => array(
            "label"=>Yii::t("common","Ressource"),
            "icon"=>Classified::ICON_RESSOURCES,
            "formType"=>"ressources",
            "color"=> "vine",
            "description"=>"Partager des ressources<br>des outils, des documents<br> des compétences et des besoins"
        ),
        Classified::TYPE_JOBS => array(
            "label"=>Yii::t("common","Jobs"),
            "icon"=>Classified::ICON_JOBS,
            "formType"=>"jobs",
            "color"=> "yellow-k",
            "description"=>"Ajouter les stages, les formations ou les offres d'emploi que vous proposez"
        
        ),
        Poi::COLLECTION => array(
            "label"=>Yii::t("common","Point of interest"),
            "icon"=>Poi::ICON,
            "formType"=>"poi",
            "color"=> "green-k",
            "description"=> Yii::t("form","Make visible an interesting place<br>Contribute to the collaborative map<br>Highlight your territory")
        )
    );
    //Filtering button add element if custom
    if(@$addConfig){
        foreach($addElement as $key=>$v)
            if(!@$addConfig[$key] && (!@$v["type"] || !@$addConfig[$v["type"]])) unset($addElement[$key]);
    } ?>
Kgneo's avatar
Kgneo committed
736
	<div class="col-xs-12 col-md-9 col-sm-9 col-lg-9 padding-50 margin-top-50 links-main-menu hidden" 
Kgneo's avatar
Kgneo committed
737
738
739
		 id="div-select-create">
		<div class="col-md-12 col-sm-12 col-xs-12 padding-15 shadow2 bg-white ">
	       
Kgneo's avatar
Kgneo committed
740
741
	       <h4 class="text-center margin-top-15" style="">
	       	<img class="img-circle" src="<?php echo $thumbAuthor; ?>" height=30 width=30 style="margin-top:-10px;">
Kgneo's avatar
Kgneo committed
742
743
744
	       	<a class="btn btn-link pull-right text-dark" id="btn-close-select-create" style="margin-top:-10px;">
	       		<i class="fa fa-times-circle fa-2x"></i>
	       	</a>
Kgneo's avatar
Kgneo committed
745
	       	<span class="name-header"><?php echo @$element["name"]; ?></span>
Kgneo's avatar
Kgneo committed
746
	       	<br>
747
	       	<i class="fa fa-plus-circle"></i> <?php echo Yii::t("form","Create content link to this page") ?>
Kgneo's avatar
Kgneo committed
748
749
	       	<br>
	       	<small><?php echo Yii::t("form","What kind of content will you create ?") ?></small>
Kgneo's avatar
Kgneo committed
750
751
752
	       </h4>

	        <div class="col-md-12 col-sm-12 col-xs-12"><hr></div>
Clément Damiens's avatar
Clément Damiens committed
753
754
755
756
757
758
759
760
761
762
763
764
765
766
	        <?php foreach($addElement as $key => $v){
	        	if(!@$v["typeAllow"] || in_array($type, $v["typeAllow"])){ ?>
	        		<button data-form-type="<?php echo $v["formType"] ?>" 
	        			<?php if(@$v["formSubType"]){ ?>
	        			data-form-subtype="<?php echo $v["formSubType"] ?>" 
	        			<?php } ?>
	        			data-dismiss="modal"
		                class="btn btn-link btn-open-form col-xs-6 col-sm-6 col-md-4 col-lg-4 text-<?php echo $v["color"] ?>">
		            	<h6><i class="fa <?php echo @$v["icon"] ?> fa-2x bg-<?php echo @$v["color"] ?>"></i><br> <?php echo $v["label"] ?></h6>
		            	<small><?php echo $v["description"] ?></small>
		        	</button>
	        	<?php }
	        }
	        ?>
Kgneo's avatar
Kgneo committed
767
768
	    </div>
    </div>
Kgneo's avatar
Kgneo committed
769
770


Kgneo's avatar
up DDA    
Kgneo committed
771
	<section class="col-xs-12 col-md-9 col-sm-9 col-lg-10 no-padding central-section pull-right">
Clément Damiens's avatar
   
Clément Damiens committed
772
773
774
775
776
		<?php    
			$marginCentral="";
			$classDescH="hidden"; 
			$classBtnDescH="<i class='fa fa-angle-down'></i> ".Yii::t("common","show description"); 
				
Tristan Goguet's avatar
Tristan Goguet committed
777
778
			if(!isset($linksBtn["isFollowing"]) && !isset($linksBtn["isAdmin"]) )
				$classDescH = "";
Clément Damiens's avatar
   
Clément Damiens committed
779
780

			if(@$element["custom"] && is_array($element["custom"]) && @$element["custom"]["pubTpl"]){
Clément Damiens's avatar
   
Clément Damiens committed
781
				echo $this->renderPartial($element["custom"]["pubTpl"], array("central"=>true));
Clément Damiens's avatar
   
Clément Damiens committed
782
			}
Clément Damiens's avatar
   
Clément Damiens committed
783
	
Tristan Goguet's avatar
Tristan Goguet committed
784
			if($typeItem != Person::COLLECTION){ 
Kgneo's avatar
Kgneo committed
785
		?>
Tristan Goguet's avatar
Tristan Goguet committed
786
			<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 hidden-xs" style="margin-top:30px;">
Kgneo's avatar
Kgneo committed
787
				<!-- <span id="desc-event" class="margin-top-10 <?php echo $classDescH; ?>">
Kgneo's avatar
Kgneo committed
788
					<b><i class="fa fa-angle-down"></i> 
Clément Damiens's avatar
   
Clément Damiens committed
789
					<i class="fa fa-info-circle"></i> <?php echo Yii::t("common","Main description") ?></b>
Raphael's avatar
Raphael committed
790
791
792
					<hr>
					<span id="descProfilsocial">
						<?php echo 	@$element["description"] && @$element["description"]!="" ? 
Kgneo's avatar
Kgneo committed
793
									@$element["description"] : 
Clément Damiens's avatar
   
Clément Damiens committed
794
									"<span class='label label-info'> ".Yii::t("common","No description registred")."</span>"; ?>
Raphael's avatar
Raphael committed
795
					</span>
Kgneo's avatar
Kgneo committed
796
				</span> -->
Kgneo's avatar
Kgneo committed
797
			</div>
Kgneo's avatar
Kgneo committed
798
799
800
			<!-- <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 hidden-xs">
				
	    		<button class="btn btn-link btn-xs pull-right" id="btn-hide-desc">
Kgneo's avatar
Kgneo committed
801
802
					<?php echo $classBtnDescH; ?>
				</button>
Kgneo's avatar
Kgneo committed
803
				
Kgneo's avatar
Kgneo committed
804
805
				<br>
				<hr>
Kgneo's avatar
Kgneo committed
806
			</div> -->
Kgneo's avatar
Kgneo committed
807
		<?php }else{ $marginCentral="50"; } ?>
Tristan Goguet's avatar
Tristan Goguet committed
808

Raphael's avatar
Raphael committed
809
		<!-- Permet de faire le convertion en HTML -->
Raphael's avatar
Raphael committed
810
		<span id="descriptionMarkdown" name="descriptionMarkdown"  class="hidden" ><?php echo (!empty($element["description"])) ? $element["description"] : ""; ?></span>
Kgneo's avatar
Kgneo committed
811
812

	    <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9 margin-top-<?php echo $marginCentral; ?>" id="central-container">
Kgneo's avatar
Kgneo committed
813
		</div>
Kgneo's avatar
Kgneo committed
814

Tibor Katelbach's avatar
Tibor Katelbach committed
815
		<?php $this->renderPartial('co2.views.pod.qrcode',array(		"type" => @$type,
816
817
818
819
820
821
822
823
																"name" => @$element['name'],
																"address" => @$address,
																"address2" => @$address2,
																"email" => @$element['email'],
																"url" => @$element["url"],
																"tel" => @$tel,
																"img"=>@$element['profilThumbImageUrl']));
																?>
Kgneo's avatar
Kgneo committed
824

Kgneo's avatar
Kgneo committed
825
826
		<div class="col-md-3 col-lg-3 hidden-sm hidden-xs margin-top-<?php echo $marginCentral; ?>" 
			 id="notif-column">
Clément Damiens's avatar
   
Clément Damiens committed
827
			<?php if(@$element["custom"] && is_array($element["custom"]) && @$element["custom"]["pubTpl"])
Clément Damiens's avatar
   
Clément Damiens committed
828
829
				echo $this->renderPartial($element["custom"]["pubTpl"]); ?>
	
Kgneo's avatar
up    
Kgneo committed
830
		</div>
Kgneo's avatar
Kgneo committed
831
	</section>
Kgneo's avatar
up    
Kgneo committed
832

Kgneo's avatar
Kgneo committed
833
	<!-- <section class="col-xs-12 col-md-9 col-sm-9 col-lg-9 no-padding form-contact-mail pull-right"> -->
Kgneo's avatar
Kgneo committed
834
835
836
		<?php 
			if(Yii::app()->params["CO2DomainName"] != "kgougle"){ 
				$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
Kgneo's avatar
Kgneo committed
837
				$this->renderPartial($layoutPath.'forms.'.Yii::app()->params["CO2DomainName"].'.formContact', 
Kgneo's avatar
Kgneo committed
838
839
									array("element"=>@$element));
			} 
Kgneo's avatar
up    
Kgneo committed
840
		?>
Kgneo's avatar
Kgneo committed
841
	<!-- </section> -->
Kgneo's avatar
Kgneo committed
842
</div>	
Kgneo's avatar
Kgneo committed
843

844
<?php 
Tibor Katelbach's avatar
Tibor Katelbach committed
845
	$this->renderPartial('co2.views.pod.confidentiality',
Kgneo's avatar
Kgneo committed
846
847
848
849
850
851
			array(  "element" => @$element, 
					"type" => @$type, 
					"edit" => @$edit,
					"controller" => $controller,
					"openEdition" => $openEdition,
				) );
Clément Damiens's avatar
   
Clément Damiens committed
852
?>
853

Clément Damiens's avatar
   
Clément Damiens committed
854
<?php	$cssAnsScriptFilesModule = array(
Kgneo's avatar
Kgneo committed
855
856
857
		'/js/default/profilSocial.js',
	);
	HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, $this->module->assetsUrl);
858
?>
Kgneo's avatar
Kgneo committed
859
860

<script type="text/javascript">
Kgneo's avatar
Kgneo committed
861
	var contextData = <?php echo json_encode( Element::getElementForJS(@$element, @$type) ); ?>; 
Raphael's avatar
Raphael committed
862
	mylog.log("init contextData", contextData);
Clément Damiens's avatar
   
Clément Damiens committed
863
864
    var params = <?php echo json_encode(@$params); ?>; 
    var edit =  ( ( '<?php echo (@$edit == true); ?>' == "1") ? true : false );
Raphael's avatar
Raphael committed
865
	var openEdition = ( ( '<?php echo (@$openEdition == true); ?>' == "1") ? true : false );
Kgneo's avatar
Kgneo committed
866
867
    var dateLimit = 0;
    var typeItem = "<?php echo $typeItem; ?>";
Clément Damiens's avatar
   
Clément Damiens committed
868
    var liveScopeType = "";
869
    var subView="<?php echo @$_GET['view']; ?>";
Clément Damiens's avatar
   
Clément Damiens committed
870
    var navInSlug=false;
Clément Damiens's avatar
Clément Damiens committed
871
872
   	var pageConfig=<?php echo json_encode($pageConfig) ?>;
   	if(notNull(pageConfig) && typeof pageConfig.initView != "undefined" && subView=="") subView=pageConfig.initView;
Clément Damiens's avatar
   
Clément Damiens committed
873
874
    if(typeof contextData.slug != "undefined")
     	navInSlug=true;
Kgneo's avatar
up dda    
Kgneo committed
875
   
Kgneo's avatar
Kgneo committed
876
	var hashUrlPage= ( (typeof contextData.slug != "undefined") ? 
Clément Damiens's avatar
Clément Damiens committed
877
						"#@"+contextData.slug : 
Kgneo's avatar
Kgneo committed
878
						"#page.type."+contextData.type+".id."+contextData.id);
Kgneo's avatar
up dda    
Kgneo committed
879
    
Clément Damiens's avatar
   
Clément Damiens committed
880
881
882
883
884
885
886
    if(location.hash.indexOf("#page")>=0){
    	strHash="";
    	if(location.hash.indexOf(".view")>0){
    		hashPage=location.hash.split(".view");
    		strHash=".view"+hashPage[1];
    	}
    	replaceSlug=true;
Clément Damiens's avatar
   
Clément Damiens committed
887
    	history.replaceState("#page.type."+contextData.type+".id."+contextData.id, "", hashUrlPage+strHash);
Clément Damiens's avatar
   
Clément Damiens committed
888
889
    	//location.hash=;
    }
Kgneo's avatar
up dda    
Kgneo committed
890
    
Clément Damiens's avatar
   
Clément Damiens committed
891
    var cropResult;
Kgneo's avatar
Kgneo committed
892
    var idObjectShared = new Array();
Kgneo's avatar
Kgneo committed
893
894

    var personCOLLECTION = "<?php echo Person::COLLECTION; ?>";
Clément Damiens's avatar
   
Clément Damiens committed
895
	var dirHash="<?php echo @$_GET['dir']; ?>";
Clément Damiens's avatar
   
Clément Damiens committed
896
897
	var key="<?php echo @$_GET['key']; ?>";
	var folderKey="<?php echo @$_GET['folder']; ?>";
Kgneo's avatar
Kgneo committed
898
899
900
901
	var roomId = "<?php echo @$_GET['room']; ?>";
	var proposalId = "<?php echo @$_GET['proposal']; ?>";
	var resolutionId = "<?php echo @$_GET['resolution']; ?>";
	var actionId = "<?php echo @$_GET['action']; ?>";
Clément Damiens's avatar
   
Clément Damiens committed
902
	var isLiveNews = "";
Clément Damiens's avatar
   
Clément Damiens committed
903
	var connectTypeElement="<?php echo Element::$connectTypes[$type] ?>";
Kgneo's avatar
Kgneo committed
904
905
906
	
	if(contextData.type == "citoyens") var currentRoomId = "";

Kgneo's avatar
Kgneo committed
907
908
	jQuery(document).ready(function() {
		bindButtonMenu();
Kgneo's avatar
Kgneo committed
909
		if(typeof contextData.name !="undefined")
Raphael's avatar
Raphael committed
910
			setTitle("", "", contextData.name);
911
		inintDescs();
912
913
914
915
916
		if( contextData.type == "events")
			$(".createProjectBtn").hide()
		else 
			$(".createProjectBtn").show()

Kgneo's avatar
Kgneo committed
917
		$(".hide-"+contextData.type).hide();
Clément Damiens's avatar
   
Clément Damiens committed
918
		getProfilSubview(subView,dirHash, key, folderKey);
Kgneo's avatar
Kgneo committed
919
		
Kgneo's avatar
Kgneo committed
920
		//loadActionRoom();
Kgneo's avatar
Kgneo committed
921

Clément Damiens's avatar
   
Clément Damiens committed
922
923
924
		KScrollTo("#topPosKScroll");
		initDateHeaderPage(contextData);
		getContextDataLinks();
Raph El's avatar
Raph El committed
925
		if(typeof contextData.links != "undefined" && typeof rolesList != "undefined")
Clément Damiens's avatar
   
Clément Damiens committed
926
			pushListRoles(contextData.links);
Clément Damiens's avatar
   
Clément Damiens committed
927
		initMetaPage(contextData.name,contextData.shortDescription,contextData.profilImageUrl);
Clément Damiens's avatar
   
Clément Damiens committed
928
929
930
		//Sig.showMapElements(Sig.map, mapElements);
		var elemSpec = dyFInputs.get("<?php echo $type?>");
		buildQRCode( elemSpec.ctrl ,"<?php echo (string)$element["_id"]?>");
Kgneo's avatar
Kgneo committed
931
		
Clément Damiens's avatar
   
Clément Damiens committed
932
	});
Kgneo's avatar
Kgneo committed
933

934
935
936
937
938
939
940
941
942
943
944
945
946
947
	function initMetaPage(title, description, image){
		if(title != ""){
			$("meta[name='title']").attr("content",title);
			$("meta[property='og:title']").attr("content",title);
		}
		if(description != ""){
			$("meta[name='description']").attr("content",description);
			$("meta[property='og:description']").attr("content",description);
		}
		if(image != ""){
			$("meta[name='image']").attr("content",baseUrl+image);
			$("meta[property='og:image']").attr("content",baseUrl+image);
		}
	}
Clément Damiens's avatar
   
Clément Damiens committed
948
	function getProfilSubview(sub, dir,key, folderId){ console.log("getProfilSubview", sub, dir);
Clément Damiens's avatar
   
Clément Damiens committed
949
950
		if(sub!=""){
			if(sub=="gallery")
Clément Damiens's avatar
   
Clément Damiens committed
951
				loadGallery(dir, key, folderKey);
Clément Damiens's avatar
   
Clément Damiens committed
952
953
			if(sub=="library")
				loadLibrary();
Clément Damiens's avatar
   
Clément Damiens committed
954
			else if(sub=="notifications")
955
				loadNotifications();
Clément Damiens's avatar
   
Clément Damiens committed
956
			else if(sub.indexOf("chart") >= 0){
Clément Damiens's avatar
   
Clément Damiens committed
957
				loadChart();
958
			}
Clément Damiens's avatar
   
Clément Damiens committed
959
			else if(sub=="mystream")
960
				loadNewsStream(false);
Clément Damiens's avatar
   
Clément Damiens committed
961
			else if(sub=="history")
Clément Damiens's avatar
Clément Damiens committed
962
				loadHistoryActivity();
Clément Damiens's avatar
   
Clément Damiens committed
963
964
965
			else if(sub=="directory")
				loadDataDirectory(dir,null,edit);
			else if(sub=="editChart")
Clément Damiens's avatar
   
Clément Damiens committed
966
				loadEditChart();
Clément Damiens's avatar
   
Clément Damiens committed
967
			else if(sub=="detail")
Clément Damiens's avatar
   
Clément Damiens committed
968
				loadDetail();
Clément Damiens's avatar
   
Clément Damiens committed
969
			else if(sub=="urls")
970
				loadUrls();
971
972
			else if(sub=="chat" && userId)
				rcObj.loadChat("","citoyens", true, true);
Clément Damiens's avatar
   
Clément Damiens committed
973
			else if(sub=="contacts")
974
				loadContacts();
Tibor Katelbach's avatar
Tibor Katelbach committed
975
976
			else if(sub=="md")
				loadMD();
Clément Damiens's avatar
   
Clément Damiens committed
977
			else if(sub=="settings")
978
				loadSettings();
Clément Damiens's avatar
   
Clément Damiens committed
979
980
			else if(sub=="coop"){
				onchangeClick=false;
Tibor Katelbach's avatar
Tibor Katelbach committed
981
				uiCoop.loadCoop(roomId, proposalId, resolutionId, actionId);
Clément Damiens's avatar
   
Clément Damiens committed
982
			}
Tristan Goguet's avatar
init cv    
Tristan Goguet committed
983
			else if(sub=="networks"){
Raph El's avatar
Raph El committed
984
				loadNetworks();
Tristan Goguet's avatar
init cv    
Tristan Goguet committed
985
986
987
988
			}
			else if(sub=="curiculum"){
				loadCuriculum();
			}
Raph El's avatar
Raph El committed
989
			
990
		} else
Clément Damiens's avatar
Clément Damiens committed
991
			loadNewsStream(false);
Clément Damiens's avatar
   
Clément Damiens committed
992
	}
Raphael's avatar
Raphael committed
993

Kgneo's avatar
Kgneo committed
994
</script>