dropdownNoneReadWrite() static public method

Make a select box for a None Read Write choice
static public dropdownNoneReadWrite ( $name, $value, $none = 1, $read = 1, $write = 1 ) : nothing
$name select name
$value preselected value.
$none display none choice ? (default 1)
$read display read choice ? (default 1)
$write display write choice ? (default 1)
return nothing (print out an HTML select box) \deprecated since version 0.84 use dropdownRight instead
Exemplo n.º 1
0
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     $profile = new Profile();
     $found_profiles = $profile->find();
     $fields_profile = new self();
     echo "<form name='form' method='post' action='" . $fields_profile->getFormURL() . "'>";
     echo "<div class='spaced' id='tabsbody'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='2'>" . _n("Profile", "Profiles", 2) . "</th></tr>";
     foreach ($found_profiles as $profile_item) {
         //get right for current profile
         $found = $fields_profile->find("`profiles_id` = '" . $profile_item['id'] . "'\n                         AND `plugin_fields_containers_id` = '" . $item->fields['id'] . "'");
         $first_found = array_shift($found);
         //display right
         echo "<tr>";
         echo "<td>" . $profile_item['name'] . "</td>";
         echo "<td>";
         Profile::dropdownNoneReadWrite("rights[" . $profile_item['id'] . "]", $first_found['right']);
         echo "</td>";
         echo "<tr>";
     }
     echo "<ul>";
     echo "<tr><td class='tab_bg_2 center' colspan='2'>";
     echo "<input type='hidden' name='plugin_fields_containers_id' value='" . $item->fields['id'] . "' />";
     echo "<input type='submit' name='update' value=\"" . _sx("button", "Save") . "\" class='submit'>";
     echo "</td>";
     echo "</tr>";
     echo "</table></div>";
     Html::closeForm();
 }
Exemplo n.º 2
0
 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 "<form action='" . $target . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='2'>" . sprintf(__('%1$s %2$s'), __('Rights management', 'appliances'), $this->fields["name"]);
     echo "</th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Appliances', 'appliances') . "</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("appliance", $this->fields["appliance"], 1, 1, 1);
     } else {
         _e('No access');
     }
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Linkable items to a ticket - Appliances') . "</td><td>";
     if ($prof->fields['create_ticket']) {
         Dropdown::showYesNo("open_ticket", $this->fields["open_ticket"]);
     } else {
         echo Dropdown::getYesNo(0);
     }
     echo "</td></tr>";
     if ($canedit) {
         echo "<tr class='tab_bg_1'>";
         echo "<td class='center' colspan='2'>";
         echo "<input type='hidden' name='id' value='" . $ID . "'>";
         echo "<input type='submit' name='update_user_profile' value=\"" . _sx('button', 'Update') . "\"\n               class='submit'>";
         echo "</td></tr>";
     }
     echo "</table>";
     Html::closeForm();
 }
Exemplo n.º 3
0
function plugin_addressing_MassiveActionsDisplay($options = array())
{
    switch ($options['itemtype']) {
        case 'Profile':
            switch ($options['action']) {
                case "plugin_addressing_allow":
                    Profile::dropdownNoneReadWrite('use', '');
                    echo "&nbsp;<input type='submit' name='massiveaction' class='submit' value=\"" . _sx('button', 'Post') . "\" >";
                    break;
            }
            break;
    }
    return "";
}
Exemplo n.º 4
0
 /**
  * Show profile form
  *
  * @param $items_id integer id of the profile
  * @param $target value url of target
  *
  * @return nothing
  **/
 function showForm($items_id)
 {
     global $CFG_GLPI;
     if ($items_id > 0 and $this->getFromDB($items_id)) {
     } else {
         $this->getEmpty();
     }
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     $canedit = Session::haveRight("profile", "w");
     if ($canedit) {
         echo "<form method='post' action='" . $CFG_GLPI['root_doc'] . "/plugins/surveyticket/front/profile.form.php'>";
         echo '<input type="hidden" name="profiles_id" value="' . $items_id . '"/>';
     }
     echo "<div class='spaced'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th colspan='4'>Survey ticket :</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Setup') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("config", $this->fields["config"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo "</td>";
     echo "<td>";
     echo "</td>";
     echo "</tr>";
     if ($canedit) {
         echo "<tr>";
         echo "<th colspan='4'>";
         echo "<input type='hidden' name='profile_id' value='" . $items_id . "'/>";
         echo "<input type='submit' name='update' value=\"" . __('Save') . "\" class='submit'>";
         echo "</td>";
         echo "</tr>";
         echo "</table>";
         Html::closeForm();
     } else {
         echo "</table>";
     }
     echo "</div>";
     Html::closeForm();
 }
Exemplo n.º 5
0
 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='2'>" . sprintf(__('%1$s - %2$s'), __('Rights management', 'immobilizationsheets'), $prof->fields["name"]) . "</th>";
     echo "<td>" . __('Generate the immobilization sheet', 'immobilizationsheets') . ":</td><td>";
     Profile::dropdownNoneReadWrite("immobilizationsheets", $this->fields["immobilizationsheets"], 1, 1, 0);
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
 function showForm($target, $ID)
 {
     global $LANG;
     if (!haveRight("profile", "r")) {
         return false;
     }
     $canedit = haveRight("profile", "w");
     if ($ID) {
         $this->getFromDB($ID);
     }
     echo "<form action='" . $target . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th colspan='4' align='center'>";
     echo $LANG['plugin_fusioninventory']["profile"][0] . " " . $this->fields["name"];
     echo "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][16] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("snmp_networking", $this->fields["snmp_networking"], 1, 1, 1);
     echo "</td>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][23] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("configuration", $this->fields["configuration"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][18] . " :</td><td>";
     Profile::dropdownNoneReadWrite("snmp_printers", $this->fields["snmp_printers"], 1, 1, 1);
     echo "</td>";
     echo "<th colspan='2'>";
     echo $LANG['plugin_fusioninventory']["profile"][34] . " :";
     echo "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][19] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("snmp_models", $this->fields["snmp_models"], 1, 1, 1);
     echo "</td>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][29] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("remotecontrol", $this->fields["remotecontrol"], 1, 0, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][20] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("snmp_authentification", $this->fields["snmp_authentification"], 1, 1, 1);
     echo "</td>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][31] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("deviceinventory", $this->fields["deviceinventory"], 1, 0, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][25] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("rangeip", $this->fields["rangeip"], 1, 1, 1);
     echo "</td>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][22] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("netdiscovery", $this->fields["netdiscovery"], 1, 0, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][26] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("agents", $this->fields["agents"], 1, 1, 1);
     echo "</td>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][32] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("snmp_query", $this->fields["snmp_query"], 1, 0, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][27] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("agentsprocesses", $this->fields["agentsprocesses"], 1, 1, 0);
     echo "</td>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][33] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("wol", $this->fields["wol"], 1, 0, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][30] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("unknowndevices", $this->fields["unknowndevices"], 1, 1, 1);
     echo "</td>";
     echo "<td colspan='2'>";
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_fusioninventory']["profile"][28] . " :</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("reports", $this->fields["reports"], 1, 1, 0);
     echo "</td>";
     echo "<td colspan='2'>";
     echo "</td>";
     echo "</tr>";
     if ($canedit) {
         echo "<tr class='tab_bg_1'>";
         echo "<td  align='center' colspan='3'>";
         echo "<input type='hidden' name='ID' value={$ID}>";
         echo "<input type='submit' name='update_user_profile' value=\"" . $LANG["buttons"][7] . "\" class='submit'>";
         echo "</td></tr>\n";
     }
     echo "</table>";
 }
Exemplo n.º 7
0
 function showForm($ID)
 {
     global $LANG;
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     $canedit = Session::haveRight("profile", "w");
     $prof = new Profile();
     if ($ID) {
         $this->getFromDBByProfile($ID);
         $prof->getFromDB($ID);
     }
     echo "<form action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<th colspan='4' align='center'><strong>" . $LANG['plugin_simcard']['profile'][0] . " " . $prof->fields["name"] . "</strong></th>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['plugin_simcard']['profile'][1] . ":</td><td>";
     Profile::dropdownNoneReadWrite("simcard", $this->fields["simcard"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['setup'][352] . " - " . $LANG['plugin_simcard']['profile'][1] . ":</td><td>";
     if ($prof->fields['create_ticket']) {
         Dropdown::showYesNo("open_ticket", $this->fields["open_ticket"]);
     } else {
         echo Dropdown::getYesNo(0);
     }
     echo "</td>";
     echo "</tr>";
     if ($canedit) {
         echo "<tr class='tab_bg_1'>";
         echo "<td align='center' colspan='2'>";
         echo "<input type='hidden' name='id' value=" . $this->getID() . ">";
         echo "<input type='submit' name='update' value=\"" . $LANG['buttons'][7] . "\" class='submit'>";
         echo "</td></tr>";
     }
     echo "</table>";
     Html::closeForm();
 }
Exemplo n.º 8
0
 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='2' class='center b'>" . self::getTypeName() . " " . $prof->fields["name"] . "</th>";
     echo "<td>" . PluginShellcommandsShellcommand::getTypeName(2) . ":</td><td>";
     Profile::dropdownNoneReadWrite("shellcommands", $this->fields["shellcommands"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
 function showForm($ID, $options = array())
 {
     global $LANG, $DB;
     if (!Session::haveRight("profile", READ)) {
         return false;
     }
     $target = $this->getFormURL();
     if (isset($options['target'])) {
         $target = $options['target'];
     }
     // TODO : Should be useless if we can use this->showFormHeader() and $this->ShowFormButtons()
     if (!Session::haveRight("profile", UPDATE)) {
         return false;
     }
     $canedit = Session::haveRight("profile", UPDATE);
     $prof = new Profile();
     if ($ID) {
         $this->getFromDB($ID);
         $prof->getFromDB($ID);
     }
     $itemtype = '';
     $query = "SELECT *\n                FROM `glpi_plugin_customfields_fields`\n                WHERE `restricted` = 1\n                ORDER BY `itemtype`, `sort_order`;";
     if (($result = $DB->query($query)) && $DB->numrows($result)) {
         echo "<form action='" . $target . "' method='post'>";
         echo "<table class='tab_cadre_fixe'>";
         echo "<tr class='tab_bg_2'>";
         echo "<th colspan='4'>" . __('Title', 'customfields') . " " . $prof->fields["name"] . "</th>";
         echo "</tr>";
         while ($data = $DB->fetch_array($result)) {
             if ($data['itemtype'] != $itemtype) {
                 $itemtype = $data['itemtype'];
                 echo "<tr><th colspan='3'>" . __($itemtype) . "</th></tr>";
             }
             $profile_field = $data['itemtype'] . '_' . $data['system_name'];
             echo "<tr class='tab_bg_2'><td>" . $data['label'] . " (" . __($data['data_type'], 'customfields') . "):</td><td>";
             if ($data['data_type'] == 'sectionhead') {
                 Dropdown::showYesNo($profile_field, $this->fields[$profile_field], 1, 1, 1);
             } else {
                 Profile::dropdownNoneReadWrite($profile_field, $this->fields[$profile_field], 1, 1, 1);
             }
             echo "</td></tr>";
         }
         if ($canedit) {
             echo "<tr class='tab_bg_1'>";
             echo "<td class='center' colspan='2'>";
             echo "<input type='hidden' name='id' value={$ID}>";
             echo "<input type='submit' name='update_user_profile' value=\"" . _sx('button', 'Update') . "\" class='submit'>";
             echo "</td></tr>";
         }
         echo "</table>";
         $options['candel'] = false;
         Html::closeForm();
     } else {
         echo __('There is no restricted field', 'customfields');
     }
 }
Exemplo n.º 10
0
 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' align='center'><strong>" . __("Rights assignment") . " " . $prof->fields["name"] . "</strong></th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __("Orders", "order") . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("order", $this->fields["order"], 1, 1, 1);
     } else {
         echo __("No access");
         // No access;
     }
     echo "</td>";
     echo "<td>" . __("Products references", "order") . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("reference", $this->fields["reference"], 1, 1, 1);
     } else {
         echo __("No access");
         // No access;
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __("Bills", "order") . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("bill", $this->fields["bill"], 1, 1, 1);
     } else {
         echo __("No access");
         // No access;
     }
     echo "</td>";
     echo "<td>" . __("Take item delivery", "order") . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("delivery", $this->fields["delivery"], 1, 1, 1);
     } else {
         echo __("No access");
         // No access;
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __("Order Generation", "order") . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("generate_order_odt", $this->fields["generate_order_odt"], 1, 0, 1);
     } else {
         echo __("No access");
         // No access;
     }
     echo "</td>";
     echo "<td>" . __("Link order to a ticket", "order") . "</td>";
     echo "<td>";
     Dropdown::showYesNo('open_ticket', $this->fields['open_ticket']);
     echo "</td>";
     echo "</tr>";
     echo "<tr align='center'><th colspan='4' >" . __("Validation", "order") . "</th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __("Order validation", "order") . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("validation", $this->fields["validation"], 1, 0, 1);
     } else {
         echo __("No access");
         // No access;
     }
     echo "</td>";
     echo "<td>" . __("Cancel order", "order") . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("cancel", $this->fields["cancel"], 1, 0, 1);
     } else {
         echo __("No access");
         // No access;
     }
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __("Edit a validated order", "order") . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("undo_validation", $this->fields["undo_validation"], 1, 0, 1);
     } else {
         echo __("No access");
         // No access;
     }
     echo "</td>";
     echo "<td colspan='2'></td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 11
0
 /**
  * profiles modification
  *
  * @param $ID
  * @param $options   array
  **/
 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'>";
     //TRANS: %$ is a profile name
     echo "<th colspan='4' class='center b'>" . sprintf(__('%1$s - %2$s'), __('Rights management'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . _n('OCSNG server', 'OCSNG servers', 2, 'ocsinventoryng') . "</td><td>";
     Profile::dropdownNoneReadWrite("ocsng", $this->fields["ocsng"], 1, 0, 1);
     echo "</td>";
     echo "<td>" . __('Manually synchronization', 'ocsinventoryng') . "</td><td>";
     Profile::dropdownNoneReadWrite("sync_ocsng", $this->fields["sync_ocsng"], 1, 0, 1);
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('See information', 'ocsinventoryng') . "</td><td>";
     Profile::dropdownNoneReadWrite("view_ocsng", $this->fields["view_ocsng"], 1, 1, 0);
     echo "<td>" . __('Clean links between GLPI and OCSNG', 'ocsinventoryng') . "</td><td>";
     Profile::dropdownNoneReadWrite("clean_ocsng", $this->fields["clean_ocsng"], 1, 1, 1);
     echo "</td></tr>\n";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 12
0
 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);
 }
Exemplo n.º 13
0
 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->getFromDBByProfile($ID);
         $prof->getFromDB($ID);
     }
     echo "<form action='" . $target . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_2'>";
     echo "<th colspan='2'>" . sprintf(__('%1$s - %2$s'), __('Rights management', 'archires'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Generate graphs', 'archires') . "</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("archires", $this->fields["archires"], 1, 1, 1);
     } else {
         _e('No access');
         // No access;
     }
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 14
0
 /**
  * Show profile form
  *
  * @param $items_id integer id of the profile
  * @param $target value url of target
  *
  * @return nothing
  **/
 function showForm($items_id)
 {
     global $LANG, $CFG_GLPI;
     if ($items_id > 0 and $this->getFromDB($items_id)) {
     } else {
         $this->getEmpty();
     }
     if (!haveRight("profile", "r")) {
         return false;
     }
     $canedit = haveRight("profile", "w");
     if ($canedit) {
         echo "<form method='post' action='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/profile.form.php'>";
         echo '<input type="hidden" name="profiles_id" value="' . $items_id . '"/>';
     }
     echo "<div class='spaced'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th colspan='4'>" . $LANG['plugin_monitoring']['title'][0] . " :</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['display'][0] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("dashboard", $this->fields["dashboard"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['servicescatalog'][0] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("servicescatalog", $this->fields["servicescatalog"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['displayview'][0] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("view", $this->fields["view"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['componentscatalog'][0] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("componentscatalog", $this->fields["componentscatalog"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['displayview'][4] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("viewshomepage", $this->fields["viewshomepage"], 1, 1, 0);
     echo "</td>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['weathermap'][0] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("weathermap", $this->fields["weathermap"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['component'][0] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("component", $this->fields["component"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['command'][0] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("command", $this->fields["command"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo $LANG['common'][12] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("config", $this->fields["config"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo $LANG['plugin_monitoring']['check'][0] . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("check", $this->fields["check"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     if ($canedit) {
         echo "<tr>";
         echo "<th colspan='4'>";
         echo "<input type='hidden' name='profile_id' value='" . $items_id . "'/>";
         echo "<input type='submit' name='update' value=\"" . $LANG['buttons'][7] . "\" class='submit'>";
         echo "</td>";
         echo "</tr>";
         echo "</table>";
         echo "</form>";
     } else {
         echo "</table>";
     }
     echo "</div>";
     echo "</form>";
 }
Exemplo n.º 15
0
 function showForm($ID, $options = array())
 {
     $target = $this->getFormURL();
     if (isset($options['target'])) {
         $target = $options['target'];
     }
     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='3'>" . __('Themes manager', 'themes') . "</th></tr>\n            <tr class='tab_bg_2'><td colspan='2'>" . __('Choose the default theme', 'themes') . " : </td><td>";
     Profile::dropdownNoneReadWrite("themes", $this->fields["themes"], 1, 1, 1);
     echo "</td></tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 16
0
 /**
  * @param $report
  **/
 static function showForReport($report)
 {
     global $DB;
     if (empty($report) || !Session::haveRight('profile', 'r')) {
         return false;
     }
     $current = self::getAllRights(array('report' => $report), true);
     $canedit = Session::haveRight('profile', 'w');
     if ($canedit) {
         echo "<form action='" . $_SERVER['PHP_SELF'] . "' method='post'>\n";
     }
     echo "<table class='tab_cadre'>\n";
     echo "<tr><th colspan='2'>" . __('Profils rights', 'reports') . "</th></tr>\n";
     $query = "SELECT `id`, `name`, `statistic`, `reports`\n                FROM `glpi_profiles`\n                ORDER BY `name`";
     foreach ($DB->request($query) as $data) {
         echo "<tr class='tab_bg_1'><td>" . $data['name'] . "&nbsp: </td><td>";
         if (isStat($report) && $data['statistic'] == 1 || !isStat($report) && $data['reports'] == 'r') {
             Profile::dropdownNoneReadWrite($data['id'], isset($current[$data['id']]) ? 'r' : '', 1, 1, 0);
         } else {
             // Can't access because missing right from GLPI core
             // Profile::dropdownNoneReadWrite($mod,'',1,0,0);
             echo "<input type='hidden' name='" . $data['id'] . "' value='NULL'>" . __('No access') . " *";
         }
         echo "</td></tr>\n";
     }
     echo "<tr class='tab_bg_4'><td colspan='2'>* ";
     if (isStat($report)) {
         _e('No right on Assistance / Statistics', 'reports');
     } else {
         _e('No right on Tools / Reports', 'reports');
     }
     echo "</tr>";
     if ($canedit) {
         echo "<tr class='tab_bg_1'><td colspan='2' class='center'>";
         echo "<input type='hidden' name='report' value='{$report}'>";
         echo "<input type='submit' name='update' value='" . _sx('button', 'Update') . "' " . "class='submit'>&nbsp;&nbsp;&nbsp;";
         echo "<input type='submit' name='delete' value='" . _sx('button', 'Delete permanently') . "'\n                class='submit'>";
         echo "</td></tr>\n";
         echo "</table>\n";
         Html::closeForm();
     } else {
         echo "</table>\n";
     }
 }
Exemplo n.º 17
0
 public 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', 'accounts'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . PluginAccountsAccount::getTypeName(2) . ":</td><td>";
     Profile::dropdownNoneReadWrite("accounts", $this->fields["accounts"], 1, 1, 1);
     echo "</td>";
     echo "<td>" . __('See accounts of my groups', 'accounts') . ":</td><td>";
     Profile::dropdownNoneReadWrite("my_groups", $this->fields["my_groups"], 1, 1, 0);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('See all accounts', 'accounts') . ":</td><td>";
     Profile::dropdownNoneReadWrite("all_users", $this->fields["all_users"], 1, 1, 0);
     echo "</td>";
     echo "<td>" . __('Associable items to a ticket') . " - " . PluginAccountsAccount::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 "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 18
0
 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', 'environment'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Environment', 'environment') . ":</td><td>";
     Profile::dropdownNoneReadWrite("environment", $this->fields["environment"], 1, 1, 0);
     echo "</td>";
     echo "<td>" . __('Appliances', 'environment') . ":</td><td>";
     Profile::dropdownNoneReadWrite("appliances", $this->fields["appliances"], 1, 1, 0);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Web applications', 'environment') . ":</td><td>";
     Profile::dropdownNoneReadWrite("webapplications", $this->fields["webapplications"], 1, 1, 0);
     echo "</td>";
     echo "<td>" . __('Certificates', 'environment') . ":</td><td>";
     Profile::dropdownNoneReadWrite("certificates", $this->fields["certificates"], 1, 1, 0);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Accounts', 'environment') . ":</td><td>";
     Profile::dropdownNoneReadWrite("accounts", $this->fields["accounts"], 1, 1, 0);
     echo "</td>";
     echo "<td>" . __('Domains', 'environment') . ":</td><td>";
     Profile::dropdownNoneReadWrite("domains", $this->fields["domains"], 1, 1, 0);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Databases', 'environment') . ":</td><td>";
     Profile::dropdownNoneReadWrite("databases", $this->fields["databases"], 1, 1, 0);
     echo "</td>";
     echo "<td>" . __('Badges', 'environment') . ":</td><td>";
     Profile::dropdownNoneReadWrite("badges", $this->fields["badges"], 1, 1, 0);
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 19
0
 /**
  * profiles modification
  **/
 function showForm($ID, $options = array())
 {
     $target = $this->getFormURL();
     if (isset($options['target'])) {
         $target = $options['target'];
     }
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     $prof = new Profile();
     if ($ID) {
         $this->getFromDBByProfile($ID);
         $prof->getFromDB($ID);
     }
     echo "<form action='" . $target . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_2'>";
     echo "<th colspan='4'>" . sprintf(__('%1$s - %2$s'), __('Rights management', 'webapplications'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . PluginWebapplicationsWebapplication::getTypeName(2) . " : </td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("webapplications", $this->fields["webapplications"], 1, 1, 1);
     } else {
         _e('No access');
         // No access;
     }
     echo "</td>";
     echo "<td>" . __('Associable items to a ticket') . " - " . PluginWebapplicationsWebapplication::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 "<input type='hidden' name='profiles_id' value=" . $this->fields["profiles_id"] . ">";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 20
0
         break;
     case "glpi_ticketvalidations.status":
         TicketValidation::dropdownStatus($inputname, array('value' => $_REQUEST['value'], 'all' => 1));
         $display = true;
         break;
 }
 // Standard datatype usage
 if (!$display && isset($searchopt['datatype'])) {
     switch ($searchopt['datatype']) {
         case "bool":
             Dropdown::showYesNo($inputname, $_REQUEST['value']);
             $display = true;
             break;
         case "right":
             // No access not displayed because empty not take into account for search
             Profile::dropdownNoneReadWrite($inputname, $_REQUEST['value'], 1, 1, 1);
             $display = true;
             break;
         case "itemtypename":
             Dropdown::dropdownUsedItemTypes($inputname, getItemTypeForTable($searchopt['table']), array('value' => $_REQUEST['value'], 'comments' => 0));
             $display = true;
             break;
     }
 }
 // Standard field usage
 if (!$display) {
     switch ($searchopt['field']) {
         case "name":
         case "completename":
             Dropdown::show(getItemTypeForTable($searchopt['table']), array('value' => $_REQUEST['value'], 'name' => $inputname, 'comments' => 0));
             $display = true;
Exemplo n.º 21
0
 function showForm($ID, $options = array())
 {
     global $LANG;
     $target = $this->getFormURL();
     if (isset($options['target'])) {
         $target = $options['target'];
     }
     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_1'>";
     echo "<th colspan='2'>" . $LANG['plugin_mobile']['profile'][0] . " " . $prof->fields["name"] . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . $LANG['plugin_mobile']['profile'][1] . " : </td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("mobile_user", $this->fields["mobile_user"], 1, 1, 1);
     } else {
         echo $LANG['profiles'][12];
         // No access;
     }
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 22
0
 /**
  * Show profile form
  *
  * @param $items_id integer id of the profile
  * @param $target value url of target
  *
  * @return nothing
  **/
 function showForm($items_id)
 {
     global $CFG_GLPI;
     if ($items_id > 0 and $this->getFromDB($items_id)) {
     } else {
         $this->getEmpty();
     }
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     $canedit = Session::haveRight("profile", "w");
     if ($canedit) {
         echo "<form method='post' action='" . $CFG_GLPI['root_doc'] . "/plugins/monitoring/front/profile.form.php'>";
         echo '<input type="hidden" name="profiles_id" value="' . $items_id . '"/>';
     }
     echo "<div class='spaced'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th colspan='4'>" . __('Monitoring', 'monitoring') . " :</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Dashboard', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("dashboard", $this->fields["dashboard"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo __('Services catalog', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("servicescatalog", $this->fields["servicescatalog"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Views', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("view", $this->fields["view"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo __('Components catalog', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("componentscatalog", $this->fields["componentscatalog"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Views in GLPI home page', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("viewshomepage", $this->fields["viewshomepage"], 1, 1, 0);
     echo "</td>";
     echo "<td>";
     echo __('Weathermap', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("weathermap", $this->fields["weathermap"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Components', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("component", $this->fields["component"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo __('Commands', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("command", $this->fields["command"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Setup') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("config", $this->fields["config"], 1, 1, 1);
     echo "</td>";
     echo "<td>";
     echo __('Check definition', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("check", $this->fields["check"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('See all resources in dashboard', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("allressources", $this->fields["allressources"], 1, 1, 0);
     echo "</td>";
     echo "<td>";
     echo __('Restart shinken', 'monitoring') . "&nbsp;:";
     echo "</td>";
     echo "<td>";
     Profile::dropdownNoneReadWrite("restartshinken", $this->fields["restartshinken"], 1, 0, 1);
     echo "</td>";
     echo "</tr>";
     if ($canedit) {
         echo "<tr>";
         echo "<th colspan='4'>";
         echo "<input type='hidden' name='profile_id' value='" . $items_id . "'/>";
         echo "<input type='submit' name='update' value=\"" . __('Save') . "\" class='submit'>";
         echo "</td>";
         echo "</tr>";
         echo "</table>";
         Html::closeForm();
     } else {
         echo "</table>";
     }
     echo "</div>";
     Html::closeForm();
 }
Exemplo n.º 23
0
 /**
  * profiles modification
  **/
 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 "<form action='" . $target . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='2' class='center b'>" . sprintf(__('%1$s %2$s'), __('Rights management'), $this->fields["name"]);
     echo "</th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Use the tree', 'treeview') . "</td><td>";
     Profile::dropdownNoneReadWrite("treeview", $this->fields["treeview"], 1, 1, 0);
     echo "</td></tr>";
     if ($canedit) {
         echo "<tr class='tab_bg_1'>";
         echo "<td class='center' colspan='2'>";
         echo "<input type='hidden' name='id' value={$id}>";
         echo "<input type='submit' name='update_user_profile' value='" . _sx('button', 'Update') . "'\n                class='submit'>";
         echo "</td></tr>";
     }
     echo "</table>";
     Html::closeForm();
 }
Exemplo n.º 24
0
 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', 'positions'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . PluginPositionsPosition::getTypeName() . ":</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("positions", $this->fields["positions"], 1, 1, 1);
     } else {
         Profile::dropdownNoneReadWrite("positions", $this->fields["positions"], 1, 1, 0);
     }
     echo "</td>";
     echo "<td></td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
 /**
  * @param $report
  **/
 static function showForReport($report)
 {
     global $DB;
     /* call from front/config.form.php
      * $report = "bar" (from reports) or "foo_bar" (other plugins)
      */
     if (empty($report) || !Session::haveRight('profile', READ)) {
         return false;
     }
     $current = self::getAllProfilesRights(array("name = 'plugin_reports_{$report}'"));
     $canedit = Session::haveRight('profile', UPDATE);
     if ($canedit) {
         echo "<form action='" . $_SERVER['PHP_SELF'] . "' method='post'>\n";
     }
     echo "<table class='tab_cadre'>\n";
     echo "<tr><th colspan='2'>" . __('Profils rights', 'reports') . "</th></tr>\n";
     $query = "SELECT `id`, `name`\n                FROM `glpi_profiles`\n                ORDER BY `name`";
     foreach ($DB->request($query) as $data) {
         echo "<tr class='tab_bg_1'><td>" . $data['name'] . "&nbsp: </td><td>";
         $profrights = ProfileRight::getProfileRights($data['id'], array('statistic', 'reports'));
         $canstat = isset($profrights['statistic']) && $profrights['statistic'];
         $canreport = isset($profrights['reports']) && $profrights['reports'];
         if (isStat($report) && $canstat || !isStat($report) && $canreport) {
             Profile::dropdownNoneReadWrite($data['id'], isset($current[$data['id']]) ? $current[$data['id']] : 0, 1, 1, 0);
         } else {
             // Can't access because missing right from GLPI core
             // Profile::dropdownNoneReadWrite($mod,'',1,0,0);
             echo "<input type='hidden' name='" . $data['id'] . "' value='NULL'>" . __('No access') . " *";
         }
         echo "</td></tr>\n";
     }
     echo "<tr class='tab_bg_4'><td colspan='2'>* ";
     if (isStat($report)) {
         _e('No right on Assistance / Statistics', 'reports');
     } else {
         _e('No right on Tools / Reports', 'reports');
     }
     echo "</tr>";
     if ($canedit) {
         echo "<tr class='tab_bg_1'><td colspan='2' class='center'>";
         echo "<input type='hidden' name='report' value='{$report}'>";
         echo "<input type='submit' name='update' value='" . _sx('button', 'Update') . "' " . "class='submit'>";
         echo "</td></tr>\n";
         echo "</table>\n";
         Html::closeForm();
     } else {
         echo "</table>\n";
     }
 }
Exemplo n.º 26
0
 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' class='center b'>" . sprintf(__('%1$s - %2$s'), __('Rights management', 'racks'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . _n('Rack enclosure', 'Rack enclosures', 2, 'racks') . "</td><td>";
     Profile::dropdownNoneReadWrite("racks", $this->fields["racks"], 1, 1, 1);
     echo "</td>";
     echo "<td>" . __('Equipments models specifications', 'racks') . "</td><td>";
     Profile::dropdownNoneReadWrite("model", $this->fields["model"], 1, 1, 1);
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 27
0
 function showForm($ID, $options = array())
 {
     global $LANG;
     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'>" . $LANG['plugin_mreporting']["name"] . " " . $prof->fields["name"] . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __("Display report") . ":</td><td>";
     Profile::dropdownNoneReadWrite("reports", $this->fields["reports"], 1, 1, 0);
     echo "</td>";
     echo "<td>" . __("Setup") . ":</td><td>";
     Profile::dropdownNoneReadWrite("config", $this->fields["config"], 1, 0, 1);
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 28
0
 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' class='center b'>" . sprintf(__('%1$s - %2$s'), __('Rights management', 'domains'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . PluginDomainsDomain::getTypeName(2) . "</td><td>";
     if ($prof->fields['interface'] != 'helpdesk') {
         Profile::dropdownNoneReadWrite("domains", $this->fields["domains"], 1, 1, 1);
     } else {
         echo Dropdown::getYesNo(0);
     }
     echo "</td>";
     echo "<td>" . __('Associable items to a ticket') . " - " . PluginDomainsDomain::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 "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 29
0
 function showForm($ID, $options = array())
 {
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     //      $target = $this->getFormURL();
     //      if (isset($options['target'])) {
     //        $target = $options['target'];
     //      }
     $prof = new Profile();
     if ($ID) {
         $this->getFromDBByProfile($ID);
         $prof->getFromDB($ID);
     }
     $this->showFormHeader($options);
     //      echo "<form action='".$target."' method='post'>";
     //      echo "<table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_2'>";
     echo "<th colspan='4'>" . sprintf(__('%1$s - %2$s'), __('Rights management', 'addressing'), $prof->fields["name"]) . "</th>";
     echo "</tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Generate reports', 'addressing') . "</td><td>";
     Profile::dropdownNoneReadWrite("addressing", $this->fields["addressing"], 1, 1, 1);
     echo "</td>";
     echo "<td>" . __('Use ping on equipment form', 'addressing') . "</td><td>";
     Dropdown::showYesNo("use_ping_in_equipment", $this->fields["use_ping_in_equipment"]);
     echo "</td>";
     echo "</tr>";
     echo "<input type='hidden' name='id' value=" . $this->fields["id"] . ">";
     $options['candel'] = false;
     $this->showFormButtons($options);
 }
Exemplo n.º 30
0
 function showForm($id)
 {
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     $canedit = Session::haveRight("profile", "w");
     if ($id) {
         $this->getProfilesFromDB($id);
     }
     $general_profile = new Profile();
     $general_profile->getFromDB($id);
     echo "<form action='" . $this->getSearchURL() . "' method='post'>";
     echo "<table class='tab_cadre_fixe'>";
     $types = PluginGenericobjectType::getTypes(true);
     if (!empty($types)) {
         echo "<tr><th colspan='2' align='center'><strong>";
         echo __("Rights assignment") . "</strong></th></tr>";
         foreach ($types as $tmp => $type) {
             $itemtype = $type['itemtype'];
             $objecttype = new PluginGenericobjectType($itemtype);
             $profile = self::getProfileforItemtype($id, $itemtype);
             echo "<tr><th align='center' colspan='2' class='tab_bg_2'>" . $itemtype::getTypeName() . "</th></tr>";
             if ($general_profile->fields['interface'] == 'central') {
                 echo "<tr class='tab_bg_2'>";
                 $right = $type['itemtype'];
                 echo "<td>" . __("Access object", "genericobject") . ":</td><td>";
                 Profile::dropdownNoneReadWrite($right, $profile['right'], 1, 1, 1);
                 echo "</td></tr>";
             }
             if ($objecttype->canUseTickets()) {
                 echo "<tr class='tab_bg_2'>";
                 echo "<td>" . __("Associate tickets to this object", "genericobject") . ":</td><td>";
                 $right_openticket = $type['itemtype'] . "_open_ticket";
                 Dropdown::showYesNo($right_openticket, $profile['open_ticket']);
                 echo "</td></tr>";
             }
         }
         if ($canedit) {
             echo "<tr class='tab_bg_1'>";
             echo "<td align='center' colspan='2'>";
             echo "<input type='hidden' name='profiles_id' value='" . $id . "'>";
             echo "<input type='hidden' name='id' value={$id}>";
             echo "<input type='submit' name='update_user_profile' value=\"" . _sx('button', 'Post') . "\" class='submit'>";
             echo "</td></tr>";
         }
     } else {
         echo "<tr><td class='center'><strong>";
         echo __("No type defined", "genericobject") . "</strong></td></tr>";
     }
     echo "</table>";
     Html::closeForm();
 }