openstamanager/modules/anagrafiche/buttons.php

87 lines
5.4 KiB
PHP
Raw Normal View History

2018-07-03 11:37:15 +02:00
<?php
2020-09-07 15:04:06 +02:00
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
2021-01-20 15:08:51 +01:00
* Copyright (C) DevCode s.r.l.
2020-09-07 15:04:06 +02:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2020-02-05 14:51:39 +01:00
2024-03-12 16:39:34 +01:00
use Models\Group;
2024-03-22 15:52:24 +01:00
use Models\Module;
2024-03-05 16:01:45 +01:00
2020-01-11 13:36:43 +01:00
if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_anagrafica)) {
2018-07-03 11:37:15 +02:00
echo '
<div class="btn-group">
2019-11-19 15:39:59 +01:00
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-magic"></i>
2019-11-19 16:01:43 +01:00
'.tr('Crea').'... <span class="caret"></span>
2018-07-03 11:37:15 +02:00
<span class="sr-only">Toggle Dropdown</span>
</button>
2020-01-09 18:33:01 +01:00
<ul class="dropdown-menu dropdown-menu-right">';
2018-07-03 11:37:15 +02:00
2024-01-15 15:30:45 +01:00
// Aggiunta utente per i tecnici
if (in_array($id_tecnico, $tipi_anagrafica)) {
echo '
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi utente').'" data-href="modules/utenti/user.php?id_module='.(new Module())->getByField('name', 'Utenti e permessi')->id_record.'&id_record='.(new Group())->getByField('name', 'Tecnici').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-user"></i>'.tr('Nuovo utente').'
</a></li>';
}
2020-01-11 13:36:43 +01:00
if (in_array($id_cliente, $tipi_anagrafica)) {
echo '
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi attività').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Interventi').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-wrench"></i>'.tr('Nuova attività').'
2018-07-03 11:37:15 +02:00
</a></li>
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi preventivo').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Preventivi').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-text"></i>'.tr('Nuovo preventivo').'
2018-07-03 11:37:15 +02:00
</a></li>
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi contratto').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Contratti').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-text-o"></i>'.tr('Nuovo contratto').'
2018-07-03 11:37:15 +02:00
</a></li>
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ordine cliente').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ordini cliente').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-o"></i>'.tr('Nuovo ordine cliente').'
2018-07-03 11:37:15 +02:00
</a></li>
2018-07-18 15:20:10 +02:00
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ddt uscita').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ddt di vendita').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-truck"></i>'.tr('Nuovo ddt in uscita').'
2018-07-05 17:23:21 +02:00
</a></li>
2018-07-03 11:37:15 +02:00
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di vendita').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Fatture di vendita').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file"></i>'.tr('Nuova fattura di vendita').'
</a></li>
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Prima nota').'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (cliente)').'
2020-01-09 18:33:01 +01:00
</a></li>';
2020-01-11 13:36:43 +01:00
}
2020-01-09 18:33:01 +01:00
2020-01-11 13:36:43 +01:00
if (in_array($id_fornitore, $tipi_anagrafica)) {
2024-03-20 11:13:28 +01:00
echo '<li><a data-toggle="modal" data-title="'.tr('Aggiungi ordine fornitore').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ordini fornitore').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-o fa-flip-horizontal"></i>'.tr('Nuovo ordine fornitore').'
2020-01-09 18:33:01 +01:00
</a></li>
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ddt entrata').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ddt di acquisto').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-truck fa-flip-horizontal"></i>'.tr('Nuovo ddt in entrata').'
2020-01-09 18:33:01 +01:00
</a></li>
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di acquisto').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Fatture di acquisto').'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file fa-flip-horizontal"></i>'.tr('Nuova fattura di acquisto').'
</a></li>
2024-03-20 11:13:28 +01:00
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Prima nota').'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (fornitore)').'
2020-01-09 18:33:01 +01:00
</a></li>';
2020-01-11 13:36:43 +01:00
}
2020-01-09 18:33:01 +01:00
2020-01-11 13:36:43 +01:00
echo '
2018-07-03 11:37:15 +02:00
</ul>
</div>';
2023-08-04 14:54:28 +02:00
}
2023-05-11 16:38:19 +02:00
if (in_array($id_agente, $tipi_anagrafica)) {
2024-01-15 15:30:45 +01:00
// Aggiunta liquidazione provvigioni per agente
2023-08-04 14:54:28 +02:00
echo '
<button type="button" class="btn btn-primary" data-title="'.tr('Liquida Provvigioni').'" data-href="'.base_path().'/modules/anagrafiche/liquida_provvigioni.php?nome_stampa=Provvigioni&id_record='.$id_record.'" ><i class="fa fa-print"></i> '.tr('Liquida Provvigioni').'</button>';
2018-07-03 11:37:15 +02:00
}