Skip to content

Commit

Permalink
feat: drop layout : no longer exists in GLPI 10
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jan 26, 2022
1 parent 604416d commit b4f7089
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
7 changes: 0 additions & 7 deletions front/issue.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
Html::redirect($CFG_GLPI['root_doc']."/front/helpdesk.public.php");
}

// force layout of glpi
PluginFormcreatorCommon::saveLayout();
$_SESSION['glpilayout'] = "lefttab";

/** @var PluginFormcreatorIssue $issue */
$issue = PluginFormcreatorIssue::getById((int) $_REQUEST['id']);

Expand Down Expand Up @@ -91,7 +87,6 @@
} else {
Html::header($header);
}
PluginFormcreatorCommon::restoreLayout();
Html::displayNotFoundError();
}

Expand All @@ -100,5 +95,3 @@
} else {
Html::footer();
}

PluginFormcreatorCommon::restoreLayout();
8 changes: 0 additions & 8 deletions inc/common.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,14 +598,6 @@ public static function checkRegex($regex) {
return $isValid;
}

public static function saveLayout() {
$_SESSION['plugin_formcreator']['layout_backup'] = $_SESSION['glpilayout'];
}

public static function restoreLayout() {
$_SESSION['glpilayout'] = $_SESSION['plugin_formcreator']['layout_backup'] ?? $_SESSION['glpilayout'];
}

/**
* Find documents data matching the tags found in the string
* Tags are deduplicated
Expand Down
12 changes: 0 additions & 12 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,10 @@ public function displayExtended($options = []) {
}
$itemtype = $this->fields['itemtype'];
if (!class_exists($itemtype)) {
PluginFormcreatorCommon::restoreLayout();
Html::displayNotFoundError();
}
$item = new $itemtype();
if (!$item->getFromDB($this->fields['items_id'])) {
PluginFormcreatorCommon::restoreLayout();
Html::displayNotFoundError();
}

Expand Down Expand Up @@ -321,7 +319,6 @@ public function displayExtended($options = []) {
$this->showNavigationHeader($options);

if (!$item->canViewItem()) {
PluginFormcreatorCommon::restoreLayout();
Html::displayNotFoundError();
}

Expand All @@ -337,12 +334,10 @@ public function displaySimplified($options = []) {
}
$itemtype = $this->fields['itemtype'];
if (!class_exists($itemtype)) {
PluginFormcreatorCommon::restoreLayout();
Html::displayNotFoundError();
}
$item = new $itemtype();
if (!$item->getFromDB($this->fields['items_id'])) {
PluginFormcreatorCommon::restoreLayout();
Html::displayNotFoundError();
}

Expand Down Expand Up @@ -398,10 +393,6 @@ public function displaySimplified($options = []) {
}
unset($options['_item']);

// force recall of ticket in layout
PluginFormcreatorCommon::saveLayout();
$_SESSION['glpilayout'] = "lefttab";

if ($item instanceof Ticket) {
//Tickets without form associated or single ticket for an answer
$satisfaction = new TicketSatisfaction();
Expand All @@ -428,9 +419,6 @@ public function displaySimplified($options = []) {
$item->showTabsContent($options);
echo '</div>';
}

// restore layout
PluginFormcreatorCommon::restoreLayout();
}

/**
Expand Down

0 comments on commit b4f7089

Please sign in to comment.