Fix selezione colori #1102

This commit is contained in:
Pek5892 2022-11-08 15:07:51 +01:00
parent 7816c45dac
commit 9b22b07dcf
16 changed files with 21 additions and 31 deletions

View File

@ -612,7 +612,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
<div class="tab-pane'.(!$is_cliente && !$is_fornitore && $is_tecnico ? ' active' : '').''.(!$is_tecnico ? ' hide' : '').'" id="tecnico">
<div class="row">
<div class="col-md-6">
{[ "type": "text", "label": "'.tr('Colore').'", "name": "colore", "id": "colore_t", "class": "colorpicker text-center", "value": "$colore$", "maxlength": "7", "icon-after": "<div class=\'img-circle square\'></div>" ]}
{[ "type": "text", "label": "'.tr('Colore').'", "name": "colore", "id": "colore_t", "class": "colorpicker text-center", "value": "$colore$", "maxlength": "30", "icon-after": "<div class=\'img-circle square\'></div>" ]}
</div>
</div>
</div>';

View File

@ -44,7 +44,7 @@ if (isset($id_original)) {
</div>
<div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength=\"7\"", "icon-after": "<div class=\"img-circle square\"></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength=\"30\"", "icon-after": "<div class=\"img-circle square\"></div>" ]}
</div>
</div>

View File

@ -36,7 +36,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -35,7 +35,7 @@ if (isset($id_record)) {
</div>
<div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength=\"7\"", "icon-after": "<div class=\"img-circle square\"></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength=\"30\"", "icon-after": "<div class=\"img-circle square\"></div>" ]}
</div>
</div>

View File

@ -36,7 +36,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -29,7 +29,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-3">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -36,7 +36,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-3">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -33,7 +33,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-3">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -40,7 +40,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-3">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -36,12 +36,3 @@ include_once __DIR__.'/../../core.php';
</div>
</div>
</form>
<script>
$(document).ready( function() {
$('.colorpicker').colorpicker().on('changeColor', function() {
$('#colore').parent().find('.square').css( 'background', $('#colore').val() );
});
$('#colore').parent().find('.square').css( 'background', $('#colore').val() );
});
</script>

View File

@ -61,12 +61,3 @@ if (!empty($righe)) {
}
?>
<script>
$(document).ready( function() {
$('.colorpicker').colorpicker().on('changeColor', function() {
$('#colore').parent().find('.square').css( 'background', $('#colore').val() );
});
$('#colore').parent().find('.square').css( 'background', $('#colore').val() );
});
</script>

View File

@ -33,7 +33,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-3">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "required": 1, "class": "colorpicker text-center", "value": "#ffffff", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "id": "colore_", "required": 1, "class": "colorpicker text-center", "value": "#ffffff", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -43,7 +43,7 @@ if ($record['can_delete']) {
</div>
<div class="col-md-3">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -29,7 +29,7 @@ include_once __DIR__.'/../../core.php';
</div>
<div class="col-md-3">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
</div>

View File

@ -42,7 +42,7 @@ if ($record['can_delete']) {
</div>
<div class="col-md-2">
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "<div class='img-circle square'></div>" ]}
{[ "type": "text", "label": "<?php echo tr('Colore'); ?>", "name": "colore", "required": 1, "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='30'", "icon-after": "<div class='img-circle square'></div>" ]}
</div>
<div class="col-md-3">

8
update/2_4_38.sql Normal file
View File

@ -0,0 +1,8 @@
--
ALTER TABLE `an_anagrafiche` CHANGE `colore` `colore` VARCHAR(30) NOT NULL DEFAULT '#FFFFFF';
ALTER TABLE `mg_categorie` CHANGE `colore` `colore` VARCHAR(30) NOT NULL;
ALTER TABLE `my_impianti_categorie` CHANGE `colore` `colore` VARCHAR(30) NOT NULL;
ALTER TABLE `an_provenienze` CHANGE `colore` `colore` VARCHAR(30) NOT NULL;
ALTER TABLE `an_relazioni` CHANGE `colore` `colore` VARCHAR(30) NOT NULL;
ALTER TABLE `in_statiintervento` CHANGE `colore` `colore` VARCHAR(30) NOT NULL DEFAULT '#FFFFFF';
ALTER TABLE `co_statipreventivi` CHANGE `colore` `colore` VARCHAR(30) NOT NULL;