$ruleaction = new RuleAction(get_class($rule)); if (isset($_POST["add_action"])) { $rulecollection->checkGlobal(CREATE); $ruleaction->add($_POST); Html::back(); } else { if (isset($_POST["update"])) { $rulecollection->checkGlobal(UPDATE); $rule->update($_POST); Event::log($_POST['id'], "rules", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { if (isset($_POST["add"])) { $rulecollection->checkGlobal(CREATE); $newID = $rule->add($_POST); Event::log($newID, "rules", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID)); Html::redirect($_SERVER['HTTP_REFERER'] . "?id={$newID}"); } else { if (isset($_POST["purge"])) { $rulecollection->checkGlobal(PURGE); $rulecollection->deleteRuleOrder($_POST["ranking"]); $rule->delete($_POST, 1); Event::log($_POST["id"], "rules", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $rule->redirectToList(); } } } } Html::header(Rule::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'admin', $rulecollection->menu_type, $rulecollection->menu_option); $rule->display(array('id' => $_GET["id"])); Html::footer();
if (isset($_POST["add_action"])) { $rulecollection->checkGlobal('w'); $ruleaction->add($_POST); Html::back(); } else { if (isset($_POST["update"])) { $rulecollection->checkGlobal('w'); $rule->update($_POST); Event::log($_POST['id'], "rules", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"])); Html::back(); } else { if (isset($_POST["add"])) { $rulecollection->checkGlobal('w'); $newID = $rule->add($_POST); Event::log($newID, "rules", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID)); Html::redirect($_SERVER['HTTP_REFERER'] . "?id={$newID}"); } else { if (isset($_POST["delete"])) { $rulecollection->checkGlobal('w'); $rulecollection->deleteRuleOrder($_POST["ranking"]); $rule->delete($_POST); Event::log($_POST["id"], "rules", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"])); $rule->redirectToList(); } } } } } Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], 'admin', $rulecollection->menu_type, $rulecollection->menu_option); $rule->showForm($_GET["id"]); Html::footer();
GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief */ include '../inc/includes.php'; Session::checkCentralAccess(); Html::header(Rule::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "admin", "rule", -1); RuleCollection::titleBackup(); echo "<table class='tab_cadre'>"; echo "<tr><th>" . __('Rule type') . "</th></tr>"; foreach ($CFG_GLPI["rulecollections_types"] as $rulecollectionclass) { $rulecollection = new $rulecollectionclass(); if ($rulecollection->canList()) { if ($plug = isPluginItemType($rulecollectionclass)) { $title = sprintf(__('%1$s - %2$s'), Plugin::getInfo($plug['plugin'], 'name'), $rulecollection->getTitle()); } else { $title = $rulecollection->getTitle(); } echo "<tr class='tab_bg_1'><td class='center b'>"; echo "<a href='" . Toolbox::getItemTypeSearchURL($rulecollection->getRuleClassName()) . "'>"; echo $title . "</a></td></tr>"; }
GLPI 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 GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief */ include '../inc/includes.php'; Session::checkCentralAccess(); Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "rule", -1); echo "<table class='tab_cadre'>"; echo "<tr><th>" . __('Rule type') . "</th></tr>"; foreach ($CFG_GLPI["rulecollections_types"] as $rulecollectionclass) { $rulecollection = new $rulecollectionclass(); if ($rulecollection->canList()) { if ($plug = isPluginItemType($rulecollectionclass)) { $title = sprintf(__('%1$s - %2$s'), Plugin::getInfo($plug['plugin'], 'name'), $rulecollection->getTitle()); } else { $title = $rulecollection->getTitle(); } echo "<tr class='tab_bg_1'><td class='center b'>"; echo "<a href='" . Toolbox::getItemTypeSearchURL($rulecollection->getRuleClassName()) . "'>"; echo $title . "</a></td></tr>"; } }
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 GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { include '../inc/includes.php'; } Session::checkCentralAccess(); if (!strpos($_SERVER['PHP_SELF'], "popup")) { Html::header(Rule::getTypeName(2), $_SERVER['PHP_SELF'], "admin", "dictionnary", "cache"); } if (isset($_GET["sub_type"])) { echo "<br>"; $rulecollection = RuleCollection::getClassByType($_GET["sub_type"]); if ($rulecollection->canView()) { if (!isset($_GET["rules_id"])) { $rulecollection->showCacheStatusForRuleType(); } else { if ($rule = getItemForItemtype($_GET["sub_type"])) { $rule->getRuleWithCriteriasAndActions($_GET["rules_id"], 0, 0); $rule->showCacheStatusByRule($_SERVER["HTTP_REFERER"]); } } } }