Skip to content

Commit

Permalink
In BasicTransitions add variation to transition and form to send scre…
Browse files Browse the repository at this point in the history
…en by email but restrict to the current user email address: emailScreenUserAsync transition and EmailScreenUserSection
  • Loading branch information
jonesde committed Sep 29, 2021
1 parent a78a79f commit 8b74c1d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions base-component/webroot/template/screen/BasicTransitions.xml
Expand Up @@ -26,6 +26,15 @@ along with this software (see the LICENSE.md file). If not, see
</actions>
<default-response url="." parameter-map="ec.web.requestParameters"/>
</transition>
<transition name="emailScreenUserAsync" read-only="true">
<service-call name="org.moqui.impl.EmailServices.send#ScreenRenderEmail" async="true"
in-map="context + [screenLocation:sri.getActiveScreenDef().location, bodyParameters:ec.web.requestParameters, toAddresses:ec.user.userAccount?.emailAddress]"/>
<actions>
<if condition="!ec.message.hasError()">
<message type="success">Your report is being generated and will be sent to ${ec.user.userAccount?.emailAddress} when ready.</message></if>
</actions>
<default-response url="." parameter-map="ec.web.requestParameters"/>
</transition>

<transition name="getEnumRelatedByTypeList" read-only="true">
<parameter name="enumId"/>
Expand Down Expand Up @@ -58,5 +67,18 @@ along with this software (see the LICENSE.md file). If not, see
</form-single>
</container-dialog>
</widgets></section>
<section name="EmailScreenUserSection"><widgets>
<container-dialog id="EmailScreenUserDialog" button-text="Email Export">
<form-single name="EmailScreenUserForm" transition="emailScreenUserAsync" pass-through-parameters="true">
<field name="screenRenderMode"><default-field title="Output"><radio no-current-selected-key="xlsx">
<option key="xlsx" text="XLS"/><option key="csv" text="CSV"/></radio></default-field></field>
<field name="title" from="'Report: ' + sri.getActiveScreenDef().getDefaultMenuName()">
<default-field><text-line size="60"/></default-field></field>
<field name="toAddresses" from="ec.user.userAccount?.emailAddress">
<default-field><display/></default-field></field>
<field name="submitButton"><default-field title="Send Email"><submit/></default-field></field>
</form-single>
</container-dialog>
</widgets></section>
</widgets>
</screen>

0 comments on commit 8b74c1d

Please sign in to comment.