diff --git a/bin/calendar b/bin/calendar new file mode 120000 index 0000000000..33929a5ba1 --- /dev/null +++ b/bin/calendar @@ -0,0 +1 @@ +../scripts/setup/manage_calendar.php \ No newline at end of file diff --git a/resources/builtin/merchant.png b/resources/builtin/merchant.png new file mode 100644 index 0000000000..c8381eb00f Binary files /dev/null and b/resources/builtin/merchant.png differ diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 8c4ba2ef05..b7f6c9042d 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -89,6 +89,7 @@ return array( 'rsrc/css/application/pholio/pholio-inline-comments.css' => '8e545e49', 'rsrc/css/application/pholio/pholio.css' => 'ca89d380', 'rsrc/css/application/phortune/phortune-credit-card-form.css' => '8391eb02', + 'rsrc/css/application/phortune/phortune-invoice.css' => '476055e2', 'rsrc/css/application/phortune/phortune.css' => '5b99dae0', 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', 'rsrc/css/application/phriction/phriction-document-css.css' => '4282e4ad', @@ -381,9 +382,8 @@ return array( 'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => 'edd1ba66', 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 'rsrc/js/application/calendar/behavior-day-view.js' => '4b3c4443', - 'rsrc/js/application/calendar/behavior-event-all-day.js' => '937bb700', + 'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9', 'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256', - 'rsrc/js/application/calendar/behavior-recurring-edit.js' => '5f1c4d5f', 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '358c717b', 'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762', @@ -650,7 +650,7 @@ return array( 'javelin-behavior-editengine-reorder-configs' => 'd7a74243', 'javelin-behavior-editengine-reorder-fields' => 'b59e1e96', 'javelin-behavior-error-log' => '6882e80a', - 'javelin-behavior-event-all-day' => '937bb700', + 'javelin-behavior-event-all-day' => 'b41537c9', 'javelin-behavior-fancy-datepicker' => '568931f3', 'javelin-behavior-global-drag-and-drop' => '960f6a39', 'javelin-behavior-herald-rule-editor' => '7ebaeed3', @@ -703,7 +703,6 @@ return array( 'javelin-behavior-project-create' => '065227cc', 'javelin-behavior-quicksand-blacklist' => '7927a7d3', 'javelin-behavior-read-only-warning' => 'ba158207', - 'javelin-behavior-recurring-edit' => '5f1c4d5f', 'javelin-behavior-refresh-csrf' => 'ab2f381b', 'javelin-behavior-releeph-preview-branch' => 'b2b4fbaf', 'javelin-behavior-releeph-request-state-change' => 'a0b57eb8', @@ -840,6 +839,7 @@ return array( 'phortune-credit-card-form' => '2290aeef', 'phortune-credit-card-form-css' => '8391eb02', 'phortune-css' => '5b99dae0', + 'phortune-invoice-css' => '476055e2', 'phrequent-css' => 'ffc185ad', 'phriction-document-css' => '4282e4ad', 'phui-action-panel-css' => '91c7b835', diff --git a/resources/sql/autopatches/20161025.phortune.merchant.image.1.sql b/resources/sql/autopatches/20161025.phortune.merchant.image.1.sql new file mode 100644 index 0000000000..995a4a8fd6 --- /dev/null +++ b/resources/sql/autopatches/20161025.phortune.merchant.image.1.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_phortune.phortune_merchant + ADD profileImagePHID VARBINARY(64); diff --git a/resources/sql/autopatches/20161029.phortune.invoice.1.sql b/resources/sql/autopatches/20161029.phortune.invoice.1.sql new file mode 100644 index 0000000000..7a4a8a8272 --- /dev/null +++ b/resources/sql/autopatches/20161029.phortune.invoice.1.sql @@ -0,0 +1,5 @@ +ALTER TABLE {$NAMESPACE}_phortune.phortune_merchant + ADD invoiceEmail VARCHAR(255) COLLATE {$COLLATE_TEXT} NOT NULL; + +ALTER TABLE {$NAMESPACE}_phortune.phortune_merchant + ADD invoiceFooter LONGTEXT COLLATE {$COLLATE_TEXT} NOT NULL; diff --git a/resources/sql/autopatches/20161031.calendar.01.seriesparent.sql b/resources/sql/autopatches/20161031.calendar.01.seriesparent.sql new file mode 100644 index 0000000000..7589a161bc --- /dev/null +++ b/resources/sql/autopatches/20161031.calendar.01.seriesparent.sql @@ -0,0 +1,5 @@ +ALTER TABLE {$NAMESPACE}_calendar.calendar_event + ADD seriesParentPHID VARBINARY(64); + +UPDATE {$NAMESPACE}_calendar.calendar_event + SET seriesParentPHID = instanceOfEventPHID; diff --git a/resources/sql/autopatches/20161031.calendar.02.notifylog.sql b/resources/sql/autopatches/20161031.calendar.02.notifylog.sql new file mode 100644 index 0000000000..0c6b1b6a80 --- /dev/null +++ b/resources/sql/autopatches/20161031.calendar.02.notifylog.sql @@ -0,0 +1,8 @@ +CREATE TABLE {$NAMESPACE}_calendar.calendar_notification ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + eventPHID VARBINARY(64) NOT NULL, + utcInitialEpoch INT UNSIGNED NOT NULL, + targetPHID VARBINARY(64) NOT NULL, + didNotifyEpoch INT UNSIGNED NOT NULL, + UNIQUE KEY `key_notify` (eventPHID, utcInitialEpoch, targetPHID) +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; diff --git a/resources/sql/autopatches/20161101.calendar.01.noholiday.sql b/resources/sql/autopatches/20161101.calendar.01.noholiday.sql new file mode 100644 index 0000000000..bfbabfd926 --- /dev/null +++ b/resources/sql/autopatches/20161101.calendar.01.noholiday.sql @@ -0,0 +1 @@ +DROP TABLE {$NAMESPACE}_calendar.calendar_holiday; diff --git a/resources/sql/autopatches/20161101.calendar.02.removecolumns.sql b/resources/sql/autopatches/20161101.calendar.02.removecolumns.sql new file mode 100644 index 0000000000..116f0f3972 --- /dev/null +++ b/resources/sql/autopatches/20161101.calendar.02.removecolumns.sql @@ -0,0 +1,17 @@ +ALTER TABLE {$NAMESPACE}_calendar.calendar_event + DROP allDayDateFrom; + +ALTER TABLE {$NAMESPACE}_calendar.calendar_event + DROP allDayDateTo; + +ALTER TABLE {$NAMESPACE}_calendar.calendar_event + DROP dateFrom; + +ALTER TABLE {$NAMESPACE}_calendar.calendar_event + DROP dateTo; + +ALTER TABLE {$NAMESPACE}_calendar.calendar_event + DROP recurrenceEndDate; + +ALTER TABLE {$NAMESPACE}_calendar.calendar_event + DROP recurrenceFrequency; diff --git a/resources/sql/autopatches/20161104.calendar.01.availability.sql b/resources/sql/autopatches/20161104.calendar.01.availability.sql new file mode 100644 index 0000000000..cb64339df2 --- /dev/null +++ b/resources/sql/autopatches/20161104.calendar.01.availability.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_calendar.calendar_eventinvitee + ADD availability VARCHAR(64) NOT NULL; diff --git a/resources/sql/autopatches/20161104.calendar.02.availdefault.sql b/resources/sql/autopatches/20161104.calendar.02.availdefault.sql new file mode 100644 index 0000000000..12a42f711a --- /dev/null +++ b/resources/sql/autopatches/20161104.calendar.02.availdefault.sql @@ -0,0 +1,3 @@ +UPDATE {$NAMESPACE}_calendar.calendar_eventinvitee + SET availability = 'default' + WHERE availability = ''; diff --git a/scripts/calendar/import_us_holidays.php b/scripts/calendar/import_us_holidays.php deleted file mode 100755 index 78d1d50c39..0000000000 --- a/scripts/calendar/import_us_holidays.php +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env php - "New Year's Day", - '2014-01-20' => 'Birthday of Martin Luther King, Jr.', - '2014-02-17' => "Washington's Birthday", - '2014-05-26' => 'Memorial Day', - '2014-07-04' => 'Independence Day', - '2014-09-01' => 'Labor Day', - '2014-10-13' => 'Columbus Day', - '2014-11-11' => 'Veterans Day', - '2014-11-27' => 'Thanksgiving Day', - '2014-12-25' => 'Christmas Day', - '2015-01-01' => "New Year's Day", - '2015-01-19' => 'Birthday of Martin Luther King, Jr.', - '2015-02-16' => "Washington's Birthday", - '2015-05-25' => 'Memorial Day', - '2015-07-03' => 'Independence Day', - '2015-09-07' => 'Labor Day', - '2015-10-12' => 'Columbus Day', - '2015-11-11' => 'Veterans Day', - '2015-11-26' => 'Thanksgiving Day', - '2015-12-25' => 'Christmas Day', - '2016-01-01' => "New Year's Day", - '2016-01-18' => 'Birthday of Martin Luther King, Jr.', - '2016-02-15' => "Washington's Birthday", - '2016-05-30' => 'Memorial Day', - '2016-07-04' => 'Independence Day', - '2016-09-05' => 'Labor Day', - '2016-10-10' => 'Columbus Day', - '2016-11-11' => 'Veterans Day', - '2016-11-24' => 'Thanksgiving Day', - '2016-12-26' => 'Christmas Day', - '2017-01-02' => "New Year's Day", - '2017-01-16' => 'Birthday of Martin Luther King, Jr.', - '2017-02-10' => "Washington's Birthday", - '2017-05-29' => 'Memorial Day', - '2017-07-04' => 'Independence Day', - '2017-09-04' => 'Labor Day', - '2017-10-09' => 'Columbus Day', - '2017-11-10' => 'Veterans Day', - '2017-11-23' => 'Thanksgiving Day', - '2017-12-25' => 'Christmas Day', -); - -$table = new PhabricatorCalendarHoliday(); -$conn_w = $table->establishConnection('w'); -$table_name = $table->getTableName(); - -foreach ($holidays as $day => $name) { - queryfx( - $conn_w, - 'INSERT IGNORE INTO %T (day, name) VALUES (%s, %s)', - $table_name, - $day, - $name); -} diff --git a/scripts/setup/manage_calendar.php b/scripts/setup/manage_calendar.php new file mode 100755 index 0000000000..135c42ded1 --- /dev/null +++ b/scripts/setup/manage_calendar.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +setTagline(pht('manage Calendar')); +$args->setSynopsis(<<parseStandardArguments(); + +$workflows = id(new PhutilClassMapQuery()) + ->setAncestorClass('PhabricatorCalendarManagementWorkflow') + ->execute(); +$workflows[] = new PhutilHelpArgumentWorkflow(); +$args->parseWorkflows($workflows); diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index cb4a6c15df..4c6fb41333 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1687,6 +1687,7 @@ phutil_register_library_map(array( 'PHUITimelineView' => 'view/phui/PHUITimelineView.php', 'PHUITwoColumnView' => 'view/phui/PHUITwoColumnView.php', 'PHUITypeaheadExample' => 'applications/uiexample/examples/PHUITypeaheadExample.php', + 'PHUIUserAvailabilityView' => 'applications/calendar/view/PHUIUserAvailabilityView.php', 'PHUIWorkboardView' => 'view/phui/PHUIWorkboardView.php', 'PHUIWorkpanelView' => 'view/phui/PHUIWorkpanelView.php', 'PassphraseAbstractKey' => 'applications/passphrase/keys/PassphraseAbstractKey.php', @@ -2034,6 +2035,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarEvent' => 'applications/calendar/storage/PhabricatorCalendarEvent.php', 'PhabricatorCalendarEventAcceptTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventAcceptTransaction.php', 'PhabricatorCalendarEventAllDayTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventAllDayTransaction.php', + 'PhabricatorCalendarEventAvailabilityController' => 'applications/calendar/controller/PhabricatorCalendarEventAvailabilityController.php', 'PhabricatorCalendarEventCancelController' => 'applications/calendar/controller/PhabricatorCalendarEventCancelController.php', 'PhabricatorCalendarEventCancelTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventCancelTransaction.php', 'PhabricatorCalendarEventDateTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventDateTransaction.php', @@ -2049,6 +2051,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarEventEmailCommand' => 'applications/calendar/command/PhabricatorCalendarEventEmailCommand.php', 'PhabricatorCalendarEventEndDateTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventEndDateTransaction.php', 'PhabricatorCalendarEventExportController' => 'applications/calendar/controller/PhabricatorCalendarEventExportController.php', + 'PhabricatorCalendarEventForkTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventForkTransaction.php', 'PhabricatorCalendarEventFrequencyTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventFrequencyTransaction.php', 'PhabricatorCalendarEventFulltextEngine' => 'applications/calendar/search/PhabricatorCalendarEventFulltextEngine.php', 'PhabricatorCalendarEventHeraldAdapter' => 'applications/calendar/herald/PhabricatorCalendarEventHeraldAdapter.php', @@ -2066,6 +2069,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarEventMailReceiver' => 'applications/calendar/mail/PhabricatorCalendarEventMailReceiver.php', 'PhabricatorCalendarEventNameHeraldField' => 'applications/calendar/herald/PhabricatorCalendarEventNameHeraldField.php', 'PhabricatorCalendarEventNameTransaction' => 'applications/calendar/xaction/PhabricatorCalendarEventNameTransaction.php', + 'PhabricatorCalendarEventNotificationView' => 'applications/calendar/notifications/PhabricatorCalendarEventNotificationView.php', 'PhabricatorCalendarEventPHIDType' => 'applications/calendar/phid/PhabricatorCalendarEventPHIDType.php', 'PhabricatorCalendarEventQuery' => 'applications/calendar/query/PhabricatorCalendarEventQuery.php', 'PhabricatorCalendarEventRSVPEmailCommand' => 'applications/calendar/command/PhabricatorCalendarEventRSVPEmailCommand.php', @@ -2101,8 +2105,6 @@ phutil_register_library_map(array( 'PhabricatorCalendarExternalInvitee' => 'applications/calendar/storage/PhabricatorCalendarExternalInvitee.php', 'PhabricatorCalendarExternalInviteePHIDType' => 'applications/calendar/phid/PhabricatorCalendarExternalInviteePHIDType.php', 'PhabricatorCalendarExternalInviteeQuery' => 'applications/calendar/query/PhabricatorCalendarExternalInviteeQuery.php', - 'PhabricatorCalendarHoliday' => 'applications/calendar/storage/PhabricatorCalendarHoliday.php', - 'PhabricatorCalendarHolidayTestCase' => 'applications/calendar/storage/__tests__/PhabricatorCalendarHolidayTestCase.php', 'PhabricatorCalendarICSFileImportEngine' => 'applications/calendar/import/PhabricatorCalendarICSFileImportEngine.php', 'PhabricatorCalendarICSImportEngine' => 'applications/calendar/import/PhabricatorCalendarICSImportEngine.php', 'PhabricatorCalendarICSURIImportEngine' => 'applications/calendar/import/PhabricatorCalendarICSURIImportEngine.php', @@ -2111,6 +2113,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarImport' => 'applications/calendar/storage/PhabricatorCalendarImport.php', 'PhabricatorCalendarImportDefaultLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportDefaultLogType.php', 'PhabricatorCalendarImportDeleteController' => 'applications/calendar/controller/PhabricatorCalendarImportDeleteController.php', + 'PhabricatorCalendarImportDeleteLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportDeleteLogType.php', 'PhabricatorCalendarImportDeleteTransaction' => 'applications/calendar/xaction/PhabricatorCalendarImportDeleteTransaction.php', 'PhabricatorCalendarImportDisableController' => 'applications/calendar/controller/PhabricatorCalendarImportDisableController.php', 'PhabricatorCalendarImportDisableTransaction' => 'applications/calendar/xaction/PhabricatorCalendarImportDisableTransaction.php', @@ -2128,6 +2131,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarImportICSFileTransaction' => 'applications/calendar/xaction/PhabricatorCalendarImportICSFileTransaction.php', 'PhabricatorCalendarImportICSLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportICSLogType.php', 'PhabricatorCalendarImportICSURITransaction' => 'applications/calendar/xaction/PhabricatorCalendarImportICSURITransaction.php', + 'PhabricatorCalendarImportICSWarningLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportICSWarningLogType.php', 'PhabricatorCalendarImportIgnoredNodeLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportIgnoredNodeLogType.php', 'PhabricatorCalendarImportListController' => 'applications/calendar/controller/PhabricatorCalendarImportListController.php', 'PhabricatorCalendarImportLog' => 'applications/calendar/storage/PhabricatorCalendarImportLog.php', @@ -2151,6 +2155,10 @@ phutil_register_library_map(array( 'PhabricatorCalendarImportTriggerLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportTriggerLogType.php', 'PhabricatorCalendarImportUpdateLogType' => 'applications/calendar/importlog/PhabricatorCalendarImportUpdateLogType.php', 'PhabricatorCalendarImportViewController' => 'applications/calendar/controller/PhabricatorCalendarImportViewController.php', + 'PhabricatorCalendarManagementNotifyWorkflow' => 'applications/calendar/management/PhabricatorCalendarManagementNotifyWorkflow.php', + 'PhabricatorCalendarManagementWorkflow' => 'applications/calendar/management/PhabricatorCalendarManagementWorkflow.php', + 'PhabricatorCalendarNotification' => 'applications/calendar/storage/PhabricatorCalendarNotification.php', + 'PhabricatorCalendarNotificationEngine' => 'applications/calendar/notifications/PhabricatorCalendarNotificationEngine.php', 'PhabricatorCalendarRemarkupRule' => 'applications/calendar/remarkup/PhabricatorCalendarRemarkupRule.php', 'PhabricatorCalendarReplyHandler' => 'applications/calendar/mail/PhabricatorCalendarReplyHandler.php', 'PhabricatorCalendarSchemaSpec' => 'applications/calendar/storage/PhabricatorCalendarSchemaSpec.php', @@ -4173,6 +4181,7 @@ phutil_register_library_map(array( 'PhortuneCurrencyTestCase' => 'applications/phortune/currency/__tests__/PhortuneCurrencyTestCase.php', 'PhortuneDAO' => 'applications/phortune/storage/PhortuneDAO.php', 'PhortuneErrCode' => 'applications/phortune/constants/PhortuneErrCode.php', + 'PhortuneInvoiceView' => 'applications/phortune/view/PhortuneInvoiceView.php', 'PhortuneLandingController' => 'applications/phortune/controller/PhortuneLandingController.php', 'PhortuneMemberHasAccountEdgeType' => 'applications/phortune/edge/PhortuneMemberHasAccountEdgeType.php', 'PhortuneMemberHasMerchantEdgeType' => 'applications/phortune/edge/PhortuneMemberHasMerchantEdgeType.php', @@ -4180,11 +4189,13 @@ phutil_register_library_map(array( 'PhortuneMerchantCapability' => 'applications/phortune/capability/PhortuneMerchantCapability.php', 'PhortuneMerchantController' => 'applications/phortune/controller/PhortuneMerchantController.php', 'PhortuneMerchantEditController' => 'applications/phortune/controller/PhortuneMerchantEditController.php', + 'PhortuneMerchantEditEngine' => 'applications/phortune/editor/PhortuneMerchantEditEngine.php', 'PhortuneMerchantEditor' => 'applications/phortune/editor/PhortuneMerchantEditor.php', 'PhortuneMerchantHasMemberEdgeType' => 'applications/phortune/edge/PhortuneMerchantHasMemberEdgeType.php', 'PhortuneMerchantInvoiceCreateController' => 'applications/phortune/controller/PhortuneMerchantInvoiceCreateController.php', 'PhortuneMerchantListController' => 'applications/phortune/controller/PhortuneMerchantListController.php', 'PhortuneMerchantPHIDType' => 'applications/phortune/phid/PhortuneMerchantPHIDType.php', + 'PhortuneMerchantPictureController' => 'applications/phortune/controller/PhortuneMerchantPictureController.php', 'PhortuneMerchantQuery' => 'applications/phortune/query/PhortuneMerchantQuery.php', 'PhortuneMerchantSearchEngine' => 'applications/phortune/query/PhortuneMerchantSearchEngine.php', 'PhortuneMerchantTransaction' => 'applications/phortune/storage/PhortuneMerchantTransaction.php', @@ -6453,6 +6464,7 @@ phutil_register_library_map(array( 'PHUITimelineView' => 'AphrontView', 'PHUITwoColumnView' => 'AphrontTagView', 'PHUITypeaheadExample' => 'PhabricatorUIExample', + 'PHUIUserAvailabilityView' => 'AphrontTagView', 'PHUIWorkboardView' => 'AphrontTagView', 'PHUIWorkpanelView' => 'AphrontTagView', 'PassphraseAbstractKey' => 'Phobject', @@ -6870,6 +6882,7 @@ phutil_register_library_map(array( ), 'PhabricatorCalendarEventAcceptTransaction' => 'PhabricatorCalendarEventReplyTransaction', 'PhabricatorCalendarEventAllDayTransaction' => 'PhabricatorCalendarEventTransactionType', + 'PhabricatorCalendarEventAvailabilityController' => 'PhabricatorCalendarController', 'PhabricatorCalendarEventCancelController' => 'PhabricatorCalendarController', 'PhabricatorCalendarEventCancelTransaction' => 'PhabricatorCalendarEventTransactionType', 'PhabricatorCalendarEventDateTransaction' => 'PhabricatorCalendarEventTransactionType', @@ -6885,6 +6898,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarEventEmailCommand' => 'MetaMTAEmailTransactionCommand', 'PhabricatorCalendarEventEndDateTransaction' => 'PhabricatorCalendarEventDateTransaction', 'PhabricatorCalendarEventExportController' => 'PhabricatorCalendarController', + 'PhabricatorCalendarEventForkTransaction' => 'PhabricatorCalendarEventTransactionType', 'PhabricatorCalendarEventFrequencyTransaction' => 'PhabricatorCalendarEventTransactionType', 'PhabricatorCalendarEventFulltextEngine' => 'PhabricatorFulltextEngine', 'PhabricatorCalendarEventHeraldAdapter' => 'HeraldAdapter', @@ -6905,6 +6919,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarEventMailReceiver' => 'PhabricatorObjectMailReceiver', 'PhabricatorCalendarEventNameHeraldField' => 'PhabricatorCalendarEventHeraldField', 'PhabricatorCalendarEventNameTransaction' => 'PhabricatorCalendarEventTransactionType', + 'PhabricatorCalendarEventNotificationView' => 'Phobject', 'PhabricatorCalendarEventPHIDType' => 'PhabricatorPHIDType', 'PhabricatorCalendarEventQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorCalendarEventRSVPEmailCommand' => 'PhabricatorCalendarEventEmailCommand', @@ -6948,8 +6963,6 @@ phutil_register_library_map(array( ), 'PhabricatorCalendarExternalInviteePHIDType' => 'PhabricatorPHIDType', 'PhabricatorCalendarExternalInviteeQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', - 'PhabricatorCalendarHoliday' => 'PhabricatorCalendarDAO', - 'PhabricatorCalendarHolidayTestCase' => 'PhabricatorTestCase', 'PhabricatorCalendarICSFileImportEngine' => 'PhabricatorCalendarICSImportEngine', 'PhabricatorCalendarICSImportEngine' => 'PhabricatorCalendarImportEngine', 'PhabricatorCalendarICSURIImportEngine' => 'PhabricatorCalendarICSImportEngine', @@ -6963,6 +6976,7 @@ phutil_register_library_map(array( ), 'PhabricatorCalendarImportDefaultLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportDeleteController' => 'PhabricatorCalendarController', + 'PhabricatorCalendarImportDeleteLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportDeleteTransaction' => 'PhabricatorCalendarImportTransactionType', 'PhabricatorCalendarImportDisableController' => 'PhabricatorCalendarController', 'PhabricatorCalendarImportDisableTransaction' => 'PhabricatorCalendarImportTransactionType', @@ -6980,6 +6994,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarImportICSFileTransaction' => 'PhabricatorCalendarImportTransactionType', 'PhabricatorCalendarImportICSLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportICSURITransaction' => 'PhabricatorCalendarImportTransactionType', + 'PhabricatorCalendarImportICSWarningLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportIgnoredNodeLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportListController' => 'PhabricatorCalendarController', 'PhabricatorCalendarImportLog' => array( @@ -7007,6 +7022,10 @@ phutil_register_library_map(array( 'PhabricatorCalendarImportTriggerLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportUpdateLogType' => 'PhabricatorCalendarImportLogType', 'PhabricatorCalendarImportViewController' => 'PhabricatorCalendarController', + 'PhabricatorCalendarManagementNotifyWorkflow' => 'PhabricatorCalendarManagementWorkflow', + 'PhabricatorCalendarManagementWorkflow' => 'PhabricatorManagementWorkflow', + 'PhabricatorCalendarNotification' => 'PhabricatorCalendarDAO', + 'PhabricatorCalendarNotificationEngine' => 'Phobject', 'PhabricatorCalendarRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PhabricatorCalendarReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', 'PhabricatorCalendarSchemaSpec' => 'PhabricatorConfigSchemaSpec', @@ -9418,6 +9437,7 @@ phutil_register_library_map(array( 'PhortuneCurrencyTestCase' => 'PhabricatorTestCase', 'PhortuneDAO' => 'PhabricatorLiskDAO', 'PhortuneErrCode' => 'PhortuneConstants', + 'PhortuneInvoiceView' => 'AphrontTagView', 'PhortuneLandingController' => 'PhortuneController', 'PhortuneMemberHasAccountEdgeType' => 'PhabricatorEdgeType', 'PhortuneMemberHasMerchantEdgeType' => 'PhabricatorEdgeType', @@ -9429,11 +9449,13 @@ phutil_register_library_map(array( 'PhortuneMerchantCapability' => 'PhabricatorPolicyCapability', 'PhortuneMerchantController' => 'PhortuneController', 'PhortuneMerchantEditController' => 'PhortuneMerchantController', + 'PhortuneMerchantEditEngine' => 'PhabricatorEditEngine', 'PhortuneMerchantEditor' => 'PhabricatorApplicationTransactionEditor', 'PhortuneMerchantHasMemberEdgeType' => 'PhabricatorEdgeType', 'PhortuneMerchantInvoiceCreateController' => 'PhortuneMerchantController', 'PhortuneMerchantListController' => 'PhortuneMerchantController', 'PhortuneMerchantPHIDType' => 'PhabricatorPHIDType', + 'PhortuneMerchantPictureController' => 'PhortuneMerchantController', 'PhortuneMerchantQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhortuneMerchantSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhortuneMerchantTransaction' => 'PhabricatorApplicationTransaction', diff --git a/src/aphront/httpparametertype/AphrontBoolHTTPParameterType.php b/src/aphront/httpparametertype/AphrontBoolHTTPParameterType.php index 4fc758ddda..43aec72a56 100644 --- a/src/aphront/httpparametertype/AphrontBoolHTTPParameterType.php +++ b/src/aphront/httpparametertype/AphrontBoolHTTPParameterType.php @@ -3,8 +3,21 @@ final class AphrontBoolHTTPParameterType extends AphrontHTTPParameterType { + protected function getParameterExists(AphrontRequest $request, $key) { + if ($request->getExists($key)) { + return true; + } + + $checkbox_key = $this->getCheckboxKey($key); + if ($request->getExists($checkbox_key)) { + return true; + } + + return false; + } + protected function getParameterValue(AphrontRequest $request, $key) { - return $request->getBool($key); + return (bool)$request->getBool($key); } protected function getParameterTypeName() { @@ -26,4 +39,8 @@ final class AphrontBoolHTTPParameterType ); } + public function getCheckboxKey($key) { + return "{$key}.exists"; + } + } diff --git a/src/applications/calendar/application/PhabricatorCalendarApplication.php b/src/applications/calendar/application/PhabricatorCalendarApplication.php index 1e1a125cde..fa534280a0 100644 --- a/src/applications/calendar/application/PhabricatorCalendarApplication.php +++ b/src/applications/calendar/application/PhabricatorCalendarApplication.php @@ -61,6 +61,8 @@ final class PhabricatorCalendarApplication extends PhabricatorApplication { => 'PhabricatorCalendarEventJoinController', 'export/(?P[1-9]\d*)/(?P[^/]*)' => 'PhabricatorCalendarEventExportController', + 'availability/(?P[1-9]\d*)/(?P[^/]+)/' + => 'PhabricatorCalendarEventAvailabilityController', ), 'export/' => array( $this->getQueryRoutePattern() @@ -104,6 +106,16 @@ final class PhabricatorCalendarApplication extends PhabricatorApplication { 'name' => pht('Calendar User Guide'), 'href' => PhabricatorEnv::getDoclink('Calendar User Guide'), ), + array( + 'name' => pht('Importing Events'), + 'href' => PhabricatorEnv::getDoclink( + 'Calendar User Guide: Importing Events'), + ), + array( + 'name' => pht('Exporting Events'), + 'href' => PhabricatorEnv::getDoclink( + 'Calendar User Guide: Exporting Events'), + ), ); } diff --git a/src/applications/calendar/controller/PhabricatorCalendarEventAvailabilityController.php b/src/applications/calendar/controller/PhabricatorCalendarEventAvailabilityController.php new file mode 100644 index 0000000000..04a2454a0f --- /dev/null +++ b/src/applications/calendar/controller/PhabricatorCalendarEventAvailabilityController.php @@ -0,0 +1,56 @@ +getViewer(); + $id = $request->getURIData('id'); + + $event = id(new PhabricatorCalendarEventQuery()) + ->setViewer($viewer) + ->withIDs(array($id)) + ->executeOne(); + if (!$event) { + return new Aphront404Response(); + } + + $response = $this->newImportedEventResponse($event); + if ($response) { + return $response; + } + + $cancel_uri = $event->getURI(); + + if (!$event->getIsUserAttending($viewer->getPHID())) { + return $this->newDialog() + ->setTitle(pht('Not Attending Event')) + ->appendParagraph( + pht( + 'You can not change your display availability for events you '. + 'are not attending.')) + ->addCancelButton($cancel_uri); + } + + // TODO: This endpoint currently only works via AJAX. It would be vaguely + // nice to provide a plain HTML version of the workflow where we return + // a dialog with a vanilla