openstamanager/modules/scadenzario/bulk.php

69 lines
2.3 KiB
PHP
Raw Normal View History

2019-07-25 15:06:07 +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/>.
*/
2019-07-25 15:06:07 +02:00
include_once __DIR__.'/../../core.php';
switch (post('op')) {
case 'change_distinta':
$distinta = post('distinta');
$n_scadenze = 0;
foreach ($id_records as $id) {
$database->update('co_scadenziario', [
'distinta' => $distinta,
], ['id' => $id]);
++$n_scadenze;
}
if ($n_scadenze > 0) {
flash()->info(tr('Distinta aggiornata a _NUM_ scadenze!', [
'_NUM_' => $n_scadenze,
]));
} else {
flash()->warning(tr('Nessuna scadenza modificata!'));
}
break;
}
2019-07-25 15:06:07 +02:00
$operations['registrazione-contabile'] = [
'text' => '<span><i class="fa fa-calculator"></i> '.tr('Registrazione contabile').'</span>',
'data' => [
'title' => tr('Registrazione contabile'),
'type' => 'modal',
'origine' => 'scadenzario',
'url' => base_path().'/add.php?id_module='.Modules::get('Prima nota')['id'],
2019-07-25 15:06:07 +02:00
],
];
$operations['change_distinta'] = [
'text' => '<span><i class="fa fa-refresh"></i> '.tr('Aggiorna distinta'),
'data' => [
'title' => tr('Aggiornare la distinta per le scadenze selezionate?'),
'msg' => tr('Per ciascuna scadenza selezionata verrà aggiornata la distinta').'.<br>
<br>{[ "type": "text", "label": "'.tr('Distinta').'", "name": "distinta", "required": 1 ]}',
'button' => tr('Procedi'),
'class' => 'btn btn-lg btn-warning',
'blank' => false,
],
];
2019-07-25 15:06:07 +02:00
return $operations;