value:
// key: name of the field
// value is an array of parameters to define the field:
// type: is required! and must be one of the following:
// text: usual text field
// checkbox: shows checkbox returns value
// select: creates a selection list (drop down)
// if a the parameter 'valueList' is set (to an array of strings)
// it will be shown.
// if it is not set, the list will be generated from the index
// therefore the field name must match an index field
// (if not an error will appear)
// suggest: a field that provides suggestion on the input the user makes
// number: creates a number field, where the user can choose integers.
// it is recommended to define 'min' and 'max' in the 'config' array
// deactivated: the field will not be writable
// hideable: set to 'true' if the field can be added by the user on demand
// config: is an array of attributes for the elements
// e.g. 'size' or 'maxlength'
// e.g. 'familyName' =>['type'=>'text', 'config'=>[size'=>45,'maxlength'=>45))
// (this will end up in a field like this:
// )
// alt: if you have a group of fields, that have to be chosen one of them exclusively.
// create a field in the field declaration section for each but only one in the
// field definition section with the default selection and put the names of the
// others in the 'alt' parameter see: familyName
// TODO do we need or want this static???
public $knownLParams = [
'country',
'geneticlocus',
'continent',
'sea',
'ocean',
'sampletype',
'collectioncode',
'institutioncode',
'indexHerbarorium'
];
public $knownParams = [
'fullScientificName',
'genusName',
'speciesName',
'kingdom',
'sequenceaccessionIdentifier',
'unitID',
'locality',
'collectors',
'collectornumber',
'institution',
'voucherCol',
'collectionYearFrom',
'collectionYearTo',
'latitudeTo',
'latitudeFrom',
'longitudeTo',
'longitudeFrom',
'cites',
'hasImage',
'hasTypestatus',
'sampleavailability',
'institutioncode',
'collectioncode',
'preparationtype',
'ipen',
'unitaccessionnumber',
'accessionStatus',
'identifiedBy'
];
public $_parameters = [
'fullScientificName' => [
'type' => 'suggest',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'fullScientificName'
],
'class' => 'test',
'name' => 'Scientific name'
],
'genusName' => [
'type' => 'suggest',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'genusName'
],
'class' => 'test',
'name' => 'Genus'
],
'speciesName' => [
'type' => 'suggest',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'speciesName'
],
'class' => 'test',
'name' => 'Species'
],
'country' => [
'type' => 'suggest',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'country'
],
'name' => 'Country'
],
'locality' => [
'type' => 'text',
'name' => 'Locality',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'locality'
],
// 'hideable' => 'true'
],
'collectors' => [
'type' => 'text',
'name' => 'Collector(s)',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'collectors'
]
]
// 'hideable' => 'true'
,
'collectornumber' => [
'type' => 'text',
'name' => "Collectors Number",
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'collectornumber'
],
'hideable' => 'true',
],
'ipen' => [
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'ipen'
],
'type' => 'text', // freigeschaltet von Gabi
'name' => 'IPEN No',
// 'hideable' => 'true',
],
'unitaccessionnumber' => [
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'unitaccessionnumber'
],
'type' => 'text', // freigeschaltet von Gabi
'name' => 'Accession Number',
// 'hideable' => 'true',
],
'institution' => [
'type' => 'select',
'name' => 'Botanic Garden',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'institution'
],
],
'collectionYear' => [
'type' => 'range',
'config' => [
'size' => 40,
'width' => '150px',
'name' => 'Collection Year',
'attribute1' => 'collectionYearFrom',
'attribute2' => 'collectionYearTo',
'attribute1value' => 'collectionYearFrom',
'attribute2value' => 'collectionYearTo',
'type' => \kartik\field\FieldRange::INPUT_TEXT
],
'hideable' => 'true',
'name' => 'Collection Year'
],
'continent' => [
'type' => 'suggest',
'name' => 'Continent',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'continent'
],
'hideable' => 'true'
],
'coordinates' => [
'type' => 'range',
'config' => [
'size' => 40,
'width' => '150px',
'name' => 'Coordinates',
'label' => 'Latitude',
'attribute1' => 'latitudeFrom',
'attribute2' => 'latitudeTo',
'attribute1value' => 'latitudeFrom',
'attribute2value' => 'latitudeTo',
'label2' => 'Longitude',
'attribute3' => 'longitudeFrom',
'attribute4' => 'longitudeTo',
'attribute3value' => 'longitudeFrom',
'attribute4value' => 'longitudeTo',
'type' => \kartik\field\FieldRange::INPUT_TEXT
],
'hideable' => 'true',
'name' => 'Coordinates'
],
'ocean' => [
'type' => 'suggest',
'name' => 'Ocean',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'ocean'
],
'hideable' => 'true'
],
'sea' => [
'type' => 'suggest',
'name' => 'Sea',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'sea'
],
'hideable' => 'true'
],
/* 'hasTypestatus' => [
'type' => 'checkbox',
'name' => 'Type status' ,
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'hasTypestatus'
],
// 'type' => 'deactivated',
// 'hideable' => 'true'
],*/
/* 'hasImage' => [
'type' => 'checkbox',
'name' => 'Images' ,
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'hasImage' ,
],
'hideable' => 'true'
], */
'identifiedBy' => [
'type' => 'checkbox',
'name' => 'Identification' ,
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'Has reviewed Identification' ,
],
'hideable' => 'true'
],
'accessionStatus' => [
'type' => 'radio',
'name' => 'AccessionStatus',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'accStatus'
],
//'hideable' => 'true'
],
];
/*
* ----------------- other settings ----------------------------
*
*These settings will overwrite the default setting in common/models/CommonSearchForm
*/
// title of the form:
// @override
/**
* Declares customized attribute labels.
* If not declared here, an attribute would have a label that is
* the same as its name with the first letter in upper case.
*/
public function attributeLabels() {
return [
'taxonomyId' => 'Taxonomy ID (NCBI)',
'fullScientificName' => 'Scientific Name',
'genusName' => 'Genus',
'speciesName' => 'Species',
'sequenceaccessionIdentifier' => 'Genetic Accession Number',
'geneticlocus' => 'Genetic Locus',
'kingdom' => 'Kingdom',
'hasImage' => 'Image available',
'identifiedBy' => 'Has reviewed identification',
'sampletype' => 'Sample Type',
'preparationType' => 'Preparation Type',
'hasTypestatus' => 'Type Specimen/Strain',
'ipen' => 'IPEN Number',
'phylumName' => 'Phylum/Division Name',
'continent' => 'Continent',
'country' => 'Country',
'ocean' => 'Ocean',
'sea' => 'Sea',
'locality' => 'Locality',
'collectors' => 'Collector(s)',
'collectornumber' => "Collectors Number",
'institution' => 'Botanic Garden',
'voucherCol' => 'Voucher collection',
'genBankRecordAvailable' => 'with Genetic Accession Number',
'collectionYear' => 'Collection Year',
'coordinates' => 'Coordinates',
'cites' => 'CITES list',
'collectioncode' => 'Collection or subcollection',
'institutioncode' => 'Institution code',
'indexHerbarorium'=>'Index Herbariorum code',
'unitaccessionnumber'=>'Accession Number',
'accessionStatus' => 'Accession Status'
];
}
private $_extendedSearchFormTitle = 'Search';
private $_previewTitle = 'Results';
private $_detailsTitle = 'Details';
private $_refineSearchButtonLabel = 'Search';
private $_selectionListNonChosen = "---";
// ------------- getters--------------------------------------
public function getParameters() {
return $this->_parameters;
}
public function getExtendedSearchFormTitle() {
return $this->_extendedSearchFormTitle;
}
public function getPreviewTitle() {
return $this->_previewTitle;
}
public function getRefineSearchButtonLabel() {
return $this->_refineSearchButtonLabel;
}
public function getSelectionListNonChosen() {
return $this->_selectionListNonChosen;
}
}