From 638bb7ae3f02faed0f120bd9b7ae011c6ad0163a Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Fri, 19 Aug 2011 12:36:41 -0400 Subject: [PATCH] Allow files to be attached to Maniphest tasks while the task is being created. Summary: This commit lets users who are filing Maniphest tasks to attache files to them right off the bat. Test Plan: {F3545} and {F3546} Reviewers: epriestley, fmoo, aran CC: Differential Revision: 837 --- .../controller/taskedit/ManiphestTaskEditController.php | 9 +++++++++ .../maniphest/controller/taskedit/__init__.php | 1 + 2 files changed, 10 insertions(+) diff --git a/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php b/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php index c33c4a3a3e..c181e71998 100644 --- a/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/taskedit/ManiphestTaskEditController.php @@ -445,6 +445,8 @@ class ManiphestTaskEditController extends ManiphestController { ''.phutil_escape_html($email_create).''; } + $panel_id = celerity_generate_unique_node_id(); + $form ->appendChild( id(new AphrontFormTextAreaControl()) @@ -452,6 +454,12 @@ class ManiphestTaskEditController extends ManiphestController { ->setName('description') ->setCaption($email_hint) ->setValue($task->getDescription())) + ->appendChild( + id(new AphrontFormDragAndDropUploadControl()) + ->setLabel('Attached Files') + ->setName('files') + ->setDragAndDropTarget($panel_id) + ->setActivatedClass('aphront-panel-view-drag-and-drop')) ->appendChild( id(new AphrontFormSubmitControl()) ->addCancelButton($cancel_uri) @@ -460,6 +468,7 @@ class ManiphestTaskEditController extends ManiphestController { $panel = new AphrontPanelView(); $panel->setWidth(AphrontPanelView::WIDTH_FULL); $panel->setHeader($header_name); + $panel->setID($panel_id); $panel->appendChild($form); return $this->buildStandardPageResponse( diff --git a/src/applications/maniphest/controller/taskedit/__init__.php b/src/applications/maniphest/controller/taskedit/__init__.php index 86b9ff37dc..83478c7560 100644 --- a/src/applications/maniphest/controller/taskedit/__init__.php +++ b/src/applications/maniphest/controller/taskedit/__init__.php @@ -24,6 +24,7 @@ phutil_require_module('phabricator', 'infrastructure/env'); phutil_require_module('phabricator', 'infrastructure/javelin/api'); phutil_require_module('phabricator', 'infrastructure/javelin/markup'); phutil_require_module('phabricator', 'view/form/base'); +phutil_require_module('phabricator', 'view/form/control/draganddropupload'); phutil_require_module('phabricator', 'view/form/control/markup'); phutil_require_module('phabricator', 'view/form/control/select'); phutil_require_module('phabricator', 'view/form/control/static');