Fix per php8.1
This commit is contained in:
parent
fc495377d6
commit
8ffe852c19
|
@ -52,8 +52,20 @@ switch (post('op')) {
|
||||||
$template->setTranslation('body', post('body'));
|
$template->setTranslation('body', post('body'));
|
||||||
$template->save();
|
$template->save();
|
||||||
|
|
||||||
$dbo->sync('em_print_template', ['id_template' => $id_record], ['id_print' => (array) post('prints')]);
|
$prints[] = post('prints');
|
||||||
$dbo->sync('em_mansioni_template', ['id_template' => $id_record], ['idmansione' => (array) post('idmansioni')]);
|
|
||||||
|
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!'));
|
flash()->info(tr('Informazioni salvate correttamente!'));
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ use Modules\Newsletter\Newsletter;
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
if (isset($id_record)) {
|
if (!empty($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');
|
$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);
|
$template = Template::find($id_record);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ use Modules\Newsletter\Newsletter;
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
if (isset($id_record)) {
|
if (!empty(($id_record))) {
|
||||||
$newsletter = Newsletter::find($id_record);
|
$newsletter = Newsletter::find($id_record);
|
||||||
|
|
||||||
$record = $newsletter->toArray();
|
$record = $newsletter->toArray();
|
||||||
|
|
Loading…
Reference in New Issue