Exemplo n.º 1
0
function plugin_certificates_getDropdown() {

   $plugin = new Plugin();
   if ($plugin->isActivated("certificates"))
      return array('PluginCertificatesCertificateType'=>PluginCertificatesCertificateType::getTypeName(2),
               'PluginCertificatesCertificateState'=>PluginCertificatesCertificateState::getTypeName(2));
   else
      return array();
}
 function showForm($ID, $options = array())
 {
     $this->initForm($ID, $options);
     $this->showFormHeader($options);
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Name') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "name");
     echo "</td>";
     echo "<td>" . __('Technician in charge of the hardware') . "</td>";
     echo "<td>";
     User::dropdown(array('name' => "users_id_tech", 'value' => $this->fields["users_id_tech"], 'entity' => $this->fields["entities_id"], 'right' => 'interface'));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Type') . "</td><td>";
     Dropdown::show('PluginCertificatesCertificateType', array('name' => "plugin_certificates_certificatetypes_id", 'value' => $this->fields["plugin_certificates_certificatetypes_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     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 "</tr>";
     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>" . _n('Manufacturer', 'Manufacturers', 1) . " (" . __('Root CA', 'certificates') . ")</td>";
     echo "<td>";
     Manufacturer::dropdown(array('value' => $this->fields["manufacturers_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('DNS name', 'certificates') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "dns_name");
     echo "</td>";
     echo "<td>" . __('Creation date') . "</td>";
     echo "<td>";
     Html::showDateFormItem("date_query", $this->fields["date_query"], true, true);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('DNS suffix', 'certificates') . "</td>";
     echo "<td>";
     Html::autocompletionTextField($this, "dns_suffix");
     echo "</td>";
     echo "<td>" . __('Expiration date');
     echo "&nbsp;";
     Html::showToolTip(nl2br(__('Empty for infinite', 'certificates')));
     echo "&nbsp;</td>";
     echo "<td>";
     Html::showDateFormItem("date_expiration", $this->fields["date_expiration"], true, true);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . PluginCertificatesCertificateState::getTypeName(1) . "</td>";
     echo "<td>";
     Dropdown::show('PluginCertificatesCertificateState', array('name' => "plugin_certificates_certificatestates_id", 'value' => $this->fields["plugin_certificates_certificatestates_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "<td>" . __('Notification email', 'certificates') . "</td>";
     echo "<td>";
     Dropdown::showYesNo('mailing', $this->fields["mailing"]);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Self-signed', 'certificates') . "</td>";
     echo "<td>";
     Dropdown::showYesNo('auto_sign', $this->fields["auto_sign"]);
     echo "</td>";
     echo "<td>" . __('Associable to a ticket') . "</td><td>";
     Dropdown::showYesNo('is_helpdesk_visible', $this->fields['is_helpdesk_visible']);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>";
     echo __('Command used', 'certificates') . "</td><td>";
     echo "<textarea cols='35' rows='4' name='command' >";
     echo $this->fields["command"] . "</textarea>";
     echo "</td>";
     echo "<td>";
     echo __('Certificate request (CSR)', 'certificates') . "</td><td>";
     echo "<textarea cols='35' rows='4' name='certificate_request' >";
     echo $this->fields["certificate_request"] . "</textarea>";
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td class='center' colspan='2'>";
     printf(__('Last update on %s'), Html::convDateTime($this->fields["date_mod"]));
     echo "</td>";
     echo "<td>";
     echo self::getTypeName(1) . "</td><td>";
     echo "<textarea cols='35' rows='4' name='certificate_item' >";
     echo $this->fields["certificate_item"] . "</textarea>";
     echo "</td>";
     echo "</tr>";
     $this->showFormButtons($options);
     return true;
 }