@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Both ghost instances and exceptions to generated ghosts should be editable

Summary: Fixes T8369, Both ghost instances and exceptions to generated ghosts should be editable

Test Plan: Create recurring event, open /E{id}/1, edit, save. New exception should not be "recurring", and should be editable, as the regular ghost events.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8369

Differential Revision: https://secure.phabricator.com/D13089

+53 -36
+48 -34
src/applications/calendar/controller/PhabricatorCalendarEventEditController.php
··· 203 203 PhabricatorCalendarEventTransaction::TYPE_NAME) 204 204 ->setNewValue($name); 205 205 206 - $xactions[] = id(new PhabricatorCalendarEventTransaction()) 207 - ->setTransactionType( 208 - PhabricatorCalendarEventTransaction::TYPE_RECURRING) 209 - ->setNewValue($is_recurring); 206 + if ($this->isCreate()) { 207 + $xactions[] = id(new PhabricatorCalendarEventTransaction()) 208 + ->setTransactionType( 209 + PhabricatorCalendarEventTransaction::TYPE_RECURRING) 210 + ->setNewValue($is_recurring); 210 211 211 - $xactions[] = id(new PhabricatorCalendarEventTransaction()) 212 - ->setTransactionType( 213 - PhabricatorCalendarEventTransaction::TYPE_FREQUENCY) 214 - ->setNewValue(array('rule' => $frequency)); 212 + $xactions[] = id(new PhabricatorCalendarEventTransaction()) 213 + ->setTransactionType( 214 + PhabricatorCalendarEventTransaction::TYPE_FREQUENCY) 215 + ->setNewValue(array('rule' => $frequency)); 216 + } 215 217 216 218 $xactions[] = id(new PhabricatorCalendarEventTransaction()) 217 219 ->setTransactionType( ··· 294 296 } 295 297 } 296 298 299 + $is_recurring_checkbox = null; 300 + $recurrence_frequency_select = null; 301 + 297 302 $name = id(new AphrontFormTextControl()) 298 303 ->setLabel(pht('Name')) 299 304 ->setName('name') 300 305 ->setValue($name) 301 306 ->setError($error_name); 302 307 303 - Javelin::initBehavior('recurring-edit', array( 304 - 'isRecurring' => $is_recurring_id, 305 - 'frequency' => $frequency_id, 306 - )); 308 + if ($this->isCreate()) { 309 + Javelin::initBehavior('recurring-edit', array( 310 + 'isRecurring' => $is_recurring_id, 311 + 'frequency' => $frequency_id, 312 + )); 307 313 308 - $is_recurring_checkbox = id(new AphrontFormCheckboxControl()) 309 - ->addCheckbox( 310 - 'isRecurring', 311 - 1, 312 - pht('Recurring Event'), 313 - $is_recurring, 314 - $is_recurring_id); 314 + $is_recurring_checkbox = id(new AphrontFormCheckboxControl()) 315 + ->addCheckbox( 316 + 'isRecurring', 317 + 1, 318 + pht('Recurring Event'), 319 + $is_recurring, 320 + $is_recurring_id); 315 321 316 - $recurrence_frequency_select = id(new AphrontFormSelectControl()) 317 - ->setName('frequency') 318 - ->setOptions(array( 319 - 'daily' => pht('Daily'), 320 - 'weekly' => pht('Weekly'), 321 - 'monthly' => pht('Monthly'), 322 - 'yearly' => pht('Yearly'), 323 - )) 324 - ->setValue($frequency) 325 - ->setLabel(pht('Recurring Event Frequency')) 326 - ->setID($frequency_id) 327 - ->setDisabled(!$is_recurring); 322 + $recurrence_frequency_select = id(new AphrontFormSelectControl()) 323 + ->setName('frequency') 324 + ->setOptions(array( 325 + 'daily' => pht('Daily'), 326 + 'weekly' => pht('Weekly'), 327 + 'monthly' => pht('Monthly'), 328 + 'yearly' => pht('Yearly'), 329 + )) 330 + ->setValue($frequency) 331 + ->setLabel(pht('Recurring Event Frequency')) 332 + ->setID($frequency_id) 333 + ->setDisabled(!$is_recurring); 334 + } 328 335 329 336 Javelin::initBehavior('event-all-day', array( 330 337 'allDayID' => $all_day_id, ··· 409 416 ->addHiddenInput('next', $next_workflow) 410 417 ->addHiddenInput('query', $uri_query) 411 418 ->setUser($viewer) 412 - ->appendChild($name) 413 - ->appendChild($is_recurring_checkbox) 414 - ->appendChild($recurrence_frequency_select) 419 + ->appendChild($name); 420 + 421 + if ($is_recurring_checkbox) { 422 + $form->appendChild($is_recurring_checkbox); 423 + } 424 + if ($recurrence_frequency_select) { 425 + $form->appendControl($recurrence_frequency_select); 426 + } 427 + 428 + $form 415 429 ->appendChild($all_day_checkbox) 416 430 ->appendChild($start_control) 417 431 ->appendChild($end_control)
+1 -1
src/applications/calendar/controller/PhabricatorCalendarEventViewController.php
··· 135 135 $event, 136 136 PhabricatorPolicyCapability::CAN_EDIT); 137 137 138 - if (($event->getIsRecurring() && $event->getIsGhostEvent())) { 138 + if ($event->getIsRecurring() && $event->getIsGhostEvent()) { 139 139 $index = $event->getSequenceIndex(); 140 140 141 141 $actions->addAction(
+4 -1
src/applications/calendar/storage/PhabricatorCalendarEvent.php
··· 279 279 $frequency = $this->getFrequencyUnit(); 280 280 $modify_key = '+'.$sequence_index.' '.$frequency; 281 281 282 + $instance_of = ($this->getPHID()) ? 283 + $this->getPHID() : $this->instanceOfEventPHID; 284 + 282 285 $date = $this->dateFrom; 283 286 $date_time = PhabricatorTime::getDateTimeFromEpoch($date, $actor); 284 287 $date_time->modify($modify_key); ··· 294 297 ->setDateTo($date + $duration) 295 298 ->setIsRecurring(true) 296 299 ->setRecurrenceFrequency($this->recurrenceFrequency) 297 - ->setInstanceOfEventPHID($this->getPHID()) 300 + ->setInstanceOfEventPHID($instance_of) 298 301 ->setSequenceIndex($sequence_index) 299 302 ->setEditPolicy($edit_policy); 300 303