$values['comment'] = Html::cleanPostForTextArea($values['comment']); $values['target'] = Toolbox::getItemTypeFormURL('PluginResourcesWizard'); $values['withtemplate'] = $_POST["withtemplate"]; if (isset($_POST["second_step"])) { $values['new'] = 1; } else { if (isset($_POST["second_step_update"])) { $values['new'] = 0; } } $values["requiredfields"] = 1; $_SESSION["MESSAGE_AFTER_REDIRECT"] = "<h3><span class='red'>" . __('Required fields are not filled. Please try again.', 'resources') . "</span></h3>"; Html::displayMessageAfterRedirect(); $resource->wizardSecondForm($_POST["id"], $values); } else { if ($resource->canCreate() && isset($_POST["second_step"])) { $newID = $resource->add($_POST); } else { if ($resource->canCreate() && isset($_POST["second_step_update"])) { $resource->update($_POST); $newID = $_POST["id"]; } } //if employee right : next step if ($newID) { $wizard_employee = PluginResourcesContractType::checkWizardSetup($newID, "use_employee_wizard"); $wizard_need = PluginResourcesContractType::checkWizardSetup($newID, "use_need_wizard"); $wizard_picture = PluginResourcesContractType::checkWizardSetup($newID, "use_picture_wizard"); if ($employee->canCreate()) { if ($wizard_employee) { $employee->wizardThirdForm($newID);
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)); $choice = new PluginResourcesChoice(); $resource = new PluginResourcesResource(); //add items needs from helpdesk if (isset($_POST["addhelpdeskitem"])) { if ($_POST['plugin_resources_choiceitems_id'] > 0 && $_POST['plugin_resources_resources_id'] > 0) { if ($resource->canCreate()) { $choice->addHelpdeskItem($_POST); } } Html::back(); } else { if (isset($_POST["deletehelpdeskitem"])) { if ($resource->canCreate()) { $choice->delete(array('id' => $_POST["id"])); } Html::back(); //next step : email and finish resource creation } else { if (isset($_POST["finish"])) { $resource->redirectToList(); } else {