当前位置: 首页>>代码示例>>PHP>>正文


PHP Html::autocompletionTextField方法代码示例

本文整理汇总了PHP中Html::autocompletionTextField方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::autocompletionTextField方法的具体用法?PHP Html::autocompletionTextField怎么用?PHP Html::autocompletionTextField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Html的用法示例。


在下文中一共展示了Html::autocompletionTextField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showNewRuleForm

 /**
  * @see Rule::showNewRuleForm()
  **/
 function showNewRuleForm($ID)
 {
     echo "<form method='post' action='" . Toolbox::getItemTypeFormURL('Entity') . "'>";
     echo "<table  class='tab_cadre_fixe'>";
     echo "<tr><th colspan='7'>" . __('Authorizations assignment rules') . "</th></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td><td>";
     Html::autocompletionTextField($this, "name", array('value' => '', 'size' => 33));
     echo '</td><td>' . __('Description') . "</td><td>";
     Html::autocompletionTextField($this, "description", array('value' => '', 'size' => 33));
     echo "</td><td>" . __('Logical operator') . "</td><td>";
     $this->dropdownRulesMatch();
     echo "</td><td rowspan='2' class='tab_bg_2 center middle'>";
     echo "<input type=hidden name='sub_type' value='" . get_class($this) . "'>";
     echo "<input type=hidden name='entities_id' value='-1'>";
     echo "<input type=hidden name='affectentity' value='{$ID}'>";
     echo "<input type=hidden name='_method' value='AddRule'>";
     echo "<input type='submit' name='execute' value=\"" . _sx('button', 'Add') . "\" class='submit'>";
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td class='center'>" . _n('Profile', 'Profiles', 1) . "</td><td>";
     Profile::dropdown();
     echo "</td><td><span class='small_space'>" . __('Recursive') . "</span></td><td colspan='3'>";
     Dropdown::showYesNo("is_recursive", 0);
     echo "</td></tr>\n";
     echo "</table>";
     Html::closeForm();
 }
开发者ID:stweil,项目名称:glpi,代码行数:31,代码来源:ruleright.class.php

示例2: showForm

 function showForm($ID, $options = array())
 {
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Name');
     echo "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, 'name');
     echo "</td>";
     echo "<td>" . __('Type') . "</td>";
     echo "<td>";
     Dropdown::showFromArray('type', PluginFusioninventoryCollect::getTypes(), array('value' => $this->fields['type']));
     echo "</td>";
     echo "</tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Comments');
     echo "</td>";
     echo "<td class='middle'>";
     echo "<textarea cols='45' rows='3' name='comment' >" . $this->fields["comment"] . "</textarea>";
     echo "</td>";
     echo "<td>" . __('Active') . "</td>";
     echo "<td>";
     Dropdown::showYesNo('is_active', $this->fields['is_active']);
     echo "</td>";
     echo "</tr>\n";
     $this->showFormButtons($options);
     return TRUE;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:31,代码来源:collect.class.php

示例3: showTextField

 /**
  * Basic display elements
  */
 public function showTextField($title, $varname)
 {
     echo "<label>" . $title . "&nbsp;:</label>";
     echo "<div class='input_wrap'>";
     Html::autocompletionTextField($this, $varname, $this->fields['name']);
     echo "</div>";
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:10,代码来源:common.view.class.php

示例4: showForm

 public function showForm($ID, $options = array())
 {
     if (!$this->isNewID($ID)) {
         $this->check($ID, READ);
     } else {
         $this->check(-1, UPDATE);
     }
     $options['colspan'] = 2;
     $options['target'] = Toolbox::getItemTypeFormURL(__CLASS__);
     $this->showFormHeader($options);
     echo '<table class="tab_cadre_fixe">';
     echo "<tr class='line0'><td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name");
     echo "</td>";
     echo "</tr>";
     echo "<tr class='line1'><td>" . __('Content') . "</td>";
     echo "<td>";
     echo "<textarea name='comment' id ='comment' >" . $this->fields['comment'] . "</textarea>";
     Html::initEditorSystem('comment');
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     return true;
 }
开发者ID:jcr0ch4,项目名称:formcreator,代码行数:25,代码来源:header.class.php

示例5: showForm

 function showForm($ID, $options = array())
 {
     $relation = new PluginRelationRelation();
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     //Nombre de la clase
     echo "<td>" . __('Nombre de la clase', 'Nombre de la clase') . ": </td><td>";
     $relation->dropdownClase("classname", $this->fields["classname"]);
     echo "</td>";
     //Clase con las que se relaciona
     echo "<td>" . __('Clase con la que se relaciona', 'Clase con la que se relaciona') . ": </td>";
     echo "<td>";
     $relation->dropdownClase("classlist", $this->fields["classlist"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     //Descripción
     echo "<td>" . __('Descripción', 'Descripción') . ": </td><td>";
     Html::autocompletionTextField($this, "comment", array('size' => "15"));
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     return true;
 }
开发者ID:OscarLoayzaB,项目名称:relation,代码行数:25,代码来源:relationclase.class.php

示例6: showInstantiationForm

 /**
  * @see NetworkPortInstantiation::showInstantiationForm()
  */
 function showInstantiationForm(NetworkPort $netport, $options = array(), $recursiveItems)
 {
     if (!$options['several']) {
         echo "<tr class='tab_bg_1'>";
         $this->showNetpointField($netport, $options, $recursiveItems);
         $this->showNetworkCardField($netport, $options, $recursiveItems);
         echo "</tr>\n";
     }
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('World Wide Name') . "</td><td>\n";
     Html::autocompletionTextField($this, 'wwn', array('value' => $this->fields['wwn']));
     echo "</td>";
     echo "<td>" . __('Fiber channel port speed') . "</td><td>\n";
     $standard_speeds = self::getPortSpeed();
     if (!isset($standard_speeds[$this->fields['speed']]) && !empty($this->fields['speed'])) {
         $speed = self::transformPortSpeed($this->fields['speed'], true);
     } else {
         $speed = true;
     }
     Dropdown::showFromArray('speed', $standard_speeds, array('value' => $this->fields['speed'], 'other' => $speed));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>\n";
     $this->showMacField($netport, $options);
     echo "<td>" . __('Connected to') . '</td><td>';
     self::showConnection($netport, true);
     echo "</td></tr>\n";
 }
开发者ID:btry,项目名称:glpi,代码行数:30,代码来源:networkportfiberchannel.class.php

示例7: showForm

 function showForm($id, $options = array())
 {
     if (!$this->can($id, READ)) {
         return false;
     }
     $this->showFormHeader($options);
     echo "<tr>";
     echo "<td><label>" . __('Name') . " :</label></td>";
     echo "<td style='width:30%'>";
     echo Html::autocompletionTextField($this, "name");
     echo "</td>";
     $rand = mt_rand();
     echo "<td><label for='dropdown_is_active{$rand}'>" . __('Active') . " :</label></td>";
     echo "<td style='width:30%'>";
     Dropdown::showYesNo('is_active', $this->fields['is_active'], -1, array('rand' => $rand));
     echo "</td></tr>";
     $rand = mt_rand();
     echo "<tr>";
     echo "<td><label for='dropdown_itilcategories_id{$rand}'>" . __('Category') . " :</label></td>";
     echo "<td>";
     Dropdown::show('ITILCategory', array('value' => $this->fields['itilcategories_id'], 'rand' => $rand));
     echo "</td><td colspan='2'></td></tr>";
     $rand = mt_rand();
     echo "<tr>";
     echo "<td><label for='dropdown_is_incident{$rand}'>" . __('Visible for an incident') . " :</label></td>";
     echo "<td>";
     Dropdown::showYesNo('is_incident', $this->fields['is_incident'], -1, array('rand' => $rand));
     echo "</td>";
     $rand = mt_rand();
     echo "<td><label for='dropdown_is_request{$rand}'>" . __('Visible for a request') . " :</label></td>";
     echo "<td>";
     Dropdown::showYesNo('is_request', $this->fields['is_request'], -1, array('rand' => $rand));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td><label for='comment'>" . __('Comments') . " : </label></td>";
     echo "<td align='left'>";
     echo "<textarea name='comment' id='comment' style='width:100%; height:70px;'>";
     echo $this->fields["comment"] . "</textarea>";
     echo "</td></tr>";
     echo "<tr><td colspan='4'><hr></td></tr>";
     echo "<tr><td><label for='groups_id_level1[]'>" . ucfirst(__('Level 1', 'itilcategorygroups')) . " :</label></td>";
     echo "<td>";
     self::multipleDropdownGroup(1, $this->fields['itilcategories_id'], $this->fields['view_all_lvl1']);
     echo "</td>";
     echo "<td><label for='groups_id_level2[]'>" . ucfirst(__('Level 2', 'itilcategorygroups')) . " :</label></td>";
     echo "<td>";
     self::multipleDropdownGroup(2, $this->fields['itilcategories_id'], $this->fields['view_all_lvl2']);
     echo "</td></tr>";
     echo "<tr><td><label for='groups_id_level3[]'>" . ucfirst(__('Level 3', 'itilcategorygroups')) . " :</label></td>";
     echo "<td>";
     self::multipleDropdownGroup(3, $this->fields['itilcategories_id'], $this->fields['view_all_lvl3']);
     echo "</td>";
     echo "<td><label for='groups_id_level4[]'>" . ucfirst(__('Level 4', 'itilcategorygroups')) . " :</label></td>";
     echo "<td>";
     self::multipleDropdownGroup(4, $this->fields['itilcategories_id'], $this->fields['view_all_lvl4']);
     echo "</td></tr>";
     $this->showFormButtons($options);
     Html::closeForm();
 }
开发者ID:erchbox,项目名称:itilcategorygroups,代码行数:59,代码来源:category.class.php

示例8: showOrderReference

 /**
  * Show order reference field
  * 
  * @param type $consumables_id
  */
 function showOrderReference($consumables_id)
 {
     $this->getFromDBByQuery(" WHERE `consumables_id` = '{$consumables_id}'");
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Order reference', 'consumables') . "</td>\n";
     echo "<td>";
     Html::autocompletionTextField($this, "order_ref");
     echo "</td>";
     echo "<td colspan='2'>";
     echo "</td>";
     echo "</tr>";
 }
开发者ID:AircraftRu,项目名称:consumables,代码行数:17,代码来源:field.class.php

示例9: showForm

 /**
  * Print the sla form
  *
  * @param $ID        integer  ID of the item
  * @param $options   array    of possible options:
  *     - target filename : where to go when done.
  *     - withtemplate boolean : template or basic item
  *
  *@return boolean item found
  **/
 function showForm($ID, $options = array())
 {
     $rowspan = 1;
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name", array('value' => $this->fields["name"]));
     echo "<td rowspan='" . $rowspan . "'>" . __('Comments') . "</td>";
     echo "<td rowspan='" . $rowspan . "'>\n            <textarea cols='45' rows='8' name='comment' >" . $this->fields["comment"] . "</textarea>";
     echo "</td></tr>";
     $this->showFormButtons($options);
     return true;
 }
开发者ID:korial29,项目名称:glpi,代码行数:25,代码来源:sla.class.php

示例10: showCloneForm

 static function showCloneForm(CommonGLPI $item)
 {
     echo "<form name='form' method='post' action='" . Toolbox::getItemTypeFormURL(__CLASS__) . "' >";
     echo "<div class='spaced' id='tabsbody'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th>" . __('Clone', 'behaviors') . "</th></tr>";
     if ($item->isEntityAssign()) {
         echo "<tr class='tab_bg_1'><td class='center'>";
         printf(__('%1$s: %2$s'), __('Destination entity'), "<span class='b'>" . Dropdown::getDropdownName('glpi_entities', $_SESSION['glpiactive_entity']) . "</span>");
         echo "</td></tr>";
     }
     $name = sprintf(__('%1$s %2$s'), __('Clone of', 'behaviors'), $item->getName());
     echo "<tr class='tab_bg_1'><td class='center'>" . sprintf(__('%1$s: %2$s'), __('Name'), $name);
     Html::autocompletionTextField($item, 'name', array('value' => $name, 'size' => 60));
     echo "<input type='hidden' name='itemtype' value='" . $item->getType() . "'>";
     echo "<input type='hidden' name='id'       value='" . $item->getID() . "'>";
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td class='center'>";
     echo "<input type='submit' name='_clone' value='" . __('Clone', 'behaviors') . "' class='submit'>";
     echo "</th></tr>";
     echo "</table></div>";
     Html::closeForm();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:23,代码来源:common.class.php

示例11: showForm

 public function showForm($ID, $options = array())
 {
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     //Nombre de la relación
     echo "<td>" . __('Nombre de la relación', 'Nombre de la relación') . ": </td><td>";
     Html::autocompletionTextField($this, "name", array('size' => "15"));
     echo "</td>";
     //Nombre de la relación en sentido inverso
     echo "<td>" . __('Nombre de la relación (sentido inverso)', 'Nombre de la relación (sentido inverso)') . ": </td>";
     echo "<td>";
     Html::autocompletionTextField($this, "invname", array('size' => "15"));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     //Descripción
     echo "<td>" . __('Descripción', 'Descripción') . ": </td><td>";
     Html::autocompletionTextField($this, "comment", array('size' => "15"));
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     return true;
 }
开发者ID:OscarLoayzaB,项目名称:relation,代码行数:24,代码来源:typerelation.class.php

示例12: showForm

 /**
  * Print the mailgate form
  *
  * @param $ID        integer  Id of the item to print
  * @param $options   array
  *     - target filename : where to go when done.
  *
  * @return boolean item found
  **/
 function showForm($ID, $options = array())
 {
     global $CFG_GLPI;
     $this->initForm($ID, $options);
     $options['colspan'] = 1;
     $this->showFormHeader($options);
     if (!function_exists('mb_list_encodings') || !function_exists('mb_convert_encoding')) {
         echo "<tr class='tab_bg_1'>" . "<td colspan='2'>" . __('mbstring extension not found. Warning with charsets used.') . "</td></tr>";
     }
     echo "<tr class='tab_bg_1'><td>" . sprintf(__('%1$s (%2$s)'), __('Name'), __('Email address')) . "</td><td>";
     Html::autocompletionTextField($this, "name");
     echo "</td></tr>";
     if ($this->fields['errors']) {
         echo "<tr class='tab_bg_1_2'><td>" . __('Connection errors') . "</td>";
         echo "<td>" . $this->fields['errors'] . "</td>";
         echo "</tr>";
     }
     echo "<tr class='tab_bg_1'><td>" . __('Active') . "</td><td>";
     Dropdown::showYesNo("is_active", $this->fields["is_active"]);
     echo "</td></tr>";
     $type = Toolbox::showMailServerConfig($this->fields["host"]);
     echo "<tr class='tab_bg_1'><td>" . __('Login') . "</td><td>";
     Html::autocompletionTextField($this, "login");
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td>" . __('Password') . "</td>";
     echo "<td><input type='password' name='passwd' value='' size='20' autocomplete='off'>";
     if ($ID > 0) {
         echo "<input type='checkbox' name='_blank_passwd'>&nbsp;" . __('Clear');
     }
     echo "</td></tr>";
     if (version_compare(PHP_VERSION, '5.3.2', '>=')) {
         echo "<tr class='tab_bg_1'><td>" . __('Use Kerberos authentication') . "</td>";
         echo "<td>";
         Dropdown::showYesNo("use_kerberos", $this->fields["use_kerberos"]);
         echo "</td></tr>\n";
     }
     if ($type != "pop") {
         echo "<tr class='tab_bg_1'><td>" . __('Accepted mail archive folder (optional)') . "</td>";
         echo "<td><input size='30' type='text' name='accepted' value=\"" . $this->fields['accepted'] . "\">";
         echo "</td></tr>\n";
         echo "<tr class='tab_bg_1'><td>" . __('Refused mail archive folder (optional)') . "</td>";
         echo "<td><input size='30' type='text' name='refused' value=\"" . $this->fields['refused'] . "\">";
         echo "</td></tr>\n";
     }
     echo "<tr class='tab_bg_1'>";
     echo "<td width='200px'> " . __('Maximum size of each file imported by the mails receiver') . "</td><td>";
     self::showMaxFilesize('filesize_max', $this->fields["filesize_max"]);
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td>" . __('Use mail date, instead of collect one') . "</td>";
     echo "<td>";
     Dropdown::showYesNo("use_mail_date", $this->fields["use_mail_date"]);
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'><td>" . __('Comments') . "</td>";
     echo "<td><textarea cols='45' rows='5' name='comment' >" . $this->fields["comment"] . "</textarea>";
     if ($ID > 0) {
         echo "<br>";
         //TRANS: %s is the datetime of update
         printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"]));
     }
     echo "</td></tr>";
     $this->showFormButtons($options);
     return true;
 }
开发者ID:remicollet,项目名称:glpi,代码行数:72,代码来源:mailcollector.class.php

示例13: showForm

 /**
  * Print the computer form
  *
  * @param $ID        integer ID of the item
  * @param $options   array
  *     - target for the Form
  *     - withtemplate template or basic computer
  *
  *@return Nothing (display)
  **/
 function showForm($ID, $options = array())
 {
     global $CFG_GLPI, $DB;
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     //TRANS: %1$s is a string, %2$s a second one without spaces between them : to change for RTL
     echo "<td>" . sprintf(__('%1$s%2$s'), __('Name'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
     echo "<td>";
     $objectName = autoName($this->fields["name"], "name", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
     Html::autocompletionTextField($this, 'name', array('value' => $objectName));
     echo "</td>";
     echo "<td>" . __('Status') . "</td>";
     echo "<td>";
     State::dropdown(array('value' => $this->fields["states_id"], 'entity' => $this->fields["entities_id"], 'condition' => "`is_visible_computer`"));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Location') . "</td>";
     echo "<td>";
     Location::dropdown(array('value' => $this->fields["locations_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "<td>" . __('Type') . "</td>";
     echo "<td>";
     ComputerType::dropdown(array('value' => $this->fields["computertypes_id"]));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Technician in charge of the hardware') . "</td>";
     echo "<td>";
     User::dropdown(array('name' => 'users_id_tech', 'value' => $this->fields["users_id_tech"], 'right' => 'own_ticket', 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "<td>" . __('Manufacturer') . "</td>";
     echo "<td>";
     Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Group in charge of the hardware') . "</td>";
     echo "<td>";
     Group::dropdown(array('name' => 'groups_id_tech', 'value' => $this->fields['groups_id_tech'], 'entity' => $this->fields['entities_id'], 'condition' => '`is_assign`'));
     echo "</td>";
     echo "<td>" . __('Model') . "</td>";
     echo "<td>";
     ComputerModel::dropdown(array('value' => $this->fields["computermodels_id"]));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     //TRANS: Number of the alternate username
     echo "<td>" . __('Alternate username number') . "</td>";
     echo "<td >";
     Html::autocompletionTextField($this, 'contact_num');
     echo "</td>";
     echo "<td>" . __('Serial number') . "</td>";
     echo "<td >";
     Html::autocompletionTextField($this, 'serial');
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Alternate username') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, 'contact');
     echo "</td>";
     echo "<td>" . sprintf(__('%1$s%2$s'), __('Inventory number'), isset($options['withtemplate']) && $options['withtemplate'] ? "*" : "") . "</td>";
     echo "<td>";
     $objectName = autoName($this->fields["otherserial"], "otherserial", isset($options['withtemplate']) && $options['withtemplate'] == 2, $this->getType(), $this->fields["entities_id"]);
     Html::autocompletionTextField($this, 'otherserial', array('value' => $objectName));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('User') . "</td>";
     echo "<td>";
     User::dropdown(array('value' => $this->fields["users_id"], 'entity' => $this->fields["entities_id"], 'right' => 'all'));
     echo "</td>";
     echo "<td>" . __('Network') . "</td>";
     echo "<td>";
     Network::dropdown(array('value' => $this->fields["networks_id"]));
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Group') . "</td>";
     echo "<td>";
     Group::dropdown(array('value' => $this->fields["groups_id"], 'entity' => $this->fields["entities_id"], 'condition' => '`is_itemgroup`'));
     echo "</td>";
     // Display auto inventory informations
     $rowspan = 10;
     $inventory_show = false;
     if (!empty($ID) && Plugin::haveImport() && $this->fields["is_dynamic"]) {
         $inventory_show = true;
         $rowspan -= 4;
     }
     echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
     echo "<td rowspan='{$rowspan}' class='middle'>";
     echo "<textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"];
     echo "</textarea></td></tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Domain') . "</td>";
//.........这里部分代码省略.........
开发者ID:pvasener,项目名称:glpi,代码行数:101,代码来源:computer.class.php

示例14: showForm

 /**
  * Print the version form
  *
  * @param $ID        integer ID of the item
  * @param $options   array
  *     - target for the Form
  *     - computers_id ID of the computer for add process
  *
  * @return true if displayed  false if item not found or not right to display
  **/
 function showForm($ID, $options = array())
 {
     global $CFG_GLPI;
     if (!Session::haveRight("computer", "w")) {
         return false;
     }
     $comp = new Computer();
     if ($ID > 0) {
         $this->check($ID, 'r');
         $comp->getFromDB($this->fields['computers_id']);
     } else {
         // Create item
         $this->check(-1, 'w', $options);
         $comp->getFromDB($options['computers_id']);
     }
     $this->showTabs($options);
     $this->showFormHeader($options);
     if ($this->isNewID($ID)) {
         echo "<input type='hidden' name='computers_id' value='" . $options['computers_id'] . "'>";
     }
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Computer') . "</td>";
     echo "<td>" . $comp->getLink() . "</td>";
     if (Plugin::haveImport()) {
         echo "<td>" . __('Automatic inventory') . "</td>";
         echo "<td>";
         if ($ID && $this->fields['is_dynamic']) {
             Plugin::doHook("autoinventory_information", $this);
         } else {
             _e('No');
         }
         echo "</td>";
     } else {
         echo "<td colspan='2'></td>";
     }
     echo "</tr>\n";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name");
     echo "</td><td>" . __('Virtualization system') . "</td>";
     echo "<td>";
     VirtualMachineType::dropdown(array('value' => $this->fields['virtualmachinetypes_id']));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Virtualization model') . "</td>";
     echo "<td>";
     VirtualMachineSystem::dropdown(array('value' => $this->fields['virtualmachinesystems_id']));
     echo "</td><td>" . __('State of the virtual machine') . "</td>";
     echo "<td>";
     VirtualMachineState::dropdown(array('value' => $this->fields['virtualmachinestates_id']));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('UUID') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "uuid");
     echo "</td>";
     echo "<td>" . _x('quantity', 'Processors number') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "vcpu");
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . sprintf(__('%1$s (%2$s)'), __('Memory'), __('Mio')) . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "ram");
     echo "</td>";
     echo "<td>" . __('Machine') . "</td>";
     echo "<td>";
     if ($link_computer = self::findVirtualMachine($this->fields)) {
         $computer = new Computer();
         if ($computer->getFromDB($link_computer)) {
             echo $computer->getLink(array('comments' => true));
         } else {
             echo NOT_AVAILABLE;
         }
     }
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     $this->addDivForTabs();
     return true;
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:92,代码来源:computervirtualmachine.class.php

示例15: showForm

 /**
  * Print the contract cost form
  *
  * @param $ID        integer  ID of the item
  * @param $options   array    options used
  **/
 function showForm($ID, $options = array())
 {
     if ($ID > 0) {
         $this->check($ID, READ);
     } else {
         // Create item
         $options['contracts_id'] = $options['parent']->getField('id');
         $this->check(-1, CREATE, $options);
         $this->initBasedOnPrevious();
     }
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     echo "<input type='hidden' name='contracts_id' value='" . $this->fields['contracts_id'] . "'>";
     Html::autocompletionTextField($this, 'name');
     echo "</td>";
     echo "<td>" . __('Cost') . "</td>";
     echo "<td>";
     echo "<input type='text' name='cost' value='" . Html::formatNumber($this->fields["cost"], true) . "'\n             size='14'>";
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td>" . __('Begin date') . "</td>";
     echo "<td>";
     Html::showDateField("begin_date", array('value' => $this->fields['begin_date']));
     echo "</td>";
     $rowspan = 3;
     echo "<td rowspan='{$rowspan}'>" . __('Comments') . "</td>";
     echo "<td rowspan='{$rowspan}' class='middle'>";
     echo "<textarea cols='45' rows='" . ($rowspan + 3) . "' name='comment' >" . $this->fields["comment"] . "</textarea>";
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_1'><td>" . __('End date') . "</td>";
     echo "<td>";
     Html::showDateField("end_date", array('value' => $this->fields['end_date']));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td>" . __('Budget') . "</td>";
     echo "<td>";
     Budget::dropdown(array('value' => $this->fields["budgets_id"]));
     echo "</td></tr>";
     $this->showFormButtons($options);
     return true;
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:47,代码来源:contractcost.class.php


注:本文中的Html::autocompletionTextField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。