Skip to content

Commit a568234

Browse files
authored
Pass request parameters instead of array of used IDs
1 parent 03267e0 commit a568234

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

Diff for: src/DomainRecord.php

+6-15
Original file line numberDiff line numberDiff line change
@@ -541,25 +541,16 @@ public static function showForDomain(Domain $domain)
541541
__('Link a record') . "</th></tr>";
542542

543543
echo "<tr class='tab_bg_1'><td class='center'>";
544-
$used_iterator = $DB->request([
545-
'SELECT' => 'id',
546-
'FROM' => self::getTable(),
547-
'WHERE' => [
548-
'domains_id' => ['>', 0],
549-
'NOT' => ['domains_id' => null]
550-
]
551-
]);
552-
553-
$used = [];
554-
foreach ($used_iterator as $row) {
555-
$used[$row['id']] = $row['id'];
556-
}
557-
558544
Dropdown::show(
559545
'DomainRecord',
560546
[
561547
'name' => "domainrecords_id",
562-
'used' => $used
548+
'condition' => [
549+
'NOT' => [
550+
'domains_id' => ['>', 0],
551+
'NOT' => ['domains_id' => null]
552+
]
553+
]
563554
]
564555
);
565556

Diff for: src/Group_User.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,10 @@ public static function showForUser(User $user)
202202
echo "<input type='hidden' name='users_id' value='$ID'>";
203203

204204
$params = [
205-
'used' => $used,
206205
'condition' => [
207206
'is_usergroup' => 1,
208207
] + getEntitiesRestrictCriteria(Group::getTable(), '', '', true)
209-
];
208+
] + ['NOT' => self::getListForItemParams($user)];
210209
Group::dropdown($params);
211210
echo "</td><td>" . _n('Manager', 'Managers', 1) . "</td><td>";
212211
Dropdown::showYesNo('is_manager');

0 commit comments

Comments
 (0)