. */ include_once __DIR__.'/../../core.php'; $google = setting('Google Maps API key'); /* if (!empty($google)) { echo ' '; } */ echo '
{[ "type": "text", "label": "'.tr('Nome sede').'", "name": "nomesede", "required": 1, "value": "$nomesede$" ]}
{[ "type": "text", "label": "'.tr('Indirizzo').'", "name": "indirizzo", "id": "indirizzo_", "required": 0, "value": "$indirizzo$" ]}
{[ "type": "text", "label": "'.($record['tipo_anagrafica'] == 'Ente pubblico' ? tr('Codice unico ufficio') : tr('Codice destinatario')).'", "name": "codice_destinatario", "required": 0, "class": "text-center text-uppercase alphanumeric-mask", "value": "$codice_destinatario$", "maxlength": '.($record['tipo_anagrafica'] == 'Ente pubblico' ? '6' : '7').', "extra": "'.(empty($record['tipo_anagrafica']) || $record['tipo_anagrafica'] == 'Privato' ? 'disabled' : '').'", "help": "'.tr('Attenzione: per impostare il codice specificare prima \'Tipologia\' e \'Nazione\' dell\'anagrafica:
  • Ente pubblico (B2G/PA) - Codice Univoco Ufficio (www.indicepa.gov.it), 6 caratteri
  • Azienda (B2B) - Codice Destinatario, 7 caratteri
  • Privato (B2C) - viene utilizzato il Codice Fiscale
').'", "readonly": "'.intval($record['iso2'] != 'IT').'" ]}
{[ "type": "text", "label": "'.tr('Città').'", "name": "citta", "id": "citta_", "value": "$citta$", "required": 1 ]}
{[ "type": "text", "label": "'.tr('C.A.P.').'", "name": "cap", "value": "$cap$" ]}
{[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "value": "$provincia$", "maxlength": 2, "class": "text-center provincia-mask text-uppercase", "extra": "onkeyup=\"this.value = this.value.toUpperCase();\"" ]}
{[ "type": "number", "label": "'.tr('Km').'", "name": "km", "value": "$km$" ]}
{[ "type": "select", "label": "'.tr('Nazione').'", "name": "id_nazione", "value": "$id_nazione$", "ajax-source": "nazioni" ]}
{[ "type": "text", "label": "'.tr('Telefono').'", "name": "telefono", "value": "$telefono$" ]}
{[ "type": "text", "label": "'.tr('Fax').'", "name": "fax", "value": "$fax$" ]}
{[ "type": "text", "label": "'.tr('Cellulare').'", "name": "cellulare", "value": "$cellulare$" ]}
{[ "type": "text", "label": "'.tr('Indirizzo email').'", "name": "email", "value": "$email$" ]}
{[ "type": "select", "label": "'.tr('Zona').'", "name": "idzona", "ajax-source": "zone", "value": "$idzona$", "placeholder": "'.tr('Nessuna zona').'", "icon-after": "add|'.Modules::get('Zone')['id'].'" ]}
{[ "type": "textarea", "label": "'.tr('Note').'", "name": "note", "value": "$note$" ]}
'; if (!empty($google)) { echo '
{[ "type": "text", "label": "'.tr('Indirizzo Google').'", "name": "gaddress", "value": "$gaddress$", "extra": "data-geo=\'formatted_address\'" ]}
{[ "type": "text", "label": "'.tr('Latitudine').'", "name": "lat", "id": "lat_", "value": "$lat$", "extra": "data-geo=\'lat\'", "class": "text-right" ]}
{[ "type": "text", "label": "'.tr('Longitudine').'", "name": "lng", "id": "lng_", "value": "$lng$", "extra": "data-geo=\'lng\'", "class": "text-right" ]}
'; // Vedi su google maps if (!empty($record['indirizzo']) || (empty($record['citta']))) { echo '

   '; echo '
'; } echo '
'; if (!empty($record['gaddress']) || (!empty($record['lat']) && !empty($record['lng']))) { echo '

'; } } else { echo '
'.Modules::link('Impostazioni', null, tr('Per abilitare la visualizzazione delle anagrafiche nella mappa, inserire la Google Maps API Key nella scheda Impostazioni'), true, null, true, null, '&search=Google Maps API key').'.
'; } // Permetto eliminazione tipo sede solo se non è utilizzata da nessun'altra parte nel gestionale $elementi = $dbo->fetchArray('SELECT `zz_user_sede`.`id_utente` AS `id` FROM `zz_user_sede` WHERE `zz_user_sede`.`id_sede` = '.prepare($id_record).' UNION SELECT `an_referenti`.`id` AS `id` FROM `an_referenti` WHERE `an_referenti`.`idsede` = '.prepare($id_record).' UNION SELECT `co_documenti`.`id` AS `id` FROM `co_documenti` WHERE `co_documenti`.`idsede_destinazione` = '.prepare($id_record).' ORDER BY `id`'); if (!empty($elementi)) { echo '
'.tr('Ci sono _NUM_ documenti collegati', [ '_NUM_' => count($elementi), ]).'.
'; $disabled = 'disabled'; } echo '
'; echo ' ';