diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ 'names' => array( 'conpherence.pkg.css' => '76ed87e3', 'conpherence.pkg.js' => '020aebcf', - 'core.pkg.css' => 'e51a98e2', + 'core.pkg.css' => '67a5ecf3', 'core.pkg.js' => '2eeda9e0', 'dark-console.pkg.js' => '187792c2', 'differential.pkg.css' => '525f9a1d', @@ -154,7 +154,7 @@ 'rsrc/css/phui/phui-document.css' => '52b748a5', 'rsrc/css/phui/phui-feed-story.css' => 'a0c05029', 'rsrc/css/phui/phui-fontkit.css' => '1ec937e5', - 'rsrc/css/phui/phui-form-view.css' => '7536aef9', + 'rsrc/css/phui/phui-form-view.css' => '57edecb7', 'rsrc/css/phui/phui-form.css' => 'd1adb52c', 'rsrc/css/phui/phui-formation-view.css' => 'd2dec8ed', 'rsrc/css/phui/phui-head-thing.css' => 'd7f293df', @@ -849,7 +849,7 @@ 'phui-font-icon-base-css' => '303c9b87', 'phui-fontkit-css' => '1ec937e5', 'phui-form-css' => 'd1adb52c', - 'phui-form-view-css' => '7536aef9', + 'phui-form-view-css' => '57edecb7', 'phui-formation-view-css' => 'd2dec8ed', 'phui-head-thing-view-css' => 'd7f293df', 'phui-header-view-css' => '36c86a58', diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php --- a/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php +++ b/src/applications/calendar/controller/PhabricatorCalendarEventViewController.php @@ -166,6 +166,7 @@ } $availability_select->setDropdownMenu($dropdown); + $availability_select->setDisabled($event->isImportedEvent()); $header->addActionLink($availability_select); } @@ -629,6 +630,7 @@ ->setIcon('fa-times grey') ->setHref($this->getApplicationURI("/event/decline/{$id}/")) ->setWorkflow(true) + ->setDisabled($event->isImportedEvent()) ->setText(pht('Decline')); $accept_button = id(new PHUIButtonView()) @@ -636,6 +638,7 @@ ->setIcon('fa-check green') ->setHref($this->getApplicationURI("/event/accept/{$id}/")) ->setWorkflow(true) + ->setDisabled($event->isImportedEvent()) ->setText(pht('Accept')); return array($decline_button, $accept_button); diff --git a/src/applications/calendar/import/PhabricatorCalendarImportEngine.php b/src/applications/calendar/import/PhabricatorCalendarImportEngine.php --- a/src/applications/calendar/import/PhabricatorCalendarImportEngine.php +++ b/src/applications/calendar/import/PhabricatorCalendarImportEngine.php @@ -207,10 +207,17 @@ $events = null; } + // Verified emails of the Calendar uploader. + $author_verified_emails = id(new PhabricatorUserEmail())->loadAllWhere( + 'userPHID = %s AND isVerified = 1', + $import->getAuthorPHID()); + $author_verified_emails = mpull($author_verified_emails, 'getAddress'); + $xactions = array(); $update_map = array(); $invitee_map = array(); - $attendee_map = array(); + $attendee_name_map = array(); // [eventUID][email from] = Attendee + $attendee_user_map = array(); // [eventUID][userPHID ] = Attendee foreach ($node_map as $full_uid => $node) { $event = idx($events, $full_uid); if (!$event) { @@ -227,7 +234,7 @@ $xactions[$full_uid] = $this->newUpdateTransactions($event, $node); $update_map[$full_uid] = $event; - $attendee_map[$full_uid] = array(); + $attendee_name_map[$full_uid] = array(); $attendees = $node->getAttendees(); $private_index = 1; foreach ($attendees as $attendee) { @@ -236,8 +243,19 @@ // of the product. $name = $attendee->getName(); if (preg_match('/@/', $name)) { - $name = new PhutilEmailAddress($name); - $name = $name->getDisplayName(); + $attendee_mail = new PhutilEmailAddress($name); + $name = $attendee_mail->getDisplayName(); + $address = $attendee_mail->getAddress(); + + // Skip creation of dummy "Private User" if this Attendee is just + // a verified email owned by the Calendar uploader. + if ($address) { + if (in_array($address, $author_verified_emails, true)) { + $attendee_user_map[$full_uid][$import->getAuthorPHID()] = + $attendee; + continue; + } + } } // If we don't have a name or the name still looks like it's an @@ -247,12 +265,12 @@ $private_index++; } - $attendee_map[$full_uid][$name] = $attendee; + $attendee_name_map[$full_uid][$name] = $attendee; } } $attendee_names = array(); - foreach ($attendee_map as $full_uid => $event_attendees) { + foreach ($attendee_name_map as $full_uid => $event_attendees) { foreach ($event_attendees as $name => $attendee) { $attendee_names[$name] = $attendee; } @@ -356,13 +374,22 @@ // We're just forcing attendees to the correct values here because // transactions intentionally don't let you RSVP for other users. This // might need to be turned into a special type of transaction eventually. - $attendees = $attendee_map[$full_uid]; + $attendees_name = $attendee_name_map[$full_uid]; + $attendees_user = idx($attendee_user_map, $full_uid, array()); $old_map = $event->getInvitees(); $old_map = mpull($old_map, null, 'getInviteePHID'); + $phid_invitees = array(); + foreach ($attendees_name as $name => $attendee) { + $attendee_phid = $external_invitees[$name]->getPHID(); + $phid_invitees[$attendee_phid] = $attendee; + } + foreach ($attendees_user as $attendee_user_phid => $attendee) { + $phid_invitees[$attendee_user_phid] = $attendee; + } + $new_map = array(); - foreach ($attendees as $name => $attendee) { - $phid = $external_invitees[$name]->getPHID(); + foreach ($phid_invitees as $phid => $attendee) { $invitee = idx($old_map, $phid); if (!$invitee) { @@ -381,7 +408,11 @@ break; case PhutilCalendarUserNode::STATUS_INVITED: default: - $status = PhabricatorCalendarEventInvitee::STATUS_INVITED; + if ($phid === $import->getAuthorPHID()) { + $status = PhabricatorCalendarEventInvitee::STATUS_ATTENDING; + } else { + $status = PhabricatorCalendarEventInvitee::STATUS_INVITED; + } break; } $invitee->setStatus($status); diff --git a/webroot/rsrc/css/phui/phui-form-view.css b/webroot/rsrc/css/phui/phui-form-view.css --- a/webroot/rsrc/css/phui/phui-form-view.css +++ b/webroot/rsrc/css/phui/phui-form-view.css @@ -63,6 +63,11 @@ color:{$greytext} !important; } +.aphront-form-input > input[type="file"] { + max-width: stretch; + max-width: -moz-available; + max-width: -webkit-fill-available; +} .aphront-form-error { width: 18%;