Commit 9c7ebc7f authored by thomas craipeau's avatar thomas craipeau
Browse files

Revert "Merge branch 'development' into qa"

This reverts commit 66cc813d, reversing
changes made to 48dbe3a6.
parent 66cc813d
......@@ -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($ctrl->costum) &&
if(!empty(Yii::app()->session['costum']) &&
!empty($answer["answers"]) &&
!empty($answer["formId"]) &&
!empty($answer["answers"][$answer["formId"]]) &&
......
......@@ -7,62 +7,24 @@ class Form {
const ICON = "fa-list-alt";
const ICON_ANSWER = "fa-calendar-check-o";
const TYPE_OPENFORM = "openForm";
public static $riskWeight = [
"11" => [ "w" => 1 , "c" => "lightGreen"],
"12" => [ "w" => 2 , "c" => "lightGreen"],
"13" => [ "w" => 3 , "c" => "lightGreen"],
"14" => [ "w" => 4 , "c" => "orange"],
"21" => [ "w" => 5 , "c" => "lightGreen"],
"22" => [ "w" => 6 , "c" => "lightGreen"],
"23" => [ "w" => 7 , "c" => "orange"],
"24" => [ "w" => 8 , "c" => "red"],
"31" => [ "w" => 9 , "c" => "lightGreen"],
"32" => [ "w" => 10 , "c" => "orange"],
"33" => [ "w" => 11 , "c" => "red"],
"34" => [ "w" => 12 , "c" => "red"],
"41" => [ "w" => 13 , "c" => "orange"],
"42" => [ "w" => 14 , "c" => "red"],
"43" => [ "w" => 15 , "c" => "red"],
"44" => [ "w" => 16 , "c" => "red"],
];
public static $inputTypes = [
"text" => "Text : petit text court",
"textarea" => "Textarea : Grande zone de texte",
//"button" => "button",
"tpls.forms.checkbox" => "checkbox : Case à cocher",
"color" => "color : Selectionner une couleur",
"date" => "date : Selectionner une date",
"datetime-local" => "datetime-local : Selectionner une date et heure",
"month" => "Choisir un mois",
"week" => "week : Choisir un semaine",
"time" => "time : Ajouter une heure",
"email" => "Remplir un email",
//"image" => "Ajouter une image",
"number" => "Choisir un nombre",
"radio" => "radio : Choix unique",
//"range" => "range : ",
"tel" => "tel : Ajouter un Telephone",
"url" => "url : Ajouter un lien internet",
"tags" => "tags : Ajouter des tags",
"tpls.forms.select" =>"select : ajouter une liste de choix",
"tpls.forms.cplx.calendar" =>"liste d'actions clefs avec des dates",
"tpls.forms.cplx.partner" =>"Les partenaires et leurs engagements réciproques",
"tpls.forms.cplx.budget" => "Liste de dépense",
"tpls.forms.cplx.financement" =>"Liste de Financement",
"tpls.forms.cplx.financementFromBudget" =>"Liste de Financement réutilisant les budgets",
"tpls.forms.cplx.indicateurs" =>"Liste d'Indicateur",
"tpls.forms.cplx.element" =>"Créer un élément Person , Organisation, Projet,...",
"tpls.forms.cplx.stepValidation" =>"Step Validation by Roles",
"tpls.forms.cplx.generatePDF" =>"Generate PDF",
"tpls.forms.cplx.address" =>"Geocode an address",
"tpls.forms.cplx.regle" =>"règle d'attribution",
"tpls.forms.cplx.multiCheckbox" =>"Liste of checkboxes",
"sectionTitle" => "Séparateur de Section avec Titre",
];
public static $riskWeight = array(
"11" => array( "w" => 1 , "c" => "lightGreen"),
"12" => array( "w" => 2 , "c" => "lightGreen"),
"13" => array( "w" => 3 , "c" => "lightGreen"),
"14" => array( "w" => 4 , "c" => "orange"),
"21" => array( "w" => 5 , "c" => "lightGreen"),
"22" => array( "w" => 6 , "c" => "lightGreen"),
"23" => array( "w" => 7 , "c" => "orange"),
"24" => array( "w" => 8 , "c" => "red"),
"31" => array( "w" => 9 , "c" => "lightGreen"),
"32" => array( "w" => 10 , "c" => "orange"),
"33" => array( "w" => 11 , "c" => "red"),
"34" => array( "w" => 12 , "c" => "red"),
"41" => array( "w" => 13 , "c" => "orange"),
"42" => array( "w" => 14 , "c" => "red"),
"43" => array( "w" => 15 , "c" => "red"),
"44" => array( "w" => 16 , "c" => "red")
);
public static function newAnswer($data)
{
......@@ -77,11 +39,10 @@ class Form {
"step" => "dossier",
"created"=>time()
);
$costum = CacheHelper::getCostum();
if( isset($costum) &&
isset($costum["slug"]) ){
$answer["source"] = array( "key" => $costum["slug"],
"keys" => array($costum["slug"]),
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"]),
"insertOrign" => "costum") ;
}
PHDB::insert( self::ANSWER_COLLECTION, $answer);
......@@ -595,32 +556,7 @@ class Form {
return $res;
}
public static function generateOpenForm($slug){
$forms = PHDB::find(self::COLLECTION, ["parentSlug"=> $slug] );
$create = false;
if( count( $forms ) == 0 )
$create = true;
else {
foreach ($forms as $i => $f) {
if( !isset($f["inputs"]) )
return $f["id"];
}
$create = true;
}
if($create)
{
$form = [
"id" => $slug.count( $forms ),
"parentSlug" => $slug,
"type" => "openForm"
];
$f = PHDB::insert( Form::COLLECTION, $form );
return $slug.count( $forms );
}
}
}
?>
\ No newline at end of file
......@@ -34,8 +34,8 @@
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
'/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
......@@ -33,8 +33,8 @@
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
'/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
......@@ -32,8 +32,8 @@
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
'/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
......@@ -32,8 +32,8 @@
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
'/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
......@@ -32,8 +32,8 @@
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
'/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
......@@ -32,8 +32,8 @@
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
'/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
......@@ -29,8 +29,8 @@ HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
// '/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
......@@ -34,8 +34,8 @@ $cssJS = array(
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
'/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
......@@ -50,7 +50,7 @@
if(isset($answers["actionPrincipal"])){
$img = "";
foreach (@$this->costum["badges"]["domainAction"] as $ki => $vi) {
foreach (@Yii::app()->session["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 (@$this->costum["badges"]["domainAction"] as $ki => $vi)
foreach (@Yii::app()->session["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 (@$this->costum["badges"]["cibleDD"] as $ki => $vi) {
foreach (@Yii::app()->session["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 (@$this->costum["badges"]["cibleDD"] as $ki => $vi) {
foreach (@Yii::app()->session["costum"]["badges"]["cibleDD"] as $ki => $vi) {
if( $vi["name"] == $v && isset($vi["profilThumbImageUrl"]) )
$img = "<img class='wimg' src='".Yii::app()->createUrl($vi["profilThumbImageUrl"])."'/>";
}
......
......@@ -35,8 +35,8 @@ HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array(
'/js/dataHelpers.js',
// '/js/sig/geoloc.js',
// '/js/sig/findAddressGeoPos.js',
'/js/sig/geoloc.js',
'/js/sig/findAddressGeoPos.js',
'/js/default/loginRegister.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() );
......
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