static function passThroughFilter(ilDataCollectionRecord $record, ilDataCollectionField $field, $filter)
 {
     $pass = false;
     $type_id = $field->getDatatypeId();
     $value = $record->getRecordFieldValue($field->getId());
     switch ($type_id) {
         case ilDataCollectionDatatype::INPUTFORMAT_TEXT:
             if (!$filter || strpos(strtolower($value), strtolower($filter)) !== false) {
                 $pass = true;
             }
             break;
         case ilDataCollectionDatatype::INPUTFORMAT_NUMBER:
             if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
                 $pass = true;
             }
             break;
         case ilDataCollectionDatatype::INPUTFORMAT_BOOLEAN:
             if ($filter == "checked" && $value == 1 || $filter == "not_checked" && $value == 0 || $filter == '' || !$filter) {
                 $pass = true;
             }
             break;
         case ilDataCollectionDatatype::INPUTFORMAT_DATETIME:
             if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
                 $pass = true;
             }
             break;
         case ilDataCollectionDatatype::INPUTFORMAT_FILE:
             if (!ilObject2::_exists($value) || ilObject2::_lookupType($value, false) != "file") {
                 $pass = true;
                 break;
             }
             $file_obj = new ilObjFile($value, false);
             $file_name = $file_obj->getTitle();
             if (!$filter || strpos(strtolower($file_name), strtolower($filter)) !== false) {
                 $pass = true;
             }
             break;
         case ilDataCollectionDatatype::INPUTFORMAT_REFERENCE:
             $props = $field->getProperties();
             if ($filter && $props[ilDataCollectionField::PROPERTYID_N_REFERENCE] && is_array($value) && in_array($filter, $value)) {
                 $pass = true;
             }
             if (!$filter || $filter == $value) {
                 $pass = true;
             }
             break;
         case ilDataCollectionDatatype::INPUTFORMAT_RATING:
             if (!$filter || $filter <= $value['avg']) {
                 $pass = true;
             }
             break;
         case ilDataCollectionDatatype::INPUTFORMAT_ILIAS_REF:
             $obj_id = ilObject::_lookupObjId($value);
             if (!$filter || strpos(strtolower(ilObject::_lookupTitle($obj_id)), strtolower($filter)) !== false) {
                 $pass = true;
             }
             break;
         case ilDataCollectionDatatype::INPUTFORMAT_MOB:
             $m_obj = new ilObjMediaObject($value, false);
             $file_name = $m_obj->getTitle();
             if (!$filter || strpos(strtolower($file_name), strtolower($filter)) !== false) {
                 $pass = true;
             }
             break;
     }
     //for the fields owner and last edit by, we check the name, not the ID
     if (($field->getId() == "owner" || $field->getId() == "last_edit_by") && $filter) {
         $pass = false;
         $user = new ilObjUser($value);
         if (strpos($user->getFullname(), $filter) !== false) {
             $pass = true;
         }
     }
     return $pass;
 }
 /**
  * @param ilDataCollectionField $originalField
  */
 public function cloneProperties(ilDataCollectionField $originalField)
 {
     $orgProps = $originalField->getProperties();
     if ($orgProps == NULL) {
         return;
     }
     foreach ($orgProps as $id => $value) {
         $fieldprop_obj = new ilDataCollectionFieldProp();
         $fieldprop_obj->setDatatypePropertyId($id);
         $fieldprop_obj->setFieldId($this->getId());
         // If reference field, we must reset the referenced field, otherwise it will point to the old ID
         if ($originalField->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_REFERENCE && $id == ilDataCollectionField::PROPERTYID_REFERENCE) {
             $value = NULL;
         }
         $fieldprop_obj->setValue($value);
         $fieldprop_obj->doCreate();
     }
 }