예제 #1
0
파일: state.class.php 프로젝트: kipman/glpi
 /**
  * Get search function for the class
  *
  * @since version 0.85
  *
  * @return array of search option
  **/
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[21]['table'] = $this->getTable();
     $tab[21]['field'] = 'is_visible_computer';
     $tab[21]['name'] = sprintf(__('%1$s - %2$s'), __('Visibility'), Computer::getTypeName(Session::getPluralNumber()));
     $tab[21]['datatype'] = 'bool';
     $tab[22]['table'] = $this->getTable();
     $tab[22]['field'] = 'is_visible_softwareversion';
     $tab[22]['name'] = sprintf(__('%1$s - %2$s'), __('Visibility'), SoftwareVersion::getTypeName(Session::getPluralNumber()));
     $tab[22]['datatype'] = 'bool';
     $tab[23]['table'] = $this->getTable();
     $tab[23]['field'] = 'is_visible_monitor';
     $tab[23]['name'] = sprintf(__('%1$s - %2$s'), __('Visibility'), Monitor::getTypeName(Session::getPluralNumber()));
     $tab[23]['datatype'] = 'bool';
     $tab[24]['table'] = $this->getTable();
     $tab[24]['field'] = 'is_visible_printer';
     $tab[24]['name'] = sprintf(__('%1$s - %2$s'), __('Visibility'), Printer::getTypeName(Session::getPluralNumber()));
     $tab[24]['datatype'] = 'bool';
     $tab[25]['table'] = $this->getTable();
     $tab[25]['field'] = 'is_visible_peripheral';
     $tab[25]['name'] = sprintf(__('%1$s - %2$s'), __('Visibility'), Peripheral::getTypeName(Session::getPluralNumber()));
     $tab[25]['datatype'] = 'bool';
     $tab[26]['table'] = $this->getTable();
     $tab[26]['field'] = 'is_visible_phone';
     $tab[26]['name'] = sprintf(__('%1$s - %2$s'), __('Visibility'), Phone::getTypeName(Session::getPluralNumber()));
     $tab[26]['datatype'] = 'bool';
     $tab[27]['table'] = $this->getTable();
     $tab[27]['field'] = 'is_visible_networkequipment';
     $tab[27]['name'] = sprintf(__('%1$s - %2$s'), __('Visibility'), NetworkEquipment::getTypeName(Session::getPluralNumber()));
     $tab[27]['datatype'] = 'bool';
     return $tab;
 }
예제 #2
0
            $peripheral->restore($_POST);
            Event::log($_POST["id"], "peripherals", 4, "inventory", sprintf(__('%s restores an item'), $_SESSION["glpiname"]));
            $peripheral->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $peripheral->check($_POST["id"], PURGE);
                $peripheral->delete($_POST, 1);
                Event::log($_POST["id"], "peripherals", 4, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
                $peripheral->redirectToList();
            } else {
                if (isset($_POST["update"])) {
                    $peripheral->check($_POST["id"], UPDATE);
                    $peripheral->update($_POST);
                    Event::log($_POST["id"], "peripherals", 4, "inventory", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
                    Html::back();
                } else {
                    if (isset($_POST["unglobalize"])) {
                        $peripheral->check($_POST["id"], UPDATE);
                        Computer_Item::unglobalizeItem($peripheral);
                        Event::log($_POST["id"], "peripherals", 4, "inventory", sprintf(__('%s sets unitary management'), $_SESSION["glpiname"]));
                        Html::redirect($CFG_GLPI["root_doc"] . "/front/peripheral.form.php?id=" . $_POST["id"]);
                    } else {
                        Html::header(Peripheral::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "assets", "peripheral");
                        $peripheral->display(array('id' => $_GET["id"], 'withtemplate' => $_GET["withtemplate"]));
                        Html::footer();
                    }
                }
            }
        }
    }
}
예제 #3
0
            $peripheral->restore($_POST);
            Event::log($_POST["id"], "peripherals", 4, "inventory", sprintf(__('%s restores an item'), $_SESSION["glpiname"]));
            $peripheral->redirectToList();
        } else {
            if (isset($_POST["purge"])) {
                $peripheral->check($_POST["id"], 'd');
                $peripheral->delete($_POST, 1);
                Event::log($_POST["id"], "peripherals", 4, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
                $peripheral->redirectToList();
            } else {
                if (isset($_POST["update"])) {
                    $peripheral->check($_POST["id"], 'w');
                    $peripheral->update($_POST);
                    Event::log($_POST["id"], "peripherals", 4, "inventory", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
                    Html::back();
                } else {
                    if (isset($_POST["unglobalize"])) {
                        $peripheral->check($_POST["id"], 'w');
                        Computer_Item::unglobalizeItem($peripheral);
                        Event::log($_POST["id"], "peripherals", 4, "inventory", sprintf(__('%s sets unitary management'), $_SESSION["glpiname"]));
                        Html::redirect($CFG_GLPI["root_doc"] . "/front/peripheral.form.php?id=" . $_POST["id"]);
                    } else {
                        Html::header(Peripheral::getTypeName(2), $_SERVER['PHP_SELF'], "inventory", "peripheral");
                        $peripheral->showForm($_GET["id"], array('withtemplate' => $_GET["withtemplate"]));
                        Html::footer();
                    }
                }
            }
        }
    }
}