Commit 33722d6c authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweaks cte nat btn

parent 6e1c2837
......@@ -23,10 +23,12 @@ class DeleteAction extends CAction
$project = $answer["answers"][$answer["formId"]]["answers"]["project"] ;
//disconnect cter.links.action(project)
Link::disconnect($cteR["id"], Project::COLLECTION, $project["id"], Project::COLLECTION,Yii::app()->session["userId"], "projects", null, null);
//Add notification - email label in child link
//disconnect project.links.cter(project)
Link::disconnect($project["id"], Project::COLLECTION, $cteR["id"], Project::COLLECTION, Yii::app()->session["userId"], "projects", null, null);
//disconnect project.links.answers
Link::disconnect($project["id"], Project::COLLECTION, $id, Form::ANSWER_COLLECTION, Yii::app()->session["userId"], "answers", null, null);
$where = array("_id" => new MongoId($project["id"]));
......
......@@ -301,7 +301,8 @@ class Form {
return $results ;
}
//rebuild answerList
// by adding organizing organization (id,type) and project (id,type)
public static function listForAdmin($answers){
//Rest::json($answers); exit ;
$uniq = array();
......@@ -320,7 +321,6 @@ class Form {
$new[Organization::CONTROLLER] = $orga;
}
if( !empty($valA["answers"][Project::CONTROLLER]) && !empty($valA["answers"][Project::CONTROLLER]["id"]) ){
$project = Element::getElementById($valA["answers"][Project::CONTROLLER]["id"], Project::COLLECTION, null, array("name", "email", "shortDescription"));
$project["id"] = $valA["answers"][Project::CONTROLLER]["id"];
......
......@@ -216,10 +216,11 @@ if( !isset($adminAnswers["validation"]) ||
<?php
$editBtn="";
if($canAdmin){
$editBtn = ( isset($answers["organization"]["type"] ) ) ?
$editBtn = ( isset($answers["organization"]["type"] ) && PHDB::findOneById(Organization::COLLECTION,$answers["organization"]["id"], ["_id"]) ) ?
"<a href='javascript:' data-form='organization' data-step='organization' data-type='".$answers["organization"]["type"]."' data-id='".$answers["organization"]["id"]."' class='editStep btn btn-default'><i class='fa fa-pencil'></i> ".Yii::t("common","Edit")."</a>"
: "<a href='javascript:' data-form='organization' data-step='organization' class='createStep btn btn-default'><i class='fa fa-pencil'></i></a>";
$editBtn = "";
if( isset($answers["organization"]["id"] ) && PHDB::findOneById(Organization::COLLECTION,$answers["organization"]["id"], ["_id"]))
$editBtn = "";
}
?>
<thead>
......@@ -1124,10 +1125,10 @@ $(document).ready(function() {
});
$('.createStep').off().click(function() {
mylog.log('createStep ',$(this).data("form"));
var dfCostum = ( form.scenario[ $(this).data("form") ]['costum']) ? form.scenario[ $(this).data("form") ]['costum']['dynFormCostum'] : null;
var dfCostum = ( form.scenario[ $(this).data("form") ]['costum']) ? form.scenario[ $(this).data( "form" ) ]['costum']['dynFormCostum'] : null;
updateForm = {
form : $(this).data("form")
};
form : $(this).data("form")
};
//il faut mettre a jour les answer avec les data de l'orga ou du project
dfCostum.afterSave = function(elem){
......@@ -1161,7 +1162,7 @@ $(document).ready(function() {
id : contextData.id,
path : "showAAP",
value : true
}, function(){alert("tout bon")} );
}, function(){} );
});
$('.editStep').off().click(function() {
......
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