Commit 59451da6 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

Merge remote-tracking branch 'origin/development' into development

parents e45a7a8f 76b86c73
......@@ -25,12 +25,12 @@ var formObj = {
initDefaults : function(pInit){},
initEvents : function(pInit){},
initViews : function(pInit){
if(location.hash.indexOf(hashUrlPage+".view.forms.form.dir")>=0){
if(location.hash.indexOf(hashUrlPage+".view.forms.dir.form")>=0){
var hashArray = location.hash.split('.');
this.urls.form(this, hashArray[4]);
this.urls.form(this, hashArray[5]);
}else if(location.hash.indexOf(hashUrlPage+".view.forms.dir.answer.")>=0){
var hashArray = location.hash.split('.');
this.urls.answer(this, hashArray[4]);
this.urls.answer(this, hashArray[5]);
}else if(location.hash.indexOf(hashUrlPage+".view.forms.dir.answers.form")>=0){
var hashArray = location.hash.split('.');
this.urls.answers(this, hashArray[6]);
......@@ -120,6 +120,7 @@ var formObj = {
});
$(fObj.container).html(str);
fObj.events.form(fObj);
fObj.events.add(fObj);
},
form : function(id, form){
var panelColor = "panel-primary";
......@@ -131,9 +132,8 @@ var formObj = {
panelColor = "panel-success";
formCostum = true;
urlCostum = baseUrl+'/costum/co/index/id/'+form.source.key
}
var str='<div class="col-sm-6 col-xs-12" id="'+id+'Form">'+
'<div class="panel '+panelColor+'">'+
'<div class="panel-heading">'+
......
......@@ -32,7 +32,7 @@ class IndexAction extends CAction
$params["form"] = $form ;
//Rest::json($params); exit;
$params = Form::getDataForAnswer($params);
$params = Form::getDataForm($params);
$params["answer"] = $answer;
// TODO améliorer getdataForAnser pour soit viré la création de lanswers soit charger la bonne answer
......
......@@ -3,15 +3,7 @@ class EditAction extends CAction
{
public function run($id=null, $answer=null)
{
// $this->getController()->layout = "//layouts/empty";
// $params = array("canEdit" => true, "showAnswerActions"=>false);
// $params = Form::getDataForAnswer($params);
// $tpl=(!empty($tpl)) ? $tpl : "survey.views.tpls.views.index";
// $params["mode"]="w";
// echo $this->getController()->renderPartial($tpl,$params );
$this->getController()->layout = "//layouts/empty";
$this->getController()->layout = "//layouts/empty";
$params = array();
if(!empty($id) && !empty(Yii::app()->session["userId"]) ){
$form = PHDB::findOneById( Form::COLLECTION , $id);
......@@ -28,7 +20,7 @@ class EditAction extends CAction
}
$params["form"] = $form ;
//Rest::json($params); exit;
$params = Form::getDataForAnswer($params);
$params = Form::getDataForm($params);
$params["answer"] = $answer;
$params["canEditForm"] = $canEditForm;
$params["canEdit"] = true;
......
......@@ -653,7 +653,7 @@ class Form {
return false;
}
public static function getDataForAnswer($params){
public static function getDataForm($params){
if(isset($_GET["form"]) || !empty($params["form"])){
if(!empty($params["form"]))
......
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