(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'; if (!isset($_GET["id"])) { $_GET["id"] = ""; } $budget = new PluginResourcesBudget(); if (isset($_POST["add"])) { $budget->check(-1, 'w'); $newID = $budget->add($_POST); Html::back(); } else { if (isset($_POST["update"])) { $budget->check($_POST["id"], 'w'); $budget->update($_POST); Html::back(); } else { if (isset($_POST["delete"])) { $budget->check($_POST["id"], 'w'); $budget->delete($_POST); $budget->redirectToList(); } else {
https://forge.indepnet.net/projects/resources ------------------------------------------------------------------------- LICENSE 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'; Html::header(PluginResourcesResource::getTypeName(2), '', "plugins", "resources", "budget"); $budget = new PluginResourcesBudget(); if ($budget->canView() || Session::haveRight("config", "w")) { Search::show("PluginResourcesBudget"); } else { Html::displayRightError(); } Html::footer();
function showForm($ID, $options = array()) { if (!Session::haveRight("profile", "r")) { return false; } $prof = new Profile(); if ($ID) { $this->getFromDBByProfile($ID); $prof->getFromDB($ID); } $this->showFormHeader($options); echo "<tr class='tab_bg_2'>"; echo "<th colspan='4'>" . sprintf(__('%1$s - %2$s'), __('Rights management', 'resources'), $prof->fields["name"]) . "</th>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . PluginResourcesResource::getTypeName(2) . "</td><td>"; Profile::dropdownNoneReadWrite("resources", $this->fields["resources"], 1, 1, 1); echo "</td>"; echo "<td>" . PluginResourcesTask::getTypeName(2) . "</td><td>"; if ($prof->fields['interface'] != 'helpdesk') { Profile::dropdownNoneReadWrite("task", $this->fields["task"], 1, 1, 1); } else { _e('No access'); // No access; } echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . PluginResourcesChecklist::getTypeName(2) . "</td><td>"; if ($prof->fields['interface'] != 'helpdesk') { Profile::dropdownNoneReadWrite("checklist", $this->fields["checklist"], 1, 1, 1); } else { _e('No access'); // No access; } echo "</td>"; echo "<td>" . PluginResourcesEmployee::getTypeName(2) . "</td><td>"; Profile::dropdownNoneReadWrite("employee", $this->fields["employee"], 1, 1, 1); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . __('All resources access', 'resources') . "</td><td>"; Profile::dropdownNoneReadWrite("all", $this->fields["all"], 1, 0, 1); echo "</td>"; echo "<td>" . __('Associable items to a ticket') . " - " . PluginResourcesResource::getTypeName(2) . "</td><td>"; if ($prof->fields['create_ticket']) { Dropdown::showYesNo("open_ticket", $this->fields["open_ticket"]); } else { echo Dropdown::getYesNo(0); } echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<th colspan='4' class='center b'>" . __('Service company management', 'resources') . "</th>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . PluginResourcesResourceResting::getTypeName(2) . "</td><td>"; Profile::dropdownNoneReadWrite("resting", $this->fields["resting"], 1, 0, 1); echo "</td>"; echo "<td>" . PluginResourcesResourceHoliday::getTypeName(2) . "</td><td>"; Profile::dropdownNoneReadWrite("holiday", $this->fields["holiday"], 1, 0, 1); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<th colspan='4' class='center b'>" . __('Public service management', 'resources') . "</th>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . PluginResourcesEmployment::getTypeName(2) . "</td><td>"; Profile::dropdownNoneReadWrite("employment", $this->fields["employment"], 1, 1, 1); echo "</td>"; echo "<td>" . PluginResourcesBudget::getTypeName(2) . ":</td><td>"; Profile::dropdownNoneReadWrite("budget", $this->fields["budget"], 1, 1, 1); echo "</td>"; echo "</tr>"; echo "<tr class='tab_bg_2'>"; echo "<td>" . __('Dropdown management', 'resources') . "</td><td>"; Profile::dropdownNoneReadWrite("dropdown_public", $this->fields["dropdown_public"], 1, 1, 1); echo "</td><td></td><td></td>"; echo "</tr>"; echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">"; $options['candel'] = false; $this->showFormButtons($options); }
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/>. -------------------------------------------------------------------------- */ //Options for GLPI 0.71 and newer : need slave db to access the report $USEDBREPLICATE = 1; $DBCONNECTION_REQUIRED = 1; include "../../../../inc/includes.php"; // Instantiate Report with Name $titre = $LANG['plugin_resources']['budgetsummary']; $report = new PluginReportsAutoReport($titre); //Report's search criterias $datecrit = new PluginResourcesDateCriteria($report, 'date_budget', '', PluginResourcesBudget::getTypeName(1) . " - " . __('Date')); $professioncategory = new PluginReportsDropdownCriteria($report, 'plugin_resources_professioncategories_id', 'glpi_plugin_resources_professioncategories', PluginResourcesProfessionCategory::getTypeName(1)); $professionline = new PluginReportsDropdownCriteria($report, 'plugin_resources_professionlines_id', 'glpi_plugin_resources_professionlines', PluginResourcesProfessionLine::getTypeName(1)); //Display criterias form is needed $report->displayCriteriasForm(); //colname with sort allowed $columns = array('professioncategory' => array('sorton' => 'professioncategory'), 'professionline' => array('sorton' => 'professionline'), 'profession' => array('sorton' => 'profession'), 'rank' => array('sorton' => 'rank'), 'begin_date' => array('sorton' => 'begin_date'), 'end_date' => array('sorton' => 'end_date'), 'budget_type' => array('sorton' => 'budget_type'), 'qt_vol_budg_vot' => array('sorton' => 'qt_vol_budg_vot')); $output_type = Search::HTML_OUTPUT; //If criterias have been validated if ($report->criteriasValidated()) { if (isset($_POST['list_limit'])) { $_SESSION['glpilist_limit'] = $_POST['list_limit']; unset($_POST['list_limit']); } if (!isset($_REQUEST['sort'])) { $_REQUEST['sort'] = "profession";