Commit 5c5f9f46 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweaks and freaks

parent d1c0e3fb
......@@ -17,7 +17,7 @@ $paramsData = [
"fonctionnement" => "Fonctionnement"
],
"amounts" => [
"price" => "Price"
"price" => "Montant"
],
"estimate" => false
];
......@@ -80,6 +80,7 @@ echo $this->renderPartial("survey.views.tpls.forms.cplx.budgetTable",
"answer"=>$answer,
"mode" => $mode,
"kunik" => $kunik,
"answerPath"=>$answerPath,
"key" => $key,
"titleColor" => $titleColor,
"properties" => $properties,
......@@ -131,12 +132,17 @@ $(document).ready(function() {
tplCtx.value[k] = $("#"+k).val();
});
var connectedData = ["financer","todo","payed","progress","worker","validFinal","votes",];
$.each( connectedData , function(k,attr) {
if(notNull("answerObj."+tplCtx.path+"."+attr))
tplCtx.value[attr] = jsonHelper.getValueByPath(answerObj,tplCtx.path+"."+attr);
});
mylog.log("save tplCtx",tplCtx);
if(typeof tplCtx.value == "undefined")
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -199,7 +205,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -212,7 +217,7 @@ $(document).ready(function() {
mylog.log("render","/modules/costum/views/tpls/forms/<?php echo $kunik ?>.php");
//adds a line into answer
$(".add<?php echo $kunik ?>").off().on("click",function() {
$( ".add<?php echo $kunik ?>" ).off().on("click",function() {
tplCtx.id = $(this).data("id");
tplCtx.collection = $(this).data("collection");
tplCtx.path = $(this).data("path")+((notNull(<?php echo $kunik ?>Data) ? <?php echo $kunik ?>Data.length : "0"));
......@@ -324,7 +329,7 @@ $(document).ready(function() {
function closePrioModal(){
prioModal.modal('hide');
}
function closePrioModalRel(){
function closePrioModalRel (){
closePrioModal();
urlCtrl.loadByHash(location.hash);
}
......
......@@ -74,12 +74,13 @@ $colspanplus = (($mode == "r") ? 0 : 2);
?>
<td>
<?php
//echo $answerPath.$q;
$this->renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [
"canEdit"=>($canEdit||Yii::app()->session["userId"] == $answer["user"]),
"id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION,
"q" => $q,
"path" => "answers.".$kunik.".".$q,
"path" => $answerPath.$q,
"kunik"=>$kunik ] ); ?>
<a href="javascript:;" class="btn btn-xs btn-primary openAnswersComment" onclick="commentObj.openPreview('answers','<?php echo $answer["_id"]?>','<?php echo $answer["_id"].$key.$q ?>', '<?php echo @$a['step'] ?>')"><?php echo PHDB::count(Comment::COLLECTION, array("contextId"=>$answer["_id"],"contextType"=>"answers", "path"=>$answer["_id"].$key.$q))?> <i class='fa fa-commenting'></i></a>
......
......@@ -144,8 +144,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
//$("#ajax-modal").modal('hide');
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -183,8 +181,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
//$("#ajax-modal").modal('hide');
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......
......@@ -317,7 +317,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -362,7 +361,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -491,13 +489,7 @@ $(document).ready(function() {
});
});
function closePrioModal(){
prioModal.modal('hide');
}
function closePrioModalRel(){
closePrioModal();
urlCtrl.loadByHash(location.hash);
}
</script>
<?php } else {
//echo "<h4 class='text-red'>CALENDAR works with existing answers</h4>";
......
......@@ -185,7 +185,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -222,7 +221,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......
......@@ -234,7 +234,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -281,7 +280,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......
......@@ -502,7 +502,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......
......@@ -144,7 +144,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -183,7 +182,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -230,7 +228,6 @@ $(document).ready(function() {
mylog.log(".editContent", "<?php echo $kunik ?>","tplCtx",tplCtx);
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......
......@@ -139,7 +139,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......
......@@ -133,7 +133,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......
......@@ -569,7 +569,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");//$("#ajax-modal").modal('hide');
urlCtrl.loadByHash(location.hash);
} );
}
......@@ -621,7 +620,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!');
else {
dataHelper.path2Value( tplCtx, function(params) {
$("#ajax-modal").html("<div class='text-center'><i class='fa fa-spin fa-spinner'></i></div>");
urlCtrl.loadByHash(location.hash);
} );
}
......
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