Html::back(); } } } else { if (isset($_POST["undo_second_step"])) { // Set default value... $values['target'] = Toolbox::getItemTypeFormURL('PluginResourcesWizard'); $values['withtemplate'] = 0; $values['new'] = 0; $resource->wizardSecondForm($_POST["plugin_resources_resources_id"], $values); } else { if (isset($_POST["third_step"])) { if (isset($_POST['id']) && $_POST['id'] > 0) { $employee->update($_POST); } else { $newid = $employee->add($_POST); } $wizard_need = PluginResourcesContractType::checkWizardSetup($_POST["plugin_resources_resources_id"], "use_need_wizard"); $wizard_picture = PluginResourcesContractType::checkWizardSetup($_POST["plugin_resources_resources_id"], "use_picture_wizard"); if ($wizard_need) { $choice->wizardFourForm($_POST["plugin_resources_resources_id"]); } elseif ($wizard_picture) { $values = array(); $values['target'] = Toolbox::getItemTypeFormURL('PluginResourcesWizard'); $resource->wizardFiveForm($_POST["plugin_resources_resources_id"], $values); } else { $resource->fields['plugin_resources_resources_id'] = $_POST['plugin_resources_resources_id']; $resource->fields['resources_step'] = 'third_step'; Plugin::doHook('item_show', $resource); $resource->redirectToList(); }
This file is part of Resources. Resources 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 2 of the License, or (at your option) any later version. Resources 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 Resources. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include '../../../inc/includes.php'; //from helpdesk Html::helpHeader(PluginResourcesResource::getTypeName(2)); $employee = new PluginResourcesEmployee(); //add employee informations from helpdesk //next step : show list needs of the new ressource if (isset($_POST["add_helpdesk_employee"])) { $newID = $employee->add($_POST); Html::redirect("./resource_item.list.php?id=" . $_POST["plugin_resources_resources_id"] . "&exist=0"); } else { //show form employee informations from helpdesk $employee->showFormHelpdesk($_GET["id"], 0); } Html::helpFooter();
$_POST["users_id_recipient"] = Session::getLoginUserID(); $_POST["date_declaration"] = $_SESSION["glpi_currenttime"]; //add resources $newID = $resource->add($_POST); if ($newID) { //add link with User $opt["plugin_resources_resources_id"] = $newID; $opt["items_id"] = $User->fields["id"]; $opt["itemtype"] = 'User'; $resource_item->addItem($opt); //add employee $values["plugin_resources_resources_id"] = $newID; $values["plugin_resources_employers_id"] = $_POST["plugin_resources_employers_id"]; $values["plugin_resources_clients_id"] = $_POST["plugin_resources_clients_id"]; $values["is_template"] = 0; $employee->add($values); } } Html::back(); //from central //add employee informations from user details form or resource form } else { if (isset($_POST["addemployee"])) { if ($_POST['plugin_resources_resources_id'] > 0) { if ($employee->canCreate()) { $values["plugin_resources_resources_id"] = $_POST["plugin_resources_resources_id"]; $values["plugin_resources_employers_id"] = $_POST["plugin_resources_employers_id"]; $values["plugin_resources_clients_id"] = $_POST["plugin_resources_clients_id"]; $newID = $employee->add($values); } }