Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 152 | Rev 154 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 152 Rev 153
Línea 50... Línea 50...
50
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
50
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
51
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
51
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
Línea 52... Línea 52...
52
 
52
 
53
// bootbox Alert //
53
// bootbox Alert //
54
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
-
 
55
// Js Render //
-
 
Línea 56... Línea 54...
56
$this->inlineScript()->appendFile($this->basePath('plugins/jsrender/jsrender.min.js'));
54
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
57
 
55
 
Línea 58... Línea 56...
58
$status_active = \LeadersLinked\Model\CompanySelfEvaluationForm::STATUS_ACTIVE;
56
$status_active = \LeadersLinked\Model\CompanySelfEvaluationForm::STATUS_ACTIVE;
59
$status_inactive = \LeadersLinked\Model\CompanySelfEvaluationForm::STATUS_INACTIVE;
57
$status_inactive = \LeadersLinked\Model\CompanySelfEvaluationForm::STATUS_INACTIVE;
-
 
58
 
60
 
59
$lang_es = \LeadersLinked\Model\CompanySelfEvaluationForm::LANGUAGE_SPANISH;
-
 
60
$lang_en = \LeadersLinked\Model\CompanySelfEvaluationForm::LANGUAGE_ENGLISH;
-
 
61
 
-
 
62
 
61
$lang_es = \LeadersLinked\Model\CompanySelfEvaluationForm::LANGUAGE_SPANISH;
63
                            
62
$lang_en = \LeadersLinked\Model\CompanySelfEvaluationForm::LANGUAGE_ENGLISH;
64
                            
63
            
65
                            
64
$this->inlineScript()->captureStart();
66
$this->inlineScript()->captureStart();
65
echo <<<JS
67
echo <<<JS
Línea 611... Línea 613...
611
				return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
613
				return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
612
		}
614
		}
613
    jQuery( document ).ready(function( $ ) {
615
    jQuery( document ).ready(function( $ ) {
614
			var objFormGenerator = new classFormGenerator();
616
			var objFormGenerator = new classFormGenerator();
615
	objFormGenerator.render();
617
	objFormGenerator.render();
616
 
-
 
617
	var allowEdit   = $allowEdit;
618
	var allowEdit   = $allowEdit;
618
	var allowDelete = $allowDelete;
619
	var allowDelete = $allowDelete;
619
 
-
 
620
	const renderSelfTable = (data) => $("#rows").html($.templates("#formTmpl").render(data));
-
 
Línea 621... Línea -...
621
	
-
 
622
 
-
 
623
 
-
 
624
 
620
	
625
	var tableForm = $('#gridTable').dataTable( {
621
	var tableForm = $('#gridTable').dataTable( {
626
			'processing': true,
622
			'processing': true,
627
			'serverSide': true,
623
			'serverSide': true,
628
			'searching': true,
624
			'searching': true,
Línea 651... Línea 647...
651
						if(response.success) {
647
						if(response.success) {
652
								json.recordsTotal       = response.data.total;
648
								json.recordsTotal       = response.data.total;
653
								json.recordsFiltered    = response.data.total;
649
								json.recordsFiltered    = response.data.total;
654
								json.data               = response.data.items;
650
								json.data               = response.data.items;
Línea 655... Línea -...
655
 
-
 
656
								console.log(json.data);
-
 
657
								renderSelfTable(json.data);
-
 
658
 
651
 
659
						} else {
652
						} else {
660
								$.fn.showError(response.data)
653
								$.fn.showError(response.data)
Línea 661... Línea 654...
661
						}
654
						}
Línea 704... Línea 697...
704
											'method'    : 'post',
697
											'method'    : 'post',
705
											'url'       :  action,
698
											'url'       :  action,
706
									}).done(function(response) {
699
									}).done(function(response) {
707
											if(response['success']) {
700
											if(response['success']) {
708
													$.fn.showSuccess(response['data']);
701
													$.fn.showSuccess(response['data']);
-
 
702
													gridTable.api().ajax.reload(null, false);
709
											} else {
703
											} else {
710
													$.fn.showError(response['data']);
704
													$.fn.showError(response['data']);
711
											}
705
											}
712
									}).fail(function( jqXHR, textStatus, errorThrown) {
706
									}).fail(function( jqXHR, textStatus, errorThrown) {
713
											$.fn.showError(textStatus);
707
											$.fn.showError(textStatus);
Línea 883... Línea 877...
883
			'url'       :  action,
877
			'url'       :  action,
884
		}).done(function(response) {
878
		}).done(function(response) {
885
			if(response['success']) {
879
			if(response['success']) {
886
					validatorForm.resetForm();
880
					validatorForm.resetForm();
Línea 887... Línea 881...
887
 
881
 
888
					$('#main #id' ).val(response['id']),
882
					$('#form-main #form-id' ).val(response['id']),
889
					$('#main #continue').val('0');
883
					$('#form-main #form-continue').val('0');
Línea 890... Línea 884...
890
					$('#main #name' ).val(response['name']),
884
					$('#form-main #form-name' ).val(response['name']),
891
 
885
 
892
 
886
 
Línea 898... Línea 892...
898
					
892
					
899
					
893
					
Línea 900... Línea 894...
900
					instanceName = 'form-text'; 
894
					instanceName = 'form-text'; 
901
					CKEDITOR.instances[instanceName ].setData(response['text']);
895
					CKEDITOR.instances[instanceName ].setData(response['text']);
Línea 902... Línea 896...
902
 
896
 
903
					$('#main #language' ).val(response['language']),
897
					$('#form-main #form-language' ).val(response['language']),
904
					$('#main #status' ).val(response['status']);
898
					$('#form-main #form-status' ).val(response['status']);
905
 
899
 
906
					objFormGenerator.clear();
900
					objFormGenerator.clear();
Línea 907... Línea 901...
907
					objFormGenerator.sections = response['sections'] || [];
901
					objFormGenerator.sections = response['sections'] || [];
Línea 908... Línea 902...
908
					objFormGenerator.render();
902
					objFormGenerator.render();
909
					$('#row-forms').hide();
903
					$('#row-forms').hide();
910
					$('#row-edit').show();
904
					$('#row-edit').show();
911
 
905
 
Línea 971... Línea 965...
971
	    var form3 = $('#form_sample_3');
965
	    var form3 = $('#form_sample_3');
972
        var error3 = $('.alert-danger', form3);
966
        var error3 = $('.alert-danger', form3);
973
        var success3 = $('.alert-success', form3);
967
        var success3 = $('.alert-success', form3);
Línea 974... Línea 968...
974
 
968
 
975
	//IMPORTANT: update CKEDITOR textarea with actual content before submit
969
	//IMPORTANT: update CKEDITOR textarea with actual content before submit
976
 	$( "#main" ).on('submit', function() {
970
 	$( "#form-main" ).on('submit', function() {
977
		for(var instanceName in CKEDITOR.instances) {
971
		for(var instanceName in CKEDITOR.instances) {
978
			CKEDITOR.instances[instanceName].updateElement();
972
			CKEDITOR.instances[instanceName].updateElement();
979
		}
973
		}
Línea 980... Línea 974...
980
	})
974
	})
981
	    
975
	    
982
	var validatorForm = $( "#main" ).validate( {
976
	var validatorForm = $( "#form-main" ).validate( {
983
        ignore: [],
977
        ignore: [],
984
        errorClass: 'help-block',
978
        errorClass: 'help-block',
985
        errorElement: 'span',
979
        errorElement: 'span',
Línea 1130... Línea 1124...
1130
    			if(error) {
1124
    			if(error) {
1131
    				return false;
1125
    				return false;
1132
    			} else {
1126
    			} else {
Línea 1133... Línea 1127...
1133
 
1127
 
1134
 
1128
 
Línea 1135... Línea 1129...
1135
    				var formId		= parseInt($('#main #id' ).val());
1129
    				var formId		= parseInt($('#form-main #form-id' ).val());
1136
    				var formContinue = parseInt($('#main #continue' ).val());
1130
    				var formContinue = parseInt($('#form-main #form-continue' ).val());
1137
        			
1131
        			
1138
    				var data = {
1132
    				var data = {
1139
    	    			'id'	: formId,
1133
    	    			'id'	: formId,
1140
        				'name' : $('#main #name' ).val(),
1134
        				'name' : $('#form-main #form-name' ).val(),
1141
        				'description' : $('#main #description' ).val(),
1135
        				'description' : $('#form-main #form-description' ).val(),
1142
        				'text' : $('#main #text' ).val(),
1136
        				'text' : $('#form-main #form-text' ).val(),
1143
        				'language' : $('#main #language' ).val(),
1137
        				'language' : $('#form-main #form-language' ).val(),
1144
        				'status' : $('#main #status' ).val(),
1138
        				'status' : $('#form-main #form-status' ).val(),
1145
        				'sections' : objFormGenerator.sections
1139
        				'sections' : objFormGenerator.sections
1146
    				}
1140
    				}
Línea 1151... Línea 1145...
1151
						'data' : data,
1145
						'data' : data,
1152
					}).done(function(response) {
1146
					}).done(function(response) {
1153
						if(response['success']) {
1147
						if(response['success']) {
1154
							$.fn.showSuccess(response['message']);
1148
							$.fn.showSuccess(response['message']);
1155
							if(formContinue == 1) {
1149
							if(formContinue == 1) {
1156
								$('#main #id').val(response['form-id']);
1150
								$('#form-main #form-id').val(response['form-id']);
1157
								$('#main #continue').val(0);
1151
								$('#form-main #form-continue').val(0);
1158
							} else {
1152
							} else {
1159
								$('#row-edit').hide();
1153
								$('#row-edit').hide();
1160
								$('#row-forms').show();
1154
								$('#row-forms').show();
1161
							}
1155
							}
1162
							tableForm.fnDraw();
1156
							tableForm.fnDraw();
Línea 1173... Línea 1167...
1173
 
1167
 
1174
		}
1168
		}
Línea 1175... Línea 1169...
1175
	});
1169
	});
1176
 
1170
 
1177
	//IMPORTANT: update CKEDITOR textarea with actual content before submit
1171
	//IMPORTANT: update CKEDITOR textarea with actual content before submit
1178
 	$( "#section" ).on('submit', function() {
1172
 	$( "#form-section" ).on('submit', function() {
1179
		for(var instanceName in CKEDITOR.instances) {
1173
		for(var instanceName in CKEDITOR.instances) {
1180
			CKEDITOR.instances[instanceName].updateElement();
1174
			CKEDITOR.instances[instanceName].updateElement();
Línea 1181... Línea 1175...
1181
		}
1175
		}
1182
	})
1176
	})
1183
	
1177
	
1184
	var validatorFormSection = $( "#section" ).validate( {
1178
	var validatorFormSection = $( "#form-section" ).validate( {
1185
        ignore: [],
1179
        ignore: [],
1186
        errorClass: 'help-block',
1180
        errorClass: 'help-block',
Línea 1222... Línea 1216...
1222
        },
1216
        },
1223
		submitHandler: function(form) {
1217
		submitHandler: function(form) {
1224
		    // do other things for a valid form
1218
		    // do other things for a valid form
1225
		    //form.submit();
1219
		    //form.submit();
Línea 1226... Línea 1220...
1226
 
1220
 
1227
		    var slug = $('#section #section-slug').val();
1221
		    var slug = $('#form-section #section-slug').val();
1228
		    if(slug) {
1222
		    if(slug) {
1229
		    	objFormGenerator.editSection(
1223
		    	objFormGenerator.editSection(
1230
		    		$('#section #section-slug').val(), 
1224
		    		$('#form-section #section-slug').val(), 
1231
			    	$('#section #section-name').val(), 
1225
			    	$('#form-section #section-name').val(), 
1232
			    	$('#section #section-text').val(),
1226
			    	$('#form-section #section-text').val(),
1233
			    	$('#section #section-value').val()
1227
			    	$('#form-section #section-value').val()
1234
			  	);	
1228
			  	);	
1235
		    } else {
1229
		    } else {
1236
		    	objFormGenerator.addSection(
1230
		    	objFormGenerator.addSection(
1237
		    		$('#section #section-name').val(), 
1231
		    		$('#form-section #section-name').val(), 
1238
		    		$('#section #section-text').val(),
1232
		    		$('#form-section #section-text').val(),
1239
		    		$('#section #section-value').val()
1233
		    		$('#form-section #section-value').val()
1240
		    	);	
1234
		    	);	
Línea 1246... Línea 1240...
1246
			return false;
1240
			return false;
1247
		  }
1241
		  }
1248
	} );
1242
	} );
Línea 1249... Línea 1243...
1249
 
1243
 
1250
	//IMPORTANT: update CKEDITOR textarea with actual content before submit
1244
	//IMPORTANT: update CKEDITOR textarea with actual content before submit
1251
 	$( "#question" ).on('submit', function() {
1245
 	$( "#form-question" ).on('submit', function() {
1252
		for(var instanceName in CKEDITOR.instances) {
1246
		for(var instanceName in CKEDITOR.instances) {
1253
			CKEDITOR.instances[instanceName].updateElement();
1247
			CKEDITOR.instances[instanceName].updateElement();
1254
		}
1248
		}
Línea 1255... Línea 1249...
1255
	})
1249
	})
1256
	
1250
	
1257
	
1251
	
1258
	var validatorFormQuestion = $( "#question" ).validate( {
1252
	var validatorFormQuestion = $( "#form-question" ).validate( {
1259
        ignore: [],
1253
        ignore: [],
1260
        errorClass: 'help-block',
1254
        errorClass: 'help-block',
Línea 1305... Línea 1299...
1305
            }, 1000);
1299
            }, 1000);
1306
        },
1300
        },
1307
		submitHandler: function(form) {
1301
		submitHandler: function(form) {
Línea 1308... Línea 1302...
1308
		    
1302
		    
Línea 1309... Línea 1303...
1309
		
1303
		
1310
		    if($('#question #question-slug').val()) {
1304
		    if($('#form-question #question-slug').val()) {
1311
		    
1305
		    
1312
			
1306
			
1313
		    	objFormGenerator.editQuestion(
1307
		    	objFormGenerator.editQuestion(
1314
		    		$('#question #question-section').val(), 
1308
		    		$('#form-question #question-section').val(), 
1315
		    		$('#question #question-slug').val(),
1309
		    		$('#form-question #question-slug').val(),
1316
		    		$('#question #question-text').val(), 
1310
		    		$('#form-question #question-text').val(), 
1317
		    		$('#question #question-value').val(),
1311
		    		$('#form-question #question-value').val(),
1318
			    	$('#question #question-type').val(),
1312
			    	$('#form-question #question-type').val(),
1319
			    	$('#question #question-max-length').val(),
1313
			    	$('#form-question #question-max-length').val(),
Línea 1320... Línea 1314...
1320
	    			$('#question #question-multiline').val(),
1314
	    			$('#form-question #question-multiline').val(),
1321
	    			$('#question #question-range').val()
1315
	    			$('#form-question #question-range').val()
1322
			  	);	
1316
			  	);	
1323
		    } else {
1317
		    } else {
1324
			    
1318
			    
1325
		    	objFormGenerator.addQuestion(
1319
		    	objFormGenerator.addQuestion(
1326
			    	$('#question #question-section').val(), 
1320
			    	$('#form-question #question-section').val(), 
1327
			    	$('#question #question-text').val(), 
1321
			    	$('#form-question #question-text').val(), 
1328
			    	$('#question #question-value').val(),
1322
			    	$('#form-question #question-value').val(),
1329
				    $('#question #question-type').val(),
1323
				    $('#form-question #question-type').val(),
Línea 1330... Línea 1324...
1330
				    $('#question #question-max-length').val(),
1324
				    $('#form-question #question-max-length').val(),
1331
		    		$('#question #question-multiline').val(),
1325
		    		$('#form-question #question-multiline').val(),
1332
		    		$('#question #question-range').val()
1326
		    		$('#form-question #question-range').val()
1333
		    	);	
1327
		    	);	
Línea 1334... Línea 1328...
1334
		    }
1328
		    }
1335
		    
1329
		    
1336
			$('#modal-question').modal('hide');
1330
			$('#modal-question').modal('hide');
1337
			return false;
1331
			return false;
1338
		  }
1332
		  }
1339
	} );
1333
	} );
Línea 1340... Línea 1334...
1340
 
1334
 
1341
	//IMPORTANT: update CKEDITOR textarea with actual content before submit
1335
	//IMPORTANT: update CKEDITOR textarea with actual content before submit
1342
 	$( "#option" ).on('submit', function() {
1336
 	$( "#form-option" ).on('submit', function() {
1343
		for(var instanceName in CKEDITOR.instances) {
1337
		for(var instanceName in CKEDITOR.instances) {
1344
			CKEDITOR.instances[instanceName].updateElement();
1338
			CKEDITOR.instances[instanceName].updateElement();
1345
		}
1339
		}
Línea 1380... Línea 1374...
1380
            }, 1000);
1374
            }, 1000);
1381
        },
1375
        },
1382
		submitHandler: function(form) {
1376
		submitHandler: function(form) {
Línea 1383... Línea 1377...
1383
		    
1377
		    
1384
 
1378
 
1385
		    if($('#option #option-slug').val()) {
1379
		    if($('#form-option #option-slug').val()) {
1386
		    	objFormGenerator.editOption(
1380
		    	objFormGenerator.editOption(
1387
		    		$('#option #option-section').val(), 
1381
		    		$('#form-option #option-section').val(), 
1388
		    		$('#option #option-question').val(), 
1382
		    		$('#form-option #option-question').val(), 
1389
		    		$('#option #option-slug').val(),
1383
		    		$('#form-option #option-slug').val(),
1390
		    		$('#option #option-text').val(), 
1384
		    		$('#form-option #option-text').val(), 
1391
		    		$('#option #option-correct').val(),
1385
		    		$('#form-option #option-correct').val(),
1392
		    		$('#option #option-value').val()
1386
		    		$('#form-option #option-value').val()
1393
			  	);	
1387
			  	);	
1394
		    } else {
1388
		    } else {
1395
		    	objFormGenerator.addOption(
1389
		    	objFormGenerator.addOption(
1396
			    	$('#option #option-section').val(), 
1390
			    	$('#form-option #option-section').val(), 
1397
			    	$('#option #option-question').val(), 
1391
			    	$('#form-option #option-question').val(), 
1398
			    	$('#option #option-text').val(), 
1392
			    	$('#form-option #option-text').val(), 
1399
			    	$('#option #option-correct').val(),
1393
			    	$('#form-option #option-correct').val(),
1400
			    	$('#option #option-value').val()
1394
			    	$('#form-option #option-value').val()
Línea 1401... Línea 1395...
1401
		    	);	
1395
		    	);	
1402
		    }
1396
		    }
Línea 1408... Línea 1402...
1408
	
1402
	
1409
	$('body').on('click', 'button[id="btn-add-section"]', function(e){
1403
	$('body').on('click', 'button[id="btn-add-section"]', function(e){
Línea 1410... Línea 1404...
1410
		e.preventDefault();
1404
		e.preventDefault();
1411
		
1405
		
1412
		validatorFormSection.resetForm();
1406
		validatorFormSection.resetForm();
Línea 1413... Línea 1407...
1413
		$('#section #section-slug').val('');
1407
		$('#form-section #section-slug').val('');
1414
		$('#section #section-name').val('');
1408
		$('#form-section #section-name').val('');
1415
 
1409
 
1416
		instanceName = 'section-text'; 
1410
		instanceName = 'section-text'; 
1417
		let editor = CKEDITOR.instances[instanceName ];
1411
		let editor = CKEDITOR.instances[instanceName ];
Línea 1418... Línea 1412...
1418
		editor.setData('', function() {
1412
		editor.setData('', function() {
1419
		    editor.focus();
1413
		    editor.focus();
1420
		});
1414
		});
1421
 
1415
 
Línea 1422... Línea 1416...
1422
	
1416
	
Línea 1436... Línea 1430...
1436
	        section = objFormGenerator.sections[i];
1430
	        section = objFormGenerator.sections[i];
Línea 1437... Línea 1431...
1437
	    	
1431
	    	
Línea 1438... Línea 1432...
1438
	    	if(slug == section.slug) {
1432
	    	if(slug == section.slug) {
1439
 
1433
 
1440
				validatorFormSection.resetForm();
1434
				validatorFormSection.resetForm();
Línea 1441... Línea 1435...
1441
	    		$('#section #section-slug').val(section.slug);
1435
	    		$('#form-section #section-slug').val(section.slug);
1442
	    		$('#section #section-name').val(section.name);
1436
	    		$('#form-section #section-name').val(section.name);
1443
	
1437
	
1444
	    		instanceName = 'section-text'; 
1438
	    		instanceName = 'section-text'; 
1445
	    		let editor = CKEDITOR.instances[instanceName ];
1439
	    		let editor = CKEDITOR.instances[instanceName ];
Línea 1446... Línea 1440...
1446
	    		editor.setData( section.text, function() {
1440
	    		editor.setData( section.text, function() {
Línea 1447... Línea 1441...
1447
	    		    editor.focus();
1441
	    		    editor.focus();
1448
	    		});
1442
	    		});
1449
	    	    		
1443
	    	    		
1450
				$('#section #section-value').val(section.value);
1444
				$('#form-section #section-value').val(section.value);
Línea 1492... Línea 1486...
1492
		e.preventDefault();
1486
		e.preventDefault();
Línea 1493... Línea 1487...
1493
		
1487
		
1494
		validatorFormQuestion.resetForm();
1488
		validatorFormQuestion.resetForm();
Línea 1495... Línea 1489...
1495
		var slug = $(this).data('slug');
1489
		var slug = $(this).data('slug');
1496
		
1490
		
Línea 1497... Línea 1491...
1497
		$('#question #question-section').val(slug);
1491
		$('#form-question #question-section').val(slug);
1498
		$('#question #question-slug').val('');
1492
		$('#form-question #question-slug').val('');
1499
 
1493
 
1500
		instanceName = 'question-text'; 
1494
		instanceName = 'question-text'; 
1501
		let editor = CKEDITOR.instances[instanceName ];
1495
		let editor = CKEDITOR.instances[instanceName ];
Línea 1502... Línea 1496...
1502
		editor.setData('', function() {
1496
		editor.setData('', function() {
1503
		    editor.focus();
1497
		    editor.focus();
Línea 1504... Línea 1498...
1504
		});
1498
		});
1505
 
1499
 
Línea 1506... Línea 1500...
1506
 
1500
 
1507
		$('#question #question-value').val('0');
1501
		$('#form-question #question-value').val('0');
Línea 1508... Línea 1502...
1508
		$('#question #question-type').val($('#question #question-type option:first').val());
1502
		$('#form-question #question-type').val($('#form-question #question-type option:first').val());
1509
		
1503
		
Línea 1510... Línea 1504...
1510
		$('#question #question-max-length').val('0');
1504
		$('#form-question #question-max-length').val('0');
1511
		$('#question #question-max-length').parent().show();
1505
		$('#form-question #question-max-length').parent().show();
Línea 1512... Línea 1506...
1512
		
1506
		
Línea 1537... Línea 1531...
1537
	    		for(j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
1531
	    		for(j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
Línea 1538... Línea 1532...
1538
	    			
1532
	    			
1539
	    			if(slug == objFormGenerator.sections[i].questions[j].slug) {
1533
	    			if(slug == objFormGenerator.sections[i].questions[j].slug) {
Línea 1540... Línea 1534...
1540
	    				validatorFormQuestion.resetForm();
1534
	    				validatorFormQuestion.resetForm();
1541
	    				
1535
	    				
Línea 1542... Línea 1536...
1542
	    				$('#question #question-section').val(objFormGenerator.sections[i].slug);
1536
	    				$('#form-question #question-section').val(objFormGenerator.sections[i].slug);
1543
	    				$('#question #question-slug').val(objFormGenerator.sections[i].questions[j].slug);
1537
	    				$('#form-question #question-slug').val(objFormGenerator.sections[i].questions[j].slug);
1544
 
1538
 
1545
	    	    		instanceName = 'question-text'; 
1539
	    	    		instanceName = 'question-text'; 
1546
	    	    		let editor = CKEDITOR.instances[instanceName ];
1540
	    	    		let editor = CKEDITOR.instances[instanceName ];
Línea 1547... Línea 1541...
1547
	    	    		editor.setData( objFormGenerator.sections[i].questions[j].text, function() {
1541
	    	    		editor.setData( objFormGenerator.sections[i].questions[j].text, function() {
1548
	    	    		    editor.focus();
1542
	    	    		    editor.focus();
Línea 1549... Línea 1543...
1549
	    	    		});
1543
	    	    		});
1550
 
1544
 
1551
 
1545
 
Línea 1552... Línea 1546...
1552
	        			$('#question #question-value').val(objFormGenerator.sections[i].questions[j].value);
1546
	        			$('#form-question #question-value').val(objFormGenerator.sections[i].questions[j].value);
1553
	        			$('#question #question-type').val(objFormGenerator.sections[i].questions[j].type);
1547
	        			$('#form-question #question-type').val(objFormGenerator.sections[i].questions[j].type);
1554
	        			
1548
	        			
1555
	        			
1549
	        			
1556
	        
1550
	        
Línea 1557... Línea 1551...
1557
	        			if(objFormGenerator.sections[i].questions[j].type == 'open') {
1551
	        			if(objFormGenerator.sections[i].questions[j].type == 'open') {
1558
		        			$('#question #question-max-length').val(objFormGenerator.sections[i].questions[j].maxlength);
1552
		        			$('#form-question #question-max-length').val(objFormGenerator.sections[i].questions[j].maxlength);
1559
		        			$('#question #question-max-length').parent().show();
1553
		        			$('#form-question #question-max-length').parent().show();
Línea 1560... Línea 1554...
1560
		        			
1554
		        			
1561
		        			$('#question #question-multiline').val(objFormGenerator.sections[i].questions[j].multiline);
1555
		        			$('#form-question #question-multiline').val(objFormGenerator.sections[i].questions[j].multiline);
1562
							$('#question #question-multiline').parent().show();
1556
							$('#form-question #question-multiline').parent().show();
Línea 1563... Línea 1557...
1563
	        			} else {
1557
	        			} else {
1564
		        			$('#question #question-max-length').val('0');
1558
		        			$('#form-question #question-max-length').val('0');
1565
		        			$('#question #question-max-length').parent().hide();
1559
		        			$('#form-question #question-max-length').parent().hide();
1566
		        			
1560
		        			
Línea 1567... Línea 1561...
1567
		        			$('#question #question-multiline').val('0');
1561
		        			$('#form-question #question-multiline').val('0');
1568
							$('#question #question-multiline').parent().hide();
1562
							$('#form-question #question-multiline').parent().hide();
Línea 1634... Línea 1628...
1634
	    	if(slug_section == objFormGenerator.sections[i].slug) {
1628
	    	if(slug_section == objFormGenerator.sections[i].slug) {
1635
	    		for(j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
1629
	    		for(j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
1636
	    			if(slug_question == objFormGenerator.sections[i].questions[j].slug) {
1630
	    			if(slug_question == objFormGenerator.sections[i].questions[j].slug) {
Línea 1637... Línea 1631...
1637
 
1631
 
1638
                		validatorFormOption.resetForm();
1632
                		validatorFormOption.resetForm();
1639
                		$('#option #option-section').val(slug_section);
1633
                		$('#form-option #option-section').val(slug_section);
1640
                		$('#option #option-question').val(slug_question);
1634
                		$('#form-option #option-question').val(slug_question);
Línea 1641... Línea 1635...
1641
                		$('#option #option-slug').val('');
1635
                		$('#form-option #option-slug').val('');
1642
						
1636
						
1643
                		instanceName = 'option-text'; 
1637
                		instanceName = 'option-text'; 
1644
	    	    		let editor = CKEDITOR.instances[instanceName ];
1638
	    	    		let editor = CKEDITOR.instances[instanceName ];
1645
	    	    		editor.setData('', function() {
1639
	    	    		editor.setData('', function() {
Línea 1646... Línea 1640...
1646
	    	    		    editor.focus();
1640
	    	    		    editor.focus();
1647
	    	    		});
1641
	    	    		});
1648
 
1642
 
1649
 
1643
 
1650
	    	    		$('#option #option-correct').val('0');
1644
	    	    		$('#form-option #option-correct').val('0');
1651
                		if(objFormGenerator.sections[i].questions[j].type == 'rating-open') {
1645
                		if(objFormGenerator.sections[i].questions[j].type == 'rating-open') {
Línea 1652... Línea 1646...
1652
                    		$('#option #option-correct').parent().hide();
1646
                    		$('#form-option #option-correct').parent().hide();
1653
                        } else {
1647
                        } else {
1654
                    		$('#option #option-correct').parent().show();
1648
                    		$('#form-option #option-correct').parent().show();
1655
                        }
1649
                        }
1656
                		
1650
                		
1657
                		if(objFormGenerator.sections[i].questions[j].type == 'multiple' || objFormGenerator.sections[i].questions[j].type == 'rating-open') {
1651
                		if(objFormGenerator.sections[i].questions[j].type == 'multiple' || objFormGenerator.sections[i].questions[j].type == 'rating-open') {
Línea 1658... Línea 1652...
1658
                			$('#option #option-value').val('0');
1652
                			$('#form-option #option-value').val('0');
1659
                			$('#option #option-value').parent().show();
1653
                			$('#form-option #option-value').parent().show();
1660
                		} else {
1654
                		} else {
1661
                			$('#option #option-value').val('1');
1655
                			$('#form-option #option-value').val('1');
Línea 1690... Línea 1684...
1690
	    		for(j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
1684
	    		for(j = 0; j < objFormGenerator.sections[i].questions.length; j++) {
1691
	    			if(slug_question == objFormGenerator.sections[i].questions[j].slug) {
1685
	    			if(slug_question == objFormGenerator.sections[i].questions[j].slug) {
1692
	    				for(k = 0; k < objFormGenerator.sections[i].questions[j].options.length; k++) {
1686
	    				for(k = 0; k < objFormGenerator.sections[i].questions[j].options.length; k++) {
1693
	    					if(slug == objFormGenerator.sections[i].questions[j].options[k].slug) {
1687
	    					if(slug == objFormGenerator.sections[i].questions[j].options[k].slug) {
1694
	    						validatorFormOption.resetForm();
1688
	    						validatorFormOption.resetForm();
1695
	    						$('#option #option-section').val(objFormGenerator.sections[i].slug);
1689
	    						$('#form-option #option-section').val(objFormGenerator.sections[i].slug);
1696
	    						$('#option #option-question').val(objFormGenerator.sections[i].questions[j].slug);
1690
	    						$('#form-option #option-question').val(objFormGenerator.sections[i].questions[j].slug);
1697
    		    				$('#option #option-slug').val(objFormGenerator.sections[i].questions[j].options[k].slug);
1691
    		    				$('#form-option #option-slug').val(objFormGenerator.sections[i].questions[j].options[k].slug);
Línea 1698... Línea 1692...
1698
 
1692
 
1699
    		    				instanceName = 'option-text'; 
1693
    		    				instanceName = 'option-text'; 
1700
    		    	    		let editor = CKEDITOR.instances[instanceName ];
1694
    		    	    		let editor = CKEDITOR.instances[instanceName ];
1701
    		    	    		editor.setData( objFormGenerator.sections[i].questions[j].options[k].text, function() {
1695
    		    	    		editor.setData( objFormGenerator.sections[i].questions[j].options[k].text, function() {
1702
    		    	    		    editor.focus();
1696
    		    	    		    editor.focus();
Línea 1703... Línea 1697...
1703
    		    	    		});
1697
    		    	    		});
1704
    	    		    	    		
1698
    	    		    	    		
1705
    		    				
1699
    		    				
1706
    		    				$('#option #option-correct').val(objFormGenerator.sections[i].questions[j].options[k].correct);
1700
    		    				$('#form-option #option-correct').val(objFormGenerator.sections[i].questions[j].options[k].correct);
1707
    		    				if(objFormGenerator.sections[i].questions[j].type == 'multiple' || objFormGenerator.sections[i].questions[j].type == 'simple') {
1701
    		    				if(objFormGenerator.sections[i].questions[j].type == 'multiple' || objFormGenerator.sections[i].questions[j].type == 'simple') {
1708
    		    					$('#option #option-correct').parent().show();
1702
    		    					$('#form-option #option-correct').parent().show();
Línea 1709... Línea 1703...
1709
    		    				} else {
1703
    		    				} else {
Línea 1710... Línea 1704...
1710
    		    					$('#option #option-correct').parent().hide();
1704
    		    					$('#form-option #option-correct').parent().hide();
1711
            		    		}
1705
            		    		}
1712
 
1706
 
1713
    		    				$('#option #option-value').val(objFormGenerator.sections[i].questions[j].options[k].value);
1707
    		    				$('#form-option #option-value').val(objFormGenerator.sections[i].questions[j].options[k].value);
1714
 
1708
 
Línea 1715... Línea 1709...
1715
								if(objFormGenerator.sections[i].questions[j].type == 'multiple' || objFormGenerator.sections[i].questions[j].type == 'rating-open') {
1709
								if(objFormGenerator.sections[i].questions[j].type == 'multiple' || objFormGenerator.sections[i].questions[j].type == 'rating-open') {
Línea 1765... Línea 1759...
1765
				}
1759
				}
1766
			}
1760
			}
1767
		});			    
1761
		});			    
1768
	})
1762
	})
Línea 1769... Línea 1763...
1769
 
1763
 
Línea 1770... Línea 1764...
1770
	$('#section #section-value').inputNumberFormat({'decimal' : 2});
1764
	$('#form-section #section-value').inputNumberFormat({'decimal' : 2});
1771
 
1765
 
Línea 1772... Línea 1766...
1772
	$('#question #question-value').inputNumberFormat({'decimal' : 2});
1766
	$('#form-question #question-value').inputNumberFormat({'decimal' : 2});
Línea 1773... Línea 1767...
1773
	$('#question #question-max-length').inputNumberFormat({'decimal' : 0});
1767
	$('#form-question #question-max-length').inputNumberFormat({'decimal' : 0});
1774
 
1768
 
Línea 1775... Línea 1769...
1775
	$('#option #option-value').inputNumberFormat({'decimal' : 2});
1769
	$('#form-option #option-value').inputNumberFormat({'decimal' : 2});
1776
	
1770
	
1777
	$('#question #question-type').change(function(e) {
1771
	$('#form-question #question-type').change(function(e) {
Línea 1778... Línea 1772...
1778
		e.preventDefault();
1772
		e.preventDefault();
1779
		
1773
		
1780
		if($('#question #question-type').val() == 'open') {
1774
		if($('#form-question #question-type').val() == 'open') {
Línea 1781... Línea 1775...
1781
			$('#question #question-max-length').parent().show();
1775
			$('#form-question #question-max-length').parent().show();
1782
			$('#question #question-multiline').parent().show();
1776
			$('#form-question #question-multiline').parent().show();
1783
			
1777
			
Línea 1784... Línea 1778...
1784
		} else {
1778
		} else {
1785
			$('#question #question-max-length').val('0');
1779
			$('#form-question #question-max-length').val('0');
1786
			$('#question #question-max-length').parent().hide();
1780
			$('#form-question #question-max-length').parent().hide();
1787
 
1781
 
1788
			$('#question #question-multiline').val('0');
1782
			$('#form-question #question-multiline').val('0');
1789
			$('#question #question-multiline').parent().hide();
1783
			$('#form-question #question-multiline').parent().hide();
Línea 1790... Línea 1784...
1790
		}
1784
		}
Línea 1805... Línea 1799...
1805
 
1799
 
1806
		objFormGenerator.clear();
1800
		objFormGenerator.clear();
1807
		objFormGenerator.render();
1801
		objFormGenerator.render();
Línea 1808... Línea 1802...
1808
		validatorForm.resetForm();
1802
		validatorForm.resetForm();
1809
 
1803
 
1810
		$('#main #id').val('0');
1804
		$('#form-main #form-id').val('0');
Línea 1811... Línea 1805...
1811
		$('#main #continue').val('0');
1805
		$('#form-main #form-continue').val('0');
1812
		$('#main #name').val('');
1806
		$('#form-main #form-name').val('');
1813
 
1807
 
1814
		instanceName = 'form-text'; 
1808
		instanceName = 'form-text'; 
Línea 1819... Línea 1813...
1819
 
1813
 
1820
 
1814
 
Línea 1821... Línea 1815...
1821
		instanceName = 'form-description'; 
1815
		instanceName = 'form-description'; 
1822
		CKEDITOR.instances[instanceName ].setData('');
1816
		CKEDITOR.instances[instanceName ].setData('');
Línea 1823... Línea 1817...
1823
		
1817
		
1824
		$('#main #language' ).val('$lang_es'),
1818
		$('#form-main #form-language' ).val('$lang_es'),
1825
		$('#main #status' ).val('$status_inactive');
1819
		$('#form-main #form-status' ).val('$status_inactive');
Línea 1826... Línea 1820...
1826
		
1820
		
Línea 1827... Línea 1821...
1827
		$('#row-forms').hide();
1821
		$('#row-forms').hide();
1828
		$('#row-edit').show();
1822
		$('#row-edit').show();
Línea 1838... Línea 1832...
1838
	});
1832
	});
Línea 1839... Línea 1833...
1839
 
1833
 
1840
 
1834
 
1841
	$('button.btn-form-save-continue').click(function(e) {
1835
	$('button.btn-form-save-continue').click(function(e) {
1842
		e.preventDefault();
1836
		e.preventDefault();
1843
		$('#main #continue').val('1')
1837
		$('#form-main #form-continue').val('1')
Línea 1844... Línea 1838...
1844
		$('#main').submit();
1838
		$('#form-main').submit();
1845
	});
1839
	});
1846
	
1840
	
1847
	$('button.btn-form-save-close').click(function(e) {
1841
	$('button.btn-form-save-close').click(function(e) {
Línea 1848... Línea 1842...
1848
		e.preventDefault();
1842
		e.preventDefault();
Línea 1849... Línea 1843...
1849
		$('#main #continue').val('0')
1843
		$('#form-main #form-continue').val('0')
1850
		$('#main').submit();
1844
		$('#form-main').submit();
Línea 1879... Línea 1873...
1879
    .panel-heading .accordion-toggle.collapsed:after {
1873
    .panel-heading .accordion-toggle.collapsed:after {
1880
        /* symbol for "collapsed" panels */
1874
        /* symbol for "collapsed" panels */
1881
        content: "\f078";    /* adjust as needed, taken from bootstrap.css */
1875
        content: "\f078";    /* adjust as needed, taken from bootstrap.css */
1882
    }
1876
    }
1883
</style>
1877
</style>
1884
 
-
 
1885
<script id="formTmpl" type="text/x-jsrender">
-
 
1886
<tr>
-
 
1887
   <td>{{:name}}</td>
-
 
1888
   <td>{{:language}}</td>
-
 
1889
   <td>
-
 
1890
      <div class="checkbox checkbox-success">
-
 
1891
         {{if status =='a' }}
-
 
1892
         <input class="styled" type="checkbox" checked="checked" disabled="disabled">
-
 
1893
         {{/if}}
-
 
1894
         {{if status !='a' }}
-
 
1895
         <input class="styled" type="checkbox"  disabled="disabled">
-
 
1896
         {{/if}}
-
 
1897
         <label></label>
-
 
1898
      </div>
-
 
1899
   </td>
-
 
1900
   <td>
-
 
1901
   <?php if ($allowAdd) : ?>
-
 
1902
      <button class="btn btn-primary btn-edit-form" data-href="{{:actions.link_edit}}" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> LABEL_EDIT </button>
-
 
1903
	  <?php endif; ?>
-
 
1904
	  <?php if ($allowDelete) : ?>
-
 
1905
      <button class="btn btn-danger btn-delete" data-href="{{:actions.link_delete}}" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> LABEL_DELETE </button>
-
 
1906
	  <?php endif; ?>
-
 
1907
   </td>
-
 
1908
</tr>
-
 
1909
</script>
-
 
1910
 
-
 
1911
<!-- Content Header (Page header) -->
1878
<!-- Content Header (Page header) -->
1912
<section class="content-header">
1879
<section class="content-header">
1913
    <div class="container-fluid">
1880
    <div class="container-fluid">
1914
        <div class="row mb-2">
1881
        <div class="row mb-2">
1915
            <div class="col-sm-12">
1882
            <div class="col-sm-12">
Línea 1924... Línea 1891...
1924
        <div class="row">
1891
        <div class="row">
1925
            <div class="col-12">
1892
            <div class="col-12">
1926
                <div class="card">
1893
                <div class="card">
1927
                    <div class="card-body">
1894
                    <div class="card-body">
Línea 1928... Línea 1895...
1928
 
1895
 
1929
					<table  id="gridTable" class="table table-hover">
1896
					<table  class="table table-hover">
1930
                            <thead>
1897
                            <thead>
1931
                                <tr>
1898
                                <tr>
1932
                                    <th>LABEL_NAME</th>
1899
                                    <th>LABEL_NAME</th>
1933
                                    <th>LABEL_LANGUAGE</th>
1900
                                    <th>LABEL_LANGUAGE</th>
1934
                                    <th>LABEL_ACTIVE</th>
1901
                                    <th>LABEL_ACTIVE</th>
1935
                                    <th>LABEL_ACTIONS</th>
1902
                                    <th>LABEL_ACTIONS</th>
1936
                                </tr>
1903
                                </tr>
1937
                            </thead>
1904
                            </thead>
1938
                            <tbody id="rows"></tbody>
1905
                            <tbody id="rows"></tbody>
-
 
1906
                        </table>
-
 
1907
                        <table id="gridTable" class="table   table-hover">
-
 
1908
                            <thead>
-
 
1909
                                <tr>
-
 
1910
                                    <th>LABEL_NAME</th>
-
 
1911
                                    <th>LABEL_LANGUAGE</th>
-
 
1912
                                    <th>LABEL_ACTIVE</th>
-
 
1913
                                    <th>LABEL_ACTIONS</th>
-
 
1914
                                </tr>
-
 
1915
                            </thead>
-
 
1916
                            <tbody>
-
 
1917
							
-
 
1918
                            </tbody>
1939
                        </table>
1919
                        </table>
1940
                    </div>
1920
                    </div>
1941
                    <div class="card-footer clearfix">
1921
                    <div class="card-footer clearfix">
1942
                        <div style="float:right;">
1922
                        <div style="float:right;">
1943
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
1923
                            <button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
Línea 2003... Línea 1983...
2003
                </div>
1983
                </div>
2004
            </form>
1984
            </form>
2005
        </div>
1985
        </div>
2006
    </div>
1986
    </div>
2007
    <!-- End Row Edit -->
1987
    <!-- End Row Edit -->
-
 
1988
	
2008
    <!-- Modals -->
1989
    <!-- Modals -->
-
 
1990
 
2009
    <!-- Section Modal -->
1991
    <!-- Section Modal -->
2010
    <div  id="modal-section" class="modal" tabindex="-1" role="dialog">
-
 
2011
        <div class="modal-dialog modal-lg" role="document">
1992
    <?php echo $this->partial('modals/sections.phtml') ;?>
2012
            <form action="#" name="form-section" id="form-section">
-
 
2013
                <input type="hidden" name="section-slug" id="section-slug" value="" />
-
 
2014
                <div class="modal-content">
-
 
2015
                    <div class="modal-header">
-
 
2016
                        <h4 class="modal-title">LABEL_ADD LABEL_SECTION</h4>
-
 
2017
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
2018
                            <span aria-hidden="true">&times;</span>
-
 
2019
                        </button>
-
 
2020
                    </div>
-
 
2021
                    <div class="modal-body">
-
 
2022
                        <div class="form-group">
-
 
2023
                            <label for="section-name">LABEL_FIRST_NAME</label>
-
 
2024
                            <input type="text" name="section-name" id="section-name" class="form-control" maxlength="50" value="" />
-
 
2025
                        </div>
-
 
2026
                        <div class="form-group">
-
 
2027
                            <label for="section-text">LABEL_TEXT</label>
-
 
2028
                            <!--  ckeditor -->
-
 
2029
                            <textarea  name="section-text" id="section-text" rows="5" class="ckeditor form-control"></textarea>
-
 
2030
                        </div>
-
 
2031
                        <div class="form-group">
-
 
2032
                            <label for="section-value">LABEL_VALUE</label>
-
 
2033
                            <input type="text" name="section-value" id="section-value"  class="form-control" value="0" />
-
 
2034
                        </div>
-
 
2035
                    </div>
-
 
2036
                    <div class="modal-footer">
-
 
2037
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
2038
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
2039
                    </div>
-
 
2040
                </div>
-
 
2041
            </form>
-
 
2042
        </div>
-
 
2043
    </div>
-
 
2044
    <!-- End Modal Section -->
1993
    <!-- End Modal Section -->
-
 
1994
 
2045
    <!-- Question Modal -->
1995
    <!-- Question Modal -->
2046
    <div  id="modal-question" class="modal" tabindex="-1" role="dialog">
-
 
-
 
1996
 
2047
        <div class="modal-dialog modal-lg" role="document">
1997
	<?php echo $this->partial('modals/questions.phtml') ;?>
2048
            <form action="#" name="form-question" id="form-question">
-
 
2049
                <input type="hidden" name="question-section" id="question-section" />
-
 
2050
                <input type="hidden" name="question-slug" id="question-slug" />
-
 
2051
                <div class="modal-content">
-
 
2052
                    <div class="modal-header">
-
 
2053
                        <h4 class="modal-title">LABEL_ADD LABEL_QUESTION</h4>
-
 
2054
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
2055
                            <span aria-hidden="true">&times;</span>
-
 
2056
                        </button>
-
 
2057
                    </div>
-
 
2058
                    <div class="modal-body">
-
 
2059
                        <div class="form-group">
-
 
2060
                            <label for="question-text">LABEL_TEXT</label>
-
 
2061
                            <!--  ckeditor -->
-
 
2062
                            <textarea  name="question-text" id="question-text" rows="5" class="ckeditor form-control"></textarea>
-
 
2063
                        </div>
-
 
2064
                        <div class="form-group">
-
 
2065
                            <label for="question-value">LABEL_VALUE</label>
-
 
2066
                            <input type="text" name="question-value" id="question-value"  class="form-control" />
-
 
2067
                        </div>
-
 
2068
                        <div class="form-group">
-
 
2069
                            <label for="question-type">LABEL_TYPE</label>
-
 
2070
                            <select name="question-type" id="question-type" class="form-control">
-
 
2071
                                <option value="open">LABEL_OPEN</option>
-
 
2072
                                <option value="simple">Simple</option>
-
 
2073
                                <option value="multiple">Multiple</option>
-
 
2074
                                <option value="rating-open">LABEL_RATING_OPEN</option>
-
 
2075
                                <option value="rating-range">LABEL_RATING_RANGE</option>
-
 
2076
                            </select>
-
 
2077
                        </div>
-
 
2078
                        <div class="form-group">
-
 
2079
                            <label for="question-max-length">LABEL_MAXLENGTH</label>
-
 
2080
                            <input type="text" name="question-max-length" id="question-max-length"  class="form-control" />
-
 
2081
                        </div>
-
 
2082
                        <div class="form-group">
-
 
2083
                            <label for="question-multiline">LABEL_MULTI_LINE</label>
-
 
2084
                            <select name="question-multiline" id="question-multiline" class="form-control">
-
 
2085
                                <option value="1">LABEL_YES</option>
-
 
2086
                                <option value="0">LABEL_NOT</option>
-
 
2087
                            </select>
-
 
2088
                        </div>
-
 
2089
                        <div class="form-group">
-
 
2090
                            <label for="question-range">LABEL_RANGE</label>
-
 
2091
                            <select name="question-range" id="question-range" class="form-control">
-
 
2092
                                <option value="10">1-10</option>
-
 
2093
                                <option value="6">1-6</option>
-
 
2094
                                <option value="5">1-5</option>
-
 
2095
                            </select>
-
 
2096
                        </div>
-
 
2097
                    </div>
-
 
2098
                    <div class="modal-footer">
-
 
2099
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
2100
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
2101
                    </div>
-
 
2102
                </div>
-
 
2103
            </form>
-
 
2104
        </div>
-
 
2105
    </div>
1998
 
2106
    <!-- End Modal Question -->
1999
	<!-- End Modal Question -->
-
 
2000
 
2107
    <!-- MOdal Options -->
2001
    <!-- Modal Options -->
2108
    <div  id="modal-option" class="modal" tabindex="-1" role="dialog">
-
 
-
 
2002
 
2109
        <div class="modal-dialog modal-lg" role="document">
2003
	<?php echo $this->partial('modals/options.phtml') ;?>
2110
            <form action="#" name="form-option" id="form-option">
-
 
2111
                <input type="hidden" name="option-section" id="option-section" value="" />
-
 
2112
                <input type="hidden" name="option-question" id="option-question" value="" />
-
 
2113
                <input type="hidden" name="option-slug" id="option-slug" value="" />
-
 
2114
                <div class="modal-content">
-
 
2115
                    <div class="modal-header">
-
 
2116
                        <h4 class="modal-title">LABEL_OPTION</h4>
-
 
2117
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-
 
2118
                            <span aria-hidden="true">&times;</span>
-
 
2119
                        </button>
-
 
2120
                    </div>
-
 
2121
                    <div class="modal-body">
-
 
2122
                        <div class="form-group">
-
 
2123
                            <label for="option-text">LABEL_TEXT</label>
-
 
2124
                            <!--  ckeditor -->
-
 
2125
                            <textarea  name="option-text" id="option-text" rows="5" class="ckeditor form-control"></textarea>
-
 
2126
                        </div>
-
 
2127
                        <div class="form-group">
-
 
2128
                            <label for="option-correct">LABEL_ANSWER_CORRECT</label>
-
 
2129
                            <select name="option-correct" id="option-correct" class="form-control">
-
 
2130
                                <option value="1">LABEL_YES</option>
-
 
2131
                                <option value="0">LABEL_NOT</option>
-
 
2132
                            </select>
-
 
2133
                        </div>
-
 
2134
                        <div class="form-group">
-
 
2135
                            <label for="option-value">LABEL_VALUE</label>
-
 
2136
                            <input type="text" name="option-value" id="option-value" class="form-control" />
-
 
2137
                        </div>
-
 
2138
                    </div>
-
 
2139
                    <div class="modal-footer">
-
 
2140
                        <button type="submit" class="btn btn-primary">LABEL_SAVE</button>
-
 
2141
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">LABEL_CLOSE</button>
-
 
2142
                    </div>
-
 
2143
                </div>
-
 
2144
            </form>
-
 
2145
        </div>
-
 
2146
    </div>
2004
    
2147
    <!-- End Modal Options -->
2005
    <!-- End Modal Options -->
-
 
2006
 
2148
    <!-- End Modals -->
2007
    <!-- End Modals -->
-
 
2008
 
2149
</section>
2009
</section>
2150
2010