Fix stampa con php8.1
This commit is contained in:
parent
c8c5f59abf
commit
ec940b82f2
|
@ -49,15 +49,9 @@ class ButtonManager implements ManagerInterface
|
|||
protected function getInfo($options)
|
||||
{
|
||||
if ($options['type'] == 'print') {
|
||||
$print = PrintTemplate::find((new PrintTemplate())->getByField('title', $options['id']));
|
||||
|
||||
if (empty($print)) {
|
||||
$print = PrintTemplate::find($options['id']);
|
||||
}
|
||||
|
||||
if (!empty($print)) {
|
||||
$result = [
|
||||
'link' => \Prints::getHref($print, $options['id_record'], $options['parameters']),
|
||||
'link' => \Prints::getHref($options['id'], $options['id_record'], $options['parameters']),
|
||||
'title' => tr('Stampa').' '.((strtoupper($print->getTranslation('title')) == $print->getTranslation('title')) ? $print->getTranslation('title') : lcfirst($print->getTranslation('title'))),
|
||||
'icon' => $print->icon,
|
||||
];
|
||||
|
|
|
@ -207,7 +207,11 @@ class Prints
|
|||
*/
|
||||
public static function getHref($print, $id_record, $get = '')
|
||||
{
|
||||
$infos = $print;
|
||||
$infos = PrintTemplate::find((new PrintTemplate())->getByField('title', $print));
|
||||
|
||||
if (empty($infos)) {
|
||||
$infos = PrintTemplate::find($print);
|
||||
}
|
||||
|
||||
if (empty($infos)) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue