Exemple #1
0
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[14]['table'] = $this->getTable();
     $tab[14]['field'] = 'code';
     $tab[14]['name'] = __('Code', 'resources');
     $tab[15]['table'] = $this->getTable();
     $tab[15]['field'] = __('Short name', 'resources');
     $tab[17]['table'] = 'glpi_plugin_resources_professions';
     $tab[17]['field'] = 'name';
     $tab[17]['name'] = __('Profession', 'resources');
     $tab[17]['datatype'] = 'dropdown';
     $tab[18]['table'] = $this->getTable();
     $tab[18]['field'] = 'is_active';
     $tab[18]['name'] = __('Active');
     $tab[18]['datatype'] = 'bool';
     $tab[19]['table'] = $this->getTable();
     $tab[19]['field'] = 'begin_date';
     $tab[19]['name'] = __('Begin date');
     $tab[19]['datatype'] = 'date';
     $tab[20]['table'] = $this->getTable();
     $tab[20]['field'] = 'end_date';
     $tab[20]['name'] = __('End date');
     $tab[20]['datatype'] = 'date';
     return $tab;
 }
Exemple #2
0
 /**
  * Get search function for the class
  *
  * @return array of search option
  **/
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab += Location::getSearchOptionsToAdd();
     $tab[3]['datatype'] = 'itemlink';
     return $tab;
 }
 function canDeleteItem()
 {
     if (isset($this->fields['OCS_TYPE']) && $this->fields['OCS_TYPE'] == '*' && isset($this->fields['OCS_TYPEMIB']) && $this->fields['OCS_TYPEMIB'] == '*') {
         return false;
     }
     return parent::canDeleteItem();
 }
 /**
  * @since version 0.85
  *
  * @see commonDBTM::getRights()
  **/
 function getRights($interface = 'central')
 {
     $values = parent::getRights();
     $values[self::HOMEPAGE] = __('See in homepage', 'monitoring');
     $values[self::DASHBOARD] = __('See in dashboard', 'monitoring');
     return $values;
 }
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[14]['table'] = $this->getTable();
     $tab[14]['field'] = 'code';
     $tab[14]['name'] = __('Code', 'resources');
     return $tab;
 }
 /**
  * Get search function for the class
  *
  * @return array of search option
  **/
 function getSearchOptions()
 {
     global $LANG;
     $tab = parent::getSearchOptions();
     $tab[11]['table'] = $this->getTable();
     $tab[11]['field'] = 'value';
     $tab[11]['name'] = $LANG['rulesengine'][16];
     return $tab;
 }
 /**
  * Get search function for the class
  *
  * @return array of search option
  */
 function getSearchOptions()
 {
     global $LANG;
     $tab = parent::getSearchOptions();
     $tab += Location::getSearchOptionsToAdd();
     $tab[3]['datatype'] = 'itemlink';
     $tab[3]['itemlink_type'] = 'Location';
     return $tab;
 }
 /**
  * Get search function for the class
  *
  * @return array of search option
  **/
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[11]['table'] = $this->getTable();
     $tab[11]['field'] = 'value';
     $tab[11]['name'] = _n('Criterion', 'Criteria', 1);
     $tab[11]['datatype'] = 'string';
     return $tab;
 }
Exemple #9
0
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[10]['table'] = $this->getTable();
     $tab[10]['field'] = 'essid';
     $tab[10]['name'] = __('ESSID');
     $tab[10]['datatype'] = 'string';
     return $tab;
 }
Exemple #10
0
 /**
  * Get search function for the class
  *
  * @return array of search option
  **/
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[11]['table'] = $this->getTable();
     $tab[11]['field'] = 'tag';
     $tab[11]['name'] = __('ID TAG');
     $tab[11]['datatype'] = 'number';
     return $tab;
 }
 /**
  * Get search function for the class
  *
  * @return array of search option
  **/
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[11]['table'] = $this->getTable();
     $tab[11]['field'] = 'content';
     $tab[11]['name'] = __('Content');
     $tab[11]['datatype'] = 'text';
     $tab[11]['massiveactoin'] = false;
     return $tab;
 }
 /**
  * Get search function for the class
  *
  * @return array of search option
  **/
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[11]['table'] = $this->getTable();
     $tab[11]['field'] = 'color';
     $tab[11]['name'] = __('Color');
     $tab[11]['datatype'] = 'color';
     $tab[12]['table'] = $this->getTable();
     $tab[12]['field'] = 'is_finished';
     $tab[12]['name'] = __('Finished state');
     $tab[12]['datatype'] = 'bool';
     return $tab;
 }
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[2303]['table'] = $this->getTable();
     $tab[2303]['field'] = 'color';
     $tab[2303]['name'] = __('Associated color', 'projet');
     $tab[2303]['datatype'] = 'text';
     $tab[2304]['table'] = $this->getTable();
     $tab[2304]['field'] = 'type';
     $tab[2304]['name'] = __('Finished', 'projet');
     $tab[2304]['datatype'] = 'bool';
     return $tab;
 }
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[11]['table'] = 'glpi_plugin_timelineticket_grouplevels';
     $tab[11]['field'] = 'rank';
     $tab[11]['name'] = __('Position');
     $tab[11]['massiveaction'] = false;
     $tab[12]['table'] = 'glpi_plugin_timelineticket_grouplevels';
     $tab[12]['field'] = 'groups';
     $tab[12]['name'] = __('List of associated groups', 'timelineticket');
     $tab[12]['massiveaction'] = false;
     $tab[12]['nosearch'] = true;
     return $tab;
 }
Exemple #15
0
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[4]['name'] = __('Content');
     $tab[4]['field'] = 'content';
     $tab[4]['table'] = $this->getTable();
     $tab[4]['datatype'] = 'text';
     $tab[4]['htmltext'] = true;
     $tab[3]['name'] = __('Task category');
     $tab[3]['field'] = 'name';
     $tab[3]['table'] = getTableForItemType('TaskCategory');
     $tab[3]['datatype'] = 'dropdown';
     return $tab;
 }
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[14]['table'] = $this->getTable();
     $tab[14]['field'] = 'is_helpdesk_default';
     $tab[14]['name'] = __('Default for tickets');
     $tab[14]['datatype'] = 'bool';
     $tab[14]['massiveaction'] = false;
     $tab[15]['table'] = $this->getTable();
     $tab[15]['field'] = 'is_mail_default';
     $tab[15]['name'] = __('Default for mail recipients');
     $tab[15]['datatype'] = 'bool';
     $tab[15]['massiveaction'] = false;
     return $tab;
 }
 function getSearchOptions()
 {
     global $LANG;
     $tab = parent::getSearchOptions();
     $tab[14]['table'] = $this->getTable();
     $tab[14]['field'] = 'is_helpdesk_default';
     $tab[14]['name'] = $LANG['tracking'][9];
     $tab[14]['datatype'] = 'bool';
     $tab[14]['massiveaction'] = false;
     $tab[15]['table'] = $this->getTable();
     $tab[15]['field'] = 'is_mail_default';
     $tab[15]['name'] = $LANG['tracking'][10];
     $tab[15]['datatype'] = 'bool';
     $tab[15]['massiveaction'] = false;
     return $tab;
 }
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[14]['table'] = $this->getTable();
     $tab[14]['field'] = 'short_name';
     $tab[14]['name'] = __('Short name', 'resources');
     $tab[15]['table'] = $this->getTable();
     $tab[15]['field'] = 'is_active';
     $tab[15]['name'] = __('Active');
     $tab[15]['datatype'] = 'bool';
     $tab[16]['table'] = $this->getTable();
     $tab[16]['field'] = 'is_leaving_state';
     $tab[16]['name'] = __("Employment state at leaving's resource", "resources");
     $tab[16]['datatype'] = 'bool';
     $tab[16]['massiveaction'] = false;
     return $tab;
 }
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[2303]['table'] = $this->getTable();
     $tab[2303]['field'] = 'color';
     $tab[2303]['name'] = __('Associated color', 'projet');
     $tab[2303]['datatype'] = 'text';
     $tab[2304]['table'] = $this->getTable();
     $tab[2304]['field'] = 'for_dependency';
     $tab[2304]['name'] = __('Finished task', 'projet');
     $tab[2304]['datatype'] = 'bool';
     $tab[2305]['table'] = $this->getTable();
     $tab[2305]['field'] = 'for_planning';
     $tab[2305]['name'] = __('Used for planning', 'projet');
     $tab[2305]['datatype'] = 'bool';
     return $tab;
 }
 /**
  * Get search function for the class
  *
  * @return array of search option
  **/
 function getSearchOptions()
 {
     global $LANG;
     $tab = parent::getSearchOptions();
     $tab[3]['table'] = $this->getTable();
     $tab[3]['field'] = 'ext';
     $tab[3]['name'] = $LANG['document'][9];
     $tab[6]['table'] = $this->getTable();
     $tab[6]['field'] = 'icon';
     $tab[6]['name'] = $LANG['document'][10];
     $tab[6]['massiveaction'] = false;
     $tab[4]['table'] = $this->getTable();
     $tab[4]['field'] = 'mime';
     $tab[4]['name'] = $LANG['document'][4];
     $tab[5]['table'] = $this->getTable();
     $tab[5]['field'] = 'is_uploadable';
     $tab[5]['name'] = $LANG['document'][15];
     $tab[5]['datatype'] = 'bool';
     return $tab;
 }
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[14]['table'] = $this->getTable();
     $tab[14]['field'] = 'code';
     $tab[14]['name'] = __('Code', 'resources');
     $tab[15]['table'] = $this->getTable();
     $tab[15]['field'] = 'use_employee_wizard';
     $tab[15]['name'] = __('Enter general information about the resource', 'resources');
     $tab[15]['datatype'] = 'bool';
     $tab[16]['table'] = $this->getTable();
     $tab[16]['field'] = 'use_need_wizard';
     $tab[16]['name'] = __('Enter employer information about the resource', 'resources');
     $tab[16]['datatype'] = 'bool';
     $tab[17]['table'] = $this->getTable();
     $tab[17]['field'] = 'use_picture_wizard';
     $tab[17]['name'] = __('Add a picture', 'resources');
     $tab[17]['datatype'] = 'bool';
     return $tab;
 }
Exemple #22
0
 function getSearchOptions()
 {
     $tab = parent::getSearchOptions();
     $tab[14]['table'] = $this->getTable();
     $tab[14]['field'] = 'is_helpdesk_default';
     $tab[14]['name'] = __('Default for tickets');
     $tab[14]['datatype'] = 'bool';
     $tab[14]['massiveaction'] = false;
     $tab[182]['table'] = $this->getTable();
     $tab[182]['field'] = 'is_followup_default';
     $tab[182]['name'] = __('Default for followups');
     $tab[182]['datatype'] = 'bool';
     $tab[182]['massiveaction'] = false;
     $tab[15]['table'] = $this->getTable();
     $tab[15]['field'] = 'is_mail_default';
     $tab[15]['name'] = __('Default for mail recipients');
     $tab[15]['datatype'] = 'bool';
     $tab[15]['massiveaction'] = false;
     $tab[183]['table'] = $this->getTable();
     $tab[183]['field'] = 'is_mailfollowup_default';
     $tab[183]['name'] = __('Default for followup mail recipients');
     $tab[183]['datatype'] = 'bool';
     $tab[183]['massiveaction'] = false;
     $tab[8]['table'] = $this->getTable();
     $tab[8]['field'] = 'is_active';
     $tab[8]['name'] = __('Active');
     $tab[8]['datatype'] = 'bool';
     $tab[180]['table'] = $this->getTable();
     $tab[180]['field'] = 'is_ticketheader';
     $tab[180]['name'] = __('Request source visible for tickets');
     $tab[180]['datatype'] = 'bool';
     $tab[181]['table'] = $this->getTable();
     $tab[181]['field'] = 'is_ticketfollowup';
     $tab[181]['name'] = __('Request source visible for followups');
     $tab[181]['datatype'] = 'bool';
     return $tab;
 }
 /**
  * @since version 0.85
  * @see CommonDBTM::post_updateItem()
  **/
 function post_updateItem($history = 1)
 {
     $this->post_workOnItem();
     parent::post_updateItem($history);
 }
Exemple #24
0
 /**
  * @since version 0.84
  *
  * @param $field
  * @param $name            (default '')
  * @param $values          (default '')
  * @param $options   array
  **/
 static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
 {
     if (!is_array($values)) {
         $values = array($field => $values);
     }
     $options['display'] = false;
     $options['value'] = $values[$field];
     switch ($field) {
         case 'type_menu':
             $tab = array('' => Dropdown::EMPTY_VALUE);
             $menus = Html::getMenuInfos();
             foreach ($menus as $key => $value) {
                 if ($key != 'plugins' && $key != 'preference') {
                     $tab[$key] = $menus[$key]['title'];
                 }
             }
             return Dropdown::showFromArray($name, $tab, $options);
             break;
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
Exemple #25
0
 /**
  * @see CommonDBTM::prepareInputForUpdate()
  **/
 function prepareInputForUpdate($input)
 {
     $input = parent::prepareInputForUpdate($input);
     return $input;
 }
 /**
  * @since version 0.85
  *
  * @see CommonDBTM::processMassiveActionsForOneItemtype()
  **/
 static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids)
 {
     switch ($ma->getAction()) {
         case 'duplicate':
             // For calendar duplicate in another entity
             if (method_exists($item, 'duplicate')) {
                 $input = $ma->getInput();
                 $options = array();
                 if ($item->isEntityAssign()) {
                     $options = array('entities_id' => $input['entities_id']);
                 }
                 foreach ($ids as $id) {
                     if ($item->getFromDB($id)) {
                         if (!$item->isEntityAssign() || $input['entities_id'] != $item->getEntityID()) {
                             if ($item->can(-1, CREATE, $options)) {
                                 if ($item->duplicate($options)) {
                                     $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
                                 } else {
                                     $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                                     $ma->addMessage($item->getErrorMessage(ERROR_ON_ACTION));
                                 }
                             } else {
                                 $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_NORIGHT);
                                 $ma->addMessage($item->getErrorMessage(ERROR_RIGHT));
                             }
                         } else {
                             $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                             $ma->addMessage($item->getErrorMessage(ERROR_COMPAT));
                         }
                     } else {
                         $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                         $ma->addMessage($item->getErrorMessage(ERROR_NOT_FOUND));
                     }
                 }
             } else {
                 $ma->itemDone($item->getType(), $ids, MassiveAction::ACTION_KO);
             }
             return;
     }
     parent::processMassiveActionsForOneItemtype($ma, $item, $ids);
 }
Exemple #27
0
 /**
  * @since version 0.84
  *
  * @param $field
  * @param $name               (default '')
  * @param $values             (default '')
  * @param $options      array
  **/
 static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
 {
     if (!is_array($values)) {
         $values = array($field => $values);
     }
     $options['display'] = false;
     switch ($field) {
         case 'type':
             $options['value'] = $values[$field];
             return self::dropdownType($name, $options);
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
 /**
  * Forbidden massive action
  *
  * @since version 0.90
  *
  * @see CommonDBTM::getForbiddenStandardMassiveAction()
  **/
 function getForbiddenStandardMassiveAction()
 {
     $forbidden = parent::getForbiddenStandardMassiveAction();
     $forbidden[] = 'merge';
     return $forbidden;
 }
 /**
  * @since version 0.85
  *
  * @see CommonDBTM::processMassiveActionsForOneItemtype()
  * @param MassiveAction $ma
  * @param CommonDBTM $item
  * @param array $ids
  * @return nothing|void
  */
 static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids)
 {
     $notimport = new PluginOcsinventoryngNotimportedcomputer();
     switch ($ma->getAction()) {
         case "plugin_ocsinventoryng_import":
             $input = $ma->getInput();
             foreach ($ids as $id) {
                 if (PluginOcsinventoryngNotimportedcomputer::computerImport(array('id' => $id, 'force' => true, 'entity' => $input['entity']))) {
                     $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
                 } else {
                     $ma->itemDone($item->getType(), $ids, MassiveAction::ACTION_KO);
                 }
             }
             return;
         case "plugin_ocsinventoryng_replayrules":
             foreach ($ids as $id) {
                 if (PluginOcsinventoryngNotimportedcomputer::computerImport(array('id' => $id))) {
                     $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
                 } else {
                     $ma->itemDone($item->getType(), $ids, MassiveAction::ACTION_KO);
                 }
             }
             return;
         case "plugin_ocsinventoryng_delete":
             foreach ($ids as $id) {
                 if ($notimport->deleteNotImportedComputer($id)) {
                     $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
                 } else {
                     $ma->itemDone($item->getType(), $ids, MassiveAction::ACTION_KO);
                 }
             }
             return;
     }
     parent::processMassiveActionsForOneItemtype($ma, $item, $ids);
 }
Exemple #30
0
 /**
  * @since version 0.85
  *
  * @see CommonDBTM::processMassiveActionsForOneItemtype()
  **/
 static function processMassiveActionsForOneItemtype(MassiveAction $ma, CommonDBTM $item, array $ids)
 {
     switch ($ma->getAction()) {
         case 'duplicate':
             // For calendar duplicate in another entity
             if (method_exists($item, 'duplicate')) {
                 $input = $ma->getInput();
                 $options = array();
                 if ($item->isEntityAssign()) {
                     $options = array('entities_id' => $input['entities_id']);
                 }
                 foreach ($ids as $id) {
                     if ($item->getFromDB($id)) {
                         if (!$item->isEntityAssign() || $input['entities_id'] != $item->getEntityID()) {
                             if ($item->can(-1, CREATE, $options)) {
                                 if ($item->duplicate($options)) {
                                     $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
                                 } else {
                                     $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                                     $ma->addMessage($item->getErrorMessage(ERROR_ON_ACTION));
                                 }
                             } else {
                                 $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_NORIGHT);
                                 $ma->addMessage($item->getErrorMessage(ERROR_RIGHT));
                             }
                         } else {
                             $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                             $ma->addMessage($item->getErrorMessage(ERROR_COMPAT));
                         }
                     } else {
                         $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                         $ma->addMessage($item->getErrorMessage(ERROR_NOT_FOUND));
                     }
                 }
             } else {
                 $ma->itemDone($item->getType(), $ids, MassiveAction::ACTION_KO);
             }
             return;
         case 'addholiday':
             // add an holiday with massive action
             $input = $ma->getInput();
             if ($input['holidays_id'] > 0) {
                 $holiday = new Holiday();
                 $calendar_holiday = new Calendar_Holiday();
                 $holiday->getFromDB($input['holidays_id']);
                 $entities = array($holiday->getEntityID() => $holiday->getEntityID());
                 if ($holiday->isRecursive()) {
                     $entities = getSonsOf("glpi_entities", $holiday->getEntityID());
                 }
                 foreach ($ids as $id) {
                     $entities_id = CommonDBTM::getItemEntity('Calendar', $id);
                     if (isset($entities[$entities_id])) {
                         $input = array('calendars_id' => $id, 'holidays_id' => $input['holidays_id']);
                         if ($calendar_holiday->add($input)) {
                             $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_OK);
                         } else {
                             $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                             $ma->addMessage($item->getErrorMessage(ERROR_ON_ACTION));
                         }
                     } else {
                         $ma->itemDone($item->getType(), $id, MassiveAction::ACTION_KO);
                         $ma->addMessage($item->getErrorMessage(ERROR_ON_ACTION));
                     }
                 }
             } else {
                 $ma->itemDone($item->getType(), $ids, MassiveAction::ACTION_KO);
             }
             return;
     }
     parent::processMassiveActionsForOneItemtype($ma, $item, $ids);
 }