| Línea 222... |
Línea 222... |
| 222 |
}).done(function(response) {
|
222 |
}).done(function(response) {
|
| 223 |
if (response['success']) {
|
223 |
if (response['success']) {
|
| 224 |
$("#rows").html('');
|
224 |
$("#rows").html('');
|
| 225 |
sections = [];
|
225 |
sections = [];
|
| 226 |
$('#form-main').attr('action', action);
|
226 |
$('#form-main').attr('action', action);
|
| 227 |
$('#form-main #form-id').val(response['data']['id']),
|
- |
|
| 228 |
$('#form-main #form-name').val(response['data']['name']),
|
227 |
$('#form-main #form-name').val(response['data']['name']),
|
| 229 |
$('#form-main #job_description_id').val(response['data']['job_description_id']);
|
228 |
$('#form-main #job_description_id').val(response['data']['job_description_id']);
|
| 230 |
$('#form-main #form-status').val(response['data']['status']);
|
229 |
$('#form-main #form-status').val(response['data']['status']);
|
| 231 |
sections = response['data']['content'] || [];
|
230 |
sections = response['data']['content'] || [];
|
| 232 |
renderData(sections);
|
231 |
renderData(sections);
|
| 233 |
$('#row-lists').hide();
|
232 |
$('#row-lists').hide();
|
| 234 |
$('#row-form').show();
|
233 |
$('#row-form').show();
|
| Línea 404... |
Línea 403... |
| 404 |
/**
|
403 |
/**
|
| 405 |
* Clicked new Form
|
404 |
* Clicked new Form
|
| 406 |
*/
|
405 |
*/
|
| 407 |
$('button.btn-add-form').click(function(e) {
|
406 |
$('button.btn-add-form').click(function(e) {
|
| 408 |
$('#form-main').attr('action', '$routeAdd');
|
407 |
$('#form-main').attr('action', '$routeAdd');
|
| 409 |
$('#form-main #form-id').val('0');
|
- |
|
| 410 |
$('#form-main #form-name').val('');
|
408 |
$('#form-main #form-name').val('');
|
| 411 |
$('#form-main #job_description_id').val('');
|
409 |
$('#form-main #job_description_id').val('');
|
| 412 |
$('#form-main #form-status').val('$status_active');
|
410 |
$('#form-main #form-status').val('$status_active');
|
| 413 |
$("#rows").html('');
|
411 |
$("#rows").html('');
|
| 414 |
sections = [];
|
412 |
sections = [];
|
| Línea 436... |
Línea 434... |
| 436 |
} else if ($('#job_description_id').val() == '') {
|
434 |
} else if ($('#job_description_id').val() == '') {
|
| 437 |
$.fn.showError('Seleccione una descripción de cargo');
|
435 |
$.fn.showError('Seleccione una descripción de cargo');
|
| 438 |
} else if (sections.length == 0) {
|
436 |
} else if (sections.length == 0) {
|
| 439 |
$.fn.showError('Debe ingresar al menos una sección');
|
437 |
$.fn.showError('Debe ingresar al menos una sección');
|
| 440 |
} else {
|
438 |
} else {
|
| 441 |
var formId = parseInt($('#form-main #form-id').val());
|
- |
|
| 442 |
var data = {
|
439 |
var data = {
|
| 443 |
'id': formId,
|
440 |
'id': formId,
|
| 444 |
'name': $('#form-main #form-name').val(),
|
441 |
'name': $('#form-main #form-name').val(),
|
| 445 |
'job_description_id': $('#form-main #job_description_id').val(),
|
442 |
'job_description_id': $('#form-main #job_description_id').val(),
|
| 446 |
'status': $('#form-main #form-status').val(),
|
443 |
'status': $('#form-main #form-status').val(),
|
| Línea 605... |
Línea 602... |
| 605 |
</div>
|
602 |
</div>
|
| 606 |
<!-- Create/Edit Form -->
|
603 |
<!-- Create/Edit Form -->
|
| 607 |
<div class="row" id="row-form" style="display: none; padding: 16px;">
|
604 |
<div class="row" id="row-form" style="display: none; padding: 16px;">
|
| 608 |
<div class="col-xs-12 col-md-12">
|
605 |
<div class="col-xs-12 col-md-12">
|
| 609 |
<form action="#" name="form-main" id="form-main">
|
606 |
<form action="#" name="form-main" id="form-main">
|
| 610 |
<input type="hidden" name="form-id" id="form-id" value="0" />
|
- |
|
| 611 |
<input type="hidden" name="form-continue" id="form-continue" value="0" />
|
607 |
<input type="hidden" name="form-continue" id="form-continue" value="0" />
|
| 612 |
<div class="form-group">
|
608 |
<div class="form-group">
|
| 613 |
<label for="form-name">LABEL_FIRST_NAME</label>
|
609 |
<label for="form-name">LABEL_FIRST_NAME</label>
|
| 614 |
<input type="text" name="form-name" id="form-name" class="form-control" maxlength="50" />
|
610 |
<input type="text" name="form-name" id="form-name" class="form-control" maxlength="50" />
|
| 615 |
</div>
|
611 |
</div>
|