mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-07 05:14:31 +00:00
feat(preferences): apply report filter (suppress merchant-transfer reports) [#198]
Honour the per-user report-filter checkboxes in marketComplete(): - v4: recipient gets no report for transfers between own villages - v6: recipient gets no report for transfers from foreign villages - v5: sender gets no report for transfers to foreign villages The user row is already fully loaded by getUserFields(), so the prefs are read without extra queries. Removes the "not coded yet" tag from the report-filter section in the preferences form. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
Catalin Novgorodschi
parent
9d88727aff
commit
8d46fc78ae
@@ -641,8 +641,17 @@ class Automation {
|
||||
$ownally = $userData_from['alliance'];
|
||||
$targetally = $userData_to['alliance'];
|
||||
|
||||
$database->addNotice($to['owner'],$to['wref'],$targetally,$sort_type,''.addslashes($from['name']).' send resources to '.addslashes($to['name']).'',''.$from['owner'].','.$from['wref'].','.$data['wood'].','.$data['clay'].','.$data['iron'].','.$data['crop'].'',$data['endtime']);
|
||||
if($from['owner'] != $to['owner']) {
|
||||
// Report filter preferences (#198): skip merchant-transfer notices
|
||||
// according to the saved checkboxes of the involved players.
|
||||
// v4 -> recipient: no report for transfers to own villages
|
||||
// v6 -> recipient: no report for transfers from foreign villages
|
||||
// v5 -> sender: no report for transfers to foreign villages
|
||||
$ownTransfer = ($from['owner'] == $to['owner']);
|
||||
$skipRecipient = $ownTransfer ? !empty($userData_to['v4']) : !empty($userData_to['v6']);
|
||||
if(!$skipRecipient) {
|
||||
$database->addNotice($to['owner'],$to['wref'],$targetally,$sort_type,''.addslashes($from['name']).' send resources to '.addslashes($to['name']).'',''.$from['owner'].','.$from['wref'].','.$data['wood'].','.$data['clay'].','.$data['iron'].','.$data['crop'].'',$data['endtime']);
|
||||
}
|
||||
if(!$ownTransfer && empty($userData_from['v5'])) {
|
||||
$database->addNotice($from['owner'],$to['wref'],$ownally,$sort_type,''.addslashes($from['name']).' send resources to '.addslashes($to['name']).'',''.$from['owner'].','.$from['wref'].','.$data['wood'].','.$data['clay'].','.$data['iron'].','.$data['crop'].'',$data['endtime']);
|
||||
}
|
||||
$database->modifyResource($data['to'],$data['wood'],$data['clay'],$data['iron'],$data['crop'],1);
|
||||
|
||||
@@ -406,10 +406,7 @@ if(isset($_POST['lang']))
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
Report filter
|
||||
<span style="color:#999; font-weight:400; font-size:0.9em; font-style:italic; opacity:0.7;">
|
||||
<?php echo TZ_NOT_CODED_YET; ?>
|
||||
</span>
|
||||
<?php echo REPORT_FILTER; ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
Reference in New Issue
Block a user