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'
],
'country' => [
'type' => 'suggest',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'country'
],
'name' => 'Country'
],
'institution' => [
'type' => 'select',
'name' => 'Repository',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'institution'
]
],
'cites' => [
'type' => 'radio',
'name' => 'CITES list',
'config' => [
'size' => 285,
'maxlength' => 150,
'name' => 'cites'
],
'hideable' => 'true'
],
'collectionYear' => [
'type' => 'range',
'config' => [
'size' => 40,
'width' => '100px',
'name' => 'Collection Year',
'attribute1' => 'collectionYearFrom',
'attribute2' => 'collectionYearTo',
'attribute1value' => 'collectionYearFrom',
'attribute2value' => 'collectionYearTo',
'type' => \kartik\field\FieldRange::INPUT_TEXT
],
//'hideable' => 'true',
'name' => 'Collection Year'
],
'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' => 150,
'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'
],
'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'
],
];
/*
* ----------------- 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;
}
// public function getExtendedSearchFormTitle() {
// return $this->_extendedSearchFormTitle;
// }
// public function getPreviewTitle() {
// return $this->_previewTitle;
// }
// public function getDetailsTitle() {
// return $this->_detailsTitle;
// }
// public function getExtendedSearchButtonLabel() {
// return $this->_extendedSearchButtonLabel;
// }
// public function getNewSearchButtonLabel() {
// return $this->_newSearchButtonLabel;
// }
// public function getRefineSearchButtonLabel() {
// return $this->_refineSearchButtonLabel;
// }
// public function getFieldsPerRow() {
// return $this->_fieldsPerRow;
// }
// public function getSelectionListNonChosen() {
// return $this->_selectionListNonChosen;
// }
// public function getSugesstionListNoMatch() {
// return $this->_sugesstionListNoMatch;
// }
// public function getHideableList() {
// return $this->_hideableList;
// }
// public function getHideableListFields() {
// return $this->_hideableListFields;
// }
// public function getCompleteList() { // Rukeia 30-03-2015: added
// return $this->_completeList;
// }
// public function getCompleteListFields() { // Rukeia 30-03-2015: added
// return $this->_completeListFields;
// }
// public function getFieldSize() {
// return $this->_fieldSize;
// }
// @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',
'hasTypestatus' => 'Type Specimen/Strain',
'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)'
];
}
}