getFromDB($ID)) { // ajouter un champ dans la table comprenant l'ID du profil de la // personne connectée et le droit d'écriture $myProf->add(array('id' => $ID, 'right' => 'w')); } } function createAccess($ID) { $this->add(array('id' => $ID)); } static function changeProfile() { $prof = new self(); if ($prof->getFromDB($_SESSION['glpiactiveprofile']['id'])) { $_SESSION["glpi_plugin_auf_profile"] = $prof->fields; } else { unset($_SESSION["glpi_plugin_auf_profile"]); } } function showForm($id, $options=array()) { $target = $this->getFormURL(); if (isset($options['target'])) { $target = $options['target']; } if (!Session::haveRight("profile", "r")) { return false; } $canedit = Session::haveRight("profile", "w"); $prof = new Profile(); if ($id){ $this->getFromDB($id); $prof->getFromDB($id); } echo "
"; echo ""; echo ""; echo ""; echo ""; if ($canedit) { echo ""; echo ""; } echo "
".sprintf(__('%1$s %2$s'), ('Gestion des droits -'), Dropdown::getDropdownName("glpi_profiles", $this->fields["id"])); echo "
Infos AUF"; Profile::dropdownNoneReadWrite("right", $this->fields["right"], 1, 1, 1); echo "
"; echo ""; echo ""; echo "
"; Html::closeForm(); } function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if ($item->getType() == 'Profile') { return "Infos AUF"; } return ''; } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'Profile') { $ID = $item->getID(); $prof = new self(); // si le profil n'existe pas dans la base, je l'ajoute if (!$prof->GetfromDB($ID)) { $prof->createAccess($ID); } $prof->showForm($ID); } return true; } } ?>