Nabil
Nabil

Reputation: 21

How to add a confirmation dialog before approving a review step of a workflow in alfresco share

I want to add a confirmation dialog before an approving review step in Alfresco's workflow, as shown in the picture for more precision

https://i.sstatic.net/nlskZ.png

I've try to do it in a custom activiti-transitions.ftl,

C:\Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\controls\workflow\custom-activiti-transitions.ftl

but it doesn't work correctly. I tried to do that with 2 javascript alert like here :

    <#if form.mode == "edit" 
    && ((form.data['prop_bpm_status']?? 
    && form.data['prop_bpm_status'] != 'Completed') 
    || form.data['prop_bpm_status']?? == false)>

    <script type="text/javascript">//<![CDATA[
    (function()
    {
       new Alfresco.ActivitiTransitions("${fieldHtmlId}").setOptions(
       {
          currentValue: "${field.control.params.options?js_string}",
          hiddenFieldName: "${field.name}"
       }).setMessages(
          ${messages}
       );
    })();
    alert("test !!!!!"); 
    //]]></script>

    <div class="form-field suggested-actions" id="${fieldHtmlId}">
       <div id="${fieldHtmlId}-buttons">
    <script type="text/javascript">//<![CDATA[
    alert("div button ?  !!!!!"); 
    //]]></script>
       </div>
    </div>
    </#if>

these 2 alerts appear before the buttons(look at the picture) "Approuver" and "Rejeter" are generated in the page .

You have the images of these two alerts in this link :

https://i.sstatic.net/oOX2X.png

Upvotes: 1

Views: 983

Answers (1)

sarika
sarika

Reputation: 1

Use confirm for ok and cancel prompt in your js -

   if (confirm('Approve?')) {
            //do something
        } else {
           //do something
        }

Upvotes: 0

Related Questions