diff --git a/actions.php b/actions.php index 5cb366333..468dac157 100755 --- a/actions.php +++ b/actions.php @@ -67,7 +67,7 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') { $upload = Uploads::upload($_FILES['upload'], [ 'name' => filter('nome_allegato'), 'category' => filter('categoria'), - 'id_module' => (new Module())->getByField('name', 'Gestione documentale', \Models\Locale::getPredefined()->id), + 'id_module' => (new Module())->getByField('name', 'Gestione documentale', Models\Locale::getPredefined()->id), 'id_record' => $id_record, ]); diff --git a/core.php b/core.php index e46d85078..ab5e726ea 100755 --- a/core.php +++ b/core.php @@ -308,7 +308,7 @@ if (database()->tableExists('zz_settings') && database()->tableExists('zz_langs' $id_lang = setting('Lingua'); Models\Locale::setDefault($id_lang); Models\Locale::setPredefined(); - + $lang = Models\Locale::find($id_lang)->language_code; $translator->setLocale($lang, $formatter); } diff --git a/cron.php b/cron.php index 9c996089f..8b208f67b 100644 --- a/cron.php +++ b/cron.php @@ -61,13 +61,13 @@ $handler->setFormatter($formatter); $logger->pushHandler($handler); // Lettura della cache -$ultima_esecuzione = Cache::find((new Cache())->getByField('name', 'Ultima esecuzione del cron', \Models\Locale::getPredefined()->id)); +$ultima_esecuzione = Cache::find((new Cache())->getByField('name', 'Ultima esecuzione del cron', Models\Locale::getPredefined()->id)); $data = $ultima_esecuzione->content; -$in_esecuzione = Cache::find((new Cache())->getByField('name', 'Cron in esecuzione', \Models\Locale::getPredefined()->id)); -$cron_id = Cache::find((new Cache())->getByField('name', 'ID del cron', \Models\Locale::getPredefined()->id)); +$in_esecuzione = Cache::find((new Cache())->getByField('name', 'Cron in esecuzione', Models\Locale::getPredefined()->id)); +$cron_id = Cache::find((new Cache())->getByField('name', 'ID del cron', Models\Locale::getPredefined()->id)); -$disattiva = Cache::find((new Cache())->getByField('name', 'Disabilita cron', \Models\Locale::getPredefined()->id)); +$disattiva = Cache::find((new Cache())->getByField('name', 'Disabilita cron', Models\Locale::getPredefined()->id)); if ($disattiva->content || (in_array($_SERVER['HTTP_HOST'], ['localhost', '127.0.0.1']) && !$forza_cron_localhost)) { return; } diff --git a/editor.php b/editor.php index 06fdac6d1..1c95d4ca8 100755 --- a/editor.php +++ b/editor.php @@ -173,7 +173,7 @@ if (empty($record) || !$has_access) { {( "name": "button", "type": "email", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}'; - if (Module::find((new Module())->getByField('name', 'Account SMS', \Models\Locale::getPredefined()->id))) { + if (Module::find((new Module())->getByField('name', 'Account SMS', Models\Locale::getPredefined()->id))) { echo ' {( "name": "button", "type": "sms", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}'; } diff --git a/include/common/importa.php b/include/common/importa.php index 5cd204480..5d7ca751a 100755 --- a/include/common/importa.php +++ b/include/common/importa.php @@ -93,7 +93,7 @@ if (!empty($options['create_document'])) { // Opzioni aggiuntive per le Fatture if (in_array($final_module->getTranslation('name'), ['Fatture di vendita', 'Fatture di acquisto'])) { - $stato_predefinito = (new StatoFattura())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id); + $stato_predefinito = (new StatoFattura())->getByField('name', 'Bozza', Models\Locale::getPredefined()->id); if (!empty($options['reversed'])) { $idtipodocumento = database()->fetchOne('SELECT `co_tipidocumento`.`id` FROM `co_tipidocumento` LEFT JOIN `co_tipidocumento_lang` ON (`co_tipidocumento_lang`.`id_record` = `co_tipidocumento`.`id` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `name` = "Nota di credito" AND `dir` = \''.$dir.'\'')['id']; @@ -131,7 +131,7 @@ if (!empty($options['create_document'])) { // Opzioni aggiuntive per i Contratti elseif ($final_module->getTranslation('name') == 'Contratti') { - $stato_predefinito = (new StatoContratto())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id); + $stato_predefinito = (new StatoContratto())->getByField('name', 'Bozza', Models\Locale::getPredefined()->id); echo '
@@ -141,7 +141,7 @@ if (!empty($options['create_document'])) { // Opzioni aggiuntive per i DDT elseif (in_array($final_module->getTranslation('name'), ['Ddt di vendita', 'Ddt di acquisto'])) { - $stato_predefinito = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id); + $stato_predefinito = (new Stato())->getByField('name', 'Bozza', Models\Locale::getPredefined()->id); echo '
@@ -149,13 +149,13 @@ if (!empty($options['create_document'])) {
- {[ "type": "select", "label": "'.tr('Causale trasporto').'", "name": "id_causale_trasporto", "required": 1, "ajax-source": "causali", "icon-after": "add|'.(new Module())->getByField('name', 'Causali', \Models\Locale::getPredefined()->id).'", "help": "'.tr('Definisce la causale del trasporto').'" ]} + {[ "type": "select", "label": "'.tr('Causale trasporto').'", "name": "id_causale_trasporto", "required": 1, "ajax-source": "causali", "icon-after": "add|'.(new Module())->getByField('name', 'Causali', Models\Locale::getPredefined()->id).'", "help": "'.tr('Definisce la causale del trasporto').'" ]}
'; } // Opzioni aggiuntive per gli Ordini elseif (in_array($final_module->getTranslation('name'), ['Ordini cliente', 'Ordini fornitore'])) { - $stato_predefinito = (new StatoOrdine())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id); + $stato_predefinito = (new StatoOrdine())->getByField('name', 'Bozza', Models\Locale::getPredefined()->id); echo '
@@ -170,7 +170,7 @@ if (!empty($options['create_document'])) { echo '
- {[ "type": "select", "label": "'.$tipo_anagrafica.'", "name": "idanagrafica", "required": 1, "ajax-source": "'.$ajax.'", "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id).'|tipoanagrafica='.$tipo_anagrafica.'" ]} + {[ "type": "select", "label": "'.$tipo_anagrafica.'", "name": "idanagrafica", "required": 1, "ajax-source": "'.$ajax.'", "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', Models\Locale::getPredefined()->id).'|tipoanagrafica='.$tipo_anagrafica.'" ]}
'; } diff --git a/include/common/riga.php b/include/common/riga.php index d77c7d234..4bbb1d5df 100755 --- a/include/common/riga.php +++ b/include/common/riga.php @@ -45,7 +45,7 @@ echo ' // Unità di misura echo '
- {[ "type": "select", "label": "'.tr('Unità di misura').'", "icon-after": "add|'.(new Module())->getByField('name', 'Unità di misura', \Models\Locale::getPredefined()->id).'", "name": "um", "value": "'.$result['um'].'", "ajax-source": "misure" ]} + {[ "type": "select", "label": "'.tr('Unità di misura').'", "icon-after": "add|'.(new Module())->getByField('name', 'Unità di misura', Models\Locale::getPredefined()->id).'", "name": "um", "value": "'.$result['um'].'", "ajax-source": "misure" ]}
'; // Unità di misura diff --git a/include/init/init.php b/include/init/init.php index 24dc3a440..e5475af21 100755 --- a/include/init/init.php +++ b/include/init/init.php @@ -72,7 +72,7 @@ if (post('action') == 'init') { // Azienda predefinita if (!$has_azienda) { Filter::set('post', 'op', 'add'); - $id_module = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id); + $id_module = (new Module())->getByField('name', 'Anagrafiche', Models\Locale::getPredefined()->id); include base_dir().'/modules/anagrafiche/actions.php'; // Logo stampe @@ -172,7 +172,7 @@ if (!$has_azienda) {
'; - $idtipoanagrafica = (new Tipo())->getByField('name', 'Azienda', \Models\Locale::getPredefined()->id); + $idtipoanagrafica = (new Tipo())->getByField('name', 'Azienda', Models\Locale::getPredefined()->id); $readonly_tipo = true; ob_start(); diff --git a/include/riferimenti/riferimenti.php b/include/riferimenti/riferimenti.php index a7343b151..7f0e10719 100644 --- a/include/riferimenti/riferimenti.php +++ b/include/riferimenti/riferimenti.php @@ -54,7 +54,7 @@ $direzione_richiesta = $source->getDocument()->direzione == 'entrata' ? 'uscita' // Individuazione DDT disponibili $ddt = DDT::whereHas('stato', function ($query) { - $id_stato = (new StatoDDT())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id); + $id_stato = (new StatoDDT())->getByField('name', 'Bozza', Models\Locale::getPredefined()->id); $query->where('id', '!=', $id_stato); })->whereHas('tipo', function ($query) use ($direzione_richiesta) { $query->where('dir', '=', $direzione_richiesta); @@ -70,7 +70,7 @@ foreach ($ddt as $elemento) { // Individuazione ordini disponibili $tipo_ordini = $direzione_richiesta == 'entrata' ? 'cliente' : 'fornitore'; $ordini = Ordine::whereHas('stato', function ($query) { - $id_stato = (new StatoOrdine())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id); + $id_stato = (new StatoOrdine())->getByField('name', 'Bozza', Models\Locale::getPredefined()->id); $query->where('id', '!=', $id_stato); })->whereHas('tipo', function ($query) use ($direzione_richiesta) { $query->where('dir', '=', $direzione_richiesta); diff --git a/include/top.php b/include/top.php index 92c012506..e2b4e99ab 100755 --- a/include/top.php +++ b/include/top.php @@ -238,7 +238,7 @@ if (Auth::check()) { { name: "tools", items : [ "Maximize", "ShowBlocks" ] }, { name: "about", items: [ "About" ] } ], - order_manager_id: "'.($dbo->isInstalled() ? (new Module())->getByField('name', 'Stato dei servizi', \Models\Locale::getPredefined()->id) : '').'", + order_manager_id: "'.($dbo->isInstalled() ? (new Module())->getByField('name', 'Stato dei servizi', Models\Locale::getPredefined()->id) : '').'", dataload_page_buffer: '.setting('Lunghezza in pagine del buffer Datatables').', tempo_attesa_ricerche: '.setting('Tempo di attesa ricerche in secondi').', restrict_summables_to_selected: '.setting('Totali delle tabelle ristretti alla selezione').', diff --git a/mail.php b/mail.php index a131cb9e5..bd971c592 100755 --- a/mail.php +++ b/mail.php @@ -164,7 +164,7 @@ if ($smtp['pec'] == 1 && $module->getTranslation('name') == 'Fatture di vendita' echo '
- {[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "uploads[]", "value": "'.implode(',', $uploads).'", "help": "'.tr('Allegati del documento o caricati nell\'anagrafica dell\'azienda.').'", "values": "query=SELECT `id`, `name` AS text FROM `zz_files` WHERE `id_module` = '.prepare($id_module).' AND `id_record` = '.prepare($id_record).' UNION SELECT `id`, CONCAT(`name`, \' (Azienda)\') AS text FROM `zz_files` WHERE `id_module` = '.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id).' AND `id_record` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \'Azienda predefinita\')", "link": "allegato" ]} + {[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "uploads[]", "value": "'.implode(',', $uploads).'", "help": "'.tr('Allegati del documento o caricati nell\'anagrafica dell\'azienda.').'", "values": "query=SELECT `id`, `name` AS text FROM `zz_files` WHERE `id_module` = '.prepare($id_module).' AND `id_record` = '.prepare($id_record).' UNION SELECT `id`, CONCAT(`name`, \' (Azienda)\') AS text FROM `zz_files` WHERE `id_module` = '.(new Module())->getByField('name', 'Anagrafiche', Models\Locale::getPredefined()->id).' AND `id_record` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \'Azienda predefinita\')", "link": "allegato" ]}
'; diff --git a/modules/aggiornamenti/actions.php b/modules/aggiornamenti/actions.php index d8f612793..a6c2044a2 100755 --- a/modules/aggiornamenti/actions.php +++ b/modules/aggiornamenti/actions.php @@ -39,7 +39,7 @@ switch (filter('op')) { } // Salvataggio della versione nella cache - Cache::find((new Cache())->getByField('name', 'Ultima esecuzione del cron', \Models\Locale::getPredefined()->id))->set($versione); + Cache::find((new Cache())->getByField('name', 'Ultima esecuzione del cron', Models\Locale::getPredefined()->id))->set($versione); echo $versione; break; diff --git a/modules/anagrafiche/add.php b/modules/anagrafiche/add.php index 742a7c742..f948b828c 100755 --- a/modules/anagrafiche/add.php +++ b/modules/anagrafiche/add.php @@ -21,7 +21,7 @@ use Modules\Anagrafiche\Nazione; include_once __DIR__.'/../../core.php'; -$id_nazione_italia = (new Nazione())->getByField('name', 'Italia', \Models\Locale::getPredefined()->id); +$id_nazione_italia = (new Nazione())->getByField('name', 'Italia', Models\Locale::getPredefined()->id); $tipo = get('tipoanagrafica'); if (!empty($tipo)) { $rs = $dbo->fetchArray('SELECT `an_tipianagrafiche`.`id`, `an_tipianagrafiche_lang`.`name` as descrizione FROM `an_tipianagrafiche` LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche`.`id` = `an_tipianagrafiche_lang`.`id_record` AND `an_tipianagrafiche_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `name`='.prepare($tipo)); diff --git a/modules/anagrafiche/ajax/search.php b/modules/anagrafiche/ajax/search.php index 3547bb447..b1f545805 100755 --- a/modules/anagrafiche/ajax/search.php +++ b/modules/anagrafiche/ajax/search.php @@ -24,7 +24,7 @@ use Models\Module; Anagrafiche */ -$link_id = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id); +$link_id = (new Module())->getByField('name', 'Anagrafiche', Models\Locale::getPredefined()->id); $fields = [ 'Codice' => 'codice', diff --git a/modules/anagrafiche/ajax/select.php b/modules/anagrafiche/ajax/select.php index a2988fce3..1d461e94d 100755 --- a/modules/anagrafiche/ajax/select.php +++ b/modules/anagrafiche/ajax/select.php @@ -66,7 +66,7 @@ switch ($resource) { $filter[] = '`an_anagrafiche`.`idanagrafica`='.prepare($element); } - $where[] = "`an_tipianagrafiche`.`id`= ".prepare($tipologia); + $where[] = '`an_tipianagrafiche`.`id`= '.prepare($tipologia); if (empty($filter)) { $where[] = '`an_anagrafiche`.`deleted_at` IS NULL'; @@ -131,7 +131,7 @@ switch ($resource) { } if (empty($filter)) { - $where[] = "`an_tipianagrafiche`.`id`= ".prepare($tipologia); + $where[] = '`an_tipianagrafiche`.`id`= '.prepare($tipologia); $where[] = '`an_anagrafiche`.`deleted_at` IS NULL'; } @@ -155,7 +155,7 @@ switch ($resource) { $filter[] = '`an_anagrafiche`.`idanagrafica`='.prepare($element); } - $where[] = "`an_tipianagrafiche`.`id`= ".prepare($tipologia); + $where[] = '`an_tipianagrafiche`.`id`= '.prepare($tipologia); if (empty($filter)) { $where[] = '`an_anagrafiche`.`deleted_at` IS NULL'; } @@ -184,7 +184,7 @@ switch ($resource) { $filter[] = '`an_anagrafiche`.`idanagrafica`='.prepare($element); } - $where[] = "`an_tipianagrafiche`.`id`= ".prepare($tipologia); + $where[] = '`an_tipianagrafiche`.`id`= '.prepare($tipologia); if (empty($filter)) { $where[] = '`an_anagrafiche`.`deleted_at` IS NULL'; } @@ -224,7 +224,7 @@ switch ($resource) { $filter[] = '`an_anagrafiche`.`idanagrafica`='.prepare($element); } - $where[] = "`an_tipianagrafiche`.`id`= ".prepare($tipologia); + $where[] = '`an_tipianagrafiche`.`id`= '.prepare($tipologia); if (empty($filter)) { $where[] = '`an_anagrafiche`.`deleted_at` IS NULL'; @@ -263,7 +263,7 @@ switch ($resource) { $where = []; if (empty($filter)) { $where[] = '`an_anagrafiche`.`deleted_at` IS NULL'; - $where[] = "`an_tipianagrafiche`.`id` IN (".prepare($id_azienda).", ".prepare($id_fornitore).", ".prepare($id_cliente).")"; + $where[] = '`an_tipianagrafiche`.`id` IN ('.prepare($id_azienda).', '.prepare($id_fornitore).', '.prepare($id_cliente).')'; } if (!empty($search)) { diff --git a/modules/anagrafiche/buttons.php b/modules/anagrafiche/buttons.php index 40de5fed3..e58916b3c 100755 --- a/modules/anagrafiche/buttons.php +++ b/modules/anagrafiche/buttons.php @@ -32,45 +32,45 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana // Aggiunta utente per i tecnici if (in_array($id_tecnico, $tipi_anagrafica)) { echo ' -
  • '.tr('Nuovo utente').' +
  • '.tr('Nuovo utente').'
  • '; } if (in_array($id_cliente, $tipi_anagrafica)) { echo ' -
  • '.tr('Nuova attività').' +
  • '.tr('Nuova attività').'
  • -
  • '.tr('Nuovo preventivo').' +
  • '.tr('Nuovo preventivo').'
  • -
  • '.tr('Nuovo contratto').' +
  • '.tr('Nuovo contratto').'
  • -
  • '.tr('Nuovo ordine cliente').' +
  • '.tr('Nuovo ordine cliente').'
  • -
  • '.tr('Nuovo ddt in uscita').' +
  • '.tr('Nuovo ddt in uscita').'
  • -
  • '.tr('Nuova fattura di vendita').' +
  • '.tr('Nuova fattura di vendita').'
  • -
  • '.tr('Nuova registrazione contabile (cliente)').' +
  • '.tr('Nuova registrazione contabile (cliente)').'
  • '; } if (in_array($id_fornitore, $tipi_anagrafica)) { - echo '
  • '.tr('Nuovo ordine fornitore').' + echo '
  • '.tr('Nuovo ordine fornitore').'
  • -
  • '.tr('Nuovo ddt in entrata').' +
  • '.tr('Nuovo ddt in entrata').'
  • -
  • '.tr('Nuova fattura di acquisto').' +
  • '.tr('Nuova fattura di acquisto').'
  • -
  • '.tr('Nuova registrazione contabile (fornitore)').' +
  • '.tr('Nuova registrazione contabile (fornitore)').'
  • '; } diff --git a/modules/anagrafiche/edit.php b/modules/anagrafiche/edit.php index 1c3f7c067..71bd5385f 100755 --- a/modules/anagrafiche/edit.php +++ b/modules/anagrafiche/edit.php @@ -32,9 +32,9 @@ $is_agente = in_array($id_agente, $tipi_anagrafica); $is_azienda = in_array($id_azienda, $tipi_anagrafica); if (!$is_cliente && !$is_fornitore && !$is_azienda && $is_tecnico) { - $ignore = Plugin::where('id', '=', (new Plugin())->getByField('name', 'Sedi', \Models\Locale::getPredefined()->id)) - ->orWhere('id', '=', (new Plugin())->getByField('name', 'Referenti', \Models\Locale::getPredefined()->id)) - ->orWhere('id', '=', (new Plugin())->getByField('name', 'Dichiarazioni d\'intento', \Models\Locale::getPredefined()->id)) + $ignore = Plugin::where('id', '=', (new Plugin())->getByField('name', 'Sedi', Models\Locale::getPredefined()->id)) + ->orWhere('id', '=', (new Plugin())->getByField('name', 'Referenti', Models\Locale::getPredefined()->id)) + ->orWhere('id', '=', (new Plugin())->getByField('name', 'Dichiarazioni d\'intento', Models\Locale::getPredefined()->id)) ->get(); foreach ($ignore as $plugin) { @@ -46,9 +46,9 @@ if (!$is_cliente && !$is_fornitore && !$is_azienda && $is_tecnico) { } if (!$is_cliente) { - $ignore = Plugin::where('id', '=', (new Plugin())->getByField('name', 'Impianti del cliente', \Models\Locale::getPredefined()->id)) - ->orWhere('id', '=', (new Plugin())->getByField('name', 'Contratti del cliente', \Models\Locale::getPredefined()->id)) - ->orWhere('id', '=', (new Plugin())->getByField('name', 'Ddt del cliente', \Models\Locale::getPredefined()->id)) + $ignore = Plugin::where('id', '=', (new Plugin())->getByField('name', 'Impianti del cliente', Models\Locale::getPredefined()->id)) + ->orWhere('id', '=', (new Plugin())->getByField('name', 'Contratti del cliente', Models\Locale::getPredefined()->id)) + ->orWhere('id', '=', (new Plugin())->getByField('name', 'Ddt del cliente', Models\Locale::getPredefined()->id)) ->get(); foreach ($ignore as $plugin) { @@ -231,7 +231,7 @@ if (in_array($id_azienda, $tipi_anagrafica)) {
    - {[ "type": "select", "label": "", "name": "idzona", "values": "query=SELECT id, CONCAT_WS( ' - ', nome, descrizione) AS descrizione FROM an_zone ORDER BY descrizione ASC", "value": "$idzona$", "placeholder": "", "icon-after": "add|getByField('name', 'Zone', \Models\Locale::getPredefined()->id); ?>" ]} + {[ "type": "select", "label": "", "name": "idzona", "values": "query=SELECT id, CONCAT_WS( ' - ', nome, descrizione) AS descrizione FROM an_zone ORDER BY descrizione ASC", "value": "$idzona$", "placeholder": "", "icon-after": "add|getByField('name', 'Zone', Models\Locale::getPredefined()->id); ?>" ]}
    @@ -460,7 +460,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
    - {[ "type": "select", "label": "'.tr('Relazione').'", "name": "idrelazione", "ajax-source": "relazioni", "value": "$idrelazione$", "icon-after": "add|'.(new Module())->getByField('name', 'Relazioni', \Models\Locale::getPredefined()->id).'" ]} + {[ "type": "select", "label": "'.tr('Relazione').'", "name": "idrelazione", "ajax-source": "relazioni", "value": "$idrelazione$", "icon-after": "add|'.(new Module())->getByField('name', 'Relazioni', Models\Locale::getPredefined()->id).'" ]}
    @@ -476,7 +476,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) { $banca_predefinita = $banche->first(function ($item) { return !empty($item['predefined']); }); - $modulo_banche = (new Module())->getByField('name', 'Banche', \Models\Locale::getPredefined()->id); + $modulo_banche = (new Module())->getByField('name', 'Banche', Models\Locale::getPredefined()->id); if (!$banche->isEmpty()) { echo '
    @@ -505,7 +505,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
    - {[ "type": "select", "label": "'.tr('Provenienza cliente').'", "name": "id_provenienza", "ajax-source": "provenienze", "value": "$id_provenienza$", "icon-after": "add|'.(new Module())->getByField('name', 'Provenienze', \Models\Locale::getPredefined()->id).'" ]} + {[ "type": "select", "label": "'.tr('Provenienza cliente').'", "name": "id_provenienza", "ajax-source": "provenienze", "value": "$id_provenienza$", "icon-after": "add|'.(new Module())->getByField('name', 'Provenienze', Models\Locale::getPredefined()->id).'" ]}
    @@ -695,7 +695,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
    - {[ "type": "select", "label": "", "name": "id_settore", "ajax-source": "settori", "value": "$id_settore$", "icon-after": "add|getByField('name', 'Settori', \Models\Locale::getPredefined()->id); ?>" ]} + {[ "type": "select", "label": "", "name": "id_settore", "ajax-source": "settori", "value": "$id_settore$", "icon-after": "add|getByField('name', 'Settori', Models\Locale::getPredefined()->id); ?>" ]}
    diff --git a/modules/anagrafiche/liquida_provvigioni.php b/modules/anagrafiche/liquida_provvigioni.php index c59cdf48c..a275b2eac 100644 --- a/modules/anagrafiche/liquida_provvigioni.php +++ b/modules/anagrafiche/liquida_provvigioni.php @@ -27,7 +27,7 @@ $id_record = filter('id_record'); $dir = filter('dir'); $nome_stampa = filter('nome_stampa'); $id_print = (new PrintTemplate())->getByField('name', $nome_stampa); -$id_module = (new Module())->getByField('name', 'Stampe contabili', \Models\Locale::getPredefined()->id); +$id_module = (new Module())->getByField('name', 'Stampe contabili', Models\Locale::getPredefined()->id); $year = (new Carbon($_SESSION['period_end']))->format('Y'); diff --git a/modules/anagrafiche/plugins/allegati.php b/modules/anagrafiche/plugins/allegati.php index db04bbad4..dc76748ed 100755 --- a/modules/anagrafiche/plugins/allegati.php +++ b/modules/anagrafiche/plugins/allegati.php @@ -60,53 +60,53 @@ if (empty($_GET['visualizza_allegati'])) { } // Interventi dell'anagrafica - if ($user->is_admin || in_array((new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id), $permessi)) { - $interventi = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id))." AS id_module, `id` AS id_record, CONCAT('Intervento num. ',codice,' del ',DATE_FORMAT(`data_richiesta`,'%d/%m/%Y')) AS descrizione FROM `in_interventi` WHERE `idanagrafica`=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Interventi', Models\Locale::getPredefined()->id), $permessi)) { + $interventi = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Interventi', Models\Locale::getPredefined()->id))." AS id_module, `id` AS id_record, CONCAT('Intervento num. ',codice,' del ',DATE_FORMAT(`data_richiesta`,'%d/%m/%Y')) AS descrizione FROM `in_interventi` WHERE `idanagrafica`=".prepare($id_record)); $documenti = array_merge($documenti, $interventi); } // Preventivi dell'anagrafica - if ($user->is_admin || in_array((new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id), $permessi)) { - $preventivi = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_preventivi WHERE idanagrafica=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Preventivi', Models\Locale::getPredefined()->id), $permessi)) { + $preventivi = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Preventivi', Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_preventivi WHERE idanagrafica=".prepare($id_record)); $documenti = array_merge($documenti, $preventivi); } // Contratti dell'anagrafica - if ($user->is_admin || in_array((new Module())->getByField('name', 'Contratti', \Models\Locale::getPredefined()->id), $permessi)) { - $contratti = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Contratti', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_contratti WHERE idanagrafica=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Contratti', Models\Locale::getPredefined()->id), $permessi)) { + $contratti = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Contratti', Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_contratti WHERE idanagrafica=".prepare($id_record)); $documenti = array_merge($documenti, $contratti); } // DDT dell'anagrafica - if ($user->is_admin || in_array((new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::getPredefined()->id), $permessi)) { - $ddt_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ddt di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Ddt di vendita', Models\Locale::getPredefined()->id), $permessi)) { + $ddt_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ddt di vendita', Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ddt di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record)); $documenti = array_merge($documenti, $ddt_vendita); } - if ($user->is_admin || in_array((new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::getPredefined()->id), $permessi)) { - $ddt_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ddt di acquisto num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Ddt di acquisto', Models\Locale::getPredefined()->id), $permessi)) { + $ddt_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ddt di acquisto', Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ddt di acquisto num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record)); $documenti = array_merge($documenti, $ddt_acquisto); } // Fatture dell'anagrafica - if ($user->is_admin || in_array((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id), $permessi)) { - $fatture_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Fattura di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Fatture di vendita', Models\Locale::getPredefined()->id), $permessi)) { + $fatture_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Fatture di vendita', Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Fattura di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record)); $documenti = array_merge($documenti, $fatture_vendita); } - if ($user->is_admin || in_array((new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::getPredefined()->id), $permessi)) { - $fatture_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Fattura di acquisto num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Fatture di acquisto', Models\Locale::getPredefined()->id), $permessi)) { + $fatture_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Fatture di acquisto', Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Fattura di acquisto num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record)); $documenti = array_merge($documenti, $fatture_acquisto); } // Ordini dell'anagrafica - if ($user->is_admin || in_array((new Module())->getByField('name', 'Ordini cliente', \Models\Locale::getPredefined()->id), $permessi)) { - $ordini_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ordini cliente', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ordine cliente num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Ordini cliente', Models\Locale::getPredefined()->id), $permessi)) { + $ordini_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ordini cliente', Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ordine cliente num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record)); $documenti = array_merge($documenti, $ordini_vendita); } - if ($user->is_admin || in_array((new Module())->getByField('name', 'Ordini fornitore', \Models\Locale::getPredefined()->id), $permessi)) { - $ordini_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ordini fornitore', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ordine fornitore num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record)); + if ($user->is_admin || in_array((new Module())->getByField('name', 'Ordini fornitore', Models\Locale::getPredefined()->id), $permessi)) { + $ordini_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ordini fornitore', Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ordine fornitore num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record)); $documenti = array_merge($documenti, $ordini_acquisto); } diff --git a/modules/articoli/add.php b/modules/articoli/add.php index 59a3bf0f3..3548bbe53 100755 --- a/modules/articoli/add.php +++ b/modules/articoli/add.php @@ -46,11 +46,11 @@ $aliquota_predefinita = floatval(Aliquota::find($iva_predefinita)->percentuale);
    - {[ "type": "select", "label": "", "name": "categoria", "required": 0, "ajax-source": "categorie", "icon-after": "add|getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id); ?>" ]} + {[ "type": "select", "label": "", "name": "categoria", "required": 0, "ajax-source": "categorie", "icon-after": "add|getByField('name', 'Categorie articoli', Models\Locale::getPredefined()->id); ?>" ]}
    - {[ "type": "select", "label": "", "name": "subcategoria", "id": "subcategoria_add", "ajax-source": "sottocategorie", "icon-after": "add|getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id); ?>||hide" ]} + {[ "type": "select", "label": "", "name": "subcategoria", "id": "subcategoria_add", "ajax-source": "sottocategorie", "icon-after": "add|getByField('name', 'Categorie articoli', Models\Locale::getPredefined()->id); ?>||hide" ]}
    @@ -104,7 +104,7 @@ $aliquota_predefinita = floatval(Aliquota::find($iva_predefinita)->percentuale);
    - {[ "type": "select", "label": "", "name": "um", "value": "", "ajax-source": "misure", "icon-after": "add|getByField('name', 'Unità di misura articoli', \Models\Locale::getPredefined()->id); ?>" ]} + {[ "type": "select", "label": "", "name": "um", "value": "", "ajax-source": "misure", "icon-after": "add|getByField('name', 'Unità di misura articoli', Models\Locale::getPredefined()->id); ?>" ]}
    {[ "type": "select", "label": "", "name": "um_secondaria", "value": "", "ajax-source": "misure", "help": "" ]} diff --git a/modules/articoli/ajax/search.php b/modules/articoli/ajax/search.php index 06368c51a..dfd5bf467 100755 --- a/modules/articoli/ajax/search.php +++ b/modules/articoli/ajax/search.php @@ -20,7 +20,7 @@ include_once __DIR__.'/../../../core.php'; use Models\Module; -$link_id = (new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id); +$link_id = (new Module())->getByField('name', 'Articoli', Models\Locale::getPredefined()->id); $prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA'); $show_prezzi = Auth::user()['gruppo'] != 'Tecnici' || (Auth::user()['gruppo'] == 'Tecnici' && setting('Mostra i prezzi al tecnico')); diff --git a/modules/articoli/bulk.php b/modules/articoli/bulk.php index 941562d4a..c7a3b0fe9 100755 --- a/modules/articoli/bulk.php +++ b/modules/articoli/bulk.php @@ -31,7 +31,7 @@ use Plugins\ListinoClienti\DettaglioPrezzo; include_once __DIR__.'/../../core.php'; // Segmenti -$id_preventivi = (new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id); +$id_preventivi = (new Module())->getByField('name', 'Preventivi', Models\Locale::getPredefined()->id); $id_segment = $_SESSION['module_'.$id_preventivi]['id_segment']; switch (post('op')) { diff --git a/modules/articoli/edit.php b/modules/articoli/edit.php index 48d74c55c..761d259b2 100755 --- a/modules/articoli/edit.php +++ b/modules/articoli/edit.php @@ -53,11 +53,11 @@ use Modules\Iva\Aliquota;
    - {[ "type": "select", "label": "", "name": "categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id); ?>" ]} + {[ "type": "select", "label": "", "name": "categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|getByField('name', 'Categorie articoli', Models\Locale::getPredefined()->id); ?>" ]}
    - {[ "type": "select", "label": "", "name": "subcategoria", "value": "$id_sottocategoria$", "ajax-source": "sottocategorie", "select-options": $record['id_categoria']]); ?>, "icon-after": "add|getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id); ?>|id_original=" ]} + {[ "type": "select", "label": "", "name": "subcategoria", "value": "$id_sottocategoria$", "ajax-source": "sottocategorie", "select-options": $record['id_categoria']]); ?>, "icon-after": "add|getByField('name', 'Categorie articoli', Models\Locale::getPredefined()->id); ?>|id_original=" ]}
    @@ -86,7 +86,7 @@ use Modules\Iva\Aliquota;
    - {[ "type": "select", "label": "", "name": "um", "value": "$um$", "ajax-source": "misure", "icon-after": "add|getByField('name', 'Unità di misura', \Models\Locale::getPredefined()->id); ?>" ]} + {[ "type": "select", "label": "", "name": "um", "value": "$um$", "ajax-source": "misure", "icon-after": "add|getByField('name', 'Unità di misura', Models\Locale::getPredefined()->id); ?>" ]}
    diff --git a/modules/articoli/plugins/articoli.movimenti.php b/modules/articoli/plugins/articoli.movimenti.php index 77d9c5255..473af72fd 100755 --- a/modules/articoli/plugins/articoli.movimenti.php +++ b/modules/articoli/plugins/articoli.movimenti.php @@ -49,7 +49,7 @@ echo '
    '; echo ' - + '.tr('Movimenta articolo').' '; @@ -69,7 +69,7 @@ if (empty($_GET['movimentazione_completa'])) { } echo ' - + '.tr('Visualizza dettagli').' '; diff --git a/modules/automezzi/add_articolo.php b/modules/automezzi/add_articolo.php index dddb3d45b..680b9ed1f 100644 --- a/modules/automezzi/add_articolo.php +++ b/modules/automezzi/add_articolo.php @@ -17,7 +17,7 @@ if (!empty($idarticolo) && !empty($idautomezzo)) { Form di inserimento riga documento */ echo ' -