1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 18:32:41 +01:00
phorge-phorge/src/applications/notification/controller/PhabricatorNotificationClearController.php
epriestley 099695ab61 Fix unacceptably light-hearted string in serious business mode
Summary: A serious business lost a bunch of serious business partners today because of this string, I assume.

Test Plan: Enabled serious mode, clicked button, was relieved to see no jokes.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D6799
2013-08-22 15:01:22 -07:00

45 lines
1.2 KiB
PHP

<?php
final class PhabricatorNotificationClearController
extends PhabricatorNotificationController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
if ($request->isDialogFormPost()) {
$table = new PhabricatorFeedStoryNotification();
queryfx(
$table->establishConnection('w'),
'UPDATE %T SET hasViewed = 1 WHERE
userPHID = %s AND hasViewed = 0',
$table->getTableName(),
$user->getPHID());
return id(new AphrontReloadResponse())
->setURI('/notification/');
}
$dialog = new AphrontDialogView();
$dialog->setUser($user);
$dialog->setTitle('Really mark all notifications as read?');
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
if ($is_serious) {
$dialog->appendChild(
pht(
"All unread notifications will be marked as read. You can not ".
"undo this action."));
} else {
$dialog->appendChild(
pht(
"You can't ignore your problems forever, you know."));
}
$dialog->addCancelButton('/notification/');
$dialog->addSubmitButton('Mark All Read');
return id(new AphrontDialogResponse())->setDialog($dialog);
}
}