commit f718413621596a3ddc1b8941d87ea8ad21868e2d
Author: Jan Šedivý <honza.seeda@gmail.com>
Date:   Tue Apr 23 18:41:09 2019 +0200

    Re #7328 inputy formuláře pro pokročilé filtry

diff --git a/app/FrontModule/component/Transliteration/TransliterationSearchForm.latte b/app/FrontModule/component/Transliteration/TransliterationSearchForm.latte
index 4762779..8743db1 100644
--- a/app/FrontModule/component/Transliteration/TransliterationSearchForm.latte
+++ b/app/FrontModule/component/Transliteration/TransliterationSearchForm.latte
@@ -23,367 +23,62 @@
         {input exact_match}
         <hr>
 
-        {*<div class="search-options">*}
-            {*<div class="form-group row">*}
-                {*<label for="book" class="col-sm-2 col-form-label">Book</label>*}
-                {*<div class="col-sm-3">*}
-                    {*<div class="input-group">*}
-
-                        {*<select name="book-op" class="form-control">*}
-                            {*<option value="equals">*}
-                                {*equals*}
-                            {*</option>*}
-                            {*<option value="not equals">*}
-                                {*not equals*}
-                            {*</option>*}
-                            {*<option value="contains" selected="selected">*}
-                                {*contains*}
-                            {*</option>*}
-                            {*<option value="begins with">*}
-                                {*begins with*}
-                            {*</option>*}
-                            {*<option value="ends with">*}
-                                {*ends with*}
-                            {*</option>*}
-                        {*</select>*}
-                        {*<input type="text" id="book" name="book" class="form-control">*}
-                    {*</div>*}
-                {*</div>*}
-            {*</div>*}
-            {*<div class="form-group row">*}
-                {*<label for="museum-no" class="col-sm-2 col-form-label">Museum number</label>*}
-                {*<div class="col-sm-3">*}
-                    {*<div class="input-group">*}
-
-                        {*<select name="museum-no-op" class="form-control">*}
-                            {*<option value="equals">*}
-                                {*equals*}
-                            {*</option>*}
-                            {*<option value="not equals">*}
-                                {*not equals*}
-                            {*</option>*}
-                            {*<option value="contains" selected="selected">*}
-                                {*contains*}
-                            {*</option>*}
-                            {*<option value="begins with">*}
-                                {*begins with*}
-                            {*</option>*}
-                            {*<option value="ends with">*}
-                                {*ends with*}
-                            {*</option>*}
-                        {*</select>*}
-                        {*<input type="text" name="museum-no" id="museum-no" class="form-control">*}
-                    {*</div>*}
-                {*</div>*}
-            {*</div>*}
-            {*<div class="form-group row">*}
-                {*<label for="id_book_type" class="col-sm-2 col-form-label">Type</label>*}
-                {*<div class="col-sm-3">*}
-                    {*<div class="input-group">*}
-
-                        {*<select name="book-type-op" class="form-control">*}
-                            {*<option value="is">*}
-                                {*is*}
-                            {*</option>*}
-                            {*<option value="is not">*}
-                                {*is not*}
-                            {*</option>*}
-                        {*</select>*}
-                        {*<select name="id_book_type" id="id_book_type" class="form-control">*}
-
-                            {*<option value="0" label="- NOT SELECTED -">*}
-                                {*- NOT SELECTED -*}
-                            {*</option>*}
-                            {*<option value="1" label="letter">*}
-                                {*letter*}
-                            {*</option>*}
-                            {*<option value="2" label="document">*}
-                                {*document*}
-                            {*</option>*}
-                            {*<option value="3" label="epic">*}
-                                {*epic*}
-                            {*</option>*}
-                            {*<option value="4" label="hymn">*}
-                                {*hymn*}
-                            {*</option>*}
-                            {*<option value="5" label="incantation">*}
-                                {*incantation*}
-                            {*</option>*}
-                            {*<option value="6" label="legal text">*}
-                                {*legal text*}
-                            {*</option>*}
-                            {*<option value="8" label="mathematics">*}
-                                {*mathematics*}
-                            {*</option>*}
-                            {*<option value="9" label="omina">*}
-                                {*omina*}
-                            {*</option>*}
-                            {*<option value="10" label="other">*}
-                                {*other*}
-                            {*</option>*}
-                            {*<option value="11" label="royal inscription">*}
-                                {*royal inscription*}
-                            {*</option>*}
-                            {*<option value="13" label="school text">*}
-                                {*school text*}
-                            {*</option>*}
-
-                        {*</select>*}
-                    {*</div>*}
-                {*</div>*}
-            {*</div>*}
-            {*<div class="form-group row">*}
-                {*<label for="id_origin" class="col-sm-2 col-form-label">Origin</label>*}
-                {*<div class="col-sm-3">*}
-                    {*<div class="input-group">*}
-
-                        {*<select name="origin-op" class="form-control">*}
-                            {*<option value="is">*}
-                                {*is*}
-                            {*</option>*}
-                            {*<option value="is not">*}
-                                {*is not*}
-                            {*</option>*}
-                        {*</select>*}
-                        {*<select name="id_origin" id="id_origin" class="form-control">*}
-
-                            {*<option value="0" label="- NOT SELECTED -">*}
-                                {*/ - NOT SELECTED -*}
-                            {*</option>*}
-                            {*<option value="9" label="Tell Ḫarīrī">*}
-                                {*Mari / Tell Ḫarīrī*}
-                            {*</option>*}
-                            {*<option value="10" label="Išān Baḫriyāt">*}
-                                {*Isin / Išān Baḫriyāt*}
-                            {*</option>*}
-                            {*<option value="11" label="Nuffar">*}
-                                {*Nippur / Nuffar*}
-                            {*</option>*}
-                            {*<option value="1" label="Babylon">*}
-                                {*Bābili / Babylon*}
-                            {*</option>*}
-                            {*<option value="2" label="Tell Inġarra, Tell al-Uḫaimir">*}
-                                {*Kiš / Tell Inġarra, Tell al-Uḫaimir*}
-                            {*</option>*}
-                            {*<option value="3" label="Abū Ḫaṭab">*}
-                                {*Kisurra / Abū Ḫaṭab*}
-                            {*</option>*}
-                            {*<option value="4" label="unknown">*}
-                                {*Lagaba / unknown*}
-                            {*</option>*}
-                            {*<option value="5" label="as-Sankara">*}
-                                {*Larsa / as-Sankara*}
-                            {*</option>*}
-                            {*<option value="6" label="Tell Harmal">*}
-                                {*Šaduppûm / Tell Harmal*}
-                            {*</option>*}
-                            {*<option value="12" label="Tell Asmar">*}
-                                {*Ešnunna / Tell Asmar*}
-                            {*</option>*}
-                            {*<option value="13" label="Tell al-Muqaiyar">*}
-                                {*Ur / Tell al-Muqaiyar*}
-                            {*</option>*}
-                            {*<option value="14" label="Tulūl al-Ḫumr">*}
-                                {*- / Tulūl al-Ḫumr*}
-                            {*</option>*}
-                            {*<option value="15" label="Tell Abū Duwari">*}
-                                {*Maškan-šāpir / Tell Abū Duwari*}
-                            {*</option>*}
-                            {*<option value="16" label="Khafajah">*}
-                                {*/ Khafajah*}
-                            {*</option>*}
-                            {*<option value="17" label="Borsippa, Birs Nimrūd">*}
-                                {*Barsip / Borsippa, Birs Nimrūd*}
-                            {*</option>*}
-                            {*<option value="18" label="Tell Abū Ḫabba">*}
-                                {*Sippar / Tell Abū Ḫabba*}
-                            {*</option>*}
-                            {*<option value="19" label="Tell Muḫammad">*}
-                                {*Diniktum? / Tell Muḫammad*}
-                            {*</option>*}
-                            {*<option value="21" label="Khafajah">*}
-                                {*Dūr-Samsu-iluna / Khafajah*}
-                            {*</option>*}
-                            {*<option value="22" label="">*}
-                                {*unknown /*}
-                            {*</option>*}
-                            {*<option value="24" label="Sūsa">*}
-                                {*Šūšan / Sūsa*}
-                            {*</option>*}
-                            {*<option value="23" label="Warka">*}
-                                {*Uruk / Warka*}
-                            {*</option>*}
-                            {*<option value="25" label="Ishchali">*}
-                                {*Nērebtum? / Ishchali*}
-                            {*</option>*}
-                            {*<option value="26" label="Cytheria (island)">*}
-                                {*/ Cytheria (island)*}
-                            {*</option>*}
-                            {*<option value="27" label="Cyprus">*}
-                                {*Iadnāna / Cyprus*}
-                            {*</option>*}
-                            {*<option value="29" label="Qalʾat Šarqāṭ">*}
-                                {*Aššur / Qalʾat Šarqāṭ*}
-                            {*</option>*}
-                            {*<option value="28" label="Tell Ḫaddād">*}
-                                {*Mê-Turran / Tell Ḫaddād*}
-                            {*</option>*}
-                            {*<option value="30" label="Tell Leilān">*}
-                                {*Šubat-Enlil / Tell Leilān*}
-                            {*</option>*}
-                            {*<option value="31" label="Acem Höyük">*}
-                                {*? / Acem Höyük*}
-                            {*</option>*}
-                            {*<option value="32" label="Tell al-ʾAšāra">*}
-                                {*Terqa / Tell al-ʾAšāra*}
-                            {*</option>*}
-                            {*<option value="33" label="Išān Dhaḫāk">*}
-                                {*/ Išān Dhaḫāk*}
-                            {*</option>*}
-                            {*<option value="34" label="Tell ad-Dibāʾī">*}
-                                {*Zaralulu / Tell ad-Dibāʾī*}
-                            {*</option>*}
-                            {*<option value="35" label="Tell al-Suleimaḫ">*}
-                                {*Batir? / Tell al-Suleimaḫ*}
-                            {*</option>*}
-                            {*<option value="36" label="Bardi Sanjian in Bītwāta">*}
-                                {*/ Bardi Sanjian in Bītwāta*}
-                            {*</option>*}
-                            {*<option value="37" label="near Tūz Ḫurmati">*}
-                                {*Ḫuršītum? / near Tūz Ḫurmati*}
-                            {*</option>*}
-                            {*<option value="38" label="Tell Šamšāra">*}
-                                {*Šušarrā / Tell Šamšāra*}
-                            {*</option>*}
-                            {*<option value="39" label="Dura-Europos">*}
-                                {*Damara / Dura-Europos*}
-                            {*</option>*}
-                            {*<option value="20" label="Tell ar-Rimāḫ">*}
-                                {*Qaṭṭarā / Tell ar-Rimāḫ*}
-                            {*</option>*}
-                            {*<option value="40" label="Tell Açana">*}
-                                {*Alalaḫ / Tell Açana*}
-                            {*</option>*}
-                            {*<option value="7" label="Rās aš-Šamra">*}
-                                {*Ugarit / Rās aš-Šamra*}
-                            {*</option>*}
-                            {*<option value="41" label="Tell Mardiḫ">*}
-                                {*Ebla / Tell Mardiḫ*}
-                            {*</option>*}
-                            {*<option value="42" label="Hillah (near Babylon)">*}
-                                {*/ Hillah (near Babylon)*}
-                            {*</option>*}
-                            {*<option value="43" label="Bismāya">*}
-                                {*Adab / Bismāya*}
-                            {*</option>*}
-                            {*<option value="44" label="al-Hibā">*}
-                                {*Lagaš / al-Hibā*}
-                            {*</option>*}
-                            {*<option value="45" label="Tell ed-Dēr">*}
-                                {*Sippar-Iaḫrūrum / Tell ed-Dēr*}
-                            {*</option>*}
-                            {*<option value="46" label="Tell Dulaiḫim or Tell Muḫaṭṭaṭ">*}
-                                {*Dilbat / Tell Dulaiḫim or Tell Muḫaṭṭaṭ*}
-                            {*</option>*}
-
-                        {*</select>*}
-                    {*</div>*}
-                {*</div>*}
-            {*</div>*}
-            {*<div class="form-group row">*}
-                {*<label for="reg_no" class="col-sm-2 col-form-label">Registration / Ex. number</label>*}
-                {*<div class="col-sm-3">*}
-                    {*<div class="input-group">*}
-
-                        {*<select name="reg_no-op" class="form-control">*}
-                            {*<option value="equals">*}
-                                {*equals*}
-                            {*</option>*}
-                            {*<option value="not equals">*}
-                                {*not equals*}
-                            {*</option>*}
-                            {*<option value="contains" selected="selected">*}
-                                {*contains*}
-                            {*</option>*}
-                            {*<option value="begins with">*}
-                                {*begins with*}
-                            {*</option>*}
-                            {*<option value="ends with">*}
-                                {*ends with*}
-                            {*</option>*}
-                        {*</select>*}
-                        {*<input type="text" id="reg_no" name="reg_no" class="form-control">*}
-                    {*</div>*}
-                {*</div>*}
-            {*</div>*}
-            {*<div class="form-group row">*}
-                {*<label for="date" class="col-sm-2 col-form-label">Date</label>*}
-                {*<div class="col-sm-3">*}
-                    {*<div class="input-group">*}
-
-                        {*<select name="date-op" class="form-control">*}
-                            {*<option value="equals">*}
-                                {*equals*}
-                            {*</option>*}
-                            {*<option value="not equals">*}
-                                {*not equals*}
-                            {*</option>*}
-                            {*<option value="contains" selected="selected">*}
-                                {*contains*}
-                            {*</option>*}
-                            {*<option value="begins with">*}
-                                {*begins with*}
-                            {*</option>*}
-                            {*<option value="ends with">*}
-                                {*ends with*}
-                            {*</option>*}
-                        {*</select>*}
-                        {*<input type="text" id="date" name="date" class="form-control">*}
-                    {*</div>*}
-                {*</div>*}
-            {*</div>*}
-        {*</div>*}
-        {*<hr>*}
-
-        {*<label for="line-count">Representation of search result:</label>*}
-        {*<div class="form-inline">*}
-            {*<div class="form-group">*}
-                {*<small class="text-muted">*}
-                    {*Print*}
-                {*</small>*}
-                {*<select name="line-count" id="line-count" class="form-control form-control-sm mx-sm-3">*}
-                    {*<option value="0" selected="selected">0</option>*}
-                    {*<option value="1">1</option>*}
-                    {*<option value="2">2</option>*}
-                    {*<option value="3">3</option>*}
-                    {*<option value="5">5</option>*}
-                    {*<option value="10">10</option>*}
-                    {*<option value="15">15</option>*}
-                {*</select>*}
-                {*<small id="passwordHelpInline" class="text-muted">*}
-                    {*lines before and after found line.*}
-                {*</small>*}
-            {*</div>*}
-        {*</div>*}
-        {*<div class="form-inline">*}
-            {*<div class="form-group">*}
-                {*<small class="text-muted">*}
-                    {*Show*}
-                {*</small>*}
-                {*<select name="r_limit" class="form-control form-control-sm mx-sm-3">*}
-                    {*<option value="1">1</option>*}
-                    {*<option value="2">2</option>*}
-                    {*<option value="3">3</option>*}
-                    {*<option value="5" selected="selected">5</option>*}
-                    {*<option value="10">10</option>*}
-                    {*<option value="15">15</option>*}
-                    {*<option value="30">30</option>*}
-                {*</select>*}
-                {*<small class="text-muted">*}
-                    {*found transliteration per site.*}
-                {*</small>*}
-            {*</div>*}
-        {*</div>*}
+        <div class="search-options">
+            <div class="form-group row">
+                {label book class => 'col-sm-2 col-form-label'}
+                <div class="col-sm-3">
+                    <div class="input-group">
+                        {input book_condition}
+                        {input book}
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                {label museum class => 'col-sm-2 col-form-label'}
+                <div class="col-sm-3">
+                    <div class="input-group">
+                        {input museum_condition}
+                        {input museum}
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                {label type class => 'col-sm-2 col-form-label'}
+                <div class="col-sm-3">
+                    <div class="input-group">
+                        {input type_condition}
+                        {input type}
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                {label origin class => 'col-sm-2 col-form-label'}
+                <div class="col-sm-3">
+                    <div class="input-group">
+                        {input origin_condition}
+                        {input origin}
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                {label registration class => 'col-sm-2 col-form-label'}
+                <div class="col-sm-3">
+                    <div class="input-group">
+                        {input registration_condition}
+                        {input registration}
+                    </div>
+                </div>
+            </div>
+            <div class="form-group row">
+                {label date class => 'col-sm-2 col-form-label'}
+                <div class="col-sm-3">
+                    <div class="input-group">
+                        {input date_condition}
+                        {input date}
+                    </div>
+                </div>
+            </div>
+        </div>
     </div>
     <div class="form-group row">
         <div class="col-sm-10">
diff --git a/app/FrontModule/component/Transliteration/TransliterationSearchForm.php b/app/FrontModule/component/Transliteration/TransliterationSearchForm.php
index 2c2737e..7bb3a87 100644
--- a/app/FrontModule/component/Transliteration/TransliterationSearchForm.php
+++ b/app/FrontModule/component/Transliteration/TransliterationSearchForm.php
@@ -2,10 +2,12 @@
 
 namespace App\FrontModule\Components;
 
-use App\Enum\ELogicalConditions;
+use App\Enum\ESearchFormOperators;
+use App\Model\Repository\BookTypeRepository;
+use App\Model\Repository\OriginRepository;
 use App\Model\TransliterationSearchModel;
+use App\Utils\Form;
 use Nette\Application\UI\Control;
-use Nette\Application\UI\Form;
 use Nette\Utils\ArrayHash;
 
 class TransliterationSearchForm extends Control
@@ -13,14 +15,26 @@ class TransliterationSearchForm extends Control
     /** @var TransliterationSearchModel */
     private $transliterationSearchModel;
 
+    /** @var BookTypeRepository */
+    private $bookTypeRepository;
+
+    /** @var OriginRepository */
+    private $originRepository;
+
     /**
      * TransliterationSearchForm constructor.
      * @param TransliterationSearchModel $transliterationSearchModel
      */
-    public function __construct(TransliterationSearchModel $transliterationSearchModel)
+    public function __construct(
+        TransliterationSearchModel $transliterationSearchModel,
+        BookTypeRepository $bookTypeRepository,
+        OriginRepository $originRepository
+    )
     {
         parent::__construct();
         $this->transliterationSearchModel = $transliterationSearchModel;
+        $this->bookTypeRepository = $bookTypeRepository;
+        $this->originRepository = $originRepository;
     }
 
 
@@ -35,14 +49,37 @@ class TransliterationSearchForm extends Control
         $form = new Form();
 
         $form->addText('word1', 'Word 1')
-            ->setRequired(true, 'Field Word 1 is required');
+            ->addRule(Form::REQUIRED, 'Field %label is required.');
         $form->addText('word2', 'Word 2');
-        $form->addSelect('word2_condition', '', ELogicalConditions::$selectValues);
+        $form->addSelect('word2_condition', '', ESearchFormOperators::$wordSelectLabels);
         $form->addText('word3', 'Word 3');
-        $form->addSelect('word3_condition', '', ELogicalConditions::$selectValues);
+        $form->addSelect('word3_condition', '', ESearchFormOperators::$wordSelectLabels);
 
         $form->addCheckbox('exact_match', ' Exact Match');
 
+        $form->addSelect('book_condition', '', ESearchFormOperators::$selectLikeOperatorLabels)
+            ->setDefaultValue(ESearchFormOperators::CONTAINS);
+        $form->addText('book', 'Book');
+        $form->addSelect('museum_condition', '', ESearchFormOperators::$selectLikeOperatorLabels)
+            ->setDefaultValue(ESearchFormOperators::CONTAINS);
+        $form->addText('museum', 'Museum number');
+
+        $form->addSelect('type_condition', '', ESearchFormOperators::$selectEqualsOperatorLabels)
+            ->setDefaultValue(ESearchFormOperators::IS);
+        $form->addSelect('type', 'Type', $this->bookTypeRepository->getTypesForSelect());
+//            ->setDefaultValue(ESearchFormOperators::IS);
+        $form->addSelect('origin_condition', '', ESearchFormOperators::$selectEqualsOperatorLabels)
+            ->setDefaultValue(ESearchFormOperators::IS);
+        $form->addSelect('origin', 'Origin', $this->originRepository->getOriginsForSelect());
+
+
+        $form->addSelect('registration_condition', '', ESearchFormOperators::$selectLikeOperatorLabels)
+            ->setDefaultValue(ESearchFormOperators::CONTAINS);
+        $form->addText('registration', 'Registration / Ex. number');
+        $form->addSelect('date_condition', '', ESearchFormOperators::$selectLikeOperatorLabels)
+            ->setDefaultValue(ESearchFormOperators::CONTAINS);
+        $form->addText('date', 'Date');
+
         $form->addSubmit('submit', 'Search');
         $form->onSuccess[] = [$this, 'formSuccess'];
 
diff --git a/app/enum/ELogicalConditions.php b/app/enum/ELogicalConditions.php
deleted file mode 100644
index 29fd2ba..0000000
--- a/app/enum/ELogicalConditions.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-namespace App\Enum;
-
-
-class ELogicalConditions
-{
-    const NOT_USED = '';
-    const AND = 'and';
-    const OR = 'or';
-    const AND_NOT = 'and_not';
-
-    public static $selectValues = [
-        self::NOT_USED => '- NOT USED -',
-        self::AND => 'AND',
-        self::OR => 'OR',
-        self::AND_NOT => 'AND NOT'
-    ];
-
-    public static $whereCondition = [
-        self::AND => 'AND',
-        self::OR => 'OR',
-        self::AND_NOT => 'AND NOT'
-    ];
-}
\ No newline at end of file
diff --git a/app/enum/ESearchFormOperators.php b/app/enum/ESearchFormOperators.php
new file mode 100644
index 0000000..dc8dfbd
--- /dev/null
+++ b/app/enum/ESearchFormOperators.php
@@ -0,0 +1,63 @@
+<?php
+
+namespace App\Enum;
+
+
+class ESearchFormOperators
+{
+    const NOT_USED = '';
+    const AND = 'and';
+    const OR = 'or';
+    const AND_NOT = 'and_not';
+
+    const EQUALS = 'eq';
+    const NOT_EQUALS = 'neq';
+    const CONTAINS = 'con';
+    const BEGINS_WITH = 'bw';
+    const ENDS_WITH = 'ew';
+
+    const IS = 'is';
+    const IS_NOT = 'is_not';
+
+
+    public static $wordSelectLabels = [
+        self::NOT_USED => '- NOT USED -',
+        self::AND => 'AND',
+        self::OR => 'OR',
+        self::AND_NOT => 'AND NOT'
+    ];
+
+    public static $wordWhereCondition = [
+        self::AND => 'AND',
+        self::OR => 'OR',
+        self::AND_NOT => 'AND NOT'
+    ];
+
+
+    public static $selectLikeOperatorLabels = [
+        self::EQUALS => 'Equals',
+        self::NOT_EQUALS => 'Not equals',
+        self::CONTAINS => 'Contains',
+        self::BEGINS_WITH => 'Begins with',
+        self::ENDS_WITH => 'Ends with'
+    ];
+
+    public static $selectLikeOperatorQueryCondition = [
+        self::EQUALS => ' = ? ',
+        self::NOT_EQUALS => ' <> ? ',
+        self::CONTAINS => ' LIKE ? ',
+        self::BEGINS_WITH => ' LIKE ? ',
+        self::ENDS_WITH => ' LIKE ? '
+    ];
+
+
+    public static $selectEqualsOperatorLabels = [
+        self::IS => 'Is',
+        self::IS_NOT => 'Is not'
+    ];
+
+    public static $selectEqualsOperatorQueryCondition = [
+        self::IS => ' = ? ',
+        self::IS_NOT => ' <> ? '
+    ];
+}
\ No newline at end of file
diff --git a/app/model/repository/BookTypeRepository.php b/app/model/repository/BookTypeRepository.php
index dcb054b..eab33c7 100644
--- a/app/model/repository/BookTypeRepository.php
+++ b/app/model/repository/BookTypeRepository.php
@@ -16,4 +16,15 @@ class BookTypeRepository extends Repository
     /** Sloupečky tabulky */
     const COLUMN_ID = 'id_book_type';
     const COLUMN_BOOK_TYPE = 'book_type';
+
+    /**
+     * Return all book types for select values
+     * @return array
+     */
+    public function getTypesForSelect()
+    {
+        $types = $this->findAll()->fetchPairs(self::COLUMN_ID, self::COLUMN_BOOK_TYPE);
+        $types[0] = '- NOT SELECTED -';
+        return $types;
+    }
 }
\ No newline at end of file
diff --git a/app/model/repository/OriginRepository.php b/app/model/repository/OriginRepository.php
index cdbf508..3c18c16 100644
--- a/app/model/repository/OriginRepository.php
+++ b/app/model/repository/OriginRepository.php
@@ -17,4 +17,15 @@ class OriginRepository extends Repository
     const COLUMN_ID = 'id_origin';
     const COLUMN_ORIGIN = 'origin';
     const COLUMN_OLD_NAME = 'old_name';
+
+    /**
+     * Return all origins for select values
+     * @return array
+     */
+    public function getOriginsForSelect()
+    {
+        $origins = $this->findAll()->fetchPairs(self::COLUMN_ID, self::COLUMN_ORIGIN);
+        $origins[0] = '- NOT SELECTED -';
+        return $origins;
+    }
 }
\ No newline at end of file
diff --git a/app/model/repository/TransliterationRepository.php b/app/model/repository/TransliterationRepository.php
index 08bb4a3..72e1e66 100644
--- a/app/model/repository/TransliterationRepository.php
+++ b/app/model/repository/TransliterationRepository.php
@@ -2,7 +2,7 @@
 
 namespace App\Model\Repository;
 
-use App\Enum\ELogicalConditions;
+use App\Enum\ESearchFormOperators;
 use Nette\Utils\ArrayHash;
 
 /**
@@ -54,12 +54,12 @@ class TransliterationRepository extends Repository
         {
             if($queryParams['exact_match'])
             {
-                $where .= ELogicalConditions::$whereCondition[$queryParams['word2_condition']] . " l.transliteration LIKE ? ";
+                $where .= ESearchFormOperators::$wordWhereCondition[$queryParams['word2_condition']] . " l.transliteration LIKE ? ";
                 $whereArgs[] = "%" . $queryParams['word2'] . "%";
             }
             else
             {
-                $where .= ELogicalConditions::$whereCondition[$queryParams['word2_condition']] . " l.transliteration REGEXP ? ";
+                $where .= ESearchFormOperators::$wordWhereCondition[$queryParams['word2_condition']] . " l.transliteration REGEXP ? ";
                 $whereArgs[] = $this->prepareSearchRegExp($queryParams['word2']);
             }
         }
@@ -68,12 +68,12 @@ class TransliterationRepository extends Repository
         {
             if($queryParams['exact_match'])
             {
-                $where .= ELogicalConditions::$whereCondition[$queryParams['word3_condition']] . " l.transliteration LIKE ? ";
+                $where .= ESearchFormOperators::$wordWhereCondition[$queryParams['word3_condition']] . " l.transliteration LIKE ? ";
                 $whereArgs[] = "%" . $queryParams['word3'] . "%";
             }
             else
             {
-                $where .= ELogicalConditions::$whereCondition[$queryParams['word3_condition']] . " l.transliteration REGEXP ? ";
+                $where .= ESearchFormOperators::$wordWhereCondition[$queryParams['word3_condition']] . " l.transliteration REGEXP ? ";
                 $whereArgs[] = $this->prepareSearchRegExp($queryParams['word3']);
             }
         }
