Skip to content

Commit c591a48

Browse files
committed
fix(form): broken add target form
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent e53d055 commit c591a48

File tree

2 files changed

+38
-35
lines changed

2 files changed

+38
-35
lines changed

ajax/target.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* ---------------------------------------------------------------------
4+
* Formcreator is a plugin which allows creation of custom forms of
5+
* easy access.
6+
* ---------------------------------------------------------------------
7+
* LICENSE
8+
*
9+
* This file is part of Formcreator.
10+
*
11+
* Formcreator is free software; you can redistribute it and/or modify
12+
* it under the terms of the GNU General Public License as published by
13+
* the Free Software Foundation; either version 2 of the License, or
14+
* (at your option) any later version.
15+
*
16+
* Formcreator is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
* GNU General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU General Public License
22+
* along with Formcreator. If not, see <http://www.gnu.org/licenses/>.
23+
* ---------------------------------------------------------------------
24+
* @author Thierry Bugier
25+
* @author Jérémy Moreau
26+
* @copyright Copyright © 2011 - 2019 Teclib'
27+
* @license http://www.gnu.org/licenses/gpl.txt GPLv3+
28+
* @link https://github.com/pluginsGLPI/formcreator/
29+
* @link https://pluginsglpi.github.io/formcreator/
30+
* @link http://plugins.glpi-project.org/#/plugin/formcreator
31+
* ---------------------------------------------------------------------
32+
*/
33+
34+
include ('../../../inc/includes.php');
35+
Session::checkRight('entity', UPDATE);
36+
37+
$target = new PluginFormcreatorForm();
38+
$target->showAddTargetForm();

inc/form.class.php

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,41 +1864,6 @@ public function showImportForm() {
18641864
}
18651865
}
18661866

1867-
/**
1868-
* Show form to add a new target
1869-
*
1870-
* @return void
1871-
*/
1872-
public function showAdTargetForm() {
1873-
echo '<form name="form_target" method="post" action="'.static::getFormURL().'">';
1874-
echo '<table class="tab_cadre_fixe">';
1875-
1876-
echo '<tr><th colspan="4">'.__('Add a destination', 'formcreator').'</th></tr>';
1877-
1878-
echo '<tr class="line1">';
1879-
echo '<td width="15%"><strong>'.__('Name').' <span style="color:red;">*</span></strong></td>';
1880-
echo '<td width="40%"><input type="text" name="name" style="width:100%;" value="" /></td>';
1881-
echo '<td width="15%"><strong>'._n('Type', 'Types', 1).' <span style="color:red;">*</span></strong></td>';
1882-
echo '<td width="30%">';
1883-
$typeNames = [];
1884-
foreach ($this->getTargetTypes() as $targetType) {
1885-
$typeNames[$targetType] = $targetType::getTypeName();
1886-
}
1887-
Dropdown::showFromArray('itemtype', $typeNames);
1888-
echo '</td>';
1889-
echo '</tr>';
1890-
1891-
echo '<tr class="line0">';
1892-
echo '<td colspan="4" class="center">';
1893-
echo '<input type="hidden" name="plugin_formcreator_forms_id" value="'.(int) $_REQUEST['form_id'].'" />';
1894-
echo '<input type="submit" name="add" class="submit_button" value="'.__('Add').'" />';
1895-
echo '</td>';
1896-
echo '</tr>';
1897-
1898-
echo '</table>';
1899-
Html::closeForm();
1900-
}
1901-
19021867
/**
19031868
* Process import of json file(s) sended by the submit of self::showImportForm
19041869
* @param array $params GET/POST data that need to contain the filename(s) in _json_file key

0 commit comments

Comments
 (0)