<?xml version="1.0" encoding="utf-8" ?>

<dictionary>
  <item key="activities" type="list">
    <list>
      <item>AC_CHANGED</item>
      <item type="dictionary">
        <dictionary>
          <item key="icon"></item>
          <item key="icon_clazz"><![CDATA[fas fa-pencil-alt text-primary wf-icon]]></item>
          <item key="id">AC_CHANGED</item>
          <item key="name">Bearbeitet</item>
        </dictionary>
      </item>
      <item>AC_REQUESTED</item>
      <item type="dictionary">
        <dictionary>
          <item key="icon"></item>
          <item key="icon_clazz"><![CDATA[far fa-bell text-primary wf-icon]]></item>
          <item key="id">AC_REQUESTED</item>
          <item key="name">Eingereicht</item>
        </dictionary>
      </item>
      <item>AC_REJECTED</item>
      <item type="dictionary">
        <dictionary>
          <item key="icon"></item>
          <item key="icon_clazz"><![CDATA[far fa-thumbs-down text-danger wf-icon]]></item>
          <item key="id">AC_REJECTED</item>
          <item key="name">Abgelehnt</item>
        </dictionary>
      </item>
      <item>AC_COMMITTED</item>
      <item type="dictionary">
        <dictionary>
          <item key="icon"></item>
          <item key="icon_clazz"><![CDATA[far fa-thumbs-up text-success wf-icon]]></item>
          <item key="id">AC_COMMITTED</item>
          <item key="name">Publiziert</item>
        </dictionary>
      </item>
      <item>AC_ROLLEDBACK</item>
      <item type="dictionary">
        <dictionary>
          <item key="icon"></item>
          <item key="icon_clazz"><![CDATA[fas fa-reply text-danger wf-icon]]></item>
          <item key="id">AC_ROLLEDBACK</item>
          <item key="name"><![CDATA[Frühere Version]]></item>
        </dictionary>
      </item>
    </list>
  </item>
  <item key="transitions" type="list">
    <list>
      <item>TR_ENTER</item>
      <item type="dictionary">
        <dictionary>
          <item key="from" type="list">
            <list>
            </list>
          </item>
          <item key="icon_clazz"></item>
          <item key="id">TR_ENTER</item>
          <item key="name"><![CDATA[Enter Workflow]]></item>
          <item key="performer" type="list">
            <list>
            </list>
          </item>
          <item key="to" type="list">
            <list>
              <item>AC_CHANGED</item>
            </list>
          </item>
        </dictionary>
      </item>
      <item>TR_EXPRESSCOMMIT</item>
      <item type="dictionary">
        <dictionary>
          <item key="from" type="list">
            <list>
            </list>
          </item>
          <item key="icon_clazz"><![CDATA[fas fa-external-link-alt]]></item>
          <item key="id">TR_EXPRESSCOMMIT</item>
          <item key="name"><![CDATA[Sofort publizieren]]></item>
          <item key="ob"><![CDATA[<!DOCTYPE html>
<html lang="en">
<tal:block tal:define="global zmscontext options/zmscontext" tal:content="structure python:zmscontext.zmi_html_head(zmscontext,request)">zmi_html_head</tal:block>
<body tal:attributes="class python:' '.join(['zms',request['lang'],'transition',zmscontext.meta_id])">
<tal:block tal:content="structure python:zmscontext.zmi_body_header(zmscontext,request)">zmi_body_header</tal:block>
<div id="zmi-tab">
<tal:block tal:content="structure python:zmscontext.zmi_breadcrumbs(zmscontext,request)">zmi_breadcrumbs</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  F o r m
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')==''">
<form class="form-horizontal" name="form0" method="post">
	<input type="hidden" name="preview" value="preview"/>
	<input type="hidden" name="lang" tal:attributes="value request/lang"/>
	<input type="hidden" name="custom" tal:attributes="value request/custom"/>
	<legend tal:content="request/custom">the headline</legend>
	<div class="control-group">

	<div class="form-group row"
		tal:define="
			myusers python:[[context.content.getUserAttr(u, 'email', ''),u] for u in context.content.getUsers(request)];
			myeditors python:[u for u in myusers if 'ZMSEditor' in context.content.getUserRoles(u[1]))">
		<label style="text-align:left !important" for="recipients" class="col-sm-12 control-label"><span tal:content="python:here.getZMILangStr('ROLE_ZMSEDITOR')">ROLE_ZMSEDITOR</span></label>
		<div class="col-sm-12" tal:content="structure python:here.zmi_input_multiselect(here,name='recipients',value=[],lang_str='ROLE_ZMSEDITOR',options=myeditors)">the control</div>
	</div><!-- .form-group -->

	<label class="control-label mandatory" for="comment"><span>Comment</span></label>
		<div class="controls"><input type="text" name="comment" class="form-control form-control-sm" /><br /></div><!-- .controls -->
	</div><!-- .control-group -->
	<div class="control-group">
		<div class="controls">
			<button name="btn" class="btn btn-primary" value="BTN_SEND" tal:content="python:here.getZMILangStr('BTN_SEND')">Send</button>
			<button name="btn" class="btn" value="BTN_CANCEL" tal:content="python:here.getZMILangStr('BTN_CANCEL')">Cancel</button>
		</div><!-- .controls -->
	</div><!-- .control-group -->
</form>
</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  E x e c u t e
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')=='BTN_SEND'">
	<tal:block tal:define="mto python:','.join(request.get('recipients',[]));
			msubject python:'[ZMS::%s - %s]: Sofort Publiziert'%(zmscontext.getDocumentElement().getTitlealt(request),zmscontext.getTitlealt(request));
			mbody python:[];
			dummy0 python:mbody.append(''
				+ 'INFO: Folgendes Objekt wude publiziert:\n'
				+ '%s: \t'%zmscontext.display_type(request)
				+ '>> '.join([x.getTitlealt(request) for x in zmscontext.breadcrumbs_obj_path()]) + '\n'
				+ 'MANAGE: \t%s/manage\n'%zmscontext.absolute_url()
				+ 'PREVIEW: \t%s/preview_html\n\n'%zmscontext.absolute_url()
				+ '\n\n'
				+ 'Meldung von %s:\n'%(str(request['AUTHENTICATED_USER']))
				+ '================================================\n'
				+ '%s\r\n'%request.get('comment','k.A.')
				+ '================================================\n\n\n'
				+ '------------------------------------------------\n'
				+ 'Diese Nachricht wurde automatisch generiert.\n');
			dummy0 python:['No Recipients',zmscontext.sendMail(mto, msubject, ''.join(mbody), request)][len(mto)>0];
			newcontext python:zmscontext.commitObj(request);
			message python:'Aktuelle Ãnderungen wurden sofort publiziert%s'%([', ohne dass eine Nachricht versendet wurde.','.'][len(mto)>0]);
			dummy0 python:request.RESPONSE.redirect(here.url_append_params('%s/manage_main'%newcontext.absolute_url(),{'lang':request['lang'],'custom':request['custom'],'manage_tabs_message':message}))">
	</tal:block>
</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  C a n c e l
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')=='BTN_CANCEL'">
	<tal:block tal:define="global
			message python:'Vorgang abgebrochen.';
			dummy0 python:request.RESPONSE.redirect(here.url_append_params('manage_main',{'lang':request['lang'],'custom':request['custom'],'manage_tabs_message':message}))">
	</tal:block>
</tal:block>

</div><!-- #zmi-tab -->
<tal:block tal:content="structure python:zmscontext.zmi_body_footer(zmscontext,request)">zmi_body_footer</tal:block>
</body>
</html>]]>
          </item>
          <item key="performer" type="list">
            <list>
            </list>
          </item>
          <item key="to" type="list">
            <list>
              <item>AC_COMMITTED</item>
            </list>
          </item>
          <item key="type"><![CDATA[Page Template]]></item>
        </dictionary>
      </item>
      <item>TR_REQUEST</item>
      <item type="dictionary">
        <dictionary>
          <item key="from" type="list">
            <list>
              <item>AC_CHANGED</item>
              <item>AC_REJECTED</item>
            </list>
          </item>
          <item key="icon_clazz"><![CDATA[far fa-bell wf-icon]]></item>
          <item key="id">TR_REQUEST</item>
          <item key="name">Einreichen</item>
          <item key="ob"><![CDATA[<!DOCTYPE html>
<html lang="en">
<tal:block tal:define="global zmscontext options/zmscontext" tal:content="structure python:zmscontext.zmi_html_head(zmscontext,request)">zmi_html_head</tal:block>
<body tal:attributes="class python:' '.join(['zms',request['lang'],'transition',zmscontext.meta_id])">
<tal:block tal:content="structure python:zmscontext.zmi_body_header(zmscontext,request)">zmi_body_header</tal:block>
<div id="zmi-tab">
<tal:block tal:content="structure python:zmscontext.zmi_breadcrumbs(zmscontext,request)">zmi_breadcrumbs</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  F o r m
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')==''">
<form class="form-horizontal" name="form0" method="post">
	<input type="hidden" name="preview" value="preview"/>
	<input type="hidden" name="lang" tal:attributes="value request/lang"/>
	<input type="hidden" name="custom" tal:attributes="value request/custom"/>
	<legend tal:content="request/custom">the headline</legend>
	<div class="control-group">

	<div class="form-group row" tal:define="myeditors python:[]">
		<tal:block tal:define="sec_users python:zmscontext.getSecurityUsers()">
			<tal:block tal:repeat="user_id python:sec_users.keys()">
				<tal:block tal:define="sec_user python:sec_users[user_id]">
					<tal:block tal:repeat="node_key python:sec_user['nodes'].keys()">
						<tal:block tal:define="node python:here.getLinkObj(node_key)">
							<tal:block tal:condition="python:
									node is not None
									and node.id in zmscontext.getPhysicalPath()
									and 'ZMSEditor' in sec_user['nodes'][node_key]['roles']
									and 'email' in sec_user.keys()
									and not (sec_user['email'],user_id) in myeditors">
								<tal:block tal:define="dummy0 python:myeditors.append((sec_user['email'],user_id))"></tal:block>
							</tal:block>
						</tal:block>
					</tal:block>
				</tal:block>
			</tal:block>
		</tal:block>
		<label style="text-align:left !important" for="recipients" class="col-sm-12 control-label mandatory"><span tal:content="python:here.getZMILangStr('ROLE_ZMSEDITOR')">ROLE_ZMSEDITOR</span></label>
		<div class="col-sm-12" tal:content="structure python:here.zmi_input_multiselect(here,name='recipients',value=[],lang_str='ROLE_ZMSEDITOR',options=myeditors)">the control</div>
	</div><!-- .form-group -->

	<label class="control-label mandatory" for="comment"><span>Comment</span></label>
		<div class="controls"><input type="text" name="comment" class="form-control form-control-sm" /><br /></div><!-- .controls -->
	</div><!-- .control-group -->
	<div class="control-group">
		<div class="controls">
			<button name="btn" class="btn btn-primary" value="BTN_SEND" tal:content="python:here.getZMILangStr('BTN_SEND')">Send</button>
			<button name="btn" class="btn" value="BTN_CANCEL" tal:content="python:here.getZMILangStr('BTN_CANCEL')">Cancel</button>
		</div><!-- .controls -->
	</div><!-- .control-group -->
</form>
</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  E x e c u t e
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')=='BTN_SEND'">
	<tal:block tal:define="
			global mto python:','.join(request.get('recipients',[]));
			global msubject python:'[ZMS::%s - %s]: Bitte Publizieren'%(zmscontext.getDocumentElement().getTitlealt(request),zmscontext.getTitlealt(request));
			global mbody python:[];
			dummy0 python:mbody.append(''
				+ 'INFO: Bitte publizieren Sie folgende Ãnderungen\n'
				+ '%s: \t'%zmscontext.display_type(request)
				+ '>> '.join([x.getTitlealt(request) for x in zmscontext.breadcrumbs_obj_path()]) + '\n'
				+ 'MANAGE: \t%s/manage\n'%zmscontext.absolute_url()
				+ 'PREVIEW: \t%s/preview_html\n\n'%zmscontext.absolute_url()
			)">
	</tal:block>
	<tal:block tal:repeat="childNode python:[x for x in [zmscontext]+zmscontext.getChildNodes(request) if x.isObjModified(request)]">
		<tal:block tal:define="global
			dummy0 python:mbody.append(''
				+ '- %s '%(zmscontext.display_type(request))
					+ '[' + ','.join([here.getZMILangStr(x) for x in ['STATE_NEW','STATE_MODIFIED','STATE_DELETED'] if childNode.inObjStates(x,request)]) + '] '
				+ '%s '%(childNode.getLangFmtDate(childNode.attr('change_dt')))
				+ '%s %s '%(childNode.getZMILangStr('BY'),childNode.attr('change_uid'))
				+ '\n'
			)">
		</tal:block>
	</tal:block>
	<tal:block tal:define="global
			dummy0 python:mbody.append(''
				+ '\n\n'
				+ 'Meldung von %s:\n'%(str(request['AUTHENTICATED_USER']))
				+ '================================================\n'
				+ '%s\r\n'%request.get('comment','k.A.')
				+ '================================================\n\n\n'
				+ '------------------------------------------------\n'
				+ 'Diese Nachricht wurde automatisch generiert.\n'
			);
			dummy0 python:zmscontext.sendMail(mto, msubject, ''.join(mbody), request);
			message python:'Ihre Ãnderungen wurden zur Publikation eingereicht. Vielen Dank!';
			dummy0 python:request.RESPONSE.redirect(here.url_append_params('manage_wfTransitionFinalize',{'lang':request['lang'],'custom':request['custom'],'manage_tabs_message':message}))">
	</tal:block>
</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  C a n c e l
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')=='BTN_CANCEL'">
	<tal:block tal:define="global
			message python:'Vorgang abgebrochen.';
			dummy0 python:request.RESPONSE.redirect(here.url_append_params('manage_main',{'lang':request['lang'],'custom':request['custom'],'manage_tabs_message':message}))">
	</tal:block>
</tal:block>

</div><!-- #zmi-tab -->
<tal:block tal:content="structure python:zmscontext.zmi_body_footer(zmscontext,request)">zmi_body_footer</tal:block>
</body>
</html>]]>
          </item>
          <item key="performer" type="list">
            <list>
              <item>ZMSAdministrator</item>
              <item>ZMSEditor</item>
              <item>ZMSAuthor</item>
            </list>
          </item>
          <item key="to" type="list">
            <list>
              <item>AC_REQUESTED</item>
            </list>
          </item>
          <item key="type"><![CDATA[Page Template]]></item>
        </dictionary>
      </item>
      <item>TR_REJECT</item>
      <item type="dictionary">
        <dictionary>
          <item key="from" type="list">
            <list>
              <item>AC_REQUESTED</item>
            </list>
          </item>
          <item key="icon_clazz"><![CDATA[far fa-thumbs-down wf-icon]]></item>
          <item key="id">TR_REJECT</item>
          <item key="name">Ablehnen</item>
          <item key="ob"><![CDATA[<!DOCTYPE html>
<html lang="en">
<tal:block tal:define="global zmscontext options/zmscontext" tal:content="structure python:zmscontext.zmi_html_head(zmscontext,request)">zmi_html_head</tal:block>
<body tal:attributes="class python:' '.join(['zms',request['lang'],'transition',zmscontext.meta_id])">
<tal:block tal:content="structure python:zmscontext.zmi_body_header(zmscontext,request)">zmi_body_header</tal:block>
<div id="zmi-tab">
<tal:block tal:content="structure python:zmscontext.zmi_breadcrumbs(zmscontext,request)">zmi_breadcrumbs</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  F o r m
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')==''">
<form class="form-horizontal" name="form0" method="post">
	<input type="hidden" name="preview" value="preview"/>
	<input type="hidden" name="lang" tal:attributes="value request/lang"/>
	<input type="hidden" name="custom" tal:attributes="value request/custom"/>
	<legend tal:content="request/custom">the headline</legend>
	<div class="control-group">
	<label class="control-label mandatory" for="comment"><span>Comment</span></label>
		<div class="controls"><input type="text" name="comment" class="form-control form-control-sm" /><br /></div><!-- .controls -->
	</div><!-- .control-group -->
	<div class="control-group">
		<div class="controls">
			<button name="btn" class="btn btn-primary" value="BTN_SEND" tal:content="python:here.getZMILangStr('BTN_SEND')">Send</button>
			<button name="btn" class="btn" value="BTN_CANCEL" tal:content="python:here.getZMILangStr('BTN_CANCEL')">Cancel</button>
		</div><!-- .controls -->
	</div><!-- .control-group -->
</form>
</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  E x e c u t e
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')=='BTN_SEND'">
	<tal:block tal:define="
			global mto python:zmscontext.getRecipientsByRole(['ZMSEditor'],request);
			global msubject python:'[ZMS::%s - %s]: Ablehnung'%(zmscontext.getDocumentElement().getTitlealt(request),zmscontext.getTitlealt(request));
			global mbody python:[];
			dummy0 python:mbody.append(''
				+ 'INFO: Publikation der Ãnderungen wurde leider abgelehnt.\n'
				+ '%s: \t'%zmscontext.display_type(request)
				+ '>> '.join([x.getTitlealt(request) for x in zmscontext.breadcrumbs_obj_path()]) + '\n'
				+ 'MANAGE: \t%s/manage\n'%zmscontext.absolute_url()
				+ 'PREVIEW: \t%s/preview_html\n\n'%zmscontext.absolute_url()
			)">
	</tal:block>
	<tal:block tal:repeat="childNode python:[x for x in [zmscontext]+zmscontext.getChildNodes(request) if x.isObjModified(request)]">
		<tal:block tal:define="global
				dummy0 python:mbody.append(''
					+ '- %s '%(zmscontext.display_type(request))
					+ '[' + ','.join([here.getZMILangStr(x) for x in ['STATE_NEW','STATE_MODIFIED','STATE_DELETED'] if childNode.inObjStates(x,request)]) + '] '
					+ '%s '%(childNode.getLangFmtDate(childNode.attr('change_dt')))
					+ '%s %s '%(childNode.getZMILangStr('BY'),childNode.attr('change_uid'))
					+ '\n'
				)">
		</tal:block>
	</tal:block>
	<tal:block tal:define="global
			dummy0 python:mbody.append(''
				+ '\n\n'
				+ 'Meldung von %s:\n'%(str(request['AUTHENTICATED_USER']))
				+ '================================================\n'
				+ '%s\r\n'%request.get('comment','k.A.')
				+ '================================================\n\n\n'
				+ '------------------------------------------------\n'
				+ 'Diese Nachricht wurde automatisch generiert.\n'
			);
			dummy0 python:zmscontext.sendMail(mto, msubject, ''.join(mbody), request);
			message python:'Publikation wurde abgelehnt. Info an: %s'%( mto );
			dummy0 python:request.RESPONSE.redirect(here.url_append_params('manage_wfTransitionFinalize',{'lang':request['lang'],'custom':request['custom'],'manage_tabs_message':message}))">
	</tal:block>
</tal:block>

<!-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
     +-  C a n c e l
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- -->
<tal:block tal:condition="python:request.get('btn','')=='BTN_CANCEL'">
	<tal:block tal:define="global
			message python:'Operation cancelled.';
			dummy0 python:request.RESPONSE.redirect(here.url_append_params('manage_main',{'lang':request['lang'],'custom':request['custom'],'manage_tabs_message':message}))">
	</tal:block>
</tal:block>

</div><!-- #zmi-tab -->
<tal:block tal:content="structure python:zmscontext.zmi_body_footer(zmscontext,request)">zmi_body_footer</tal:block>
</body>
</html>]]>
          </item>
          <item key="performer" type="list">
            <list>
              <item>ZMSAdministrator</item>
              <item>ZMSEditor</item>
            </list>
          </item>
          <item key="to" type="list">
            <list>
              <item>AC_REJECTED</item>
            </list>
          </item>
          <item key="type"><![CDATA[Page Template]]></item>
        </dictionary>
      </item>
      <item>TR_COMMIT</item>
      <item type="dictionary">
        <dictionary>
          <item key="from" type="list">
            <list>
              <item>AC_CHANGED</item>
              <item>AC_REQUESTED</item>
              <item>AC_REJECTED</item>
            </list>
          </item>
          <item key="icon_clazz"><![CDATA[far fa-thumbs-up wf-icon]]></item>
          <item key="id">TR_COMMIT</item>
          <item key="name">Publizieren</item>
          <item key="ob"><![CDATA[## Script (Python) "TR_COMMIT"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=zmscontext
##title=Commit
##
request = zmscontext.REQUEST
message = ''

##### Notification ####
# Recipient
name = zmscontext.attr('work_uid')
mto = zmscontext.getRecipientWf(request)
# Subject
msubject = '[ZMS::%s]: Änderungen wurden publiziert.'%zmscontext.getDocumentElement().getTitle(request)
# Body
mbody = []
mbody.append('MANAGE: \t<%s/manage>\n'%(zmscontext.absolute_url()))
mbody.append('PREVIEW: \t<%s/preview_html>\n'%(zmscontext.absolute_url()))
mbody.append('INFO: Änderungen wurden publiziert von:\n')
mbody.append('%s\r\n\n\n'%(str(request['AUTHENTICATED_USER'])))
mbody.append('------------------------------------------------\n')
mbody.append('Diese Nachricht wurde automatisch generiert.\n')
# Send notification via MailHost
zmscontext.sendMail(mto, msubject, ''.join(mbody), request)

##### Commit ####
newcontext = zmscontext.commitObj(request)
message += 'Changes were committed'

##### Purge Cache ####
try:
  request.set('preview','')
  request.set('url',zmscontext.getHref2IndexHtml(request))
  zmscontext.purge_cache()
  # zmscontext.purgecache(zmscontext.getHref2IndexHtml(request))
  request.set('preview','preview')
  message += ', Cache were purged'
except:
  message += ', ERROR: No Cache Purging'

# Return with message
return request.RESPONSE.redirect(zmscontext.url_append_params('%s/manage_wfTransitionFinalize'%newcontext.absolute_url(),{
    'lang':request['lang'],
    'custom': request['custom'],
    'manage_tabs_message':message}))
]]>
          </item>
          <item key="performer" type="list">
            <list>
              <item>ZMSAdministrator</item>
              <item>ZMSEditor</item>
            </list>
          </item>
          <item key="to" type="list">
            <list>
              <item>AC_COMMITTED</item>
            </list>
          </item>
          <item key="type"><![CDATA[Script (Python)]]></item>
        </dictionary>
      </item>
      <item>TR_ROLLBACK</item>
      <item type="dictionary">
        <dictionary>
          <item key="from" type="list">
            <list>
              <item>AC_CHANGED</item>
              <item>AC_REQUESTED</item>
              <item>AC_REJECTED</item>
            </list>
          </item>
          <item key="icon_clazz"><![CDATA[fas fa-reply wf-icon]]></item>
          <item key="id">TR_ROLLBACK</item>
          <item key="name">Zurückziehen</item>
          <item key="ob"><![CDATA[## Script (Python) "TR_ROLLBACK"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=zmscontext
##title=Rollback
##
request = zmscontext.REQUEST

##### Notification ####
# Recipient
name = zmscontext.attr('work_uid')
mto = zmscontext.getRecipientWf(request)
# Subject
msubject = '[ZMS::%s]: Änderungen wurden zurück gezogen'%zmscontext.getDocumentElement().getTitle(request)
# Body
mbody = []
mbody.append('MANAGE: \t<%s/manage>\n'%(zmscontext.absolute_url()))
mbody.append('PREVIEW: \t<%s/preview_html>\n'%(zmscontext.absolute_url()))
mbody.append('INFO: Ihre Änderungen wurden rückgängig gemacht von\n\n')
mbody.append('%s\r\n\n\n'%(str(request['AUTHENTICATED_USER'])))
mbody.append('------------------------------------------------\n')
mbody.append('Diese Nachricht wurde automatisch generiert.\n')
# Send notification via MailHost
zmscontext.sendMail(mto, msubject, ''.join(mbody), request)

##### Rollback ####
zmscontext.rollbackObj(request)

# Return with message
message = 'Changes were rolled back.'
return request.RESPONSE.redirect(zmscontext.url_append_params('manage_wfTransitionFinalize',{
    'lang':request['lang'],
    'custom': request['custom'],
    'manage_tabs_message':message}))
]]>
          </item>
          <item key="performer" type="list">
            <list>
              <item>ZMSAdministrator</item>
              <item>ZMSEditor</item>
              <item>ZMSAuthor</item>
            </list>
          </item>
          <item key="to" type="list">
            <list>
              <item>AC_ROLLEDBACK</item>
            </list>
          </item>
          <item key="type"><![CDATA[Script (Python)]]></item>
        </dictionary>
      </item>
      <item>TR_LEAVE</item>
      <item type="dictionary">
        <dictionary>
          <item key="from" type="list">
            <list>
              <item>AC_COMMITTED</item>
              <item>AC_ROLLEDBACK</item>
            </list>
          </item>
          <item key="icon_clazz"></item>
          <item key="id">TR_LEAVE</item>
          <item key="name"><![CDATA[Leave Workflow]]></item>
          <item key="performer" type="list">
            <list>
            </list>
          </item>
          <item key="to" type="list">
            <list>
            </list>
          </item>
        </dictionary>
      </item>
    </list>
  </item>
</dictionary>