| Línea -... |
Línea 1... |
| - |
|
1 |
|
| - |
|
2 |
Alfredo Alejandro Geraldo Geraldo <info@alfredogeraldo.com>
|
| - |
|
3 |
19:47 (hace 1 minuto)
|
| - |
|
4 |
para mí
|
| - |
|
5 |
|
| 1 |
<?php
|
6 |
<?php
|
| 2 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
7 |
$acl = $this->viewModel()->getRoot()->getVariable('acl');
|
| 3 |
$currentUser = $this->currentUserHelper();
|
8 |
$currentUser = $this->currentUserHelper();
|
| Línea 4... |
Línea 9... |
| 4 |
|
9 |
|
| Línea 149... |
Línea 154... |
| 149 |
}
|
154 |
}
|
| 150 |
}
|
155 |
}
|
| 151 |
$('[data-toggle="tooltip"]').tooltip();
|
156 |
$('[data-toggle="tooltip"]').tooltip();
|
| 152 |
},
|
157 |
},
|
| 153 |
/**
|
158 |
/**
|
| 154 |
* Add element to section array
|
159 |
* Add element to section array
|
| 155 |
*/
|
160 |
*/
|
| 156 |
this.addSection = function(name, text, value) {
|
161 |
this.addSection = function(name, text, value) {
|
| 157 |
var d = new Date();
|
162 |
var d = new Date();
|
| 158 |
var slug = 'section' + d.getTime();
|
163 |
var slug = 'section' + d.getTime();
|
| 159 |
var position = 0;
|
164 |
var position = 0;
|
| Línea 173... |
Línea 178... |
| 173 |
'status': 0
|
178 |
'status': 0
|
| 174 |
}
|
179 |
}
|
| 175 |
this.sections.push(section);
|
180 |
this.sections.push(section);
|
| 176 |
},
|
181 |
},
|
| 177 |
/**
|
182 |
/**
|
| 178 |
* Edit element to section array
|
183 |
* Edit element to section array
|
| 179 |
*/
|
184 |
*/
|
| 180 |
this.editSection = function(slug, name, text, value) {
|
185 |
this.editSection = function(slug, name, text, value) {
|
| 181 |
var renderTable = false;
|
186 |
var renderTable = false;
|
| 182 |
for (i = 0; i < this.sections.length; i++) {
|
187 |
for (i = 0; i < this.sections.length; i++) {
|
| 183 |
if (slug == this.sections[i].slug_section) {
|
188 |
if (slug == this.sections[i].slug_section) {
|
| Línea 594... |
Línea 599... |
| 594 |
|
599 |
|
| 595 |
$('#form-main #form-language').val(response['data']['language']),
|
600 |
$('#form-main #form-language').val(response['data']['language']),
|
| Línea 596... |
Línea 601... |
| 596 |
$('#form-main #form-status').val(response['data']['status']);
|
601 |
$('#form-main #form-status').val(response['data']['status']);
|
| 597 |
|
602 |
|
| 598 |
/*-------------Render Sections -------*/
|
603 |
/*-------------Render Sections -------*/
|
| 599 |
|
604 |
|
| 600 |
objFormGenerator.clear();
|
605 |
objFormGenerator.clear();
|
| 601 |
objFormGenerator.sections = response['data']['content'] || [];
|
606 |
objFormGenerator.sections = response['data']['content'] || [];
|
| 602 |
objFormGenerator.render();
|
607 |
objFormGenerator.render();
|
| 603 |
renderSectionData(objFormGenerator.sections);
|
608 |
renderSectionData(objFormGenerator.sections);
|
| 604 |
|
609 |
|
| 605 |
$('#row-forms').hide();
|
610 |
$('#row-forms').hide();
|
| Línea 606... |
Línea 611... |
| 606 |
$('#row-edit').show();
|
611 |
$('#row-edit').show();
|
| Línea 663... |
Línea 668... |
| 663 |
for (var instanceName in CKEDITOR.instances) {
|
668 |
for (var instanceName in CKEDITOR.instances) {
|
| 664 |
CKEDITOR.instances[instanceName].updateElement();
|
669 |
CKEDITOR.instances[instanceName].updateElement();
|
| 665 |
}
|
670 |
}
|
| 666 |
})
|
671 |
})
|
| 667 |
/**
|
672 |
/**
|
| 668 |
* Validate rules form
|
673 |
* Validate rules form
|
| 669 |
*/
|
674 |
*/
|
| 670 |
var validatorForm = $("#form-main").validate({
|
675 |
var validatorForm = $("#form-main").validate({
|
| 671 |
ignore: [],
|
676 |
ignore: [],
|
| 672 |
errorClass: 'help-block',
|
677 |
errorClass: 'help-block',
|
| 673 |
errorElement: 'span',
|
678 |
errorElement: 'span',
|
| Línea 1330... |
Línea 1335... |
| 1330 |
}
|
1335 |
}
|
| 1331 |
}
|
1336 |
}
|
| 1332 |
});
|
1337 |
});
|
| 1333 |
})
|
1338 |
})
|
| 1334 |
/**
|
1339 |
/**
|
| 1335 |
* Format input number (Form Section)
|
1340 |
* Format input number (Form Section)
|
| 1336 |
*/
|
1341 |
*/
|
| 1337 |
$('#form-section #section-value').inputNumberFormat({
|
1342 |
$('#form-section #section-value').inputNumberFormat({
|
| 1338 |
'decimal': 2
|
1343 |
'decimal': 2
|
| 1339 |
});
|
1344 |
});
|
| 1340 |
/**
|
1345 |
/**
|
| 1341 |
* Format input number (Form Question)
|
1346 |
* Format input number (Form Question)
|
| 1342 |
*/
|
1347 |
*/
|
| 1343 |
$('#form-question #question-value').inputNumberFormat({
|
1348 |
$('#form-question #question-value').inputNumberFormat({
|
| 1344 |
'decimal': 2
|
1349 |
'decimal': 2
|
| 1345 |
});
|
1350 |
});
|
| 1346 |
/**
|
1351 |
/**
|
| 1347 |
* Format input number (Form Question)
|
1352 |
* Format input number (Form Question)
|
| 1348 |
*/
|
1353 |
*/
|
| 1349 |
$('#form-question #question-max-length').inputNumberFormat({
|
1354 |
$('#form-question #question-max-length').inputNumberFormat({
|
| 1350 |
'decimal': 0
|
1355 |
'decimal': 0
|
| 1351 |
});
|
1356 |
});
|
| 1352 |
/**
|
1357 |
/**
|
| 1353 |
* Format input number (Form Option)
|
1358 |
* Format input number (Form Option)
|
| 1354 |
*/
|
1359 |
*/
|
| 1355 |
$('#form-option #option-value').inputNumberFormat({
|
1360 |
$('#form-option #option-value').inputNumberFormat({
|
| 1356 |
'decimal': 2
|
1361 |
'decimal': 2
|
| 1357 |
});
|
1362 |
});
|
| 1358 |
/**
|
1363 |
/**
|
| Línea 1455... |
Línea 1460... |
| 1455 |
removeTags: removeTags
|
1460 |
removeTags: removeTags
|
| 1456 |
}));
|
1461 |
}));
|
| Línea 1457... |
Línea 1462... |
| 1457 |
|
1462 |
|
| 1458 |
|
1463 |
|
| 1459 |
/**
|
1464 |
/**
|
| 1460 |
* Clear Div Section data
|
1465 |
* Clear Div Section data
|
| 1461 |
*/
|
1466 |
*/
|
| 1462 |
const clearSectionData = () => $("#rows").html('');
|
1467 |
const clearSectionData = () => $("#rows").html('');
|
| 1463 |
/**
|
1468 |
/**
|
| Línea 1553... |
Línea 1558... |
| 1553 |
<div class="row">
|
1558 |
<div class="row">
|
| 1554 |
<div class="col-xs-12 col-md-12 text-right">
|
1559 |
<div class="col-xs-12 col-md-12 text-right">
|
| 1555 |
<button class="btn btn-primary" id="btn-add-section" data-toggle="tooltip" title="LABEL_ADD LABEL_SECTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_SECTION</button>
|
1560 |
<button class="btn btn-primary" id="btn-add-section" data-toggle="tooltip" title="LABEL_ADD LABEL_SECTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_SECTION</button>
|
| 1556 |
</div>
|
1561 |
</div>
|
| 1557 |
</div>
|
1562 |
</div>
|
| 1558 |
<br />
|
1563 |
<br />
|
| 1559 |
<div class="row">
|
1564 |
<div class="row">
|
| 1560 |
<div class="col-xs-12 col-md-12">
|
1565 |
<div class="col-xs-12 col-md-12">
|
| 1561 |
<div class="panel-group" id="rows"></div>
|
1566 |
<div class="panel-group" id="rows"></div>
|
| 1562 |
</div>
|
1567 |
</div>
|
| 1563 |
</div>
|
1568 |
</div>
|
| Línea 1749... |
Línea 1754... |
| 1749 |
<td class="text-left">{{:name}}</td>
|
1754 |
<td class="text-left">{{:name}}</td>
|
| 1750 |
<td>{{:value}}</td>
|
1755 |
<td>{{:value}}</td>
|
| 1751 |
<td></td>
|
1756 |
<td></td>
|
| 1752 |
<td>
|
1757 |
<td>
|
| 1753 |
<button class="btn btn-default btn-edit-section" data-section="{{:slug_section}}" data-toggle="tooltip" data-original-title="LABEL_EDIT LABEL_SECTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_SECTION </button>
|
1758 |
<button class="btn btn-default btn-edit-section" data-section="{{:slug_section}}" data-toggle="tooltip" data-original-title="LABEL_EDIT LABEL_SECTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_SECTION </button>
|
| 1754 |
<button class="btn btn-default btn-delete-section" data-section="{{:slug_section}}" data-toggle="tooltip" data-original-title="LABEL_DELETE LABEL_SECTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_SECTION </button>
|
1759 |
<button class="btn btn-default btn-delete-section" data-section="{{:slug_section}}" data-toggle="tooltip" data-original-title="LABEL_DELETE LABEL_SECTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_SECTION </button>
|
| 1755 |
<button class="btn btn-default btn-add-question" data-section="{{:slug_section}}" data-toggle="tooltip" data-original-title="LABEL_ADD LABEL_QUESTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_QUESTION </button>
|
1760 |
<button class="btn btn-default btn-add-question" data-section="{{:slug_section}}" data-toggle="tooltip" data-original-title="LABEL_ADD LABEL_QUESTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_QUESTION </button>
|
| 1756 |
</td>
|
1761 |
</td>
|
| 1757 |
</tr>
|
1762 |
</tr>
|
| 1758 |
{{for questions}}
|
1763 |
{{for questions}}
|
| 1759 |
<tr class="tr-question">
|
1764 |
<tr class="tr-question">
|
| 1760 |
<td class="text-left">--LABEL_QUESTION</td>
|
1765 |
<td class="text-left">--LABEL_QUESTION</td>
|
| Línea 1768... |
Línea 1773... |
| 1768 |
{{if type == 'multiple'}} Multiple {{/if}}
|
1773 |
{{if type == 'multiple'}} Multiple {{/if}}
|
| 1769 |
{{if type == 'rating-open'}} LABEL_RATING_OPEN {{/if}}
|
1774 |
{{if type == 'rating-open'}} LABEL_RATING_OPEN {{/if}}
|
| 1770 |
{{if type == 'rating-range'}} LABEL_RATING_RANGE {{/if}}
|
1775 |
{{if type == 'rating-range'}} LABEL_RATING_RANGE {{/if}}
|
| 1771 |
</td>
|
1776 |
</td>
|
| 1772 |
<td>
|
1777 |
<td>
|
| 1773 |
<button class="btn btn-default btn-edit-question" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-toggle="tooltip" data-original-title="LABEL_EDIT LABEL_QUESTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_QUESTION</button>
|
1778 |
<button class="btn btn-default btn-edit-question" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-toggle="tooltip" data-original-title="LABEL_EDIT LABEL_QUESTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_QUESTION</button>
|
| 1774 |
<button class="btn btn-default btn-delete-question" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-toggle="tooltip" data-original-title="LABEL_DELETE LABEL_QUESTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_QUESTION</button>
|
1779 |
<button class="btn btn-default btn-delete-question" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-toggle="tooltip" data-original-title="LABEL_DELETE LABEL_QUESTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_QUESTION</button>
|
| 1775 |
|
1780 |
|
| 1776 |
{{if type == 'simple' || type == 'rating-open' || type=='multiple' }}
|
1781 |
{{if type == 'simple' || type == 'rating-open' || type=='multiple' }}
|
| 1777 |
<button class="btn btn-default btn-add-option" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-toggle="tooltip" data-original-title="LABEL_ADD LABEL_OPTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_OPTION</button>
|
1782 |
<button class="btn btn-default btn-add-option" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-toggle="tooltip" data-original-title="LABEL_ADD LABEL_OPTION"><i class="fa fa-plus" aria-hidden="true"></i> LABEL_ADD LABEL_OPTION</button>
|
| 1778 |
{{/if}}
|
1783 |
{{/if}}
|
| 1779 |
|
1784 |
|
| 1780 |
</td>
|
1785 |
</td>
|
| 1781 |
</tr>
|
1786 |
</tr>
|
| 1782 |
{{for options}}
|
1787 |
{{for options}}
|
| 1783 |
<tr class="tr-option">
|
1788 |
<tr class="tr-option">
|
| 1784 |
<td class="text-left">---LABEL_OPTION</td>
|
1789 |
<td class="text-left">---LABEL_OPTION</td>
|
| Línea 1800... |
Línea 1805... |
| 1800 |
<font color="red">LABEL_FAIL</font>
|
1805 |
<font color="red">LABEL_FAIL</font>
|
| 1801 |
{{/if}}
|
1806 |
{{/if}}
|
| 1802 |
{{/if}}
|
1807 |
{{/if}}
|
| 1803 |
</td>
|
1808 |
</td>
|
| 1804 |
<td>
|
1809 |
<td>
|
| 1805 |
<button class="btn btn-default btn-edit-option" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-slug="{{:slug_option}}" data-toggle="tooltip" data-original-title="LABEL_EDIT LABEL_OPTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_OPTION</button>
|
1810 |
<button class="btn btn-default btn-edit-option" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-slug="{{:slug_option}}" data-toggle="tooltip" data-original-title="LABEL_EDIT LABEL_OPTION"><i class="fa fa-edit" aria-hidden="true"></i> LABEL_EDIT LABEL_OPTION</button>
|
| 1806 |
<button class="btn btn-default btn-delete-option" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-slug="{{:slug_option}}" data-toggle="tooltip" data-original-title="LABEL_DELETE LABEL_OPTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_OPTION</button>
|
1811 |
<button class="btn btn-default btn-delete-option" data-section="{{:slug_section}}" data-question="{{:slug_question}}" data-slug="{{:slug_option}}" data-toggle="tooltip" data-original-title="LABEL_DELETE LABEL_OPTION"><i class="fa fa-ban" aria-hidden="true"></i> LABEL_DELETE LABEL_OPTION</button>
|
| 1807 |
</td>
|
1812 |
</td>
|
| 1808 |
</tr>
|
1813 |
</tr>
|
| 1809 |
{{/for}}
|
1814 |
{{/for}}
|
| 1810 |
{{/for}}
|
1815 |
{{/for}}
|
| 1811 |
</tbody>
|
1816 |
</tbody>
|