Search Engine

Conventions

  • ID 80 : entities_id link -> no massive action
  • ID 90 : notepad -> no massive action
  • ID 101 : glpi_ocslinks -> no linkfield but massive action on it
  • Pour export : lien web à export <a href.... les autres pour lesquels ce n'est qu'un affichage HTML : <a quelquechose href=

Entry format

  • linkfield : if empty no massive action for field of main table
  • searchtype : string or array containing forced search type : equals or contains (if equals may force use of field instead of id adding searchequalsonfield option)
  • forcegroupby : boolean use to force group by
  • splititems : instead of using simple <br> to split grouped items : used <hr>
  • usehaving : use having instead of WHERE
  • massiveaction : use massive action default to true : can be disable setting to false
  • nosort : do permit to sort this field : set to true
  • nosearch : do not permit to do a search on this field : set to true
  • nodisplay : do not permit to display this field : set to true
  • joinparams : define how the join must be done (if complex)
    • array may contain :
      • beforejoin : array define which tables must be join before. array contains table key (may contain additional joinparams). Do an array of array if several beforejoin , both are valid. example : array("beforejoin"=>array('table'=>mytable,'joinparams'=>array('jointype'=>'child'...
      • jointype : string define the join type :
        • empty for a standard join
        • child for a child table (standard foreign key usage)
        • itemtype_item for links using itemtype and items_id fields
        • item_item for table used to link 2 similar items : glpi_tickets_tickets for example : link fields are standardfk_1 and standardfk_2
      • condition : additional condition to add to the standard link (use NEWTABLE or REFTABLE to use the table names)
      • nolink : boolean (default false) set to true to define an additional join not used to join the initial table
  • additionalfields : is array of additionalfields need to display or define value
  • datatype
    • date
      • parameters : ['searchunit']=SEARCH_UNIT (DAY or MONTH default), ['maybefuture'] = true (date may be in future) , ['emptylabel'] = string to display if null is selected
    • datetime
      • parameters : ['searchunit']=SEARCH_UNIT (DAY or MONTH default), ['maybefuture'] = true (date may be in future) , ['emptylabel'] = string to display if null is selected
    • date_delay : date with a delay in month (end_warranty, end_date)
      • parameters : ['datafields'][1]=DATE_FIELD, ['datafields'][2]=DELAY_ADD_FIELD, ['datafields'][3]=DELAY_MINUS_FIELD, ['searchunit']=SEARCH_UNIT (DAY or MONTH default), ['delay_unit']=DELAY_UNIT (DAY or MONTH default), ['maybefuture'] = true (date may be in future) , ['emptylabel'] = string to display if null is selected
    • timestamp : time in seconds
      • parameters : ['withseconds']=true/false (false by default)
    • weblink
    • email
    • text
    • string
    • ip
    • mac
      • parameter : ['htmltext']=true/false (false by default)
    • number :
      • optional parameters : ['width'] for width search, ['min'] minimum value (default 0), ['max'] maximum value (default 100), ['step'] step for select (default 1), ['toadd'] array of values to add (default empty)
    • count : same as number but count the number of item in the table
    • decimal : idem that number but formatted with decimal
    • bool
    • itemlink : link to the item
    • itemtypename
      • optional parameter defined itemtypes available : 'itemtype_list' : list in $CFG_GLPI or 'types' array containing available types
    • language : parameters : ['display_emptychoice'] ['emptylabel']
    • right : for No Access / Read / Right
      • optional parameters : ['nonone'] ['noread'] ['nowrite'] set to true to disable the values
    • dropdown : dropdown may have several additional parameters depending of dropdown type : ['right'] for user one for example
  • Spécial parameters :
    • ['unit'] permit to set unit to display after standard display
    • ['computation'] for special computation case : use TABLE for table name
    • ['computationgroupby'] boolean to know if computation must be used in groupby or not (not in case of SUM or ROUND for example)

Field number in search constant.

See attached document.

S => STATE_TYPE, R => RESERVATION_TYPE

To be check :
  • contact / contact_num on computer
  • name on License + version
  • ID on License + version + budget
  • is_recursive on group
  • all tracking (not yet used by search engine)

GLPI-SearchEngine.ods (13.7 KB) remi, 10/25/2009 07:53 AM