Fix per php8.1
This commit is contained in:
parent
fc495377d6
commit
8ffe852c19
|
@ -52,9 +52,21 @@ switch (post('op')) {
|
|||
$template->setTranslation('body', post('body'));
|
||||
$template->save();
|
||||
|
||||
$dbo->sync('em_print_template', ['id_template' => $id_record], ['id_print' => (array) post('prints')]);
|
||||
$dbo->sync('em_mansioni_template', ['id_template' => $id_record], ['idmansione' => (array) post('idmansioni')]);
|
||||
$prints[] = post('prints');
|
||||
|
||||
foreach ($prints as $print) {
|
||||
if (!empty($print)) {
|
||||
$dbo->sync('em_print_template', ['id_template' => $id_record], ['id_print' => $print]);
|
||||
}
|
||||
}
|
||||
|
||||
$mansioni[] = post('idmansioni');
|
||||
foreach ($mansioni as $mansione) {
|
||||
if (!empty($mansione)) {
|
||||
$dbo->sync('em_mansioni_template', ['id_template' => $id_record], ['idmansione' => $mansione]);
|
||||
}
|
||||
}
|
||||
|
||||
flash()->info(tr('Informazioni salvate correttamente!'));
|
||||
|
||||
break;
|
||||
|
|
|
@ -22,8 +22,8 @@ use Modules\Newsletter\Newsletter;
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (isset($id_record)) {
|
||||
$record = $dbo->fetchOne('SELECT * FROM em_templates LEFT JOIN `em_templates_lang` ON (`em_templates`.`id` = `em_templates_lang`.`id_record` AND `em_templates_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `em_templates`.`id`='.prepare($id_record).' AND `deleted_at` IS NULL');
|
||||
if (!empty($id_record)) {
|
||||
$record = $dbo->fetchOne('SELECT `em_templates`.*, `em_templates_lang`.`name` FROM `em_templates` LEFT JOIN `em_templates_lang` ON (`em_templates`.`id` = `em_templates_lang`.`id_record` AND `em_templates_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `em_templates`.`id`='.prepare($id_record).' AND `deleted_at` IS NULL');
|
||||
|
||||
$template = Template::find($id_record);
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ use Modules\Newsletter\Newsletter;
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (isset($id_record)) {
|
||||
if (!empty(($id_record))) {
|
||||
$newsletter = Newsletter::find($id_record);
|
||||
|
||||
$record = $newsletter->toArray();
|
||||
|
|
Loading…
Reference in New Issue