Commit d01ed23a authored by thomas craipeau's avatar thomas craipeau
Browse files

fix session refactor costum

parent cfa003d6
......@@ -13,7 +13,7 @@ class DeleteAction extends CAction
if( $answer["user"] == Yii::app()->session["userId"] || Authorisation::isElementAdmin($id, Form::ANSWER_COLLECTION, Yii::app()->session["userId"], false)){
//var_dump($answer["answers"][$answer["formId"]]); exit;
if(!empty(Yii::app()->session['costum']) &&
if(!empty($ctrl->costum) &&
!empty($answer["answers"]) &&
!empty($answer["formId"]) &&
!empty($answer["answers"][$answer["formId"]]) &&
......
......@@ -108,10 +108,11 @@ class Form {
"step" => "dossier",
"created"=>time()
);
if( isset(Yii::app()->session["costum"]) &&
isset(Yii::app()->session["costum"]["slug"]) ){
$answer["source"] = array( "key" => Yii::app()->session["costum"]["slug"],
"keys" => array(Yii::app()->session["costum"]["slug"]),
$costum = CacheHelper::getCostum();
if( isset($costum) &&
isset($costum["slug"]) ){
$answer["source"] = array( "key" => $costum["slug"],
"keys" => array($costum["slug"]),
"insertOrign" => "costum") ;
}
PHDB::insert( self::ANSWER_COLLECTION, $answer);
......
......@@ -50,7 +50,7 @@
if(isset($answers["actionPrincipal"])){
$img = "";
foreach (@Yii::app()->session["costum"]["badges"]["domainAction"] as $ki => $vi) {
foreach (@$this->costum["badges"]["domainAction"] as $ki => $vi) {
if( $vi["name"] == $answers["actionPrincipal"] && isset($vi["profilThumbImageUrl"]) )
$img = "<img class='wimg' src='".Yii::app()->createUrl($vi["profilThumbImageUrl"])."'/>";
}
......@@ -66,7 +66,7 @@
if(!empty($answers["actionSecondaire"])){
foreach ($answers["actionSecondaire"] as $k => $v ) {
$img = "";
foreach (@Yii::app()->session["costum"]["badges"]["domainAction"] as $ki => $vi)
foreach (@$this->costum["badges"]["domainAction"] as $ki => $vi)
{
if( $vi["name"] == $v && isset($vi["profilThumbImageUrl"]) )
$img = "<img class='wimg' src='".Yii::app()->createUrl($vi["profilThumbImageUrl"])."'/>";
......@@ -89,7 +89,7 @@
<?php
if(isset($answers["cibleDDPrincipal"])){
$img = "";
foreach (@Yii::app()->session["costum"]["badges"]["cibleDD"] as $ki => $vi) {
foreach (@$this->costum["badges"]["cibleDD"] as $ki => $vi) {
if( $vi["name"] == $answers["cibleDDPrincipal"] && isset($vi["profilThumbImageUrl"]) )
$img = "<img class='wimg' src='".Yii::app()->createUrl($vi["profilThumbImageUrl"])."'/>";
}
......@@ -111,7 +111,7 @@
if(isset($answers["cibleDDSecondaire"])){
foreach ($answers["cibleDDSecondaire"] as $k => $v ) {
$img = "";
foreach (@Yii::app()->session["costum"]["badges"]["cibleDD"] as $ki => $vi) {
foreach (@$this->costum["badges"]["cibleDD"] as $ki => $vi) {
if( $vi["name"] == $v && isset($vi["profilThumbImageUrl"]) )
$img = "<img class='wimg' src='".Yii::app()->createUrl($vi["profilThumbImageUrl"])."'/>";
}
......
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