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

tweaks and freaks

parent d1c0e3fb
...@@ -17,7 +17,7 @@ $paramsData = [ ...@@ -17,7 +17,7 @@ $paramsData = [
"fonctionnement" => "Fonctionnement" "fonctionnement" => "Fonctionnement"
], ],
"amounts" => [ "amounts" => [
"price" => "Price" "price" => "Montant"
], ],
"estimate" => false "estimate" => false
]; ];
...@@ -80,6 +80,7 @@ echo $this->renderPartial("survey.views.tpls.forms.cplx.budgetTable", ...@@ -80,6 +80,7 @@ echo $this->renderPartial("survey.views.tpls.forms.cplx.budgetTable",
"answer"=>$answer, "answer"=>$answer,
"mode" => $mode, "mode" => $mode,
"kunik" => $kunik, "kunik" => $kunik,
"answerPath"=>$answerPath,
"key" => $key, "key" => $key,
"titleColor" => $titleColor, "titleColor" => $titleColor,
"properties" => $properties, "properties" => $properties,
...@@ -130,13 +131,18 @@ $(document).ready(function() { ...@@ -130,13 +131,18 @@ $(document).ready(function() {
$.each( sectionDyf.<?php echo $kunik ?>.jsonSchema.properties , function(k,val) { $.each( sectionDyf.<?php echo $kunik ?>.jsonSchema.properties , function(k,val) {
tplCtx.value[k] = $("#"+k).val(); 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); mylog.log("save tplCtx",tplCtx);
if(typeof tplCtx.value == "undefined") if(typeof tplCtx.value == "undefined")
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -199,8 +205,7 @@ $(document).ready(function() { ...@@ -199,8 +205,7 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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);
urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -212,7 +217,7 @@ $(document).ready(function() { ...@@ -212,7 +217,7 @@ $(document).ready(function() {
mylog.log("render","/modules/costum/views/tpls/forms/<?php echo $kunik ?>.php"); mylog.log("render","/modules/costum/views/tpls/forms/<?php echo $kunik ?>.php");
//adds a line into answer //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.id = $(this).data("id");
tplCtx.collection = $(this).data("collection"); tplCtx.collection = $(this).data("collection");
tplCtx.path = $(this).data("path")+((notNull(<?php echo $kunik ?>Data) ? <?php echo $kunik ?>Data.length : "0")); tplCtx.path = $(this).data("path")+((notNull(<?php echo $kunik ?>Data) ? <?php echo $kunik ?>Data.length : "0"));
...@@ -324,7 +329,7 @@ $(document).ready(function() { ...@@ -324,7 +329,7 @@ $(document).ready(function() {
function closePrioModal(){ function closePrioModal(){
prioModal.modal('hide'); prioModal.modal('hide');
} }
function closePrioModalRel(){ function closePrioModalRel (){
closePrioModal(); closePrioModal();
urlCtrl.loadByHash(location.hash); urlCtrl.loadByHash(location.hash);
} }
......
...@@ -74,12 +74,13 @@ $colspanplus = (($mode == "r") ? 0 : 2); ...@@ -74,12 +74,13 @@ $colspanplus = (($mode == "r") ? 0 : 2);
?> ?>
<td> <td>
<?php <?php
//echo $answerPath.$q;
$this->renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [ $this->renderPartial( "survey.views.tpls.forms.cplx.editDeleteLineBtn" , [
"canEdit"=>($canEdit||Yii::app()->session["userId"] == $answer["user"]), "canEdit"=>($canEdit||Yii::app()->session["userId"] == $answer["user"]),
"id" => $answer["_id"], "id" => $answer["_id"],
"collection" => Form::ANSWER_COLLECTION, "collection" => Form::ANSWER_COLLECTION,
"q" => $q, "q" => $q,
"path" => "answers.".$kunik.".".$q, "path" => $answerPath.$q,
"kunik"=>$kunik ] ); ?> "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> <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() { ...@@ -144,8 +144,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -183,8 +181,6 @@ $(document).ready(function() { ...@@ -183,8 +181,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -317,7 +317,6 @@ $(document).ready(function() { ...@@ -317,7 +317,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -362,7 +361,6 @@ $(document).ready(function() { ...@@ -362,7 +361,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -491,13 +489,7 @@ $(document).ready(function() { ...@@ -491,13 +489,7 @@ $(document).ready(function() {
}); });
}); });
function closePrioModal(){
prioModal.modal('hide');
}
function closePrioModalRel(){
closePrioModal();
urlCtrl.loadByHash(location.hash);
}
</script> </script>
<?php } else { <?php } else {
//echo "<h4 class='text-red'>CALENDAR works with existing answers</h4>"; //echo "<h4 class='text-red'>CALENDAR works with existing answers</h4>";
......
...@@ -185,7 +185,6 @@ $(document).ready(function() { ...@@ -185,7 +185,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -222,7 +221,6 @@ $(document).ready(function() { ...@@ -222,7 +221,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -234,7 +234,6 @@ $(document).ready(function() { ...@@ -234,7 +234,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -281,7 +280,6 @@ $(document).ready(function() { ...@@ -281,7 +280,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -502,7 +502,6 @@ $(document).ready(function() { ...@@ -502,7 +502,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -144,8 +144,7 @@ $(document).ready(function() { ...@@ -144,8 +144,7 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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);
urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -183,7 +182,6 @@ $(document).ready(function() { ...@@ -183,7 +182,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -230,8 +228,7 @@ $(document).ready(function() { ...@@ -230,8 +228,7 @@ $(document).ready(function() {
mylog.log(".editContent", "<?php echo $kunik ?>","tplCtx",tplCtx); mylog.log(".editContent", "<?php echo $kunik ?>","tplCtx",tplCtx);
dataHelper.path2Value( tplCtx, function(params) { 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);
urlCtrl.loadByHash(location.hash);
} ); } );
} }
} }
......
...@@ -139,7 +139,6 @@ $(document).ready(function() { ...@@ -139,7 +139,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -133,7 +133,6 @@ $(document).ready(function() { ...@@ -133,7 +133,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
......
...@@ -569,7 +569,6 @@ $(document).ready(function() { ...@@ -569,7 +569,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); urlCtrl.loadByHash(location.hash);
} ); } );
} }
...@@ -621,7 +620,6 @@ $(document).ready(function() { ...@@ -621,7 +620,6 @@ $(document).ready(function() {
toastr.error('value cannot be empty!'); toastr.error('value cannot be empty!');
else { else {
dataHelper.path2Value( tplCtx, function(params) { 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); 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