Currently if on a page with no workflow object attached the workflow macro / panel shows the option to start a new workflow. This always starts with the current page as a draft, which is then published to a selected (different) location. However often one has an already existing tree of pages, which should remain available at the same place. It is desirable to start the workflow from the original location of the page, and have these pages end up as the target page of the workflow. Implementation suggestion Add (yet another) checkbox in the publication workflow macro labeled "start with this page as target" (hopefully not too long). The setting of the checkbox should be:
- checked if any of the parent pages has a workflow object with a value of isTarget=1
- unchecked otherwise
(I think the "draft space" and "target space" of the workflow can be ignored for now, as they can change when selecting a different workflow.) When checking / unchecking the checkbox, the label "Publish Location" might need to be changed via JavaScript to "Draft Location", and also the corresponding description. (I am not sure if this can be done easier by show/hide two sections, or replace the text content with javascript.)
Implementation note There is already a startWorkflowAsTarget in the PublicationWorkflow as API, and the PublicationWorkflow.Script uses this if the action is startastarget. but the UI seems not to used it anywhere. Possible workarounds / alternatives The workaround is to move the existing pages to the draft space, start the workflow from there and publish the pages, placing them in the old location. However this approach has some drawbacks, especially the history of the original page gets lost (from a user point of view, who should not have to care about the move), and also it might be wanted that the pages are not published "with children", but each one separately ... which will create quite a lot of work to click through all the pages |