* Copyright (C) 2024 Frédéric France * * 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 . */ /** * @var Conf $conf * @var DoliDB $db * @var Translate $langs * * @var string $element * @var int $element_id * @var string $mode * @var string $resource_type * @var array,mandatory:int<0,1>}> $linked_resources */ // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) { print "Error, template page can't be called as URL"; exit(1); } ' @phan-var-force string $element @phan-var-force int $element_id @phan-var-force string $resource_type @phan-var-force array,mandatory:int<0,1>}> $linked_resources '; $form = new Form($db); print '
'; print '
'; print '
'; print '
'.$langs->trans('Resource').'
'; print '
'.$langs->trans('Type').'
'; print '
'.$langs->trans('Busy').'
'; print '
'.$langs->trans('Mandatory').'
'; print '
'; print '
'; print ''; print ''; print ''; print ''; if ((array) $linked_resources && count($linked_resources) > 0) { foreach ($linked_resources as $linked_resource) { $object_resource = fetchObjectByElement($linked_resource['resource_id'], $linked_resource['resource_type']); //$element_id = $linked_resource['rowid']; if ($mode == 'edit' && $linked_resource['rowid'] == GETPOSTINT('lineid')) { print '
'; print ''; print ''; print ''; print '
'.$object_resource->getNomUrl(1).'
'; print '
'.$object_resource->type_label.'
'; print '
'.$form->selectyesno('busy', $linked_resource['busy'] ? 1 : 0, 1).'
'; print '
'.$form->selectyesno('mandatory', $linked_resource['mandatory'] ? 1 : 0, 1).'
'; print '
'; print '
'; } else { $class = ''; if ($linked_resource['rowid'] == GETPOSTINT('lineid')) { $class = 'highlight'; } print '
'; print '
'; print $object_resource->getNomUrl(1); print '
'; print '
'; print $object_resource->type_label; print '
'; print '
'; print yn($linked_resource['busy']); print '
'; print '
'; print yn($linked_resource['mandatory']); print '
'; print ''; print '
'; } } } else { print '
'; print '
'.$langs->trans('NoResourceLinked').'
'; print '
'; print '
'; print '
'; print '
'; print '
'; } print '
'; print '
'; ?>