コード例 #1
0
 public function GetAllowedValues($aArgs = array(), $sContains = '')
 {
     //throw new Exception("GetAllowedValues on ext key has been deprecated");
     try {
         return parent::GetAllowedValues($aArgs, $sContains);
     } catch (MissingQueryArgument $e) {
         // Some required arguments could not be found, enlarge to any existing value
         $oValSetDef = new ValueSetObjects('SELECT ' . $this->GetTargetClass());
         return $oValSetDef->GetValues($aArgs, $sContains);
     }
 }
コード例 #2
0
 /**
  * Search for objects to be selected
  * @param WebPage $oP The page used for the output (usually an AjaxWebPage)
  * @param string $sFilter The OQL expression used to define/limit limit the scope of possible values
  * @param DBObject $oObj The current object for the OQL context
  * @param string $sContains The text of the autocomplete to filter the results
  */
 public function AutoComplete(WebPage $oP, $sFilter, $oObj = null, $sContains)
 {
     if (is_null($sFilter)) {
         throw new Exception('Implementation: null value for allowed values definition');
     }
     $oValuesSet = new ValueSetObjects($sFilter, 'friendlyname');
     // Bypass GetName() to avoid the encoding by htmlentities
     $oValuesSet->SetModifierProperty('UserRightsGetSelectFilter', 'bSearchMode', $this->bSearchMode);
     $aValues = $oValuesSet->GetValues(array('this' => $oObj), $sContains);
     foreach ($aValues as $sKey => $sFriendlyName) {
         $oP->add(trim($sFriendlyName) . "\t" . $sKey . "\n");
     }
 }
コード例 #3
0
 public function ProjectObject($oObject)
 {
     $sExpr = $this->Get('value');
     if ($sExpr == '<this>') {
         $sColumn = $this->Get('attribute');
         if (empty($sColumn)) {
             $aRes = array($oObject->GetKey());
         } else {
             $aRes = array($oObject->Get($sColumn));
         }
     } elseif ($sExpr == '<any>' || $sExpr == '') {
         $aRes = null;
     } elseif (strtolower(substr($sExpr, 0, 6)) == 'select') {
         $sColumn = $this->Get('attribute');
         // SELECT...
         $oValueSetDef = new ValueSetObjects($sExpr, $sColumn, array(), true);
         $aRes = $oValueSetDef->GetValues(array('this' => $oObject), '');
     } else {
         // Constant value(s)
         $aRes = explode(';', trim($sExpr));
     }
     return $aRes;
 }