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); }
function showResourcesToRemove() { global $CFG_GLPI; if (countElementsInTable($this->getTable()) > 0) { echo "<div align='center'>"; echo "<form method='post' action=\"" . $CFG_GLPI["root_doc"] . "/plugins/resources/front/resource.remove.php\">"; echo "<table class='plugin_resources_wizard' style='margin-top:1px;'>"; echo "<tr>"; echo "<td class='plugin_resources_wizard_left_area' valign='top'>"; echo "<div class='plugin_resources_presentation_logo'>"; echo "<img src='" . $CFG_GLPI['root_doc'] . "/plugins/resources/pics/removeresource.png' alt='removeresource' /></div>"; echo "</td>"; echo "<td class='plugin_resources_wizard_right_area' style='width:500px' valign='top'>"; echo "<div class='plugin_resources_wizard_title'>"; _e('Declare a departure', 'resources'); echo "</div>"; echo "<table>"; echo "<table>"; echo "<tr class='plugin_resources_wizard_explain'>"; echo "<td style='width:40%'>" . self::getTypeName(1) . "</td>"; echo "<td class='left'>"; PluginResourcesResource::dropdown(array('name' => 'plugin_resources_resources_id', 'entity' => $_SESSION['glpiactiveentities'])); echo "</td></tr>"; echo "<tr class='plugin_resources_wizard_explain'><td>"; echo __('Departure date', 'resources') . "</td>"; echo "<td class='left'>"; Html::showDateFormItem("date_end", $_POST["date_end"], true, true); echo "</td></tr>"; echo "<tr class='plugin_resources_wizard_explain'><td>"; echo PluginResourcesLeavingReason::getTypeName(1) . "</td>"; echo "<td class='left'>"; Dropdown::show('PluginResourcesLeavingReason', array('entity' => $_SESSION['glpiactiveentities'])); echo "</td></tr>"; echo "</table>"; echo "</div></td>"; echo "</tr>"; echo "<tr><td class='plugin_resources_wizard_button' colspan='2'>"; echo "<div class='next'>"; echo "<input type='submit' name='removeresources' value=\"" . __s('Declare a departure', 'resources') . "\" class='submit'>"; echo "</div>"; echo "</td></tr></table>"; Html::closeForm(); echo "</div>"; } else { echo "<div align='center'>" . __('No item found') . "</div>"; } }
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(); } }