Skip to content

Commit

Permalink
Dev: Hide Cint nag after survey activation
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Aug 8, 2016
1 parent d7f56b9 commit ea745b1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions application/core/plugins/CintLink/CintLink.php
Expand Up @@ -293,6 +293,7 @@ protected function checkCintActive($surveyId)
else
{
// No order is on hold, new/review or live. So completed or cancelled. Unset all flags.
$this->hideNaggingNotication($surveyId);
$this->set('cint_active_' . $surveyId, false);
}
}
Expand Down Expand Up @@ -1068,6 +1069,24 @@ protected function showNaggingNotification($message, $surveyId) {
}
}

/**
* Set the nagging notification to read
* @return void
*/
protected function hideNaggingNotication($surveyId)
{
$nagId = $this->get('nag_id_' . $surveyId);
if (!empty($nagId))
{
$not = Notification::model()->findByPk($nagId);
if (!empty($not))
{
$not->status = 'read';
$not->save();
}
}
}

/**
* Create a new notification and save its id in plugin settings
*
Expand Down

0 comments on commit ea745b1

Please sign in to comment.