Search::getLogicalOperators PHP Method

getLogicalOperators() static public method

static public getLogicalOperators ( )
    static function getLogicalOperators()
    {
        return array('AND' => 'AND', 'OR' => 'OR', 'AND NOT' => 'AND NOT', 'OR NOT' => 'OR NOT');
    }

Usage Example

Example #1
0
     }
 }
 $linked = Search::getMetaItemtypeAvailable($_POST["itemtype"]);
 $rand = mt_rand();
 $rowid = 'metasearchrow' . $_POST['itemtype'] . $rand;
 echo "<tr class='metacriteria' id='{$rowid}'><td class='left' colspan='2'>";
 echo "<table class='tab_format'><tr class='left'>";
 echo "<td width='30%'>";
 echo "<img class='pointer' src=\"" . $CFG_GLPI["root_doc"] . "/pics/meta_moins.png\" alt='-' title=\"" . __s('Delete a global search criterion') . "\" onclick=\"" . Html::jsGetElementbyID($rowid) . ".remove();\">";
 echo "&nbsp;&nbsp;";
 // Display link item (not for the first item)
 $value = '';
 if (isset($metacriteria["link"])) {
     $value = $metacriteria["link"];
 }
 Dropdown::showFromArray("metacriteria[" . $_POST["num"] . "][link]", Search::getLogicalOperators(), array('value' => $value, 'width' => '40%'));
 // Display select of the linked item type available
 foreach ($linked as $key) {
     if (!isset($metanames[$key])) {
         if ($linkitem = getItemForItemtype($key)) {
             $metanames[$key] = $linkitem->getTypeName();
         }
     }
 }
 $value = '';
 if (isset($metacriteria['itemtype']) && !empty($metacriteria['itemtype'])) {
     $value = $metacriteria['itemtype'];
 }
 $rand = Dropdown::showItemTypes("metacriteria[" . $_POST["num"] . "][itemtype]", $linked, array('width' => '50%', 'value' => $value));
 $field_id = Html::cleanId("dropdown_metacriteria[" . $_POST["num"] . "][itemtype]{$rand}");
 echo "</td><td>";
All Usage Examples Of Search::getLogicalOperators