Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 431 Rev 432
Línea 155... Línea 155...
155
            if (slug_section == this.sections[i].slug_section) {
155
            if (slug_section == this.sections[i].slug_section) {
156
                for (j = 0; j < this.sections[i].questions.length; j++) {
156
                for (j = 0; j < this.sections[i].questions.length; j++) {
157
                    if (slug_question == this.sections[i].questions[j].slug_question) {
157
                    if (slug_question == this.sections[i].questions[j].slug_question) {
158
                        this.sections[i].questions[j].status = status;
158
                        this.sections[i].questions[j].status = status;
159
                        this.sections[i].questions[j].comment = comment;
159
                        this.sections[i].questions[j].comment = comment;
-
 
160
                        this.sections[i].questions[j].question_value = question_value;
160
                        this.renderSection(slug_section);
161
                        this.renderSection(slug_section);
161
                        return true;
162
                        return true;
162
                    }
163
                    }
163
                }
164
                }
164
            }
165
            }
Línea 310... Línea 311...
310
    /**
311
    /**
311
     * Clicked edit question
312
     * Clicked edit question
312
     */
313
     */
313
    $('body').on('click', 'button.btn-add-review', function(e) {
314
    $('body').on('click', 'button.btn-add-review', function(e) {
314
        e.preventDefault();
315
        e.preventDefault();
-
 
316
        if($('#question-value').val()==''){
-
 
317
            $.fn.showError('ERROR_ENTER_VALUE');
-
 
318
            return false;
-
 
319
        }else{
315
        objFormGenerator.editQuestion(
320
        objFormGenerator.editQuestion(
316
            $('#section').val(),
321
            $('#section').val(),
317
            $('#question').val(),
322
            $('#question').val(),
318
            $('#question-comment').val(),
323
            $('#question-comment').val(),
-
 
324
            $('#question-value').val(),
319
            $('#question-status').val() == '1' ? true : false
325
            $('#question-status').val() == '1' ? true : false
320
        );
326
        );
321
        renderSectionData(objFormGenerator.sections);
327
        renderSectionData(objFormGenerator.sections);
322
        $('#form-review')[0].reset();
328
        $('#form-review')[0].reset();
323
        $('#modal-review').modal('hide');
329
        $('#modal-review').modal('hide');
-
 
330
    }
324
    });
331
    });
325
    /**
332
    /**
326
     * Clicked edit question
333
     * Clicked edit question
327
     */
334
     */
328
    $('body').on('click', 'button.btn-edit-review', function(e) {
335
    $('body').on('click', 'button.btn-edit-review', function(e) {
Línea 345... Línea 352...
345
                        if (objFormGenerator.sections[i].questions[j].comment) {
352
                        if (objFormGenerator.sections[i].questions[j].comment) {
346
                            $('#form-review #question-comment').val(objFormGenerator.sections[i].questions[j].comment);
353
                            $('#form-review #question-comment').val(objFormGenerator.sections[i].questions[j].comment);
347
                        } else {
354
                        } else {
348
                            $('#form-review #question-comment').val('');
355
                            $('#form-review #question-comment').val('');
349
                        }
356
                        }
-
 
357
 
-
 
358
                        if (objFormGenerator.sections[i].questions[j].question_value) {
-
 
359
                            $('#form-review #question-value').val(objFormGenerator.sections[i].questions[j].question_value);
-
 
360
                        } else {
-
 
361
                            $('#form-review #question-value').val('0');
-
 
362
                        }
350
                        $('#modal-review').modal('show');
363
                        $('#modal-review').modal('show');
351
                        return true;
364
                        return true;
352
                    }
365
                    }
353
                }
366
                }
354
            }
367
            }
Línea 467... Línea 480...
467
                        ptos = parseInt(opt.value);
480
                        ptos = parseInt(opt.value);
468
                    }
481
                    }
469
                });
482
                });
470
            }
483
            }
471
        }
484
        }
472
        return ptos + '/' + value;
485
        return ptos + '/' + parseInt(value);
473
    }
486
    }
474
    /**
487
    /**
475
     * Remove Html Tags
488
     * Remove Html Tags
476
     */
489
     */
477
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
490
    const removeTags = (str) => str.toString().replace(/(<([^>]+)>)/ig, '')
Línea 492... Línea 505...
492
     * Clicked refresh button
505
     * Clicked refresh button
493
     */
506
     */
494
    $('button.btn-refresh').click(function(e) {
507
    $('button.btn-refresh').click(function(e) {
495
        tableForm.fnDraw();
508
        tableForm.fnDraw();
496
    });
509
    });
-
 
510
    /**
-
 
511
     * Format input number (Form Option) 
-
 
512
     */
-
 
513
    $('#form-review #question-value').inputNumberFormat({
-
 
514
        'decimal': 2
-
 
515
    });
497
});
516
});
498
JS;
517
JS;
499
$this->inlineScript()->captureEnd();
518
$this->inlineScript()->captureEnd();
500
?>
519
?>
Línea 560... Línea 579...
560
                        <option value="<?php echo $pending; ?>">LABEL_PENDING</option>
579
                        <option value="<?php echo $pending; ?>">LABEL_PENDING</option>
561
                        <option value="<?php echo $review; ?>">LABEL_REVIEW</option>
580
                        <option value="<?php echo $review; ?>">LABEL_REVIEW</option>
562
                        <option value="<?php echo $completed; ?>">LABEL_COMPLETED</option>
581
                        <option value="<?php echo $completed; ?>">LABEL_COMPLETED</option>
563
                    </select>
582
                    </select>
564
                </div>
583
                </div>
-
 
584
                <div class="form-group">
-
 
585
                            <label for="question-value">LABEL_VALUE</label>
-
 
586
                            <input type="text" name="question-value" id="question-value" class="form-control" />
-
 
587
                        </div>
565
                <div class="row">
588
                <div class="row">
566
                    <div class="col-xs-12 col-md-12">
589
                    <div class="col-xs-12 col-md-12">
567
                        <div class="panel-group" id="rows"></div>
590
                        <div class="panel-group" id="rows"></div>
568
                    </div>
591
                    </div>
569
                </div>
592
                </div>