diff --git a/views/tpls/forms/sommom/acteurEncadrement.php b/views/tpls/forms/sommom/acteurEncadrement.php index 6531e354445a4aa6687851665117e5cad94f210f..5deab35529b8a83e6a34ea061e42f2af6c7a3aef 100644 --- a/views/tpls/forms/sommom/acteurEncadrement.php +++ b/views/tpls/forms/sommom/acteurEncadrement.php @@ -98,7 +98,7 @@ - +
" >

">

@@ -191,7 +191,7 @@ - +
}; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -361,7 +376,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); @@ -382,6 +397,42 @@ dyFObj.openForm( sectionDyf.Params,null, sectionDyf.ParamsData); }); + $('.deleteLine').off().click( function(){ + formId = $(this).data("id"); + key = $(this).data("key"); + pathLine = $(this).data("path"); + collection = $(this).data("collection"); + bootbox.dialog({ + title: "Confirmez la suppression", + message: " Cette action sera irréversible", + buttons: [ + { + label: "Ok", + className: "btn btn-primary pull-left", + callback: function() { + var formQ = { + value:null, + collection : collection, + id : formId, + path : pathLine + }; + + dataHelper.path2Value( formQ , function(params) { + $("#"+key).remove(); + location.reload(); + } ); + } + }, + { + label: "Annuler", + className: "btn btn-default pull-left", + callback: function() {} + } + ] + }); + + }); + }); diff --git a/views/tpls/forms/sommom/airemarineprotege.php b/views/tpls/forms/sommom/airemarineprotege.php index 1b75b74d44e2c82d06dd85f1626702cc0f45e360..a6b9cd97ea9fd98492e6492c032abbe755ff5d40 100644 --- a/views/tpls/forms/sommom/airemarineprotege.php +++ b/views/tpls/forms/sommom/airemarineprotege.php @@ -115,7 +115,7 @@ ?> -
+
" >

">

@@ -213,7 +213,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -393,7 +408,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/collaboration.php b/views/tpls/forms/sommom/collaboration.php index 73d44e1197161002a24095bdc912177922e4c7b2..497e18afa29687625a297aea92063c900e4bb2ec 100644 --- a/views/tpls/forms/sommom/collaboration.php +++ b/views/tpls/forms/sommom/collaboration.php @@ -113,7 +113,7 @@ -
+
" >

">

@@ -205,7 +205,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -356,8 +371,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -372,7 +390,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/contribution.php b/views/tpls/forms/sommom/contribution.php index 766b7152b045a96035d745a46c543c2bb45fd03b..2cfd56d9123e5d0453a2dd6a795c9e8149199feb 100644 --- a/views/tpls/forms/sommom/contribution.php +++ b/views/tpls/forms/sommom/contribution.php @@ -82,7 +82,7 @@ -
+
" >

">

@@ -187,6 +187,21 @@ }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -254,8 +269,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -270,7 +288,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/encadrementrec.php b/views/tpls/forms/sommom/encadrementrec.php index f42d9bfa9e91dcaae3e51adba2ace719c8c933a2..40d09c8867f4652b40671b5d7f649213b934506b 100644 --- a/views/tpls/forms/sommom/encadrementrec.php +++ b/views/tpls/forms/sommom/encadrementrec.php @@ -125,7 +125,7 @@ - +
" >

">

@@ -282,6 +282,21 @@ }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -350,8 +365,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -366,7 +384,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/equipeDedie.php b/views/tpls/forms/sommom/equipeDedie.php index 7007f06b9955ef2ea7d7c44ed506a8473a412a27..dc8a5f6bdaea64fccb55c59141fb050ddbb09a0b 100644 --- a/views/tpls/forms/sommom/equipeDedie.php +++ b/views/tpls/forms/sommom/equipeDedie.php @@ -81,7 +81,7 @@ - +
" >

">

@@ -166,7 +166,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -295,8 +310,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -311,7 +329,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/especeObs.php b/views/tpls/forms/sommom/especeObs.php index 6f93ca93036f297bbe8aba57d49c265c03e8212f..a20ae7991d6e5aeb86a245518bb991f16563754c 100644 --- a/views/tpls/forms/sommom/especeObs.php +++ b/views/tpls/forms/sommom/especeObs.php @@ -185,7 +185,7 @@ -
+
" >

">

@@ -396,6 +396,21 @@ placeholders : }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -477,8 +492,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -493,7 +511,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/evntdedie.php b/views/tpls/forms/sommom/evntdedie.php index 611aacee71b749ecef6cb343a306ac6b3f2c1f94..e82f2f9ac89b721113ba395952000792a53cca8a 100644 --- a/views/tpls/forms/sommom/evntdedie.php +++ b/views/tpls/forms/sommom/evntdedie.php @@ -79,7 +79,7 @@ - +
" >

">

@@ -169,7 +169,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -310,8 +325,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -326,7 +344,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/formdedie.php b/views/tpls/forms/sommom/formdedie.php index db44e9370b230b92677027a5bf8de861d0a0f767..aaa349a1ca59b0870b91386a692fdc55a2185276 100644 --- a/views/tpls/forms/sommom/formdedie.php +++ b/views/tpls/forms/sommom/formdedie.php @@ -90,7 +90,7 @@ -
+
" >

">

@@ -180,7 +180,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -316,8 +331,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -332,7 +350,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/geographie.php b/views/tpls/forms/sommom/geographie.php index 897ed74e9a77dafee71fa0a77a7626add3a88448..0bb57d3f8b5b599e68d683edbc3f4259238b0bb2 100644 --- a/views/tpls/forms/sommom/geographie.php +++ b/views/tpls/forms/sommom/geographie.php @@ -85,7 +85,7 @@ -
+
" >

">

@@ -177,7 +177,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -340,8 +355,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -356,7 +374,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/label.php b/views/tpls/forms/sommom/label.php index 5829a640399cb69955ac065a7be4a1247fefc443..aa5195910e5f07b6eb1e65ec39de758f796c358f 100644 --- a/views/tpls/forms/sommom/label.php +++ b/views/tpls/forms/sommom/label.php @@ -138,7 +138,7 @@ -
+
" >

">

@@ -309,6 +309,21 @@ }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -382,8 +397,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -398,7 +416,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/mapterritoire.php b/views/tpls/forms/sommom/mapterritoire.php index 1096a8e730f3ed79651a85de4d1a146fd9361fc2..0f4ad9cf267cbc9a70f254f3aa0e25c81776700e 100644 --- a/views/tpls/forms/sommom/mapterritoire.php +++ b/views/tpls/forms/sommom/mapterritoire.php @@ -45,7 +45,7 @@ ?> - +
" >

">

@@ -179,6 +179,21 @@ placeholders : }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -274,8 +289,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -290,7 +308,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/organisme.php b/views/tpls/forms/sommom/organisme.php index 235c6d1d151d9089686c14b0fb80c7c414e9d6af..2d3dfda58af846f79b5990346496c5d5d60f96da 100644 --- a/views/tpls/forms/sommom/organisme.php +++ b/views/tpls/forms/sommom/organisme.php @@ -31,7 +31,6 @@ if (isset($communityLinks["links"]["members"])) { foreach ($communityLinks["links"]["members"] as $memberId => $memberValue) { if(isset(Yii::app()->session["userId"])){ - var_dump(Yii::app()->session["userId"]); if($memberId != ""){ if($memberId == Yii::app()->session["userId"]){ if(isset($memberValue["roles"])){ @@ -147,7 +146,7 @@ - +
" >

">

@@ -393,6 +392,21 @@ placeholders : }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -506,8 +520,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -522,7 +539,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); @@ -543,6 +560,42 @@ dyFObj.openForm( sectionDyf.Params,null, sectionDyf.ParamsData); }); + $('.deleteLine').off().click( function(){ + formId = $(this).data("id"); + key = $(this).data("key"); + pathLine = $(this).data("path"); + collection = $(this).data("collection"); + bootbox.dialog({ + title: "Confirmez la suppression", + message: " Cette action sera irréversible", + buttons: [ + { + label: "Ok", + className: "btn btn-primary pull-left", + callback: function() { + var formQ = { + value:null, + collection : collection, + id : formId, + path : pathLine + }; + + dataHelper.path2Value( formQ , function(params) { + $("#"+key).remove(); + location.reload(); + } ); + } + }, + { + label: "Annuler", + className: "btn btn-default pull-left", + callback: function() {} + } + ] + }); + + }); + }); diff --git a/views/tpls/forms/sommom/outilsPed.php b/views/tpls/forms/sommom/outilsPed.php index 58a8dbb5e679aed47bfebe8ccb562870e597e757..2000aefbdfb90d160ebebf06fae1b70f0114bdb9 100644 --- a/views/tpls/forms/sommom/outilsPed.php +++ b/views/tpls/forms/sommom/outilsPed.php @@ -95,7 +95,7 @@ - +
" >

">

@@ -190,7 +190,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -330,8 +345,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -346,7 +364,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/pgmrech.php b/views/tpls/forms/sommom/pgmrech.php index c38dbb911047aab0f5e1fa68752070cddcfb09c4..ee57a0e24364eb240a609186e6894cf0719c45d7 100644 --- a/views/tpls/forms/sommom/pgmrech.php +++ b/views/tpls/forms/sommom/pgmrech.php @@ -77,7 +77,7 @@ -
+
" >

">

@@ -156,7 +156,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -279,8 +294,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -295,7 +313,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/pgmsci.php b/views/tpls/forms/sommom/pgmsci.php index 90f703877855e3879fd258e11baee5d2d8d22210..4aa0012218408c351b7ed75ec77ac5e26580b376 100644 --- a/views/tpls/forms/sommom/pgmsci.php +++ b/views/tpls/forms/sommom/pgmsci.php @@ -76,7 +76,7 @@ -
+
" >

">

@@ -154,7 +154,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -278,8 +293,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -294,7 +312,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/planConsevation.php b/views/tpls/forms/sommom/planConsevation.php index bba701eb87f25a4c1ab059876db64373da514225..e05001527e25760ab892fd0e4463c93a61d45e6a 100644 --- a/views/tpls/forms/sommom/planConsevation.php +++ b/views/tpls/forms/sommom/planConsevation.php @@ -94,7 +94,7 @@ -
+
" >

">

@@ -179,7 +179,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -311,8 +326,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -327,7 +345,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/publact.php b/views/tpls/forms/sommom/publact.php index 22cda7c630e250717ab1889ae5cf7a6f47d42a8a..d44a4bba48c749f88c333b03b3f840cc0786b941 100644 --- a/views/tpls/forms/sommom/publact.php +++ b/views/tpls/forms/sommom/publact.php @@ -91,7 +91,7 @@ -
+
" >

">

@@ -181,7 +181,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -315,8 +330,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -331,7 +349,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/recommendation.php b/views/tpls/forms/sommom/recommendation.php index 62d8504d3a8c61005d280904bcf04982fd5b0874..676987fd4258f4f3f9254e236a653d7b4f2eedb0 100644 --- a/views/tpls/forms/sommom/recommendation.php +++ b/views/tpls/forms/sommom/recommendation.php @@ -339,7 +339,7 @@ $editBtnLbl = ""; -
+

">

@@ -916,6 +916,21 @@ $editBtnLbl = ""; }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf.Reg = { @@ -1038,8 +1053,11 @@ $editBtnLbl = ""; toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -1054,21 +1072,21 @@ $editBtnLbl = ""; $(".addReg").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf.Reg ); }); $(".addCrt").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf.Crt ); }); $(".addLbl").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf.Lbl ); }); diff --git a/views/tpls/forms/sommom/recommendationnage.php b/views/tpls/forms/sommom/recommendationnage.php index b600e2bc760316792bfd8eddcf73c87d389022eb..9693557d2272b2e9f42d8634667058a42cb86a06 100644 --- a/views/tpls/forms/sommom/recommendationnage.php +++ b/views/tpls/forms/sommom/recommendationnage.php @@ -405,7 +405,7 @@ $actualNbr1 = 0; - +

">

@@ -1164,6 +1164,21 @@ $actualNbr1 = 0; }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf.Reg = { @@ -1286,8 +1301,11 @@ $actualNbr1 = 0; toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -1302,21 +1320,21 @@ $actualNbr1 = 0; $(".addReg").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf.Reg ); }); $(".addCrt").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf.Crt ); }); $(".addLbl").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf.Lbl ); }); diff --git a/views/tpls/forms/sommom/reglementation.php b/views/tpls/forms/sommom/reglementation.php index 21c773efbfca476b97a8a00ad673e54a16facbc7..66baeacb9357e4a5441edfc7c95f9f9b447a70bc 100644 --- a/views/tpls/forms/sommom/reglementation.php +++ b/views/tpls/forms/sommom/reglementation.php @@ -144,7 +144,7 @@ - +
" >

">

@@ -254,6 +254,21 @@ }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -326,8 +341,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -342,7 +360,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/reglementationesp.php b/views/tpls/forms/sommom/reglementationesp.php index 05b705e36634e04f54b7a8dbca82358bdac78e1f..e28389dc81ad5e0263545ca28580584fb06414d4 100644 --- a/views/tpls/forms/sommom/reglementationesp.php +++ b/views/tpls/forms/sommom/reglementationesp.php @@ -242,7 +242,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -399,8 +414,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -415,7 +433,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/sitededie.php b/views/tpls/forms/sommom/sitededie.php index 5ebcff4d45ec3e4d87f7313ccb4e40a4bb773598..c0d77c7a60695b1220709b375a0a0a145192bb07 100644 --- a/views/tpls/forms/sommom/sitededie.php +++ b/views/tpls/forms/sommom/sitededie.php @@ -61,7 +61,7 @@ -
+
" >

">

@@ -145,7 +145,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -274,8 +289,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -290,7 +308,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/structureaer.php b/views/tpls/forms/sommom/structureaer.php index 95fbf51dfeadc1f5aab34c61626c826979b18696..7ef08d19fc67d52adb42340d746ebd8067e90c69 100644 --- a/views/tpls/forms/sommom/structureaer.php +++ b/views/tpls/forms/sommom/structureaer.php @@ -86,7 +86,7 @@ ?> -
+
" >

">

@@ -174,7 +174,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -313,8 +328,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -329,7 +347,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/structureop.php b/views/tpls/forms/sommom/structureop.php index 168e2c429ddc6f2666ea7cc0626dfec552544b02..78c14c89a91d208bd3d0d378a1b1db7927b17384 100644 --- a/views/tpls/forms/sommom/structureop.php +++ b/views/tpls/forms/sommom/structureop.php @@ -159,7 +159,7 @@ -
+
" >

">

@@ -251,7 +251,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -404,8 +419,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -420,7 +438,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); @@ -441,6 +459,42 @@ dyFObj.openForm( sectionDyf.Params,null, sectionDyf.ParamsData); }); + $('.deleteLine').off().click( function(){ + formId = $(this).data("id"); + key = $(this).data("key"); + pathLine = $(this).data("path"); + collection = $(this).data("collection"); + bootbox.dialog({ + title: "Confirmez la suppression", + message: " Cette action sera irréversible", + buttons: [ + { + label: "Ok", + className: "btn btn-primary pull-left", + callback: function() { + var formQ = { + value:null, + collection : collection, + id : formId, + path : pathLine + }; + + dataHelper.path2Value( formQ , function(params) { + $("#"+key).remove(); + location.reload(); + } ); + } + }, + { + label: "Annuler", + className: "btn btn-default pull-left", + callback: function() {} + } + ] + }); + + }); + }); diff --git a/views/tpls/forms/sommom/structuresite.php b/views/tpls/forms/sommom/structuresite.php index d56eb76574c8d990a4fe3a2b2eca2065704187b8..7ae7bc0df5870cc097d5ca9f39bf11a460c6b659 100644 --- a/views/tpls/forms/sommom/structuresite.php +++ b/views/tpls/forms/sommom/structuresite.php @@ -109,7 +109,7 @@ -
+
" >

">

@@ -211,7 +211,7 @@ - +
= 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -379,8 +394,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -395,7 +413,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/surveillanceControle.php b/views/tpls/forms/sommom/surveillanceControle.php index 370dec03c8192f248a46f612a6009762632f4386..95f9c70bbe678a587a1cde8a773817c8e26ed050 100644 --- a/views/tpls/forms/sommom/surveillanceControle.php +++ b/views/tpls/forms/sommom/surveillanceControle.php @@ -130,7 +130,7 @@ -
+
" >

">

@@ -279,6 +279,21 @@ }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -346,8 +361,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -362,7 +380,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/territoire.php b/views/tpls/forms/sommom/territoire.php index 0a3463ad4552610e294d7bdbb5209fab93ae0866..f28c60c035ae1a718d175ba897122a466b696ca7 100644 --- a/views/tpls/forms/sommom/territoire.php +++ b/views/tpls/forms/sommom/territoire.php @@ -65,7 +65,7 @@ - +
" >

">

@@ -170,6 +170,21 @@ }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -246,8 +261,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -262,7 +280,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); }); diff --git a/views/tpls/forms/sommom/zone_obs_act.php b/views/tpls/forms/sommom/zone_obs_act.php index 151c49483cdefb536cc1486a53f5893995e76cdc..39bd97d142559034cc6c3b73bf9b1d7545055a3c 100644 --- a/views/tpls/forms/sommom/zone_obs_act.php +++ b/views/tpls/forms/sommom/zone_obs_act.php @@ -93,7 +93,7 @@ - +
@@ -221,7 +221,7 @@ -
+
@@ -333,6 +333,21 @@ }; + var max = 0; + var nextValuekey = 0; + + if(notNull(Data)){ + $.each(Data, function(ind, val){ + if(parseInt(ind) > max){ + max = parseInt(ind); + } + }); + + nextValuekey = max + 1; + + } + + $(document).ready(function() { sectionDyf. = { @@ -415,8 +430,11 @@ toastr.error('value cannot be empty!'); else { dataHelper.path2Value( tplCtx, function(params) { - $("#ajax-modal").html("
"); - location.reload(); + + +$("#ajax-modal").modal('hide'); + urlCtrl.loadByHash( location.hash ); + } ); } @@ -431,7 +449,7 @@ $(".add").off().on("click",function() { tplCtx.id = $(this).data("id"); tplCtx.collection = $(this).data("collection"); - tplCtx.path = $(this).data("path")+((notNull(Data) ? Data.length : "0")); + tplCtx.path = $(this).data("path")+nextValuekey; dyFObj.openForm( sectionDyf. ); });