Beispiel #1
0
 function getSearchOptions()
 {
     $tab = array();
     $tab['common'] = self::getTypeName(2);
     $tab[1]['table'] = 'glpi_plugin_resources_resources';
     $tab[1]['field'] = 'name';
     $tab[1]['name'] = __('Name');
     $tab[1]['datatype'] = 'itemlink';
     $tab[1]['itemlink_type'] = $this->getType();
     $tab[2]['table'] = 'glpi_plugin_resources_employers';
     $tab[2]['field'] = 'name';
     $tab[2]['name'] = PluginResourcesEmployer::getTypeName(1);
     $tab[2]['datatype'] = 'dropdown';
     $tab[3]['table'] = 'glpi_plugin_resources_clients';
     $tab[3]['field'] = 'name';
     $tab[3]['name'] = PluginResourcesClient::getTypeName(1);
     $tab[3]['datatype'] = 'dropdown';
     $tab[31]['table'] = $this->getTable();
     $tab[31]['field'] = 'id';
     $tab[31]['name'] = __('ID');
     $tab[31]['datatype'] = 'number';
     $tab[31]['massiveaction'] = false;
     return $tab;
 }
Beispiel #2
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[34]['table'] = $this->table;
     $tab[34]['field'] = 'realname';
     $tab[34]['name'] = __('Surname');
     $tab[34]['datatype'] = 'string';
     $tab[9]['table'] = $this->table;
     $tab[9]['field'] = 'firstname';
     $tab[9]['name'] = __('First name');
     $tab[9]['datatype'] = 'string';
     $tab[5]['table'] = 'glpi_useremails';
     $tab[5]['field'] = 'email';
     $tab[5]['name'] = _n('Email', 'Emails', 2);
     $tab[5]['datatype'] = 'email';
     $tab[5]['joinparams'] = array('jointype' => 'child');
     $tab[5]['forcegroupby'] = true;
     $tab[5]['massiveaction'] = false;
     $tab += Location::getSearchOptionsToAdd();
     $tab[6]['table'] = $this->table;
     $tab[6]['field'] = 'phone';
     $tab[6]['name'] = __('Phone');
     $tab[6]['datatype'] = 'string';
     $tab[10]['table'] = $this->table;
     $tab[10]['field'] = 'phone2';
     $tab[10]['name'] = __('Phone 2');
     $tab[10]['datatype'] = 'string';
     $tab[11]['table'] = $this->table;
     $tab[11]['field'] = 'mobile';
     $tab[11]['name'] = __('Mobile phone');
     $tab[11]['datatype'] = 'string';
     // FROM employee
     $tab[4313]['table'] = 'glpi_plugin_resources_employers';
     $tab[4313]['field'] = 'completename';
     $tab[4313]['name'] = PluginResourcesEmployer::getTypeName(1);
     $tab[4313]['datatype'] = 'dropdown';
     $tab[4314]['table'] = 'glpi_plugin_resources_clients';
     $tab[4314]['field'] = 'name';
     $tab[4314]['name'] = PluginResourcesClient::getTypeName(1);
     $tab[4314]['datatype'] = 'dropdown';
     // FROM resources
     $tab[4315]['table'] = 'glpi_plugin_resources_contracttypes';
     $tab[4315]['field'] = 'name';
     $tab[4315]['name'] = PluginResourcesContractType::getTypeName(1);
     $tab[4315]['datatype'] = 'dropdown';
     $tab[4316]['table'] = 'glpi_plugin_resources_managers';
     $tab[4316]['field'] = 'name';
     $tab[4316]['name'] = __('Resource manager', 'resources');
     $tab[4316]['searchtype'] = 'contains';
     $tab[4316]['datatype'] = 'dropdown';
     $tab[4317]['table'] = 'glpi_plugin_resources_resources';
     $tab[4317]['field'] = 'date_begin';
     $tab[4317]['name'] = __('Arrival date', 'resources');
     $tab[4317]['datatype'] = 'date';
     $tab[4318]['table'] = 'glpi_plugin_resources_resources';
     $tab[4318]['field'] = 'date_end';
     $tab[4318]['name'] = __('Departure date', 'resources');
     $tab[4318]['datatype'] = 'date';
     $tab[4319]['table'] = 'glpi_plugin_resources_departments';
     $tab[4319]['field'] = 'name';
     $tab[4319]['name'] = PluginResourcesDepartment::getTypeName(1);
     $tab[4319]['datatype'] = 'dropdown';
     $tab[4320]['table'] = 'glpi_plugin_resources_resourcestates';
     $tab[4320]['field'] = 'name';
     $tab[4320]['name'] = PluginResourcesResourceState::getTypeName(1);
     $tab[4320]['datatype'] = 'dropdown';
     return $tab;
 }
Beispiel #3
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();
    }
}