|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione |
| 5 | + * Copyright (C) DevCode s.r.l. |
| 6 | + * |
| 7 | + * This program is free software: you can redistribute it and/or modify |
| 8 | + * it under the terms of the GNU General Public License as published by |
| 9 | + * the Free Software Foundation, either version 3 of the License, or |
| 10 | + * (at your option) any later version. |
| 11 | + * |
| 12 | + * This program is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License |
| 18 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | + */ |
| 20 | + |
| 21 | +include_once __DIR__.'/../../core.php'; |
| 22 | + |
| 23 | +$assets_pretty = ''; |
| 24 | +if (!empty($record['assets'])) { |
| 25 | + $decoded = json_decode($record['assets'], true); |
| 26 | + if (is_array($decoded)) { |
| 27 | + $assets_pretty = json_encode($decoded, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
| 28 | + } else { |
| 29 | + $assets_pretty = $record['assets']; |
| 30 | + } |
| 31 | +} |
| 32 | +?> |
| 33 | +<form action="" method="post" id="edit-form"> |
| 34 | + <input type="hidden" name="op" value="update"> |
| 35 | + <input type="hidden" name="backto" value="record-edit"> |
| 36 | + |
| 37 | + <div class="row"> |
| 38 | + <div class="col-md-8"> |
| 39 | + <div class="card card-primary"> |
| 40 | + <div class="card-header"> |
| 41 | + <h3 class="card-title"><?php echo tr('Informazioni base'); ?></h3> |
| 42 | + </div> |
| 43 | + <div class="card-body"> |
| 44 | + <div class="row"> |
| 45 | + <div class="col-md-6"> |
| 46 | + {[ "type": "text", "label": "<?php echo tr('Nome interno'); ?>", "name": "name", "required": 1, "value": "$name$", "help": "<?php echo tr('Identificatore macchina univoco (slug). Usato come riferimento dai moduli consumer.'); ?>" ]} |
| 47 | + </div> |
| 48 | + <div class="col-md-6"> |
| 49 | + {[ "type": "text", "label": "<?php echo tr('Etichetta'); ?>", "name": "label", "required": 1, "value": "$label$" ]} |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + |
| 53 | + <div class="row"> |
| 54 | + <div class="col-md-12"> |
| 55 | + {[ "type": "text", "label": "<?php echo tr('Tooltip'); ?>", "name": "title", "value": "$title$" ]} |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + |
| 62 | + <div class="col-md-4"> |
| 63 | + <div class="card card-primary"> |
| 64 | + <div class="card-header"> |
| 65 | + <h3 class="card-title"><?php echo tr('Stato'); ?></h3> |
| 66 | + </div> |
| 67 | + <div class="card-body"> |
| 68 | + {[ "type": "checkbox", "label": "<?php echo tr('Abilitato'); ?>", "name": "enabled", "value": "$enabled$" ]} |
| 69 | + |
| 70 | + {[ "type": "number", "label": "<?php echo tr('Ordine'); ?>", "name": "order", "value": "$order$" ]} |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + </div> |
| 75 | + |
| 76 | + <div class="card card-primary"> |
| 77 | + <div class="card-header"> |
| 78 | + <h3 class="card-title"><?php echo tr('Comportamento'); ?></h3> |
| 79 | + </div> |
| 80 | + <div class="card-body"> |
| 81 | + <div class="row"> |
| 82 | + <div class="col-md-4"> |
| 83 | + {[ "type": "select", "label": "<?php echo tr('Tipo'); ?>", "name": "type", "required": 1, "value": "$type$", "values": "list=\"link\": \"<?php echo tr('Link URL'); ?>\", \"javascript\": \"<?php echo tr('JavaScript'); ?>\", \"module\": \"<?php echo tr('Modulo'); ?>\", \"plugin\": \"<?php echo tr('Plugin'); ?>\"" ]} |
| 84 | + </div> |
| 85 | + <div class="col-md-8"> |
| 86 | + {[ "type": "text", "label": "<?php echo tr('Valore'); ?>", "name": "value", "required": 1, "value": "$value$", "help": "<?php echo tr('Link: URL. JavaScript: nome funzione globale (regex ^[a-zA-Z_$][a-zA-Z0-9_$.]*$). Modulo/Plugin: nome registrato in zz_modules / zz_plugins.'); ?>" ]} |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + |
| 92 | + <div class="card card-primary"> |
| 93 | + <div class="card-header"> |
| 94 | + <h3 class="card-title"><?php echo tr('Aspetto'); ?></h3> |
| 95 | + </div> |
| 96 | + <div class="card-body"> |
| 97 | + <div class="row"> |
| 98 | + <div class="col-md-6"> |
| 99 | + {[ "type": "text", "label": "<?php echo tr('Icona'); ?>", "name": "icon", "value": "$icon$", "icon-after": "<i class=\"<?php echo addslashes((string) ($record['icon'] ?? '')); ?>\"></i>" ]} |
| 100 | + </div> |
| 101 | + <div class="col-md-6"> |
| 102 | + {[ "type": "select", "label": "<?php echo tr('Colore'); ?>", "name": "color", "value": "$color$", "values": "list=\"\": \"<?php echo tr('Nessuno'); ?>\", \"text-primary\": \"<?php echo tr('Primary'); ?>\", \"text-success\": \"<?php echo tr('Success'); ?>\", \"text-warning\": \"<?php echo tr('Warning'); ?>\", \"text-danger\": \"<?php echo tr('Danger'); ?>\", \"text-info\": \"<?php echo tr('Info'); ?>\", \"text-muted\": \"<?php echo tr('Muted'); ?>\"" ]} |
| 103 | + </div> |
| 104 | + </div> |
| 105 | + </div> |
| 106 | + </div> |
| 107 | + |
| 108 | + <div class="card card-primary"> |
| 109 | + <div class="card-header"> |
| 110 | + <h3 class="card-title"><?php echo tr('Struttura e permessi'); ?></h3> |
| 111 | + </div> |
| 112 | + <div class="card-body"> |
| 113 | + <div class="row"> |
| 114 | + <div class="col-md-6"> |
| 115 | + {[ "type": "select", "label": "<?php echo tr('Voce padre'); ?>", "name": "parent", "value": "$parent$", "values": "query=SELECT zz_links.id AS id, CONCAT(zz_links.name, ' (', COALESCE(zz_links_lang.label, ''), ')') AS descrizione FROM zz_links LEFT JOIN zz_links_lang ON (zz_links.id = zz_links_lang.id_record AND zz_links_lang.id_lang = <?php echo prepare(Models\Locale::getDefault()->id); ?>) WHERE zz_links.id != <?php echo (int) $id_record; ?> AND zz_links.parent IS NULL ORDER BY zz_links.name", "placeholder": "<?php echo tr('Top level'); ?>", "help": "<?php echo tr('Se valorizzato, voce appare come elemento di un dropdown.'); ?>" ]} |
| 116 | + </div> |
| 117 | + <div class="col-md-6"> |
| 118 | + {[ "type": "select", "label": "<?php echo tr('Modulo associato'); ?>", "name": "id_module", "value": "$id_module$", "values": "query=SELECT zz_modules.id AS id, COALESCE(zz_modules_lang.title, zz_modules.name) AS descrizione FROM zz_modules LEFT JOIN zz_modules_lang ON (zz_modules.id = zz_modules_lang.id_record AND zz_modules_lang.id_lang = <?php echo prepare(Models\Locale::getDefault()->id); ?>) WHERE zz_modules.enabled = 1 ORDER BY descrizione", "placeholder": "<?php echo tr('Nessuno'); ?>", "help": "<?php echo tr('Se valorizzato per type=link/javascript: voce visibile solo se utente ha permessi sul modulo. Determina anche directory per asset shorthand.'); ?>" ]} |
| 119 | + </div> |
| 120 | + </div> |
| 121 | + </div> |
| 122 | + </div> |
| 123 | + |
| 124 | + <div class="card card-primary"> |
| 125 | + <div class="card-header"> |
| 126 | + <h3 class="card-title"><?php echo tr('Asset JS'); ?></h3> |
| 127 | + </div> |
| 128 | + <div class="card-body"> |
| 129 | + <div class="row"> |
| 130 | + <div class="col-md-12"> |
| 131 | + {[ "type": "textarea", "label": "<?php echo tr('Lista asset (JSON array)'); ?>", "name": "assets", "value": "<?php echo addslashes($assets_pretty); ?>", "rows": "5", "help": "<?php echo tr('Esempio: [\"file.js\", \"modules/altro/assets/dist/js/x.js\"]. Shorthand (solo filename) richiede modulo associato e cerca in modules/{dir}/assets/dist/js/. Path con / è interpretato da OSM root (cross-module).'); ?>" ]} |
| 132 | + </div> |
| 133 | + </div> |
| 134 | + </div> |
| 135 | + </div> |
| 136 | +</form> |
| 137 | + |
| 138 | +<a class="btn btn-danger ask" data-backto="record-list"> |
| 139 | + <i class="fa fa-trash"></i> <?php echo tr('Elimina'); ?> |
| 140 | +</a> |
0 commit comments