@@ -55,9 +55,9 @@ public function getOxcomAdminSearchResults()
5555 if ($ this ->getOxcomAdminSearchConfigParam ("blOxComAdminSearchShowCmsPages " )) {
5656 $ aData ["cmspages " ] = $ this ->_getOxcomAdminSearchCmsPages ();
5757 }
58- // if ($this->getOxcomAdminSearchConfigParam("blOxComAdminSearchShowOrders")) {
59- $ aData ["orders " ] = $ this ->_getOxcomAdminSearchOrders ();
60- // }
58+ if ($ this ->getOxcomAdminSearchConfigParam ("blOxComAdminSearchShowOrders " )) {
59+ $ aData ["orders " ] = $ this ->_getOxcomAdminSearchOrders ();
60+ }
6161 if ($ this ->getOxcomAdminSearchConfigParam ("blOxComAdminSearchShowUsers " )) {
6262 $ aData ["users " ] = $ this ->_getOxcomAdminSearchUsers ();
6363 }
@@ -98,7 +98,12 @@ public function getOxcomAdminSearchConfigParam($sParam = '')
9898 protected function _getOxcomAdminSearchArticles ()
9999 {
100100 $ sViewName = $ this ->_sViewNameGenerator ->getViewName ("oxarticles " );
101- $ sSql = "SELECT oxid, CONCAT_WS(' / ', oxartnum, oxtitle, '', oxvarselect) FROM $ sViewName WHERE CONCAT_WS(' / ', oxartnum, oxtitle, oxvarselect) LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
101+ $ aFields = $ this ->getOxcomAdminSearchConfigParam ("aOxComAdminSearchArticleFields " );
102+ if (!is_array ($ aFields )) {
103+ $ aFields = ['oxartnum ' , 'oxtitle ' , 'oxvarselect ' ];
104+ }
105+ $ sFieldsList = implode (', ' , $ aFields );
106+ $ sSql = "SELECT oxid, CONCAT_WS(' / ', $ sFieldsList) FROM $ sViewName WHERE CONCAT_WS(' / ', $ sFieldsList) LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
102107
103108 return $ this ->_getOxcomAdminSearchData ($ sSql , 'article ' );
104109 }
@@ -111,7 +116,12 @@ protected function _getOxcomAdminSearchArticles()
111116 protected function _getOxcomAdminSearchCategories ()
112117 {
113118 $ sViewName = $ this ->_sViewNameGenerator ->getViewName ("oxcategories " );
114- $ sSql = "SELECT oxid, oxtitle FROM $ sViewName WHERE oxtitle LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
119+ $ aFields = $ this ->getOxcomAdminSearchConfigParam ("aOxComAdminSearchCategoryFields " );
120+ if (!is_array ($ aFields )) {
121+ $ aFields = ['oxtitle ' ];
122+ }
123+ $ sFieldsList = implode (', ' , $ aFields );
124+ $ sSql = "SELECT oxid, $ sFieldsList FROM $ sViewName WHERE $ sFieldsList LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
115125
116126 return $ this ->_getOxcomAdminSearchData ($ sSql , 'category ' );
117127 }
@@ -124,7 +134,12 @@ protected function _getOxcomAdminSearchCategories()
124134 protected function _getOxcomAdminSearchCmsPages ()
125135 {
126136 $ sViewName = $ this ->_sViewNameGenerator ->getViewName ("oxcontents " );
127- $ sSql = "SELECT oxid, oxtitle FROM $ sViewName WHERE oxtitle LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
137+ $ aFields = $ this ->getOxcomAdminSearchConfigParam ("aOxComAdminSearchCmsPageFields " );
138+ if (!is_array ($ aFields )) {
139+ $ aFields = ['oxtitle ' ];
140+ }
141+ $ sFieldsList = implode (', ' , $ aFields );
142+ $ sSql = "SELECT oxid, $ sFieldsList FROM $ sViewName WHERE $ sFieldsList LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
128143
129144 return $ this ->_getOxcomAdminSearchData ($ sSql , 'admin_content ' );
130145 }
@@ -137,7 +152,12 @@ protected function _getOxcomAdminSearchCmsPages()
137152 protected function _getOxcomAdminSearchOrders ()
138153 {
139154 $ sViewName = $ this ->_sViewNameGenerator ->getViewName ("oxorder " );
140- $ sSql = "SELECT oxid, CONCAT_WS(' / ', oxordernr, oxbillfname, oxbilllname, oxbillemail, oxtrackcode, oxremark) AS search FROM $ sViewName WHERE CONCAT_WS(' / ', oxordernr, oxbillfname, oxbilllname, oxbillemail, oxtrackcode, oxremark) LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
155+ $ aFields = $ this ->getOxcomAdminSearchConfigParam ("aOxComAdminSearchOrderFields " );
156+ if (!is_array ($ aFields )) {
157+ $ aFields = ['oxordernr ' , 'oxbillfname ' , 'oxbilllname ' , 'oxbillemail ' , 'oxtrackcode ' , 'oxremark ' ];
158+ }
159+ $ sFieldsList = implode (', ' , $ aFields );
160+ $ sSql = "SELECT oxid, CONCAT_WS(' / ', $ sFieldsList) AS search FROM $ sViewName WHERE CONCAT_WS(' / ', $ sFieldsList) LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
141161
142162 return $ this ->_getOxcomAdminSearchData ($ sSql , 'admin_order ' );
143163 }
@@ -150,7 +170,12 @@ protected function _getOxcomAdminSearchOrders()
150170 protected function _getOxcomAdminSearchUsers ()
151171 {
152172 $ sViewName = $ this ->_sViewNameGenerator ->getViewName ("oxuser " );
153- $ sSql = "SELECT oxid, CONCAT_WS(' / ', oxcustnr, oxfname, oxlname, oxusername, oxzip) FROM $ sViewName WHERE CONCAT_WS(' / ', oxcustnr, oxlname, oxfname, oxusername, oxzip) LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
173+ $ aFields = $ this ->getOxcomAdminSearchConfigParam ("aOxComAdminSearchUserFields " );
174+ if (!is_array ($ aFields )) {
175+ $ aFields = ['oxcustnr ' , 'oxfname ' , 'oxlname ' , 'oxusername ' , 'oxzip ' ];
176+ }
177+ $ sFieldsList = implode (', ' , $ aFields );
178+ $ sSql = "SELECT oxid, CONCAT_WS(' / ', $ sFieldsList) FROM $ sViewName WHERE CONCAT_WS(' / ', $ sFieldsList) LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
154179
155180 return $ this ->_getOxcomAdminSearchData ($ sSql , 'admin_user ' );
156181 }
@@ -163,7 +188,12 @@ protected function _getOxcomAdminSearchUsers()
163188 protected function _getOxcomAdminSearchCompanies ()
164189 {
165190 $ sViewName = $ this ->_sViewNameGenerator ->getViewName ("oxuser " );
166- $ sSql = "SELECT oxid, oxcompany FROM $ sViewName WHERE oxcompany LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
191+ $ aFields = $ this ->getOxcomAdminSearchConfigParam ("aOxComAdminSearchCompanyFields " );
192+ if (!is_array ($ aFields )) {
193+ $ aFields = ['oxcompany ' ];
194+ }
195+ $ sFieldsList = implode (', ' , $ aFields );
196+ $ sSql = "SELECT oxid, $ sFieldsList FROM $ sViewName WHERE $ sFieldsList LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
167197
168198 return $ this ->_getOxcomAdminSearchData ($ sSql , 'admin_user ' );
169199 }
@@ -176,7 +206,12 @@ protected function _getOxcomAdminSearchCompanies()
176206 protected function _getOxcomAdminSearchVendors ()
177207 {
178208 $ sViewName = $ this ->_sViewNameGenerator ->getViewName ("oxvendor " );
179- $ sSql = "SELECT oxid, oxtitle FROM $ sViewName WHERE oxtitle LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
209+ $ aFields = $ this ->getOxcomAdminSearchConfigParam ("aOxComAdminSearchVendorFields " );
210+ if (!is_array ($ aFields )) {
211+ $ aFields = ['oxtitle ' ];
212+ }
213+ $ sFieldsList = implode (', ' , $ aFields );
214+ $ sSql = "SELECT oxid, $ sFieldsList FROM $ sViewName WHERE $ sFieldsList LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
180215
181216 return $ this ->_getOxcomAdminSearchData ($ sSql , 'vendor ' );
182217 }
@@ -189,7 +224,12 @@ protected function _getOxcomAdminSearchVendors()
189224 protected function _getOxcomAdminSearchManufacturers ()
190225 {
191226 $ sViewName = $ this ->_sViewNameGenerator ->getViewName ("oxmanufacturers " );
192- $ sSql = "SELECT oxid, oxtitle FROM $ sViewName WHERE oxtitle LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
227+ $ aFields = $ this ->getOxcomAdminSearchConfigParam ("aOxComAdminSearchManufacturerFields " );
228+ if (!is_array ($ aFields )) {
229+ $ aFields = ['oxtitle ' ];
230+ }
231+ $ sFieldsList = implode (', ' , $ aFields );
232+ $ sSql = "SELECT oxid, $ sFieldsList FROM $ sViewName WHERE $ sFieldsList LIKE " . \OxidEsales \Eshop \Core \DatabaseProvider::getDb ()->quote ('% ' . $ this ->_sQueryName . '% ' );
193233
194234 return $ this ->_getOxcomAdminSearchData ($ sSql , 'manufacturer ' );
195235 }
0 commit comments