diff --git a/modules/visa/js/functions.js b/modules/visa/js/functions.js index d888d4a9216dd87a1237e70fc6c15ee72ec03e1a..69b96be825f5443cdc39ceca9d1ad7f65f3ff380 100755 --- a/modules/visa/js/functions.js +++ b/modules/visa/js/functions.js @@ -5,20 +5,10 @@ function addVisaUser(users) { if(nb_visa == 0){ $j("#emptyVisa").hide(); } - if ($j("select[id^=signRequest_] option:selected[value=true]").length >= 2 || - ($j("select[id^=signRequest_] option:selected[value=true]").length == 1 && $j("select[id^=signRequest_] option:last:selected[value=true]").length == 0)) { - selected = ''; - } else { - if (!$j('#signRequest_'+nb_visa).is(':disabled')) { - $j('#signRequest_'+nb_visa).val("false"); - } - selected = ' selected="selected" '; - } - - if ($j("#isAllAttachementSigned").val() == 'false') { - signRequest = '<br/><sub><select id="signRequest_'+next_visa+'"><option value="false">VISEUR</option><option value="true" '+selected+'>SIGNATAIRE</option></select></sub>'; - } else if($j("#isAllAttachementSigned").val() == 'allsigned'){ + selected = ' selected="selected" '; + + if($j("#isAllAttachementSigned").val() == 'allsigned' || $j("#isAllAttachementSigned").val() == 'false'){ signRequest = '<br/><sub><select id="signRequest_'+next_visa+'"><option value="false" '+selected+'>VISEUR</option><option value="true">SIGNATAIRE</option></select></sub>'; } else { signRequest = '<br/><sub><select id="signRequest_'+next_visa+'" disabled="disabled"><option value="false" '+selected+'>VISEUR</option><option value="true">SIGNATAIRE</option></select></sub>'; @@ -55,21 +45,13 @@ function addVisaUser(users) { if(nb_visa == 0){ $j("#emptyVisa").hide(); } - if ($j("select[id^=signRequest_] option:selected[value=true]").length <= 2) { - if (!$j('#signRequest_'+nb_visa).is(':disabled')) { - $j('#signRequest_'+nb_visa).val("false"); - } - selected = ' selected="selected" '; - } else { - selected = ''; - } - if ($j("#isAllAttachementSigned").val() == 'false') { - signRequest = '<br/><sub><select id="signRequest_'+next_visa+'"><option value="false">VISEUR</option><option value="true" '+selected+'>SIGNATAIRE</option></select></sub>'; - } else if($j("#isAllAttachementSigned").val() == 'allsigned'){ + selected = ' selected="selected" '; + + if($j("#isAllAttachementSigned").val() == 'allsigned' || $j("#isAllAttachementSigned").val() == 'false'){ signRequest = '<br/><sub><select id="signRequest_'+next_visa+'"><option value="false" '+selected+'>VISEUR</option><option value="true">SIGNATAIRE</option></select></sub>'; } else { - signRequest = '<br/><sub><select id="signRequest_'+next_visa+'" disabled="disabled"><option value="false" '+selected+'>VISEUR</option><option value="true">SIGNATAIRE</option></select></sub>'; + signRequest = '<br/><sub><select id="signRequest_'+next_visa+'" disabled="disabled"><option value="false" '+selected+'>VISEUR</option><option value="true">SIGNATAIRE</option></select></sub>'; } $j("#visa_content").append('<div class="droptarget" id="visa_' + next_visa + '" draggable="true">' +'<span class="visaUserStatus">' @@ -116,30 +98,6 @@ function resetPosVisa () { $j("#" + this.id).find(".visaUserPos").text(i); i++; }); - - i = 1; - var hasSignatory = false; - $j(".droptarget").each(function() { - if ($j("#signRequest_"+(i)+" option:selected[value=true]").length) { - userRequestSign=true; - } else { - userRequestSign=false; - } - if ($j("#signedUser_"+(i)).css('visibility') == 'visible') { - userSignatory=true; - } else { - userSignatory=false; - } - - if(userRequestSign || userSignatory){ - hasSignatory = true; - } - if ($j("#signRequest_"+(i+1)).length == 0 && !hasSignatory) { - $j('#signRequest_'+(i)).val("true"); - } - i++; - - }); i--; } diff --git a/modules/visa/lang/en.php b/modules/visa/lang/en.php index e7f6665e5c0b3a4fe6f9f04ebef9a72f8f2bd8b0..945698d2ff75cd3314f3222ac321b711b5bd9bc1 100755 --- a/modules/visa/lang/en.php +++ b/modules/visa/lang/en.php @@ -180,7 +180,7 @@ if (!defined('_ENCRYPTED')) { } if (!defined('_ADD_VISA_ROLE')) { - define('_ADD_VISA_ROLE', 'Add visa user / signatory user'); + define('_ADD_VISA_ROLE', 'Add visa user'); } if (!defined('_ADD_VISA_MODEL')) { diff --git a/modules/visa/lang/fr.php b/modules/visa/lang/fr.php index 79a603cb40bb4135b3cd9a9195b91e21633ee874..1b306bce5aa00cfa9c98a40874823a924db04688 100755 --- a/modules/visa/lang/fr.php +++ b/modules/visa/lang/fr.php @@ -201,7 +201,7 @@ if (!defined('_SIGN_USER')) { } if (!defined('_ADD_VISA_ROLE')) { - define('_ADD_VISA_ROLE', 'Ajouter un viseur / signataire'); + define('_ADD_VISA_ROLE', 'Ajouter un viseur'); } if (!defined('_ADD_VISA_MODEL')) {