mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 20:40:56 +01:00
Calendar event detail view should show "Unnamed Event" as title for events with no title
Summary: Closes T8048, Calendar event detail view should show "Unnamed Event" as title for events with no title Test Plan: Open an old event created before titles were required, event detail view should display title as "Unnamed Event" instead of a blank title Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8048 Differential Revision: https://secure.phabricator.com/D12736
This commit is contained in:
parent
24c267eb9c
commit
bcf60f1b05
2 changed files with 34 additions and 1 deletions
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
echo "Retro-naming unnamed events.\n";
|
||||||
|
|
||||||
|
$table = new PhabricatorCalendarEvent();
|
||||||
|
$conn_w = $table->establishConnection('w');
|
||||||
|
$iterator = new LiskMigrationIterator($table);
|
||||||
|
foreach ($iterator as $event) {
|
||||||
|
$id = $event->getID();
|
||||||
|
|
||||||
|
if (strlen($event->getName()) == 0) {
|
||||||
|
echo "Renaming event {$id}...\n";
|
||||||
|
$viewer = PhabricatorUser::getOmnipotentUser();
|
||||||
|
$handle = id(new PhabricatorHandleQuery())
|
||||||
|
->setViewer($viewer)
|
||||||
|
->withPHIDs(array($event->getUserPHID()))
|
||||||
|
->executeOne();
|
||||||
|
if ($handle->isComplete()) {
|
||||||
|
$new_name = $handle->getName();
|
||||||
|
} else {
|
||||||
|
$new_name = pht('Unnamed Event');
|
||||||
|
}
|
||||||
|
|
||||||
|
queryfx(
|
||||||
|
$conn_w,
|
||||||
|
'UPDATE %T SET name = %s WHERE id = %d',
|
||||||
|
$table->getTableName(),
|
||||||
|
$new_name,
|
||||||
|
$id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Done.\n";
|
|
@ -76,7 +76,7 @@ final class PhabricatorCalendarEventViewController
|
||||||
$is_cancelled = $event->getIsCancelled();
|
$is_cancelled = $event->getIsCancelled();
|
||||||
$icon = $is_cancelled ? ('fa-times') : ('fa-calendar');
|
$icon = $is_cancelled ? ('fa-times') : ('fa-calendar');
|
||||||
$color = $is_cancelled ? ('grey') : ('green');
|
$color = $is_cancelled ? ('grey') : ('green');
|
||||||
$status = $is_cancelled ? ('Cancelled') : ('Active');
|
$status = $is_cancelled ? pht('Cancelled') : pht('Active');
|
||||||
|
|
||||||
$invite_status = $event->getUserInviteStatus($viewer->getPHID());
|
$invite_status = $event->getUserInviteStatus($viewer->getPHID());
|
||||||
$status_invited = PhabricatorCalendarEventInvitee::STATUS_INVITED;
|
$status_invited = PhabricatorCalendarEventInvitee::STATUS_INVITED;
|
||||||
|
|
Loading…
Reference in a new issue