Beispiel #1
0
 function getSearchOptions()
 {
     $tab = array();
     $tab['common'] = self::getTypeName(2);
     $tab[1]['table'] = $this->table;
     $tab[1]['field'] = 'registration_number';
     $tab[1]['name'] = __('Administrative number');
     $tab[1]['datatype'] = 'string';
     $tab[2]['table'] = $this->table;
     $tab[2]['field'] = 'id';
     $tab[2]['name'] = __('ID');
     $tab[2]['massiveaction'] = false;
     $tab[2]['datatype'] = 'number';
     $tab[2]['nosearch'] = true;
     // FROM resources
     $tab[4350]['table'] = 'glpi_plugin_resources_resources';
     $tab[4350]['field'] = 'name';
     $tab[4350]['name'] = __('Name');
     $tab[4350]['datatype'] = 'itemlink';
     $tab[4350]['itemlink_type'] = 'PluginResourcesResource';
     $tab[4351]['table'] = 'glpi_plugin_resources_resources';
     $tab[4351]['field'] = 'firstname';
     $tab[4351]['name'] = __('First name');
     $tab[4352]['table'] = 'glpi_plugin_resources_resources';
     $tab[4352]['field'] = 'quota';
     $tab[4352]['name'] = __('Quota', 'resources');
     $tab[4352]['datatype'] = 'decimal';
     $tab[4353]['table'] = 'glpi_plugin_resources_resourcesituations';
     $tab[4353]['field'] = 'name';
     $tab[4353]['name'] = PluginResourcesResourceSituation::getTypeName(1);
     $tab[4353]['datatype'] = 'dropdown';
     $tab[4354]['table'] = 'glpi_plugin_resources_contractnatures';
     $tab[4354]['field'] = 'name';
     $tab[4354]['name'] = PluginResourcesContractNature::getTypeName(1);
     $tab[4354]['datatype'] = 'dropdown';
     $tab[4355]['table'] = 'glpi_plugin_resources_contracttypes';
     $tab[4355]['field'] = 'name';
     $tab[4355]['name'] = PluginResourcesContractType::getTypeName(1);
     $tab[4355]['datatype'] = 'dropdown';
     $tab[4356]['table'] = 'glpi_plugin_resources_resourcespecialities';
     $tab[4356]['field'] = 'name';
     $tab[4356]['name'] = PluginResourcesResourceSpeciality::getTypeName(1);
     $tab[4356]['datatype'] = 'dropdown';
     $tab[4357]['table'] = 'glpi_plugin_resources_ranks';
     $tab[4357]['field'] = 'name';
     $tab[4357]['name'] = PluginResourcesRank::getTypeName(1);
     $tab[4357]['datatype'] = 'dropdown';
     $tab[4358]['table'] = 'glpi_plugin_resources_professions';
     $tab[4358]['field'] = 'name';
     $tab[4358]['name'] = PluginResourcesProfession::getTypeName(1);
     $tab[4358]['datatype'] = 'dropdown';
     $tab[4359]['table'] = 'glpi_plugin_resources_professionlines';
     $tab[4359]['field'] = 'name';
     $tab[4359]['name'] = PluginResourcesProfessionLine::getTypeName(1);
     $tab[4359]['datatype'] = 'dropdown';
     $tab[4360]['table'] = 'glpi_plugin_resources_professioncategories';
     $tab[4360]['field'] = 'name';
     $tab[4360]['name'] = PluginResourcesProfessionCategory::getTypeName(1);
     $tab[4360]['datatype'] = 'dropdown';
     $tab[4376]['table'] = 'glpi_plugin_resources_resources';
     $tab[4376]['field'] = 'date_begin';
     $tab[4376]['name'] = __('Arrival date', 'resources');
     $tab[4376]['datatype'] = 'date';
     $tab[4377]['table'] = 'glpi_plugin_resources_resources';
     $tab[4377]['field'] = 'date_end';
     $tab[4377]['name'] = __('Departure date', 'resources');
     $tab[4377]['datatype'] = 'date';
     // FROM employment
     $tab[4361]['table'] = 'glpi_plugin_resources_employments';
     $tab[4361]['field'] = 'name';
     $tab[4361]['name'] = __('Name') . " - " . PluginResourcesEmployment::getTypeName(1);
     $tab[4361]['forcegroupby'] = true;
     $tab[4362]['table'] = 'glpi_plugin_resources_employments';
     $tab[4362]['field'] = 'ratio_employment_budget';
     $tab[4362]['name'] = __('Ratio Employment / Budget', 'resources');
     $tab[4362]['datatype'] = 'decimal';
     $tab[4363]['table'] = 'glpi_plugin_resources_employmentranks';
     $tab[4363]['field'] = 'name';
     $tab[4363]['name'] = PluginResourcesEmployment::getTypeName(1) . " - " . PluginResourcesRank::getTypeName(1);
     $tab[4363]['datatype'] = 'dropdown';
     $tab[4364]['table'] = 'glpi_plugin_resources_employmentprofessions';
     $tab[4364]['field'] = 'name';
     $tab[4364]['name'] = PluginResourcesEmployment::getTypeName(1) . " - " . PluginResourcesProfession::getTypeName(1);
     $tab[4364]['datatype'] = 'dropdown';
     $tab[4365]['table'] = 'glpi_plugin_resources_employmentprofessionlines';
     $tab[4365]['field'] = 'name';
     $tab[4365]['name'] = PluginResourcesEmployment::getTypeName(1) . " - " . PluginResourcesProfessionLine::getTypeName(1);
     $tab[4365]['datatype'] = 'dropdown';
     $tab[4366]['table'] = 'glpi_plugin_resources_employmentprofessioncategories';
     $tab[4366]['field'] = 'name';
     $tab[4366]['name'] = PluginResourcesEmployment::getTypeName(1) . " - " . PluginResourcesProfessionCategory::getTypeName(1);
     $tab[4366]['datatype'] = 'dropdown';
     $tab[4367]['table'] = 'glpi_plugin_resources_employments';
     $tab[4367]['field'] = 'begin_date';
     $tab[4367]['name'] = __('Begin date');
     $tab[4367]['datatype'] = 'date';
     $tab[4368]['table'] = 'glpi_plugin_resources_employments';
     $tab[4368]['field'] = 'end_date';
     $tab[4368]['name'] = __('End date');
     $tab[4368]['datatype'] = 'date';
     $tab[4369]['table'] = 'glpi_plugin_resources_employmentstates';
     $tab[4369]['field'] = 'name';
     $tab[4369]['name'] = PluginResourcesEmploymentState::getTypeName(1);
     $tab[4369]['datatype'] = 'dropdown';
     //From employer
     $tab[4370]['table'] = 'glpi_plugin_resources_employers';
     $tab[4370]['field'] = 'completename';
     $tab[4370]['name'] = PluginResourcesEmployer::getTypeName(1);
     $tab[4370]['datatype'] = 'dropdown';
     $tab[4371]['table'] = 'glpi_locations';
     $tab[4371]['field'] = 'completename';
     $tab[4371]['name'] = __('Employer address', 'resources');
     $tab[4371]['datatype'] = 'dropdown';
     $tab[4372]['table'] = 'glpi_plugin_resources_employmentranks';
     $tab[4372]['field'] = 'id';
     $tab[4372]['name'] = PluginResourcesEmployment::getTypeName(1) . " - " . PluginResourcesRank::getTypeName(1) . " - " . __('ID');
     $tab[4373]['table'] = 'glpi_plugin_resources_employmentprofessions';
     $tab[4373]['field'] = 'id';
     $tab[4373]['name'] = PluginResourcesEmployment::getTypeName(1) . " - " . PluginResourcesProfession::getTypeName(1) . " - " . __('ID');
     $tab[4374]['table'] = 'glpi_plugin_resources_ranks';
     $tab[4374]['field'] = 'id';
     $tab[4374]['name'] = PluginResourcesResource::getTypeName(1) . " - " . PluginResourcesRank::getTypeName(1) . " - " . __('ID');
     $tab[4375]['table'] = 'glpi_plugin_resources_professions';
     $tab[4375]['field'] = 'id';
     $tab[4375]['name'] = PluginResourcesResource::getTypeName(1) . " - " . PluginResourcesProfession::getTypeName(1) . " - " . __('ID');
     return $tab;
 }
 function getTags()
 {
     $tags = array('resource.id' => 'ID', 'resource.name' => __('Name'), 'resource.firstname' => __('First name'), 'resource.type' => PluginResourcesContractType::getTypeName(1), 'resource.quota' => __('Quota', 'resources'), 'resource.situation' => PluginResourcesResourceSituation::getTypeName(1), 'resource.contractnature' => PluginResourcesContractNature::getTypeName(1), 'resource.rank' => PluginResourcesRank::getTypeName(1), 'resource.speciality' => PluginResourcesResourceSpeciality::getTypeName(1), 'resource.users' => __('Resource manager', 'resources'), 'resource.usersrecipient' => __('Requester'), 'resource.datedeclaration' => __('Request date'), 'resource.datebegin' => __('Arrival date', 'resources'), 'resource.dateend' => __('Departure date', 'resources'), 'resource.department' => PluginResourcesDepartment::getTypeName(1), 'resource.location' => __('Location'), 'resource.comment' => __('Description'), 'resource.usersleaving' => __('Informant of leaving', 'resources'), 'resource.leaving' => __('Declared as leaving', 'resources'), 'resource.leavingreason' => PluginResourcesLeavingReason::getTypeName(1), 'resource.helpdesk' => __('Associable to a ticket'), 'resource.action_user' => __('Last updater'), 'update.name' => __('Name'), 'update.firstname' => __('First name'), 'update.type' => PluginResourcesContractType::getTypeName(1), 'update.quota' => __('Quota', 'resources'), 'update.situation' => PluginResourcesResourceSituation::getTypeName(1), 'update.contractnature' => PluginResourcesContractNature::getTypeName(1), 'update.rank' => PluginResourcesRank::getTypeName(1), 'update.speciality' => PluginResourcesResourceSpeciality::getTypeName(1), 'update.users' => __('Resource manager', 'resources'), 'update.usersrecipient' => __('Requester'), 'update.datedeclaration' => __('Request date'), 'update.datebegin' => __('Arrival date', 'resources'), 'update.dateend' => __('Departure date', 'resources'), 'update.department' => PluginResourcesDepartment::getTypeName(1), 'update.status' => PluginResourcesResourceState::getTypeName(1), 'update.location' => __('Location'), 'update.comment' => __('Description'), 'update.usersleaving' => __('Informant of leaving', 'resources'), 'update.leaving' => __('Declared as leaving', 'resources'), 'update.leavingreason' => PluginResourcesLeavingReason::getTypeName(1), 'update.helpdesk' => __('Associable to a ticket'), 'task.name' => __('Name'), 'task.type' => __('Type'), 'task.users' => __('Technician'), 'task.groups' => __('Group'), 'task.datebegin' => __('Begin date'), 'task.dateend' => __('End date'), 'task.planned' => __('Used for planning', 'resources'), 'task.realtime' => __('Effective duration', 'resources'), 'task.finished' => __('Carried out task', 'resources'), 'task.comment' => __('Description'));
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true));
     }
     $this->addTagToList(array('tag' => 'resource', 'label' => __('At creation, update, removal of a resource', 'resources'), 'value' => false, 'foreach' => true, 'events' => array('new', 'update', 'delete', 'report', 'newresting', 'updateresting', 'deleteresting', 'newholiday', 'updateholiday', 'deleteholiday')));
     $this->addTagToList(array('tag' => 'updates', 'label' => __('Modified fields', 'resources'), 'value' => false, 'foreach' => true, 'events' => array('update', 'updateresting', 'updateholiday')));
     $this->addTagToList(array('tag' => 'tasks', 'label' => __('At creation, update, removal of a task', 'resources'), 'value' => false, 'foreach' => true, 'events' => array('newtask', 'updatetask', 'deletetask')));
     asort($this->tag_descriptions);
 }
Beispiel #3
0
 function wizardSecondForm($ID, $options = array())
 {
     global $CFG_GLPI;
     $empty = 0;
     if ($ID > 0) {
         $this->check($ID, 'r');
     } else {
         // Create item
         $this->check(-1, 'w');
         $this->getEmpty();
         $empty = 1;
     }
     $rank = new PluginResourcesRank();
     if (!isset($options["requiredfields"])) {
         $options["requiredfields"] = 0;
     }
     if (($options['withtemplate'] == 2 || $options["new"] != 1) && $options["requiredfields"] != 1) {
         $options["name"] = $this->fields["name"];
         $options["firstname"] = $this->fields["firstname"];
         $options["locations_id"] = $this->fields["locations_id"];
         $options["users_id"] = $this->fields["users_id"];
         $options["plugin_resources_departments_id"] = $this->fields["plugin_resources_departments_id"];
         $options["date_begin"] = $this->fields["date_begin"];
         $options["date_end"] = $this->fields["date_end"];
         $options["comment"] = $this->fields["comment"];
         $options["quota"] = $this->fields["quota"];
         $options["plugin_resources_resourcesituations_id"] = $this->fields["plugin_resources_resourcesituations_id"];
         $options["plugin_resources_contractnatures_id"] = $this->fields["plugin_resources_contractnatures_id"];
         $options["plugin_resources_ranks_id"] = $this->fields["plugin_resources_ranks_id"];
         $options["plugin_resources_resourcespecialities_id"] = $this->fields["plugin_resources_resourcespecialities_id"];
         $options["plugin_resources_leavingreasons_id"] = $this->fields["plugin_resources_leavingreasons_id"];
     }
     echo "<div align='center'>";
     echo "<form action='" . $options['target'] . "' method='post'>";
     echo "<table class='plugin_resources_wizard'>";
     echo "<tr>";
     echo "<td class='plugin_resources_wizard_right_area' valign='top'>";
     echo "<div class='plugin_resources_wizard_title'><p>";
     echo "<img class='plugin_resource_wizard_img' src='" . $CFG_GLPI['root_doc'] . "/plugins/resources/pics/newresource.png' alt='newresource'/>&nbsp;";
     _e('Enter general information about the resource', 'resources');
     echo "</p></div>";
     echo "<div class='center'>";
     if (!$this->canView()) {
         return false;
     }
     echo "<table class='plugin_resources_wizard_table'>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td width='30%'>" . PluginResourcesContractType::getTypeName(1) . "</td><td width='70%'>";
     if ($this->fields["plugin_resources_contracttypes_id"]) {
         echo Dropdown::getDropdownName("glpi_plugin_resources_contracttypes", $this->fields["plugin_resources_contracttypes_id"]);
     } else {
         _e('Without contract', 'resources');
     }
     echo "</td>";
     echo "</tr></table>";
     echo "<br>";
     echo "<table class='plugin_resources_wizard_table'>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     $required = array();
     $input = array();
     if (isset($this->fields["entities_id"]) || $empty == 1) {
         if ($empty == 1) {
             $input['plugin_resources_contracttypes_id'] = 0;
             $input['entities_id'] = $_SESSION['glpiactive_entity'];
             echo "<input type='hidden' name='entities_id' value='" . $_SESSION['glpiactive_entity'] . "'>";
         } else {
             $input['plugin_resources_contracttypes_id'] = $this->fields["plugin_resources_contracttypes_id"];
             if (isset($options['withtemplate']) && $options['withtemplate'] == 2) {
                 $input['entities_id'] = $_SESSION['glpiactive_entity'];
                 echo "<input type='hidden' name='entities_id' value='" . $_SESSION['glpiactive_entity'] . "'>";
             } else {
                 $input['entities_id'] = $this->fields["entities_id"];
                 echo "<input type='hidden' name='entities_id' value='" . $this->fields["entities_id"] . "'>";
             }
         }
     }
     $required = $this->checkRequiredFields($input);
     $alert = " class='red' ";
     if (Session::isMultiEntitiesMode()) {
         echo "<tr class='plugin_resources_wizard_explain'>";
         echo "<td width='30%'>";
         _e('Entity');
         echo "</td>";
         echo "<td width='50%'>";
         echo Dropdown::getDropdownName("glpi_entities", $input['entities_id']);
         echo "</td>";
         echo "</tr>";
     }
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td";
     if (in_array("name", $required)) {
         echo $alert;
     }
     echo ">";
     _e('Name');
     echo "</td>";
     echo "<td>";
     $option = array('value' => $options["name"], 'option' => "onchange=\"javascript:this.value=this.value.toUpperCase();\"");
     Html::autocompletionTextField($this, "name", $option);
     echo "</td>";
     echo "<td rowspan='2' class='plugin_resources_wizard_comment red'>";
     _e("Thank you for paying attention to the spelling of the name and the firstname of the resource. For compound firstnames, separate them with a dash \"-\".", "resources");
     echo "</td>";
     echo "</tr>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td";
     if (in_array("firstname", $required)) {
         echo $alert;
     }
     echo ">";
     _e('First name');
     echo "</td>";
     echo "<td>";
     $option = array('value' => $options["firstname"], 'option' => "onChange='First2UpperCase(this.value);' style='text-transform:capitalize;'");
     Html::autocompletionTextField($this, "firstname", $option);
     echo "</td>";
     echo "</tr>";
     if ($this->fields["plugin_resources_resourcestates_id"]) {
         echo "<tr class='plugin_resources_wizard_explain'>";
         echo "<td>" . PluginResourcesResourceState::getTypeName(1) . "</td><td>";
         echo Dropdown::getDropdownName("glpi_plugin_resources_resourcestates", $this->fields["plugin_resources_resourcestates_id"]);
         echo "</td>";
         echo "</tr>";
     }
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td";
     if (in_array("locations_id", $required)) {
         echo $alert;
     }
     echo ">";
     _e('Location');
     echo "</td>";
     echo "<td>";
     Dropdown::show('Location', array('name' => "locations_id", 'value' => $options["locations_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td";
     if (in_array("quota", $required)) {
         echo $alert;
     }
     echo ">";
     _e('Quota', 'resources');
     echo "</td>";
     echo "<td>";
     echo "<input type='text' name='quota' value='" . Html::formatNumber($options["quota"], true, 4) . "' size='14'>";
     echo "</td>";
     echo "</tr></table>";
     echo "<br>";
     if ($rank->canView()) {
         echo "<table class='plugin_resources_wizard_table'>";
         echo "<tr class='plugin_resources_wizard_explain'>";
         echo "<td width='30%' ";
         if (in_array("plugin_resources_resourcesituations_id", $required)) {
             echo $alert;
         }
         echo ">";
         echo PluginResourcesResourceSituation::getTypeName(1);
         echo "</td>";
         echo "<td width='70%'>";
         $params = array('name' => 'plugin_resources_resourcesituations_id', 'value' => $options['plugin_resources_resourcesituations_id'], 'entity' => $this->fields["entities_id"], 'action' => $CFG_GLPI["root_doc"] . "/plugins/resources/ajax/dropdownContractnature.php", 'span' => 'span_contractnature');
         self::showGenericDropdown('PluginResourcesResourceSituation', $params);
         echo "</td>";
         echo "</tr>";
         echo "<tr class='plugin_resources_wizard_explain'>";
         echo "<td";
         if (in_array("plugin_resources_contractnatures_id", $required)) {
             echo $alert;
         }
         echo ">";
         echo PluginResourcesContractNature::getTypeName(1);
         echo "</td><td>";
         echo "<span id='span_contractnature' name='span_contractnature'>";
         if ($options["plugin_resources_contractnatures_id"] > 0) {
             echo Dropdown::getDropdownName('glpi_plugin_resources_contractnatures', $options["plugin_resources_contractnatures_id"]);
         } else {
             echo "<input type='hidden' name='plugin_resources_contractnatures_id' value='0'>";
             _e('None');
         }
         echo "</span>";
         echo "</td>";
         echo "</tr>";
         echo "<tr class='plugin_resources_wizard_explain'>";
         echo "<td";
         if (in_array("plugin_resources_ranks_id", $required)) {
             echo $alert;
         }
         echo ">";
         echo PluginResourcesRank::getTypeName(1);
         echo "</td>";
         echo "<td>";
         $params = array('name' => 'plugin_resources_ranks_id', 'value' => $options['plugin_resources_ranks_id'], 'entity' => $this->fields["entities_id"], 'action' => $CFG_GLPI["root_doc"] . "/plugins/resources/ajax/dropdownSpeciality.php", 'span' => 'span_speciality');
         self::showGenericDropdown('PluginResourcesRank', $params);
         echo "</td>";
         echo "</tr>";
         echo "<tr class='plugin_resources_wizard_explain'>";
         echo "<td";
         if (in_array("plugin_resources_resourcespecialities_id", $required)) {
             echo $alert;
         }
         echo ">";
         echo PluginResourcesResourceSpeciality::getTypeName(1);
         echo "</td><td>";
         echo "<span id='span_speciality' name='span_speciality'>";
         if ($options["plugin_resources_resourcespecialities_id"] > 0) {
             echo Dropdown::getDropdownName('glpi_plugin_resources_resourcespecialities', $options["plugin_resources_resourcespecialities_id"]);
         } else {
             echo "<input type='hidden' name='plugin_resources_resourcespecialities_id' value='0'>";
             _e('None');
         }
         echo "</span>";
         echo "</td>";
         echo "</tr></table>";
         echo "<br>";
     } else {
         echo "<input type='hidden' name='plugin_resources_resourcesituations_id' value='0'>";
         echo "<input type='hidden' name='plugin_resources_contractnatures_id' value='0'>";
         echo "<input type='hidden' name='plugin_resources_ranks_id' value='0'>";
         echo "<input type='hidden' name='plugin_resources_resourcespecialities_id' value='0'>";
     }
     echo "<table class='plugin_resources_wizard_table'>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td width='30%' ";
     if (in_array("users_id", $required)) {
         echo $alert;
     }
     echo ">";
     echo __('Resource manager', 'resources') . "</td>";
     echo "<td width='70%'>";
     User::dropdown(array('value' => $options["users_id"], 'name' => "users_id", 'entity' => $input['entities_id'], 'right' => 'all'));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td";
     if (in_array("plugin_resources_departments_id", $required)) {
         echo $alert;
     }
     echo ">";
     echo PluginResourcesDepartment::getTypeName(1) . "</td><td>";
     Dropdown::show('PluginResourcesDepartment', array('name' => "plugin_resources_departments_id", 'value' => $options["plugin_resources_departments_id"], 'entity' => $this->fields["entities_id"]));
     echo "</td>";
     echo "</tr>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td";
     if (in_array("date_begin", $required)) {
         echo $alert;
     }
     echo ">";
     _e('Arrival date', 'resources');
     echo "</td>";
     echo "<td>";
     Html::showDateFormItem("date_begin", $options["date_begin"], true, true);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td";
     if (in_array("date_end", $required)) {
         echo $alert;
     }
     echo ">";
     echo __('Departure date', 'resources') . "&nbsp;";
     if (!in_array("date_end", $required)) {
         Html::showToolTip(nl2br(__('Empty for non defined', 'resources')));
     }
     echo "</td>";
     echo "<td>";
     Html::showDateFormItem("date_end", $options["date_end"], true, true);
     echo "</td>";
     echo "</tr></table>";
     echo "<br>";
     echo "<table class='plugin_resources_wizard_table'>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td colspan='4'>" . __('Description') . "</td>";
     echo "</tr>";
     echo "<tr><td colspan='4'>";
     echo "<textarea cols='95' rows='6' name='comment' >" . $options["comment"] . "</textarea>";
     echo "</td></tr>";
     echo "<tr class='plugin_resources_wizard_explain'>";
     echo "<td colspan='2'>" . __('Send a notification') . "&nbsp;";
     echo "<input type='checkbox' name='send_notification' checked = true";
     if ($_SESSION['glpiactiveprofile']['interface'] != 'central') {
         echo " disabled='true' ";
     }
     echo " value='1'>";
     if ($_SESSION['glpiactiveprofile']['interface'] != 'central') {
         echo "<input type='hidden' name='send_notification' value=\"1\">";
     }
     echo "</td></tr>";
     echo "<tr><td colspan='4'>&nbsp;";
     echo "</td></tr>";
     if (!empty($required)) {
         echo "<tr>";
         echo "<td class='right plugin_resources_wizard_explain red' colspan='4'>";
         _e('The fields in red must be completed', 'resources');
         echo "</td>";
         echo "</tr>";
     }
     echo "</table>";
     echo "</div></td>";
     echo "</tr>";
     $contract = $this->fields["plugin_resources_contracttypes_id"];
     if ($empty == 1) {
         $contract = $input['plugin_resources_contracttypes_id'];
     }
     echo "<input type='hidden' name='plugin_resources_contracttypes_id' value=\"" . $contract . "\">";
     echo "<input type='hidden' name='plugin_resources_resourcestates_id' value=\"" . $this->fields["plugin_resources_resourcestates_id"] . "\">";
     echo "<input type='hidden' name='withtemplate' value=\"" . $options['withtemplate'] . "\" >";
     echo "<input type='hidden' name='date_declaration' value=\"" . $_SESSION["glpi_currenttime"] . "\">";
     echo "<input type='hidden' name='users_id_recipient' value=\"" . Session::getLoginUserID() . "\">";
     echo "<input type='hidden' name='id' value=\"" . $ID . "\">";
     echo "<input type='hidden' name='plugin_resources_leavingreasons_id' value='0'>";
     if ($this->canCreate() && (empty($ID) || $options['withtemplate'] == 2)) {
         echo "<tr><td class='plugin_resources_wizard_button' colspan='2'>";
         echo "<div class='preview'>";
         echo "<input type='submit' name='undo_first_step' value='" . _sx('button', '< Previous', 'resources') . "' class='submit' />";
         echo "</div>";
         echo "<div class='next'>";
         echo "<input type='submit' name='second_step' value='" . _sx('button', 'Next >', 'resources') . "' class='submit' />";
         echo "<input type='hidden' name='plugin_resources_resources_id' value='" . $this->fields["id"] . "'/>";
         echo "</div>";
         echo "</td></tr>";
     } else {
         if ($this->canCreate() && !empty($ID) && $options["new"] != 1) {
             echo "<tr><td class='plugin_resources_wizard_button' colspan='2'>";
             echo "<div class='preview'>";
             echo "<input type='submit' name='undo_first_step' value='" . _sx('button', '< Previous', 'resources') . "' class='submit' />";
             echo "</div>";
             echo "<div class='next'>";
             echo "<input type='submit' name='second_step_update' value='" . _sx('button', 'Next >', 'resources') . "' class='submit' />";
             echo "<input type='hidden' name='plugin_resources_resources_id' value='" . $this->fields["id"] . "'/>";
             echo "</div>";
             echo "</td></tr>";
         }
     }
     echo "</table>";
     Html::closeForm();
     echo "</div>";
 }
Beispiel #4
0
function plugin_resources_getDropdown()
{
    $plugin = new Plugin();
    if ($plugin->isActivated("resources")) {
        return array('PluginResourcesContractType' => PluginResourcesContractType::getTypeName(2), 'PluginResourcesTaskType' => PluginResourcesTaskType::getTypeName(2), 'PluginResourcesResourceState' => PluginResourcesResource::getTypeName(2) . " - " . PluginResourcesResourceSituation::getTypeName(2), 'PluginResourcesDepartment' => PluginResourcesDepartment::getTypeName(2), 'PluginResourcesEmployer' => PluginResourcesEmployer::getTypeName(2), 'PluginResourcesClient' => PluginResourcesClient::getTypeName(2), 'PluginResourcesChoiceItem' => PluginResourcesChoiceItem::getTypeName(2), 'PluginResourcesResourceSituation' => PluginResourcesEmployer::getTypeName(2) . " - " . PluginResourcesResourceSituation::getTypeName(2), 'PluginResourcesContractNature' => PluginResourcesContractNature::getTypeName(2), 'PluginResourcesRank' => PluginResourcesRank::getTypeName(2), 'PluginResourcesResourceSpeciality' => PluginResourcesResourceSpeciality::getTypeName(2), 'PluginResourcesLeavingReason' => PluginResourcesLeavingReason::getTypeName(2), 'PluginResourcesProfession' => PluginResourcesProfession::getTypeName(2), 'PluginResourcesProfessionLine' => PluginResourcesProfessionLine::getTypeName(2), 'PluginResourcesProfessionCategory' => PluginResourcesProfessionCategory::getTypeName(2), 'PluginResourcesEmploymentState' => PluginResourcesEmploymentState::getTypeName(2), 'PluginResourcesBudgetType' => PluginResourcesBudgetType::getTypeName(2), 'PluginResourcesBudgetVolume' => PluginResourcesBudgetVolume::getTypeName(2), 'PluginResourcesCost' => PluginResourcesCost::getTypeName(2));
    } else {
        return array();
    }
}