@@ -220,10 +220,11 @@ function verifyEntryURL_failure(XmlRequest)
220
220
} else {
221
221
$ fdTable = Database::getTablePrefix ().'faqdata ' ;
222
222
$ fcrTable = Database::getTablePrefix ().'faqcategoryrelations ' ;
223
- $ search = SearchFactory::create ($ faqConfig , array ( 'database ' => Database::getType ()) );
223
+ $ search = SearchFactory::create ($ faqConfig , [ 'database ' => Database::getType ()] );
224
224
225
225
$ search ->setTable ($ fdTable )
226
- ->setResultColumns (array (
226
+ ->setResultColumns (
227
+ [
227
228
$ fdTable .'.id AS id ' ,
228
229
$ fdTable .'.lang AS lang ' ,
229
230
$ fdTable .'.solution_id AS solution_id ' ,
@@ -232,24 +233,29 @@ function verifyEntryURL_failure(XmlRequest)
232
233
$ fdTable .'.active AS active ' ,
233
234
$ fdTable .'.thema AS thema ' ,
234
235
$ fdTable .'.content AS content ' ,
235
- $ fdTable .'.updated AS updated ' ,))
236
+ $ fdTable .'.updated AS updated ' ,
237
+ ]
238
+ )
236
239
->setJoinedTable ($ fcrTable )
237
- ->setJoinedColumns (array (
240
+ ->setJoinedColumns (
241
+ [
238
242
$ fdTable .'.id = ' .$ fcrTable .'.record_id ' ,
239
- $ fdTable .'.lang = ' .$ fcrTable .'.record_lang ' ,));
243
+ $ fdTable .'.lang = ' .$ fcrTable .'.record_lang ' ,
244
+ ]
245
+ );
240
246
241
247
if (is_numeric ($ searchTerm )) {
242
- $ search ->setMatchingColumns (array ( $ fdTable .'.solution_id ' ) );
248
+ $ search ->setMatchingColumns ([ $ fdTable .'.solution_id ' ] );
243
249
} else {
244
- $ search ->setMatchingColumns (array ( $ fdTable .'.thema ' , $ fdTable .'.content ' , $ fdTable .'.keywords ' ) );
250
+ $ search ->setMatchingColumns ([ $ fdTable .'.thema ' , $ fdTable .'.content ' , $ fdTable .'.keywords ' ] );
245
251
}
246
252
247
253
$ result = $ search ->search ($ searchTerm );
248
254
$ laction = 'view ' ;
249
255
$ internalSearch = '&search= ' .$ searchTerm ;
250
256
$ wasSearch = true ;
251
- $ idsFound = array () ;
252
- $ faqsFound = array () ;
257
+ $ idsFound = [] ;
258
+ $ faqsFound = [] ;
253
259
254
260
while ($ row = $ faqConfig ->getDb ()->fetchObject ($ result )) {
255
261
if ($ searchCat != 0 && $ searchCat != (int )$ row ->category_id ) {
@@ -472,7 +478,7 @@ function verifyEntryURL_failure(XmlRequest)
472
478
<?php if ($ user ->perm ->checkRight ($ user ->getUserId (),
473
479
'approverec ' ) && isset ($ numVisits [$ record ['id ' ]])) { ?>
474
480
<label>
475
- <input type="checkbox" lang="<?= $ record ['lang ' ] ?> "
481
+ <input type="checkbox" lang="<?= $ record ['lang ' ] ?> " class="active-records-category- <?= $ cid ?> "
476
482
onclick="saveStatus(<?= $ cid .', [ ' .$ record ['id ' ].'] ' ?> , 'active', '<?= $ user ->getCsrfTokenFromSession () ?> ');"
477
483
id="active_record_<?= $ cid .'_ ' .$ record ['id ' ] ?> "
478
484
<?= 'yes ' == $ record ['active ' ] ? 'checked ' : ' ' ?> >
@@ -580,27 +586,19 @@ function saveStatus(cid, ids, type, csrf) {
580
586
if ('active' === type) {
581
587
for (let j = 0; j < sameRecords.length; j++) {
582
588
$('#' + sameRecords[j].id).attr('checked', status);
583
-
584
589
const catid = sameRecords[j].id.match(/active_record_(\d+)_\d+/)[1];
585
- const current_item_count = $('#js-active-records-' + catid).html();
586
- const delta = 'checked' === status ? -1 : 1;
587
-
588
- $('#js-active-records-' + catid).html(current_item_count * 1 + delta);
590
+ $('#js-active-records-' + catid).html($('.active-records-category-' + cid + ':not(:checked)').length);
589
591
}
590
592
} else {
591
593
for (let j = 0; j < sameRecords.length; j++) {
592
594
$('#' + sameRecords[j].id).attr('checked', status);
593
-
594
595
const catid = sameRecords[j].id.match(/active_record_(\d+)_\d+/)[1];
595
- const current_item_count = $('#js-active-records-' + catid).html();
596
- const delta = 'checked' === status ? -1 : 1;
597
-
598
- $('#js-active-records-' + catid).html(current_item_count * 1 + delta);
596
+ $('#js-active-records-' + catid).html($('.active-records-category-' + cid + ':not(:checked)').length);
599
597
}
600
598
}
601
599
}
602
600
603
- $.get(" index.php" , data, null);
601
+ $.get(' index.php' , data, null);
604
602
indicator.html('<?= $ PMF_LANG ['ad_entry_savedsuc ' ] ?> ');
605
603
}
606
604
0 commit comments