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
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
2020-01-20 20:06:53 +01:00
//Aggiunta utente per i tecnici
if ( in_array ( $id_tecnico , $tipi_anagrafica )) {
echo '
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi utente').' " data - href = " modules/utenti/user.php?id_module='.Modules::get('Utenti e permessi')['id'].'&id_record='. $dbo->fetchOne ('SELECT id FROM zz_groups WHERE nome= \ 'Tecnici \ '')['id'].'&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 '
2020-05-13 13:42:14 +02:00
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi attività').' " data - href = " add.php?id_module='.Modules::get('Interventi')['id'].'&idanagrafica='. $record['idanagrafica'] .' " >< i class = " fa fa-wrench " ></ i > '.tr(' Nuova attività ').'
2018-07-03 11:37:15 +02:00
</ a ></ li >
2019-11-19 15:39:59 +01:00
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi preventivo').' " data - href = " add.php?id_module='.Modules::get('Preventivi')['id'].'&idanagrafica='. $record['idanagrafica'] .' " >< i class = " fa fa-file-text " ></ i > '.tr(' Nuovo preventivo ').'
2018-07-03 11:37:15 +02:00
</ a ></ li >
2019-11-19 15:39:59 +01:00
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi contratto').' " data - href = " add.php?id_module='.Modules::get('Contratti')['id'].'&idanagrafica='. $record['idanagrafica'] .' " >< i class = " fa fa-file-text-o " ></ i > '.tr(' Nuovo contratto ').'
2018-07-03 11:37:15 +02:00
</ a ></ li >
2020-01-09 18:33:01 +01:00
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi ordine cliente').' " data - href = " add.php?id_module='.Modules::get('Ordini cliente')['id'].'&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
2020-01-09 18:33:01 +01:00
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi ddt uscita').' " data - href = " add.php?id_module='.Modules::get('Ddt di vendita')['id'].'&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
2020-01-09 18:33:01 +01:00
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi fattura di vendita').' " data - href = " add.php?id_module='.Modules::get('Fatture di vendita')['id'].'&idanagrafica='. $record['idanagrafica'] .' " >< i class = " fa fa-file " ></ i > '.tr(' Nuova fattura di vendita ').'
2020-11-02 14:36:53 +01:00
</ a ></ li >
2020-12-29 00:39:30 +01:00
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi registrazione contabile').' " data - href = " add.php?id_module='.Modules::get('Prima nota')['id'].'&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 )) {
2021-02-18 18:48:44 +01:00
echo '<li><a data-toggle="modal" data-title="' . tr ( 'Aggiungi ordine fornitore' ) . '" data-href="add.php?id_module=' . Modules :: get ( 'Ordini fornitore' )[ 'id' ] . '&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 >
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi ddt entrata').' " data - href = " add.php?id_module='.Modules::get('Ddt di acquisto')['id'].'&idanagrafica='. $record['idanagrafica'] .' " >< i class = " fa fa-truck fa-flip-horizontal " ></ i > '.tr(' Nuovo ddt in entrata ').'
</ a ></ li >
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi fattura di acquisto').' " data - href = " add.php?id_module='.Modules::get('Fatture di acquisto')['id'].'&idanagrafica='. $record['idanagrafica'] .' " >< i class = " fa fa-file fa-flip-horizontal " ></ i > '.tr(' Nuova fattura di acquisto ').'
2020-11-02 14:36:53 +01:00
</ a ></ li >
2020-12-29 00:39:30 +01:00
< li >< a data - toggle = " modal " data - title = " '.tr('Aggiungi registrazione contabile').' " data - href = " add.php?id_module='.Modules::get('Prima nota')['id'].'&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 )) {
2023-05-05 18:28:36 +02:00
//Aggiunta liquidazione provvigioni per agente
2023-08-04 14:54:28 +02:00
echo '
2023-05-11 16:38:19 +02:00
< 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
}