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 = [
'kingdom' => [
'type' => 'select',
'name' => 'Kingdom',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'kingdom'
]
],
'phylumName' => [
'type' => 'text',
'name' => 'Phylum',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'phylumName'
],
'hidden'=>true,
],
'className' => [
'type' => 'text',
'name' => 'Class',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'className'
],
'hidden'=>true,
],
'orderName' => [
'type' => 'text',
'name' => 'Order',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'orderName'
],
'hidden'=>true,
],
'familyName' => [
'type' => 'text',
'name' => 'Family',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'familyName'
],
'hidden'=>true,
],
'genusName' => [
'type' => 'text',
'name' => 'Genus',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'genusName'
],
'hidden'=>true,
],
'fullScientificName' => [
'type' => 'suggest',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'fullScientificName'
],
'class' => 'test',
'name' => 'Scientific Name'
],
'country' => [
'type' => 'suggest',
'name' => 'Country',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'country'
]
],
// 'isocountrycode' => [
// 'name' => 'ISO-Code'
// ],
'unitID' => [
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'unitID'
],
'type' => 'text', // freigeschaltet von Gabi
'name' => 'Sample, Voucher or Strain No.'
],
'sequenceaccessionIdentifier' => [
'type' => 'suggest',
'name' => 'Genetic Accession No.',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'sequenceaccessionIdentifier'
]
],
'geneticlocus' => [
'type' => 'text',
'name' => 'Genetic Locus',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'geneticlocus'
] ,
'hideable' => 'true'
],
'institution' => [
'type' => 'select',
'name' => 'Repository',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'institution'
]
],
'voucherCol' => [
'type' => 'select',
'name' => 'Voucher collection',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'voucherCol'
]
],
'cites' => [
'type' => 'radio',
'name' => 'CITES list',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'cites'
],
'hideable' => 'true'
],
'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'
],
'collectornumber' => [
'type' => 'text',
'name' => "Collector's No.",
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'collectornumber'
],
'hideable' => 'true'
],
'collectors' => [
'type' => 'text',
'name' => 'Collectors',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'collectors'
],
'hideable' => 'true'
],
'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'
],
'locality' => [
'type' => 'text',
'name' => 'Locality',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'locality'
],
'hideable' => 'true'
],
'ocean' => [
'type' => 'suggest',
'name' => 'Ocean',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'ocean'
],
'hideable' => 'true'
],
'sampleavailability' => [
'type' => 'radio',
'name' => 'Sample availability (loan)',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'sampleavailability'
],
'hideable' => 'true'
],
'sampletype' => [
'type' => 'select',
'name' => 'Sample Type',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'sampletype'
],
'hideable' => 'true'
],
'preparationtype' => [
'type' => 'text',
'name' => 'Preparation Type',
'config' => [
'size' => 45,
'maxlength' => 150,
'name' => 'preparationtype'
],
'hideable' => 'true'
],
'sea' => [
'type' => 'suggest',
'name' => 'Sea',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'sea'
],
'hideable' => 'true'
],
];
/*
* ----------------- other settings ----------------------------
*
*These settings will overwrite the default setting in common/models/CommonSearchForm
*/
// title of the form:
// private $_extendedSearchFormTitle = 'SEARCH';
// private $_previewTitle = 'RESULTS OVERVIEW';
// private $_detailsTitle = 'DETAILS';
// search button text:
// private $_extendedSearchButtonLabel = 'Search'; // Rukeia 16-02-2015: Das ist das Search-Button-Label.
// private $_refineSearchButtonLabel = 'Refine search';
// private $_newSearchButtonLabel = 'New search';
// private $_saveSearchButtonLabel = 'Save Search'; // Hartebrodt 22-07-15
// private $_searchName; //Hartebrodt 23-07-15: name a search to store it in the database
// what string represents if nothing is chosen in the drop down lists
// (technically it leads to everything (*))
// private $_selectionListNonChosen = "---";
// string that is presented in a suggestion list if
// the input does not match to any item
// private $_sugesstionListNoMatch = "-- no match --";
// default size of fields
// - if you don't give a size in the definition area this value will be used
// private $_fieldSize = 50;
// ------------- getters--------------------------------------
public function getParameters() {
return $this->_parameters;
}
// @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',
'sequenceaccessionIdentifier' => 'Genetic Accession Number',
'geneticlocus' => 'Genetic Locus',
'kingdom' => 'Kingdom',
'hasImage' => 'Image available',
'sampletype' => 'Sample Type',
'preparationtype' => 'Preparation Type',
'hasTypestatus' => 'Type Specimen/Strain',
'country' => 'Country',
'unitID' => 'Sample, Voucher or Strain No.',
'phylumName' => 'Phylum/Division Name',
'continent' => 'Continent',
'sea' => 'Sea',
'locality' => 'Locality',
'collectors' => 'Collectors',
'collectornumber' => "Collectors' No.",
'institution' => 'Repository',
'voucherCol' => 'Voucher collection',
'genBankRecordAvailable' => 'with Genetic Accession Number',
'collectionYear' => 'Collection year',
'coordinates' => 'Coordinates',
'cites' => 'CITES list',
'sampleavailability' => 'Sample availability (loan)'
];
}
}