Skip to content

Commit

Permalink
Fix copyright infringement ACP members tab error (#3)
Browse files Browse the repository at this point in the history
* Fixed infringements chart

* Build 1.0.4
  • Loading branch information
jonerickson authored Nov 16, 2023
1 parent 4786cd2 commit a4ad98a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/data/lang.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<language>
<app key="dmca" version="10003">
<app key="dmca" version="10004">
<word key="__app_dmca" js="0">DMCA Copyright Claim Manager</word>
<word key="menutab__dmca" js="0">DMCA Manager</word>
<word key="menutab__dmca_icon" js="0">flag</word>
Expand Down
3 changes: 2 additions & 1 deletion src/data/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"10000": "1.0.0",
"10001": "1.0.1",
"10002": "1.0.2",
"10003": "1.0.3"
"10003": "1.0.3",
"10004": "1.0.4"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@

namespace IPS\dmca\extensions\core\MemberACPProfileBlocks;

use IPS\dmca\Reports\Strike;
use IPS\dmca\Reports\Report;
use IPS\Helpers\Chart\Database;
use IPS\Http\Url;
use IPS\Member;
use IPS\Request;
use IPS\Theme;

/* To prevent PHP errors (extending class does not exist) revealing path */
if (!\defined('\IPS\SUITE_UNIQUE_KEY')) {
Expand All @@ -32,21 +37,22 @@ class _CopyrightInfringementChart extends \IPS\core\MemberACPProfile\Block
*/
public function output(): string
{
$chart = new \IPS\Helpers\Chart\Database(Url::internal('app=core&module=members&controller=members&do=view')->setQueryString('id', \IPS\Request::i()->id)->setQueryString('tab', 'dmca_CopyrightInfringements'), Report::$databaseTable, 'created_at', '', array(
$chart = new Database(Url::internal('app=core&module=members&controller=members&do=view')->setQueryString('id', Request::i()->id)->setQueryString('tab', 'dmca_CopyrightInfringements'), Strike::$databaseTable, 'created_at', '', array(
'isStacked' => false,
'backgroundColor' => '#ffffff',
'hAxis' => array('gridlines' => array('color' => '#f5f5f5')),
'lineWidth' => 1,
'areaOpacity' => 0.4
));

$chart->where[] = ['member_id = ?', \IPS\Request::i()->id];
$chart->where[] = ['status = ?', \IPS\dmca\Reports\Report::REPORT_STATUS_APPROVED];
$chart->joins[] = ['dmca_reports', 'dmca_reports.id=dmca_strikes.report_id'];
$chart->where[] = ['member_id = ?', Request::i()->id];
$chart->where[] = ['status = ?', Report::REPORT_STATUS_APPROVED];

$chart->addSeries(\IPS\Member::loggedIn()->language()->addToStack('dcma_chart_infringements'), 'number', 'COUNT(*)');
$chart->title = \IPS\Member::loggedIn()->language()->addToStack('dcma_chart_infringements_title');
$chart->addSeries(Member::loggedIn()->language()->addToStack('dcma_chart_infringements'), 'number', 'COUNT(*)');
$chart->title = Member::loggedIn()->language()->addToStack('dcma_chart_infringements_title');
$chart->availableTypes = array( 'AreaChart', 'ColumnChart', 'BarChart' );

return \IPS\Theme::i()->getTemplate('chart', 'dmca', 'admin')->chart($chart);
return Theme::i()->getTemplate('chart', 'dmca', 'admin')->chart($chart);
}
}
23 changes: 23 additions & 0 deletions src/setup/upg_10004/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"id": 10004,
"name": "1.0.4",
"steps": {
"queries": false,
"lang": false,
"theme": false,
"themeSettings": false,
"javascript": false,
"emailTemplates": false,
"hooks": false,
"acpSearchKeywords": false,
"settings": false,
"tasks": false,
"modules": false,
"widgets": false,
"customOptions": false,
"customRoutines": false
},
"forceMainUpgrader": false,
"forceManualDownloadNoCiC": false,
"forceManualDownloadCiC": false
}

0 comments on commit a4ad98a

Please sign in to comment.