Merge branch 'rework-dashboard' into 'master'
fixed cache disabling See merge request fronk/thetool!884
This commit is contained in:
@@ -99,19 +99,7 @@ class DashboardNewController extends mfBaseController {
|
||||
}
|
||||
|
||||
private function checkParameterAuthorization($campaign_ids = []) {
|
||||
// $campaigns = PreordercampaignModel::search(["owner_id" => $this->me->address_id]);
|
||||
// $campaign_filter = ["preordercampaign_id" => $campaign_ids];
|
||||
// if(!$campaign_ids) {
|
||||
// foreach(PreordercampaignModel::search(["owner_id" => $this->me->address_id]) as $campaign) {
|
||||
// $campaign_ids[] = $campaign->id;
|
||||
// }
|
||||
// }
|
||||
// we need to use this if the user is not a admin to only show his campaigns
|
||||
// we will pass the campaign_ids to the function and check if the user is allowed to see the data
|
||||
// if the user is not allowed to see the data we will return an empty array
|
||||
|
||||
$campaigns = PreordercampaignModel::search(["owner_id" => $this->me->address_id]);
|
||||
// loop through the campaigns and check if the user is allowed to see the data
|
||||
foreach ($campaigns as $campaign) {
|
||||
if (!in_array($campaign->id, $campaign_ids)) {
|
||||
$key = array_search($campaign->id, $campaign_ids);
|
||||
@@ -225,11 +213,6 @@ class DashboardNewController extends mfBaseController {
|
||||
return $timeline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// add Leerrohr to timeline
|
||||
// add ont installed to timeline
|
||||
|
||||
private function getTimelineData($type, $params) {
|
||||
$timeline = [];
|
||||
$start = strtotime('-1 year');
|
||||
@@ -247,7 +230,7 @@ class DashboardNewController extends mfBaseController {
|
||||
}
|
||||
|
||||
// Load cached data if it exists
|
||||
if (file_exists($cacheFile) && false) {
|
||||
if (file_exists($cacheFile)) {
|
||||
$cachedData = json_decode(file_get_contents($cacheFile), true);
|
||||
$lastCachedDate = end($cachedData)['date'];
|
||||
$lastCachedTimestamp = strtotime($lastCachedDate);
|
||||
|
||||
Reference in New Issue
Block a user