diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-05-27 13:08:29 +0200 |
commit | 75160b12821f7f4299cce7f0b69c83c1502ae071 (patch) | |
tree | 27e25e4ccaef45f0c58b22831164050d1af1d4db /main/survey/app/Controllers/Vprasanja/TextController.php | |
parent | prvi-commit (diff) | |
download | 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst 1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip |
Diffstat (limited to 'main/survey/app/Controllers/Vprasanja/TextController.php')
-rw-r--r-- | main/survey/app/Controllers/Vprasanja/TextController.php | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/main/survey/app/Controllers/Vprasanja/TextController.php b/main/survey/app/Controllers/Vprasanja/TextController.php index 03c3fd3..ae0ca9d 100644 --- a/main/survey/app/Controllers/Vprasanja/TextController.php +++ b/main/survey/app/Controllers/Vprasanja/TextController.php @@ -21,6 +21,7 @@ use App\Controllers\LanguageController as Language; use App\Controllers\Vprasanja\SystemVariableController as SystemVariable;
use App\Models\Model;
use enkaParameters;
+use AppSettings;
class TextController extends Controller
{
@@ -229,7 +230,7 @@ class TextController extends Controller if ($naslov != '') $row1['naslov'] = $naslov;
# preverimo izbrano vrednost
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
# ugotovimo ali je na katerem gridu predhodno izbran missing
$is_missing = false;
@@ -272,19 +273,18 @@ class TextController extends Controller $first_missing_value = true;
foreach ($srv_grids AS $i => $srv_grid) {
- if ($srv_grid['other'] != 0)
- $grid_id = $srv_data_grid[$row1['id']]['grd_id'];
- else
- $grid_id = $srv_data_cache[$row1['id']][$i]['grd_id'];
+ if ($srv_grid['other'] != 0){
+ $grid_id = isset($srv_data_grid[$row1['id']]['grd_id']) ? $srv_data_grid[$row1['id']]['grd_id'] : '';
+ }
+ else{
+ $grid_id = isset($srv_data_cache[$row1['id']][$i]['grd_id']) ? $srv_data_cache[$row1['id']][$i]['grd_id'] : '';
+ }
$value = $srv_grid['id'];
$vsebina = '';
if ($grid_id == $value) {
-
$vsebina = $srv_data_cache[$row1['id']][$i]['text'];
-
- //$row2 = mysqli_fetch_array($sql2);
}
if ((string)$srv_grid['other'] != '0' && $first_missing_value == true) {
@@ -480,7 +480,6 @@ class TextController extends Controller ************************************************/
public function textbox($spremenljivka, $oblika)
{
- global $recaptcha_sitekey;
global $lang;
$row = Model::select_from_srv_spremenljivka($spremenljivka);
@@ -575,7 +574,7 @@ class TextController extends Controller $captcha = ($spremenljivkaParams->get('captcha') ? $spremenljivkaParams->get('captcha') : 0);
if ($captcha == 1) {
- echo '<div class="g-recaptcha" data-sitekey="' .$recaptcha_sitekey .'"></div>';
+ echo '<div class="g-recaptcha" data-sitekey="'.AppSettings::getInstance()->getSetting('google-recaptcha_sitekey').'"></div>';
}
else {
$char_counter_events = $limit ? 'charCounter(this);' : '';
@@ -583,12 +582,11 @@ class TextController extends Controller // Ce gre za email preverjamo pravilnost na blur in ne na keyup
$js_trigger = ($email_verify == 1) ? 'onBlur' : 'onKeyUp';
- echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '">';
if ($taSize > 1) {
echo '<textarea name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" '.($disabled_vprasanje ? ' disabled="disabled"' : '').' rows="' . $taSize . '" class="width_' . $input . '" onkeyup="checkBranching();'.$char_counter_events.'"' . (!$missing && !$disabled_vprasanje ? '' : ' disabled') . $max_text_length. '>' . (!$missing ? $row2['text'] : '') . '</textarea>';
} else {
- echo '<input type="text" name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" class="width_' . $input . '" '.($disabled_vprasanje ? ' disabled="disabled"' : '').' '.$js_trigger.'="checkBranching();'.$char_counter_events.'" value="' . (!$missing ? $row2['text'] : '') . '" ' . (!$missing && !$disabled_vprasanje ? '' : ' disabled') . $max_text_length. '>';
+ echo '<input type="text" name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" class="width_' . $input . '" '.($disabled_vprasanje ? ' disabled="disabled"' : '').' '.$js_trigger.'="checkBranching();'.$char_counter_events.'" value="' . (!$missing && isset($row2['text']) ? $row2['text'] : '') . '" ' . (!$missing && !$disabled_vprasanje ? '' : ' disabled') . $max_text_length. '>';
}
// Ce je vprasanje disabled moramo vseeno postati vrednost
@@ -602,6 +600,7 @@ class TextController extends Controller echo '<script>set_charCounter(\'spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '\');</script>';
}
+ echo '<label for="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '">';
echo '</label>';
}
@@ -632,9 +631,9 @@ class TextController extends Controller //***novo
- //$sqlSignature = sisplet_query("SELECT filename FROM srv_data_upload WHERE usr_id = '" . get('usr_id') . "'");
$sqlSignature = sisplet_query("SELECT filename FROM srv_data_upload WHERE usr_id = '" . get('usr_id') . "' AND code='" . $spremenljivka . "' ");
if (mysqli_num_rows($sqlSignature) > 0) {
+
$rowSignature = mysqli_fetch_array($sqlSignature);
$signaturefile = $rowSignature[0];
@@ -752,22 +751,24 @@ class TextController extends Controller <div id="canvas_' . $spremenljivka . '">
<div class="sig sigWrapper">
- <canvas width="'.$width.'" height="'.$height.'" style="border:1px solid black"></canvas>
+ <canvas width="'.$width.'" height="'.$height.'"></canvas>
</div>
</div>
<div id="podpis_slika_' . $spremenljivka . '" hidden>
<img src="' . self::$site_url . 'main/survey/uploads/' . $signaturefile . '" style="width: '.$width.'px; height: '.$height.'px; border:1px solid black">
</div>
- <div>
-
- <input id="clear_spremenljivka_' . $spremenljivka . '" type="button" value="' . self::$lang['srv_signature_clear'] . '" class="sig_clear_button" style="width: '.$width.'px;">
-
- <input id="signature-data_spremenljivka_' . $spremenljivka . '" type="text" value="" name="signature-data_spremenljivka_' . $spremenljivka . '" hidden><br />
+
+ <div class="sig_clear_button_wrapper">
+ <input id="clear_spremenljivka_' . $spremenljivka . '" type="button" value="' . self::$lang['srv_signature_clear'] . '" class="sig_clear_button" >
+
+ <input id="signature-data_spremenljivka_' . $spremenljivka . '" type="text" value="" name="signature-data_spremenljivka_' . $spremenljivka . '" hidden>
+ </div>
';
echo '
- ' . self::$lang['srv_signature_name'] . ' ' . '<input type="text" name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" ' . (!$missing ? '' : ' disabled') . '><br />
+ <div class="sig_input_wrapper">
+ ' . self::$lang['srv_signature_name'] . ' ' . '<input type="text" name="vrednost_' . $spremenljivka . '_kos_' . $row1['id'] . '" id="spremenljivka_' . $spremenljivka . '_vrednost_' . $i . '" ' . (!$missing ? '' : ' disabled') . '><br />
</div>
</div>
@@ -775,7 +776,7 @@ class TextController extends Controller }
// Smo v admin podatkih in uplodamo datoteko ali fotografijo
- elseif( ($row['upload'] == 1 || $row['upload'] == 2) && ($_GET['t'] == 'postprocess' || $_GET['m'] == 'quick_edit') ){
+ elseif( ($row['upload'] == 1 || $row['upload'] == 2) && ((isset($_GET['t']) && $_GET['t'] == 'postprocess') || (isset($_GET['m']) && $_GET['m'] == 'quick_edit')) ){
$sqlUpload = sisplet_query("SELECT filename FROM srv_data_upload WHERE usr_id='".get('usr_id')."' AND code='".$row2['text']."'");
@@ -937,7 +938,7 @@ class TextController extends Controller # missing vrednost
$_id = 'missing_value_spremenljivka_' . $spremenljivka . '_vrednost_' . $oKey;
- if ($srv_data_vrednost[$oKey]) {
+ if (isset($srv_data_vrednost[$oKey]) && $srv_data_vrednost[$oKey]) {
$sel = true;
} else {
$sel = false;
|