answerInvite.php 1.93 KB
Newer Older
Clément Damiens's avatar
 
Clément Damiens committed
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php if(@$invitedMe && !empty($invitedMe)){
		$inviteRefuse="Refuse";
		$inviteAccept="Accept";
		$verb="Join";
		$labelAdmin="";
		$option=null;
		$linkValid=Link::IS_INVITING;
		$msgRefuse=Yii::t("common","Are you sure to refuse this invitation");
		if(@$invitedMe["isAdminInviting"]){
			$verb="Administrate";
			$option="isAdminInviting";
			$labelAdmin=" to administrate";
			$linkValid=Link::IS_ADMIN_INVITING;
Clément Damiens's avatar
Clément Damiens committed
14
			$msgRefuse=Yii::t("common","Are you sure to refuse to administrate {what}", array("{what}"=>Yii::t("common"," this ".Element::getControlerByCollection($elementType))));
Clément Damiens's avatar
 
Clément Damiens committed
15
16
		}
		$labelInvitation=Yii::t("common", "{who} invited you".$labelAdmin, array("{who}"=>"<a href='#page.type.".Person::COLLECTION.".id.".$invitedMe["invitorId"]."' class='lbh'>".$invitedMe["invitorName"]."</a>"));
Clément Damiens's avatar
Clément Damiens committed
17
18
		$tooltipAccept=$verb." this ".Element::getControlerByCollection($elementType);
		if ($elementType == Event::COLLECTION){
Clément Damiens's avatar
 
Clément Damiens committed
19
20
21
			$inviteRefuse="Not interested";
			$inviteAccept="I go";
		}
Clément Damiens's avatar
Clément Damiens committed
22
		echo "<div class='no-padding containInvitation'>".
Clément Damiens's avatar
 
Clément Damiens committed
23
24
			"<div class='padding-5'>".
				$labelInvitation.": <br/>".
Clément Damiens's avatar
Clément Damiens committed
25
				'<a class="btn btn-xs tooltips btn-accept" href="javascript:links.validate(\''.$elementType.'\',\''.$elementId.'\', \''.Yii::app()->session["userId"].'\',\''.Person::COLLECTION.'\',\''.$linkValid.'\')" data-placement="bottom" data-original-title="'.Yii::t("common",$tooltipAccept).'">'.
Clément Damiens's avatar
 
Clément Damiens committed
26
27
					'<i class="fa fa-check "></i> '.Yii::t("common",$inviteAccept).
				'</a>'.
Clément Damiens's avatar
Clément Damiens committed
28
				'<a class="btn btn-xs tooltips btn-refuse margin-left-5" href="javascript:links.disconnect(\''.$elementType.'\',\''.$elementId.'\',\''.Yii::app()->session["userId"].'\',\''.Person::COLLECTION.'\',\''.Element::$connectTypes[$elementType].'\',null,\''.$option.'\',\''.$msgRefuse.'\')" data-placement="bottom" data-original-title="'.Yii::t("common","Not interested by the invitation").'">'.
Clément Damiens's avatar
 
Clément Damiens committed
29
30
31
32
33
34
					'<i class="fa fa-remove"></i> '.Yii::t("common",$inviteRefuse).
				'</a>'.
			"</div>".
		"</div>";
	}
?>