Front to add TypeDePieceJustificative for a procedure

Back not implement for this commit
This commit is contained in:
Xavier J 2015-10-28 15:55:31 +01:00
parent e673fe6ae2
commit 059211755a
6 changed files with 120 additions and 1 deletions

View file

@ -7,6 +7,13 @@ ready = function () {
e.stopPropagation();
return false;
});
$("#add_type_de_piece_justificative_procedure").on('click', function (e) {
add_new_type_de_piece_justificative();
e.stopPropagation();
return false;
});
};
$(document).ready(ready);
@ -41,3 +48,28 @@ function add_new_type_de_champs() {
$("#new_type_de_champs #add_type_de_champs_button").remove();
$("#new_type_de_champs .form-inline").append($("#add_type_de_champs_button"))
}
function add_new_type_de_piece_justificative() {
var index_id = "#type_de_piece_justificative_" + types_de_piece_justificative_index;
$("#liste_piece_justificative").append($(index_id));
$("#new_type_de_piece_justificative").append($(index_id).clone());
types_de_piece_justificative_index++;
$("#new_type_de_piece_justificative .form-inline").attr('id', 'type_de_piece_justificative_' + types_de_piece_justificative_index);
$("#new_type_de_piece_justificative #libelle").attr('name', 'type_de_piece_justificative[' + types_de_piece_justificative_index + '][libelle]');
$("#new_type_de_piece_justificative #libelle").val('');
$("#new_type_de_piece_justificative #description").attr('name', 'type_de_piece_justificative[' + types_de_piece_justificative_index + '][description]');
$("#new_type_de_piece_justificative #description").val('');
$("#new_type_de_piece_justificative #id_type_de_piece_justificative").attr('name', 'type_de_piece_justificative[' + types_de_piece_justificative_index + '][id_type_de_piece_justificative]');
$("#new_type_de_piece_justificative #id_type_de_piece_justificative").val('')
$("#new_type_de_piece_justificative #delete").attr('name', 'type_de_piece_justificative[' + types_de_piece_justificative_index + '][delete]');
$("#new_type_de_piece_justificative #delete").val('false')
$("#new_type_de_piece_justificative #add_type_de_piece_justificative_button").remove();
$("#new_type_de_piece_justificative .form-inline").append($("#add_type_de_piece_justificative_button"))
}