Files
dolibarr/htdocs/webportal/controllers/abstractcard.controller.class.php
kkhelifa-opendsi 548bb94e4f NEW: Rework of the management of the card and fields on the web portal (#36076)
* NEW: Rework of the management of the card and fields on the web portal

* Correction pre-commit check

* Correction affichage logo login

* Ajout hook

* Ajout params fonction FormWebPortal::convertAllLink()

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction travis

* Correction travis

* Correction travis

* Correction travis

* Correction

* Fix get options of sellist by AJAX in webportal scope

* Correction pre-commit

* Correction pre-commit

* Add hook and change hook name for viewImage controller

* Correction phan

* Corrections

* Corrections
2025-11-19 15:14:53 +01:00

77 lines
2.1 KiB
PHP

<?php
/* Copyright (C) 2023-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2023-2024 Lionel Vessiller <lvessiller@easya.solutions>
*
* 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/>.
*/
require_once __DIR__ . '/../class/controller.class.php';
/**
* \file htdocs/webportal/controllers/abstractcard.controller.class.php
* \ingroup webportal
* \brief This file is an abstract controller with shared logic to display a card
*/
/**
* Class for AbstractCardController
*/
abstract class AbstractCardController extends Controller
{
/**
* @var FormCardWebPortal Form for card
*/
public $formCard;
/**
* Display
*
* @return void
*/
public function display()
{
$context = Context::getInstance();
if (!$context->controllerInstance->checkAccess()) {
$this->display404();
return;
}
$this->loadTemplate('header');
if (empty($this->formCard->modal)) {
$this->loadTemplate('menu');
$this->loadTemplate('hero-header-banner');
}
// @phpstan-ignore-next-line
if (isset($this->formCard)) {
$hookRes = $this->hookPrintPageView();
if (empty($hookRes)) {
print '<main class="container">';
if ($this->formCard->object->id > 0) {
if ($this->formCard->action == 'edit' && $this->formCard->permissiontoadd) {
$this->loadTemplate('card-edit');
} else {
$this->loadTemplate('card-view');
}
}
print '</main>';
}
} else {
$this->loadTemplate('404');
}
$this->loadTemplate('footer');
}
}