email_options_legacy.xts 140 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ps
  5. (C) Copyright IBM Corp. 2005, 2017
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
  10. Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
  11. -->
  12. <!--
  13. =================================================================================================================================
  14. email_options_legacy.xts
  15. view email_interface.xml for information on the API.
  16. this legacy email_option file is for those components who are not compitable with Dojo solution (e.g. rich text editor) yet.
  17. =================================================================================================================================
  18. -->
  19. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml">
  20. <!--
  21. ===============================================================================================
  22. processRequestParams - Default any params that weren't passed in. Also this is where we would
  23. do validation (when time permits).
  24. ===============================================================================================
  25. -->
  26. <xts:block id="processRequestParams" processor="XSLT" type="exec" nodeList="/root/*[local-name()='requestParams']">
  27. <xsl:stylesheet version="1.0"
  28. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  29. exclude-result-prefixes="xsl">
  30. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  31. <xsl:template match="/">
  32. <xts:sequence>
  33. <xts:append select="/root/*[local-name()='requestParams']">
  34. <xts:transform src="portal/controls/gen_default_parameters.xslt" processor="XSLT">
  35. <root>
  36. <xts:transform name="XML">
  37. <xts:param name="systemId">portal/emailOptions/email_interface.xml</xts:param>
  38. </xts:transform>
  39. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  40. </root>
  41. </xts:transform>
  42. </xts:append>
  43. </xts:sequence>
  44. </xsl:template>
  45. </xsl:stylesheet>
  46. </xts:block>
  47. <!--
  48. ===============================================================================================
  49. returnResult - We're done with the email options morphlet, so return the appropriate response
  50. ===============================================================================================
  51. -->
  52. <xts:block id="returnResult" type="exec" processor="XSLT" dependency="processResponse processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'genDefault' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'next' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'back' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'canceled']" mandatory="false">
  53. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  54. <xsl:stylesheet version="1.0"
  55. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  56. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  57. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  58. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  59. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  60. exclude-result-prefixes="xsl xos xtsext">
  61. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  62. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  63. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  64. <xsl:key name="session-param" match="/root/session/param" use="@name"/>
  65. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  66. <xsl:template match="/">
  67. <xts:sequence>
  68. <xts:append select="/root/output">
  69. <!-- build a part -->
  70. <xts:transform name="Null" option="part" mimeType="text/xml">
  71. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  72. <xsl:choose>
  73. <xsl:when test="key('request-param','requestState') = 'canceled'">
  74. <canceled/>
  75. </xsl:when>
  76. <!-- generate default delivery options -->
  77. <xsl:when test="key('request-param','requestState') = 'genDefault'">
  78. <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
  79. <root>
  80. <xts:transform src="portal/emailOptions/transforms/delivery_items.xslt" processor="XSLT">
  81. <root>
  82. <xsl:if test="key('session-param','e_hp')!='' and key('session-param','e_hp')!='CAMID(&quot;::Anonymous&quot;)'">
  83. <xts:transform src="portal/emailOptions/transforms/generateEmailTo.xslt" processor="XSLT">
  84. <root>
  85. <e_hp><xsl:value-of select="key('session-param','e_hp')"/></e_hp>
  86. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  87. <send:request provider="cm">
  88. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  89. <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
  90. <search>
  91. <xsl:value-of select="'~'"/>
  92. </search>
  93. <properties>
  94. <cm:property name="email"/>
  95. <cm:property name="notificationEMail"/>
  96. <cm:property name="iconURI"/>
  97. </properties>
  98. </query>
  99. </xts:transform>
  100. </send:request>
  101. </xts:transform>
  102. <xsl:if test="key('request-param','subscription')='true'">
  103. <!-- add another node to say to use the notification email address -->
  104. <subscription/>
  105. </xsl:if>
  106. </root>
  107. </xts:transform>
  108. </xsl:if>
  109. <xsl:choose>
  110. <xsl:when test="key('request-param','defaultEmailAsAttachment')='true' and key('request-param','hideEmailAsAttachment')='false' and not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)"><param name="m_ro_emailAsAttachment">true</param></xsl:when>
  111. <xsl:otherwise><param name="m_ro_emailAsAttachment">false</param></xsl:otherwise>
  112. </xsl:choose>
  113. <xsl:choose>
  114. <xsl:when test="key('request-param','defaultEmailAsAttachment')='true'"><param name="m_ro_emailAsURL">false</param></xsl:when>
  115. <xsl:when test="key('request-param','hideLinkToReport')='false'"><param name="m_ro_emailAsURL">true</param></xsl:when>
  116. <xsl:otherwise><param name="m_ro_emailAsURL">false</param></xsl:otherwise>
  117. </xsl:choose>
  118. <param name="email_subject">
  119. <xsl:choose>
  120. <!-- use the supplied subject when we're given one - else we just make it up -->
  121. <xsl:when test="key('request-param','defaultSubject')">
  122. <xsl:value-of select="key('request-param','defaultSubject')"/>
  123. </xsl:when>
  124. <!-- only time we'd be defaulting the delivery options and we have a step class if for reports -->
  125. <!-- Don't pretty print the following section since it'll add spaces in the default subject -->
  126. <xsl:when test="key('env-param','step-class') != ''"><xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/><xsl:value-of select="concat(' ',key('env-param','step_default_name'))"/></xsl:when>
  127. <xsl:when test="key('env-param','m_class')='jobDefinition' or key('env-param','m_new_class')='jobDefinition'"><xts:string id="IDS_EMAIL_OPTIONS_JOB_PREFIX"/><xsl:choose><xsl:when test="key('env-param','m_p_defaultName')"><xsl:value-of select="concat(' ',key('env-param','m_p_defaultName'))"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(' ',key('env-param','m_name'))"/></xsl:otherwise></xsl:choose></xsl:when>
  128. <xsl:otherwise><xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/><xsl:choose><xsl:when test="key('env-param','ui.name')"><xsl:value-of select="concat(' ',key('env-param','ui.name'))"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(' ',key('env-param','m_name'))"/></xsl:otherwise></xsl:choose></xsl:otherwise>
  129. </xsl:choose>
  130. </param>
  131. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  132. </root>
  133. </xts:transform>
  134. </root>
  135. </xts:transform>
  136. <!-- return the task name -->
  137. <xsl:if test="key('request-param','agentStudio') = 'true' or key('request-param','subscription') = 'true'">
  138. <xsl:call-template name="buildAgentVars"/>
  139. </xsl:if>
  140. </xsl:when>
  141. <xsl:otherwise>
  142. <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
  143. <root>
  144. <xts:transform src="portal/emailOptions/transforms/delivery_items.xslt" processor="XSLT">
  145. <root>
  146. <xts:transform src="portal/emailOptions/transforms/process_email_address.xslt" processor="XSLT">
  147. <root>
  148. <xsl:copy-of select="/root/env"/>
  149. <xsl:if test="key('env-param','addedRecipients') != ''">
  150. <xsl:choose>
  151. <!-- if the 'to', 'cc' or 'bcc' fields have changed then rebuild the addedRecipients list -->
  152. <xsl:when test="key('env-param','recipientsChanged')='true'">
  153. <xts:transform src="portal/emailOptions/transforms/move_recipients.xslt" processor="XSLT">
  154. <root>
  155. <addedRecipients>
  156. <xts:transform name="XMLDecode">
  157. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
  158. </xts:transform>
  159. </addedRecipients>
  160. <toField><xsl:value-of select="key('env-param','email_to')"/></toField>
  161. <ccField><xsl:value-of select="key('env-param','email_cc')"/></ccField>
  162. <bccField><xsl:value-of select="key('env-param','email_bcc')"/></bccField>
  163. </root>
  164. </xts:transform>
  165. </xsl:when>
  166. <xsl:otherwise>
  167. <addedRecipients>
  168. <xts:transform name="XMLDecode">
  169. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
  170. </xts:transform>
  171. </addedRecipients>
  172. </xsl:otherwise>
  173. </xsl:choose>
  174. </xsl:if>
  175. </root>
  176. </xts:transform>
  177. <!-- links and attachments -->
  178. <xsl:if test="key('env-param','links') != ''">
  179. <links>
  180. <xts:transform src="portal/emailOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  181. <root>
  182. <xts:transform name="XMLDecode">
  183. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
  184. </xts:transform>
  185. <deleted>
  186. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
  187. </deleted>
  188. </root>
  189. </xts:transform>
  190. </links>
  191. </xsl:if>
  192. <!-- attachments -->
  193. <xsl:if test="key('env-param','attachments') != ''">
  194. <attachments>
  195. <xts:transform src="portal/emailOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  196. <root>
  197. <xts:transform name="XMLDecode">
  198. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
  199. </xts:transform>
  200. <deleted>
  201. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
  202. </deleted>
  203. </root>
  204. </xts:transform>
  205. </attachments>
  206. </xsl:if>
  207. <!-- richEditBody - validate HTML for allowed tags only-->
  208. <!-- only perform this transform when we are in Rich Edit Mode -->
  209. <xsl:if test="key('env-param','hidden_richEditBody') != '' and key('env-param','richEditMode')='true'">
  210. <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE">
  211. <xsl:choose>
  212. <xsl:when test="key('system-param','allow-email-links')='true'">
  213. <xts:param name="noNamespaceSchemaLocation">portal/emailOptions/schemas/richEditBodyPartial.xsd</xts:param>
  214. </xsl:when>
  215. <xsl:otherwise>
  216. <xts:param name="noNamespaceSchemaLocation">portal/emailOptions/schemas/richEditBodyFull.xsd</xts:param>
  217. </xsl:otherwise>
  218. </xsl:choose>
  219. <!-- use the normalizeEmailBody transform to change all element names to uppercase and all atrributes to lowercase -->
  220. <xts:transform src="portal/emailOptions/transforms/normalizeEmailBody.xslt" processor="XSLT">
  221. <xsl:value-of select="/root/env/param[@name='hidden_richEditBody']" disable-output-escaping="yes"/>
  222. </xts:transform>
  223. </xts:transform>
  224. </xsl:if>
  225. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  226. </root>
  227. </xts:transform>
  228. </root>
  229. </xts:transform>
  230. <!-- return the task name -->
  231. <xsl:if test="key('request-param','agentStudio') = 'true' or key('request-param','subscription') = 'true'">
  232. <xsl:call-template name="buildAgentVars"/>
  233. </xsl:if>
  234. </xsl:otherwise>
  235. </xsl:choose>
  236. </xsl:element>
  237. </xts:transform>
  238. </xts:append>
  239. </xts:sequence>
  240. </xsl:template>
  241. <xsl:template name="buildAgentVars">
  242. <!-- taskName isn't shown in the UI anymore (trakker bug 478414). Agent studio wants the email subject
  243. returned as the taskName -->
  244. <xsl:variable name="quote">"</xsl:variable>
  245. <xsl:variable name="apos">'</xsl:variable>
  246. <xsl:variable name="task_name">
  247. <xsl:choose>
  248. <xsl:when test="key('env-param','email_subject') and key('env-param','email_subject')!=''">
  249. <xsl:value-of select="key('env-param','email_subject')"/>
  250. </xsl:when>
  251. <xsl:when test="key('request-param','defaultSubject') and key('request-param','defaultSubject')!=''">
  252. <xsl:value-of select="key('request-param','defaultSubject')"/>
  253. </xsl:when>
  254. <xsl:otherwise>
  255. <xsl:value-of select="key('request-param','taskName')"/>
  256. </xsl:otherwise>
  257. </xsl:choose>
  258. </xsl:variable>
  259. <taskName>
  260. <xsl:choose>
  261. <xsl:when test="contains($task_name,$quote) and contains($task_name,$apos)">
  262. <xsl:value-of select="translate($task_name,$quote,$apos)"/>
  263. </xsl:when>
  264. <xsl:otherwise>
  265. <xsl:value-of select="$task_name"/>
  266. </xsl:otherwise>
  267. </xsl:choose>
  268. </taskName>
  269. <hasAttachment>
  270. <xsl:choose>
  271. <xsl:when test="key('env-param','attachments') != '' or key('env-param','links') != ''">true</xsl:when>
  272. <xsl:otherwise>false</xsl:otherwise>
  273. </xsl:choose>
  274. </hasAttachment>
  275. </xsl:template>
  276. </xsl:stylesheet>
  277. </xts:block>
  278. <!--
  279. ===============================================================================================
  280. callMorphlet - Calls the appropriate morphlet using the passed in params which will return
  281. markup to be displayed or the expected results
  282. ===============================================================================================
  283. -->
  284. <xts:block id="callMorphlet" processor="XSLT" type="exec" dependency="processRequestParams" condition=".[ starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addEntries') or starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addLinks') ]" mandatory="false">
  285. <xts:logicsheet path="logicsheets/portal.xsl"/>
  286. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  287. <xsl:stylesheet version="1.0"
  288. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  289. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  290. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  291. xmlns:req-params="http://developer.cognos.com/schemas/request/params"
  292. exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  293. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  294. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  295. <xsl:template match="/">
  296. <xts:sequence>
  297. <xsl:choose>
  298. <xsl:when test="starts-with(key('request-param','requestState'),'addEntries')">
  299. <dlgctrl:XTS2Request>
  300. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  301. <dlgctrl:stackName>add_entries</dlgctrl:stackName>
  302. <req-params:param name="defaultTarget"><xsl:value-of select="key('request-param','defaultTarget')"/></req-params:param>
  303. <req-params:param name="titlePostfix"><xsl:value-of select="key('request-param','titlePostfix')"/></req-params:param>
  304. <req-params:param name="defaultSearchPath">/directory</req-params:param>
  305. <req-params:param name="showUsers">true</req-params:param>
  306. <req-params:param name="addEntriesUI"><xsl:value-of select="'recipients'"/></req-params:param>
  307. <req-params:param name="returnProperties">
  308. <req-params:property name="userName"/>
  309. </req-params:param>
  310. <req-params:param name="isPopup"><xsl:value-of select="key('request-param','addEntriesPopUp')"/></req-params:param>
  311. <req-params:param name="agentStudio"><xsl:value-of select="key('request-param','agentStudio')"/></req-params:param>
  312. </dlgctrl:XTS2Request>
  313. </xsl:when>
  314. <xsl:when test="starts-with(key('request-param','requestState'),'addLinks')">
  315. <dlgctrl:XTS2Request>
  316. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  317. <dlgctrl:stackName>add_entries</dlgctrl:stackName>
  318. <req-params:param name="defaultTarget"><xsl:value-of select="key('request-param','defaultTarget')"/></req-params:param>
  319. <req-params:param name="titlePostfix"><xsl:value-of select="key('request-param','titlePostfix')"/></req-params:param>
  320. <req-params:param name="defaultSearchPath">/content</req-params:param>
  321. <req-params:param name="addEntriesUI"><xsl:value-of select="'links'"/></req-params:param>
  322. <req-params:param name="isPopup"><xsl:value-of select="key('request-param','addEntriesPopUp')"/></req-params:param>
  323. <req-params:param name="allowRootBrowsing"><xsl:value-of select="'true'"/></req-params:param>
  324. <req-params:param name="agentStudio"><xsl:value-of select="key('request-param','agentStudio')"/></req-params:param>
  325. </dlgctrl:XTS2Request>
  326. </xsl:when>
  327. </xsl:choose>
  328. </xts:sequence>
  329. </xsl:template>
  330. </xsl:stylesheet>
  331. </xts:block>
  332. <!--
  333. ===============================================================================================
  334. processReponse - Process the response from the callMorphlet block and either displays
  335. the markup or processes the results
  336. ===============================================================================================
  337. -->
  338. <xts:block id="processResponse" processor="XSLT" dependency="callMorphlet processRequestParams" type="exec" condition=".[ starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addEntries') or starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addLinks')]" mandatory="false">
  339. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  340. <xts:logicsheet path="logicsheets/portal.xsl"/>
  341. <xsl:stylesheet version="1.0"
  342. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  343. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  344. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  345. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  346. exclude-result-prefixes="xsl dlgctrl xtsext pf">
  347. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  348. <xsl:template match="/">
  349. <xts:sequence>
  350. <dlgctrl:processXTS2Response>
  351. <dlgctrl:stackName>add_entries</dlgctrl:stackName>
  352. <!-- if we got markup back, then simply send it back to the calling morphlet.
  353. email options should never have to take care of displaying the add entries markup -->
  354. <dlgctrl:mode match="markup"/>
  355. <!-- got back selected entries -->
  356. <dlgctrl:mode match="selectedEntries">
  357. <xsl:if test="/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'] != ''">
  358. <xts:append select="/root">
  359. <selectedEntries>
  360. <xts:transform name="XMLDecode">
  361. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'])), true())"/>
  362. </xts:transform>
  363. </selectedEntries>
  364. </xts:append>
  365. </xsl:if>
  366. </dlgctrl:mode>
  367. </dlgctrl:processXTS2Response>
  368. </xts:sequence>
  369. </xsl:template>
  370. </xsl:stylesheet>
  371. </xts:block>
  372. <!--
  373. ===============================================================================================
  374. businessRules - Take care off any business logic to simplify the UI generation
  375. ===============================================================================================
  376. -->
  377. <xts:block id="businessRules" type="exec" processor="XSLT" dependency="processResponse processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='canceled']]" mandatory="false">
  378. <xts:logicsheet path="logicsheets/portal.xsl"/>
  379. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  380. <xsl:stylesheet version="1.0"
  381. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  382. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  383. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  384. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  385. exclude-result-prefixes="xsl xtsext">
  386. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  387. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  388. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  389. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  390. <pf:variables/>
  391. <xsl:template match="/">
  392. <xts:sequence>
  393. <!-- if it's the first time we hit this page -->
  394. <xsl:if test="not(/root/env/param[@name='email_body']) and not(/root/env/param[@name='hidden_richEditBody'])">
  395. <xts:append select="/root">
  396. <defaultOptions>
  397. <!-- transform the options blob passed in into env params -->
  398. <xsl:if test="key('request-param','options') != ''">
  399. <xts:transform src="portal/emailOptions/transforms/parse_options.xslt" processor="XSLT">
  400. <xts:transform name="XMLDecode">
  401. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('request-param','options'))), true())"/>
  402. </xts:transform>
  403. </xts:transform>
  404. </xsl:if>
  405. </defaultOptions>
  406. </xts:append>
  407. <!-- append all the params to env -->
  408. <xts:append select="/root/env">
  409. <xts:queryNode select="/root/defaultOptions/*[local-name() = 'param']"/>
  410. </xts:append>
  411. </xsl:if>
  412. <!-- if the 'to', 'cc', or 'bcc' fields have changed, then we must update the blob -->
  413. <xsl:if test="key('env-param','recipientsChanged')='true' and key('env-param','addedRecipients')!=''">
  414. <!-- create the new added recipients list -->
  415. <xts:append select="/root">
  416. <xts:transform src="portal/emailOptions/transforms/move_recipients.xslt" processor="XSLT">
  417. <root>
  418. <addedRecipients>
  419. <xts:transform name="XMLDecode">
  420. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
  421. </xts:transform>
  422. </addedRecipients>
  423. <toField><xsl:value-of select="key('env-param','email_to')"/></toField>
  424. <ccField><xsl:value-of select="key('env-param','email_cc')"/></ccField>
  425. <bccField><xsl:value-of select="key('env-param','email_bcc')"/></bccField>
  426. </root>
  427. </xts:transform>
  428. </xts:append>
  429. <!-- delete the old list -->
  430. <xts:delete select="/root/env/param[@name='addedRecipients']"/>
  431. <!-- web64 encode the new list -->
  432. <xts:append select="/root/env">
  433. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  434. <param name="addedRecipients">
  435. <passport><xsl:value-of select="$passport"/></passport>
  436. <markup>
  437. <xts:transform name="XMLEncode">
  438. <xts:queryNode select="/root/addedRecipients/*"/>
  439. </xts:transform>
  440. </markup>
  441. </param>
  442. </xts:transform>
  443. </xts:append>
  444. </xsl:if>
  445. <!-- if we're in Event studio, then deal with the links and attachments -->
  446. <xsl:if test="key('request-param','agentStudio') = 'true'">
  447. <!-- links -->
  448. <xsl:choose>
  449. <!-- if the user delete any links -->
  450. <xsl:when test="key('env-param','links') != '' and /root/env/param[starts-with(@name,'deleted_link_')]='true'">
  451. <xts:append select="/root">
  452. <links>
  453. <xts:transform src="portal/emailOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  454. <root>
  455. <xts:transform name="XMLDecode">
  456. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
  457. </xts:transform>
  458. <deleted>
  459. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
  460. </deleted>
  461. </root>
  462. </xts:transform>
  463. </links>
  464. </xts:append>
  465. <!-- delete the old list -->
  466. <xts:delete select="/root/env/param[@name='links']"/>
  467. <!-- web64 encode the new list -->
  468. <xts:append select="/root/env">
  469. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  470. <param name="links">
  471. <passport><xsl:value-of select="$passport"/></passport>
  472. <markup>
  473. <xts:transform name="XMLEncode">
  474. <xts:queryNode select="/root/links/*"/>
  475. </xts:transform>
  476. </markup>
  477. </param>
  478. </xts:transform>
  479. </xts:append>
  480. </xsl:when>
  481. <!-- unpack the list of links and attachments -->
  482. <xsl:when test="key('env-param','links') != ''">
  483. <xts:append>
  484. <links>
  485. <xts:transform name="XMLDecode">
  486. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
  487. </xts:transform>
  488. </links>
  489. </xts:append>
  490. </xsl:when>
  491. </xsl:choose>
  492. <!-- attachments -->
  493. <xsl:choose>
  494. <!-- if the user delete any links -->
  495. <xsl:when test="key('env-param','attachments') != '' and /root/env/param[starts-with(@name,'deleted_attachment_')]='true'">
  496. <xts:append select="/root">
  497. <attachments>
  498. <xts:transform src="portal/emailOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  499. <root>
  500. <xts:transform name="XMLDecode">
  501. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
  502. </xts:transform>
  503. <deleted>
  504. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
  505. </deleted>
  506. </root>
  507. </xts:transform>
  508. </attachments>
  509. </xts:append>
  510. <!-- delete the old list -->
  511. <xts:delete select="/root/env/param[@name='attachments']"/>
  512. <!-- web64 encode the new list -->
  513. <xts:append select="/root/env">
  514. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  515. <param name="attachments">
  516. <passport><xsl:value-of select="$passport"/></passport>
  517. <markup>
  518. <xts:transform name="XMLEncode">
  519. <xts:queryNode select="/root/attachments/*"/>
  520. </xts:transform>
  521. </markup>
  522. </param>
  523. </xts:transform>
  524. </xts:append>
  525. </xsl:when>
  526. <!-- unpack the list of links and attachments -->
  527. <xsl:when test="key('env-param','attachments') != ''">
  528. <xts:append>
  529. <attachments>
  530. <xts:transform name="XMLDecode">
  531. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
  532. </xts:transform>
  533. </attachments>
  534. </xts:append>
  535. </xsl:when>
  536. </xsl:choose>
  537. </xsl:if>
  538. <xts:append select="/root">
  539. <businessRules>
  540. <!-- browser title -->
  541. <browserTitle>
  542. <xsl:text/>
  543. <xsl:choose>
  544. <xsl:when test="key('request-param','titlePostfix') != ''">
  545. <xts:string id="IDS_COMBINE_TITLE">
  546. <xts:param name="prefix"><xsl:value-of select="key('request-param','titlePrefix')"/></xts:param>
  547. <xts:param name="postfix"><xsl:value-of select="key('request-param','titlePostfix')"/></xts:param>
  548. </xts:string>
  549. </xsl:when>
  550. <xsl:otherwise>
  551. <xsl:value-of select="key('request-param','titlePrefix')"/>
  552. </xsl:otherwise>
  553. </xsl:choose>
  554. <xsl:text/>
  555. </browserTitle>
  556. <!-- description -->
  557. <description>
  558. <xsl:choose>
  559. <xsl:when test="key('request-param','agentStudio') = 'true' and key('request-param','burst') != 'true'" >
  560. <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_AGENT_STUDIO_INTRO"/><xsl:text/>
  561. </xsl:when>
  562. <xsl:when test="key('request-param','agentStudio') = 'true' and key('request-param','burst') = 'true'" >
  563. <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_AGENT_STUDIO_INTRO_BURST"/><xsl:text/>
  564. </xsl:when>
  565. <xsl:when test="key('request-param','burst') = 'true'">
  566. <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_BURST_INTRO"/><xsl:text/>
  567. </xsl:when>
  568. <xsl:when test="key('request-param','subscription') = 'true'">
  569. <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_SUBSCRIPTION_INTRO"/><xsl:text/>
  570. </xsl:when>
  571. <xsl:otherwise>
  572. <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_INTRODUCTION"/><xsl:text/>
  573. </xsl:otherwise>
  574. </xsl:choose>
  575. </description>
  576. <!-- should we show the email as attachment checkbox -->
  577. <allowEmailAsAttachment>
  578. <xsl:variable name="s" select="concat(' ', key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment/@show, ' ')"/>
  579. <xsl:choose>
  580. <xsl:when test="key('request-param', 'agentStudio')='true' and not(key('request-param','hideEmailAsAttachment'))">false</xsl:when>
  581. <xsl:when test="key('request-param','hideEmailAsAttachment') = 'true'">false</xsl:when>
  582. <xsl:when test="
  583. not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)
  584. or
  585. (
  586. key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment
  587. and
  588. (
  589. (contains($s, 'Administrators') and $hasAdminCapability) or
  590. (contains($s, 'QSUsers') and $hasFullQSCapability) or
  591. (contains($s, 'RSUsers') and $hasFullRSCapability) or
  592. (contains($s, 'Consumers') and $is-named='1') or
  593. (contains($s, 'Anonymous') and $is-named='0') or
  594. (key('system-param', 'ui_groups')/group[contains($s, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])
  595. )
  596. )">
  597. <xsl:value-of select="'true'"/>
  598. </xsl:when>
  599. <xsl:otherwise>
  600. <xsl:value-of select="'false'"/>
  601. </xsl:otherwise>
  602. </xsl:choose>
  603. </allowEmailAsAttachment>
  604. <allowLinkToReport>
  605. <xsl:choose>
  606. <xsl:when test="key('request-param','agentStudio')='true' and not(key('request-param','hideLinkToReport'))">false</xsl:when>
  607. <xsl:when test="key('request-param','hideLinkToReport')='false'">true</xsl:when>
  608. <xsl:otherwise>false</xsl:otherwise>
  609. </xsl:choose>
  610. </allowLinkToReport>
  611. <allowAttachMenu>
  612. <xsl:variable name="checkShowParam" select="concat(' ', key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment/@show, ' ')"/>
  613. <xsl:choose>
  614. <xsl:when test="key('request-param','hideAttachMenu')='false' and (not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment) or
  615. (contains($checkShowParam, 'Administrators') and $hasAdminCapability)) or
  616. (contains($checkShowParam, 'QSUsers') and $hasFullQSCapability) or
  617. (contains($checkShowParam, 'RSUsers') and $hasFullRSCapability) or
  618. (key('system-param', 'ui_groups')/group[contains($checkShowParam, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])">true</xsl:when>
  619. <xsl:otherwise>false</xsl:otherwise>
  620. </xsl:choose>
  621. </allowAttachMenu>
  622. <allowAddLinksAction>
  623. <xsl:choose>
  624. <xsl:when test="key('request-param','hideAddLinks')='false'">true</xsl:when>
  625. <xsl:otherwise>false</xsl:otherwise>
  626. </xsl:choose>
  627. </allowAddLinksAction>
  628. </businessRules>
  629. </xts:append>
  630. </xts:sequence>
  631. </xsl:template>
  632. </xsl:stylesheet>
  633. </xts:block>
  634. <!--
  635. ===============================================================================================
  636. queryCMForOptionsInfo - If the options blob passed had recipients which referenced CM, then
  637. we must query for those recipients. Also if the options blob had attachments or links then
  638. query CM for the information need to display the UI
  639. ===============================================================================================
  640. -->
  641. <xts:block id="queryCMForOptionsInfo" type="exec" processor="XSLT" dependency="businessRules" condition=".[/root/*[local-name()='defaultOptions']/*[local-name()='attachments'] or /root/*[local-name()='defaultOptions']/*[local-name()='link'] or /root/*[local-name()='defaultOptions']/*[local-name()='to'] or /root/*[local-name()='defaultOptions']/*[local-name()='cc'] or /root/*[local-name()='defaultOptions']/*[local-name()='bcc']]" mandatory="false">
  642. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  643. <xsl:stylesheet version="1.0"
  644. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  645. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  646. exclude-result-prefixes="xsl send">
  647. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  648. <xsl:key name="recipient-search-paths" match="/root/*[local-name()='defaultOptions']/*[local-name()='to' or local-name()='cc' or local-name()='bcc']/*[local-name()='searchPath']" use="."/>
  649. <xsl:key name="links-search-paths" match="/root/*[local-name()='defaultOptions']/*[local-name()='attachment' or local-name()='link']/*[local-name()='item']/*[local-name()='searchPath']" use="."/>
  650. <xsl:key name="default-options" match="/root/*[local-name()='defaultOptions']/*" use="local-name()"/>
  651. <xsl:variable name="passport">
  652. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  653. </xsl:variable>
  654. <xsl:template match="/">
  655. <!-- recipients -->
  656. <xts:sequence>
  657. <xsl:if test="key('default-options','to') or key('default-options','cc') or key('default-options','bcc')">
  658. <xts:append select="/root">
  659. <xsl:variable name="unique-search-paths" select="/root/*[local-name()='defaultOptions']/*[local-name()='to' or local-name()='cc' or local-name()='bcc']/*[local-name()='searchPath'][generate-id(.)=generate-id(key('recipient-search-paths',.))]"/>
  660. <selectedEntries>
  661. <!-- Make sure we add 'unknown' items in our list for every nil queryReply we got back from CM -->
  662. <xts:transform src="portal/emailOptions/transforms/add-unknown-entries.xslt" processor="XSLT">
  663. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  664. <root>
  665. <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
  666. the same transforms to update the email fields and the recipients blob -->
  667. <xts:transform src="portal/emailOptions/transforms/gen-standard-list.xslt" processor="XSLT">
  668. <root>
  669. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  670. <send:request provider="cm">
  671. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  672. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  673. <cm:requests>
  674. <xsl:for-each select="$unique-search-paths">
  675. <xsl:if test=". != ''">
  676. <cm:query>
  677. <cm:search>
  678. <xsl:value-of select="."/>
  679. </cm:search>
  680. <cm:properties>
  681. <cm:property name="defaultName"/>
  682. <cm:property name="searchPath"/>
  683. <cm:property name="userName"/>
  684. <cm:property name="iconURI"/>
  685. </cm:properties>
  686. </cm:query>
  687. </xsl:if>
  688. </xsl:for-each>
  689. </cm:requests>
  690. </cm:query>
  691. </xts:transform>
  692. </send:request>
  693. </xts:transform>
  694. <defaultOptions>
  695. <xsl:copy-of select="/root/defaultOptions/*[local-name()='to' or local-name()='cc' or local-name()='bcc']"/>
  696. </defaultOptions>
  697. <action>recipients</action>
  698. </root>
  699. </xts:transform>
  700. <defaultOptions>
  701. <xsl:copy-of select="/root/defaultOptions/*[local-name()='to' or local-name()='cc' or local-name()='bcc']"/>
  702. </defaultOptions>
  703. </root>
  704. </xts:transform>
  705. </selectedEntries>
  706. </xts:append>
  707. </xsl:if>
  708. </xts:sequence>
  709. <!-- links -->
  710. <xts:sequence>
  711. <xsl:if test="key('default-options','link') and /root/*[local-name()='defaultOptions']/*[local-name()='link']/*[local-name()='item']/*[local-name()='searchPath'] != ''">
  712. <xts:append select="/root">
  713. <links>
  714. <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
  715. the same transforms to update the email fields and the recipients blob -->
  716. <xts:transform src="portal/emailOptions/transforms/gen-standard-list.xslt" processor="XSLT">
  717. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  718. <root>
  719. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  720. <send:request provider="cm">
  721. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  722. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  723. <cm:requests>
  724. <xsl:for-each select="/root/*[local-name()='defaultOptions']/*[local-name()='link']/*[local-name()='item']/*[local-name()='searchPath' and .!='']">
  725. <cm:query>
  726. <cm:search>
  727. <xsl:value-of select="."/><xsl:value-of select="/root/system/param[@name='visible']"/>
  728. </cm:search>
  729. <cm:properties>
  730. <cm:property name="defaultName"/>
  731. <cm:property name="searchPath"/>
  732. <cm:property name="iconURI"/>
  733. </cm:properties>
  734. </cm:query>
  735. </xsl:for-each>
  736. </cm:requests>
  737. </cm:query>
  738. </xts:transform>
  739. </send:request>
  740. </xts:transform>
  741. <action>links</action>
  742. </root>
  743. </xts:transform>
  744. </links>
  745. </xts:append>
  746. <!-- web64 encode the list of links -->
  747. <xts:append select="/root/env">
  748. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  749. <param name="links">
  750. <passport><xsl:value-of select="$passport"/></passport>
  751. <markup>
  752. <xts:transform name="XMLEncode">
  753. <xts:queryNode select="/root/links/*"/>
  754. </xts:transform>
  755. </markup>
  756. </param>
  757. </xts:transform>
  758. </xts:append>
  759. </xsl:if>
  760. </xts:sequence>
  761. <!-- attachments -->
  762. <xts:sequence>
  763. <xsl:if test="key('default-options','attachments') or key('default-options','eventOutput')">
  764. <xts:append select="/root">
  765. <attachments>
  766. <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
  767. the same transforms to update the email fields and the recipients blob -->
  768. <xts:transform src="portal/emailOptions/transforms/gen-standard-list.xslt" processor="XSLT">
  769. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  770. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  771. <root>
  772. <xsl:if test="key('default-options','attachments') and /root/*[local-name()='defaultOptions']/*[local-name()='attachments']/*[local-name()='item']/*[local-name()='searchPath' and not(starts-with(.,'AgentTask-'))] != ''">
  773. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  774. <send:request provider="cm">
  775. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  776. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  777. <cm:requests>
  778. <xsl:for-each select="/root/*[local-name()='defaultOptions']/*[local-name()='attachments']/*[local-name()='item' and ./*[local-name()='format']!='']/*[local-name()='searchPath' and .!='' and not(starts-with(.,'AgentTask-'))]">
  779. <cm:query>
  780. <cm:search>
  781. <xsl:value-of select="."/><xsl:value-of select="/root/system/param[@name='visible']"/>
  782. </cm:search>
  783. <cm:properties>
  784. <cm:property name="defaultName"/>
  785. <cm:property name="searchPath"/>
  786. <cm:property name="iconURI"/>
  787. </cm:properties>
  788. </cm:query>
  789. </xsl:for-each>
  790. </cm:requests>
  791. </cm:query>
  792. </xts:transform>
  793. </send:request>
  794. </xts:transform>
  795. </xsl:if>
  796. <action>attachments</action>
  797. <defaultOptions>
  798. <xsl:copy-of select="/root/defaultOptions/*[local-name()='attachments']"/>
  799. <eventOutput>
  800. <xsl:copy-of select="/root/defaultOptions/*[local-name()='eventOutput']"/>
  801. </eventOutput>
  802. </defaultOptions>
  803. <attachParam>
  804. <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*"/>
  805. </attachParam>
  806. </root>
  807. </xts:transform>
  808. </attachments>
  809. </xts:append>
  810. <!-- web64 encode the list of links -->
  811. <xts:append select="/root/env">
  812. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  813. <param name="attachments">
  814. <passport><xsl:value-of select="$passport"/></passport>
  815. <markup>
  816. <xts:transform name="XMLEncode">
  817. <xts:queryNode select="/root/attachments/*"/>
  818. </xts:transform>
  819. </markup>
  820. </param>
  821. </xts:transform>
  822. </xts:append>
  823. </xsl:if>
  824. </xts:sequence>
  825. </xsl:template>
  826. </xsl:stylesheet>
  827. </xts:block>
  828. <!--
  829. ================================================================================
  830. decode the agent items
  831. ===============================================================================================
  832. -->
  833. <xts:block id="decode_agent_definition" processor="XSLT" type="exec" nodelist="env" dependency="processResponse processRequestParams queryCMForOptionsInfo" condition=".[/root/*[local-name()='selectedEntries'] or /root/env/param[@name='addAttachment']!='']" mandatory="false">
  834. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
  835. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  836. <xsl:template match="/">
  837. <xts:sequence>
  838. <xsl:if test="/root/env/param[@name = 'agent_definition_blob']">
  839. <xts:append select="/root">
  840. <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_seqagenttasks001',string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
  841. </xts:append>
  842. </xsl:if>
  843. </xts:sequence>
  844. </xsl:template>
  845. </xsl:stylesheet>
  846. </xts:block>
  847. <!--
  848. ===============================================================================================
  849. updateAddedLists
  850. ===============================================================================================
  851. -->
  852. <xts:block id="updateAddedLists" type="exec" processor="XSLT" dependency="decode_agent_definition" condition=".[/root/*[local-name()='selectedEntries'] or /root/env/param[@name='addAttachment']!='']" mandatory="false">
  853. <xts:logicsheet path="logicsheets/portal.xsl"/>
  854. <xsl:stylesheet version="1.0"
  855. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  856. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  857. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  858. xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/"
  859. exclude-result-prefixes="xsl send xtsext pf">
  860. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  861. <pf:serialize-xml/>
  862. <!-- Session variables -->
  863. <xsl:variable name="passport">
  864. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  865. </xsl:variable>
  866. <xsl:template match="/">
  867. <xts:sequence>
  868. <xsl:choose>
  869. <!-- adding attachments -->
  870. <xsl:when test="/root/env/param[@name='addAttachment'] != ''">
  871. <xts:delete select="/root/attachments"/>
  872. <xts:append select="/root">
  873. <attachments>
  874. <xts:transform src="portal/emailOptions/transforms/update_entries_list.xslt" processor="XSLT">
  875. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  876. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  877. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  878. <root>
  879. <createWeb64Param>false</createWeb64Param>
  880. <action>addingAttachments</action>
  881. <attachmentToAdd>
  882. <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment'])]/*"/>
  883. <xsl:if test="not(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment'])]/*[local-name()='locale'])">
  884. <locale/>
  885. </xsl:if>
  886. <xsl:if test="not(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment'])]/*[local-name()='format'])">
  887. <format/>
  888. </xsl:if>
  889. <xsl:if test="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment']) and local-name()='eventOutput']">
  890. <eventOutput>true</eventOutput>
  891. </xsl:if>
  892. </attachmentToAdd>
  893. <xsl:if test="/root/env/param[@name='attachments'] != ''">
  894. <previouslyAdded>
  895. <xts:transform name="XMLDecode">
  896. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='attachments'])), true())"/>
  897. </xts:transform>
  898. </previouslyAdded>
  899. </xsl:if>
  900. <defaultFormat><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name']='outputFormat']/*[local-name()='value']"/></defaultFormat>
  901. <defaultLocale><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name']='outputLocale']/*[local-name()='value']"/></defaultLocale>
  902. </root>
  903. </xts:transform>
  904. </attachments>
  905. </xts:append>
  906. <!-- web64 the list of links and attachments -->
  907. <xts:delete select="/root/env/param[@name='attachments']"/>
  908. <xts:append select="/root/env">
  909. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  910. <param name="attachments">
  911. <passport><xsl:value-of select="$passport"/></passport>
  912. <markup>
  913. <xts:transform name="XMLEncode">
  914. <xts:queryNode select="/root/attachments/*"/>
  915. </xts:transform>
  916. </markup>
  917. </param>
  918. </xts:transform>
  919. </xts:append>
  920. </xsl:when>
  921. <!-- added links -->
  922. <xsl:when test="/root/env/param[@name='addingLinks']='true'">
  923. <xts:delete select="/root/links"/>
  924. <xts:append select="/root">
  925. <links>
  926. <xts:transform src="portal/emailOptions/transforms/update_entries_list.xslt" processor="XSLT">
  927. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  928. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  929. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  930. <root>
  931. <createWeb64Param>false</createWeb64Param>
  932. <selectedEntries>
  933. <xts:queryNode select="/root/selectedEntries/*"/>
  934. </selectedEntries>
  935. <action>addingLinks</action>
  936. <xsl:if test="/root/env/param[@name='links'] != ''">
  937. <previouslyAdded>
  938. <xts:transform name="XMLDecode">
  939. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='links'])), true())"/>
  940. </xts:transform>
  941. </previouslyAdded>
  942. </xsl:if>
  943. </root>
  944. </xts:transform>
  945. </links>
  946. </xts:append>
  947. <!-- web64 the list of links and attachments -->
  948. <xts:delete select="/root/env/param[@name='links']"/>
  949. <xts:append select="/root/env">
  950. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  951. <param name="links">
  952. <passport><xsl:value-of select="$passport"/></passport>
  953. <markup>
  954. <xts:transform name="XMLEncode">
  955. <xts:queryNode select="/root/links/*"/>
  956. </xts:transform>
  957. </markup>
  958. </param>
  959. </xts:transform>
  960. </xts:append>
  961. </xsl:when>
  962. <!-- added recipients -->
  963. <xsl:otherwise>
  964. <xsl:variable name="env" select="/root/env"/>
  965. <xts:delete select="/root/env/param[@name='email_to' or @name='email_cc' or @name='email_bcc' or @name='addedRecipients']"/>
  966. <xts:append select="/root/env">
  967. <xts:transform src="portal/emailOptions/transforms/update_email_recipients.xslt" processor="XSLT">
  968. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  969. <root>
  970. <xsl:copy-of select="$env"/>
  971. <selectedEntries>
  972. <xts:queryNode select="/root/selectedEntries/*"/>
  973. </selectedEntries>
  974. <xsl:if test="/root/env/param[@name='addedRecipients'] != ''">
  975. <previouslyAdded>
  976. <xts:transform name="XMLDecode">
  977. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addedRecipients'])), true())"/>
  978. </xts:transform>
  979. </previouslyAdded>
  980. </xsl:if>
  981. </root>
  982. </xts:transform>
  983. <xts:transform src="portal/emailOptions/transforms/update_entries_list.xslt" processor="XSLT">
  984. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  985. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  986. <root>
  987. <passport><xsl:value-of select="$passport"/></passport>
  988. <paramName>addedRecipients</paramName>
  989. <selectedEntries>
  990. <xts:queryNode select="/root/selectedEntries/*"/>
  991. </selectedEntries>
  992. <xsl:if test="/root/env/param[@name='addedRecipients'] != ''">
  993. <previouslyAdded>
  994. <xts:transform name="XMLDecode">
  995. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addedRecipients'])), true())"/>
  996. </xts:transform>
  997. </previouslyAdded>
  998. </xsl:if>
  999. <action>addingRecipients</action>
  1000. </root>
  1001. </xts:transform>
  1002. </xts:append>
  1003. <!-- if the user just added recipients to the bcc, then make sure the bcc field will be visible -->
  1004. <xsl:if test="/root/*[local-name()='selectedEntries']/*/*[local-name()='type'] = 'bcc'">
  1005. <xts:append select="/root">
  1006. <showBccField>true</showBccField>
  1007. </xts:append>
  1008. </xsl:if>
  1009. </xsl:otherwise>
  1010. </xsl:choose>
  1011. </xts:sequence>
  1012. </xsl:template>
  1013. </xsl:stylesheet>
  1014. </xts:block>
  1015. <!--
  1016. ===============================================================================================
  1017. genMarkup -
  1018. ===============================================================================================
  1019. -->
  1020. <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="updateAddedLists queryCMForOptionsInfo businessRules processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='canceled']]" mandatory="false">
  1021. <!-- logicsheets -->
  1022. <!-- portal specific information -->
  1023. <xts:logicsheet path="logicsheets/portal.xsl"/>
  1024. <!-- Dialog specific logicsheets -->
  1025. <xts:logicsheet path="portal/emailOptions/logicsheets/ui-templates.xsl"/>
  1026. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  1027. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  1028. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  1029. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  1030. <!-- Generic logicsheets -->
  1031. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  1032. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  1033. <xts:logicsheet path="logicsheets/validation.xslt"/>
  1034. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  1035. <xsl:stylesheet version="1.0"
  1036. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  1037. xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/"
  1038. xmlns:pf="http://developer.cognos.com/schemas/xts/pf"
  1039. xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt"
  1040. xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/"
  1041. xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/"
  1042. xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/"
  1043. xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/"
  1044. xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/"
  1045. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  1046. xmlns:eut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/emailOptions/logicsheets/"
  1047. xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/"
  1048. exclude-result-prefixes="xts xsl cm pf xtsext lyt dp df cf cp xos dlgctrl eut">
  1049. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  1050. <xsl:key name="business-rules" match="/root/businessRules/*" use="local-name()"/>
  1051. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  1052. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  1053. <pf:variables/>
  1054. <pf:gen-icon/>
  1055. <xsl:variable name="agentStudio" select="key('request-param','agentStudio') = 'true'"/>
  1056. <xsl:variable name="inWizard" select="key('request-param','inWizard') = 'true'"/>
  1057. <xsl:variable name="subscription" select="key('request-param','subscription') = 'true'"/>
  1058. <xsl:variable name="hideInsertButton" select="key('request-param','hideInsertButton') = 'true'"/>
  1059. <xsl:variable name="richEditMode">
  1060. <xsl:choose>
  1061. <xsl:when test="$browser = 'ie' and not(key('env-param','richEditMode'))">true</xsl:when>
  1062. <xsl:when test="$browser = 'ie'"><xsl:value-of select="key('env-param','richEditMode')"/></xsl:when>
  1063. <xsl:otherwise>false</xsl:otherwise>
  1064. </xsl:choose>
  1065. </xsl:variable>
  1066. <xsl:variable name="bccVisible">
  1067. <xsl:choose>
  1068. <xsl:when test="/root/showBccField = 'true'">true</xsl:when>
  1069. <xsl:when test="key('env-param','bccVisible')!=''"><xsl:value-of select="key('env-param','bccVisible')"/></xsl:when>
  1070. <xsl:when test="key('env-param','email_bcc')!=''">true</xsl:when>
  1071. <xsl:otherwise>false</xsl:otherwise>
  1072. </xsl:choose>
  1073. </xsl:variable>
  1074. <xsl:template match="/">
  1075. <xts:sequence>
  1076. <xts:append select="/root/output">
  1077. <xos:part>
  1078. <xos:entityHeader>
  1079. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  1080. </xos:entityHeader>
  1081. <xos:entityBody>
  1082. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  1083. <markup>
  1084. <xts:transform name="XMLEncode">
  1085. <!-- adds standard hidden inputs and javascript -->
  1086. <dlgctrl:markupHelper/>
  1087. <input type="hidden" name="addedRecipients" value="{key('env-param','addedRecipients')}"/>
  1088. <input type="hidden" name="links" value="{key('env-param','links')}"/>
  1089. <input type="hidden" name="attachments" value="{key('env-param','attachments')}"/>
  1090. <input type="hidden" name="recipientsChanged" value="false"/>
  1091. <input type="hidden" name="addingLinks" value="false"/>
  1092. <input type="hidden" name="addAttachment" value=""/>
  1093. <input type="hidden" name="richEditMode" value="{$richEditMode}"/>
  1094. <input type="hidden" name="bccVisible" value="{$bccVisible}"/>
  1095. <input type="hidden" name="visited_email_options" value="true"/>
  1096. <xsl:if test="key('request-param', 'usePowerPlay8Options') = 'true'">
  1097. <input type="hidden" name="usePowerPlay8Options" value="true"/>
  1098. </xsl:if>
  1099. <xsl:if test="key('request-param','burst') = 'true'">
  1100. <input type="hidden" name="m_ro_burst" value="true"/>
  1101. </xsl:if>
  1102. <pf:help context="HID_DISTRIBUTION"/>
  1103. <xsl:choose>
  1104. <xsl:when test="key('request-param','headerStyle')='page'">
  1105. <eut:header close='false' border='false' help='false'>
  1106. <dp:image>
  1107. <img alt="" border="0">
  1108. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>icon_email_24.gif</xsl:attribute>
  1109. </img>
  1110. </dp:image>
  1111. <dp:title>
  1112. <xsl:value-of select="key('business-rules','browserTitle')"/>
  1113. </dp:title>
  1114. <dp:description>
  1115. <xsl:value-of select="key('business-rules','description')"/>
  1116. </dp:description>
  1117. </eut:header>
  1118. </xsl:when>
  1119. <xsl:otherwise>
  1120. <dp:header>
  1121. <dp:title>
  1122. <xsl:value-of select="key('business-rules','browserTitle')"/>
  1123. </dp:title>
  1124. <dp:description>
  1125. <xsl:value-of select="key('business-rules','description')"/>
  1126. </dp:description>
  1127. <dp:close>
  1128. <a href="#" onclick="controller_changeState('canceled'); controller_submitForm('cancel');">
  1129. <dp:closeMarker/>
  1130. </a>
  1131. </dp:close>
  1132. </dp:header>
  1133. </xsl:otherwise>
  1134. </xsl:choose>
  1135. <xsl:if test="$agentStudio">
  1136. <script type="text/javascript" src="{$webRoot}/ags/dragDropHandler.js"/>
  1137. <script type="text/javascript" src="{$webRoot}/ags/layout.js"/>
  1138. <script type="text/javascript" src="{$webRoot}/ags/AccessibilityHandler.js"/>
  1139. </xsl:if>
  1140. <script language="javascript">
  1141. <xsl:choose>
  1142. <xsl:when test="$agentStudio">
  1143. var textRange;
  1144. function init()
  1145. {
  1146. droppy.registerDropZone("email_to","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;,true);
  1147. droppy.registerDropZone("email_cc","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;,true);
  1148. droppy.registerDropZone("email_bcc","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;,true);
  1149. droppy.registerDropZone("email_subject","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;,false);
  1150. if (document.<xsl:value-of select="key('request-param','formName')"/>.richEditMode.value == 'true')
  1151. {
  1152. richEditControl_init();
  1153. }
  1154. else
  1155. {
  1156. var dropZone = new DropZone("email_body","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;);
  1157. droppy.registerDropZoneObject(dropZone);
  1158. //pass the dropzone as a group to let the listener process swaps to the html body
  1159. droppy.registerDropZoneGroup(new Array(dropZone), &quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;);
  1160. }
  1161. }
  1162. function deleteLinksAndAttachments()
  1163. {
  1164. var foundSelectedItems = false;
  1165. <xsl:variable name="linksCount" select="count(/root/*[local-name()='links']/*[local-name()='item'])+1"/>
  1166. frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1167. for (var i=1; i&lt;<xsl:value-of select="$linksCount"/>; i++)
  1168. {
  1169. tableName = 'linkTable_' + i;
  1170. table = document.getElementById(tableName);
  1171. if (table &amp;&amp; table.className == 'emailItem_active')
  1172. {
  1173. table.className = 'hidden';
  1174. hiddenInputName = 'deleted_link_' + i;
  1175. document.getElementById(hiddenInputName).value = 'true';
  1176. foundSelectedItems = true;
  1177. }
  1178. }
  1179. <xsl:variable name="attachmentCount" select="count(/root/*[local-name()='attachments']/*[local-name()='item'])+1"/>
  1180. for (var i=1; i&lt;<xsl:value-of select="$attachmentCount"/>; i++)
  1181. {
  1182. tableName = 'attachTable_' + i;
  1183. table = document.getElementById(tableName);
  1184. if (table &amp;&amp; table.className == 'emailItem_active')
  1185. {
  1186. table.className = 'hidden';
  1187. hiddenInputName = 'deleted_attachment_' + i;
  1188. document.getElementById(hiddenInputName).value = 'true';
  1189. foundSelectedItems = true;
  1190. }
  1191. }
  1192. return foundSelectedItems;
  1193. }
  1194. function mouseOverLinkAttach(item)
  1195. {
  1196. if (item.className == 'emailItem')
  1197. {
  1198. item.className = 'emailItem_hover';
  1199. }
  1200. }
  1201. function mouseOutLinkAttach(item)
  1202. {
  1203. if (item.className == 'emailItem_hover')
  1204. {
  1205. item.className = 'emailItem';
  1206. }
  1207. }
  1208. function mouseDownLinkAttach(item)
  1209. {
  1210. if (item.className == 'emailItem_active')
  1211. {
  1212. item.className = 'emailItem';
  1213. }
  1214. else if (item.className == 'emailItem' || item.className == 'emailItem_hover')
  1215. {
  1216. item.className = 'emailItem_active';
  1217. }
  1218. }
  1219. function attach(position)
  1220. {
  1221. if (document.<xsl:value-of select="key('request-param','formName')"/>.addAttachment) {
  1222. document.<xsl:value-of select="key('request-param','formName')"/>.addAttachment.value = position;
  1223. }
  1224. controller_submitForm('default');
  1225. }
  1226. </xsl:when>
  1227. <xsl:otherwise>
  1228. function init()
  1229. {
  1230. if (document.<xsl:value-of select="key('request-param','formName')"/>.richEditMode.value == 'true') {
  1231. richEditControl_init();
  1232. }
  1233. if (document.<xsl:value-of select="key('request-param','formName')"/>.controller_state)
  1234. {
  1235. document.<xsl:value-of select="key('request-param','formName')"/>.controller_state.value = '<xsl:value-of select="xtsext:javascriptencode(key('env-param','controller_state'))"/>';
  1236. }
  1237. if (document.getElementById("email_to"))
  1238. {
  1239. document.getElementById("email_to").focus();
  1240. }
  1241. }
  1242. </xsl:otherwise>
  1243. </xsl:choose>
  1244. function changedEmailRecipients()
  1245. {
  1246. <!-- update the changed flag so we know that we should regenerate the added entries blob -->
  1247. document.<xsl:value-of select="key('request-param','formName')"/>.recipientsChanged.value = 'true';
  1248. }
  1249. function validate()
  1250. {
  1251. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1252. <xsl:if test="key('request-param','burst')!='true'">
  1253. if ( frm.email_to.value == '' &amp;&amp; frm.email_cc.value == '' &amp;&amp; frm.email_bcc.value == '')
  1254. {
  1255. alert("<xts:string id="IDS_EMAIL_OPTIONS_NO_RECIPIENTS" encode="javascript"/>");
  1256. return false;
  1257. }
  1258. </xsl:if>
  1259. leavingDialog();
  1260. return true;
  1261. }
  1262. <!-- makes sure all the hidden inputs are properlly set before leavingt the
  1263. email options dialog -->
  1264. function leavingDialog()
  1265. {
  1266. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1267. <!-- we need to get the plain text body since the memopart needs both the html and plain text body -->
  1268. if (frm.richEditMode &amp;&amp; frm.richEditMode.value == 'true')
  1269. {
  1270. frm.email_body.value = email_body_iframe.document.body.innerText;
  1271. if (frm.hidden_richEditBody)
  1272. {
  1273. // copy the contents of the edit window into a form field
  1274. frm.hidden_richEditBody.value = richEditControl_convertToXHTML();
  1275. }
  1276. }
  1277. <!-- we're in plain text mode, so make sure the hidden HTML input gets updated -->
  1278. else
  1279. {
  1280. if (frm.hidden_richEditBody)
  1281. {
  1282. frm.hidden_richEditBody.value = replaceCarriageReturns(htmlEncode(frm.email_body.value),'&lt;br/&gt;');
  1283. }
  1284. }
  1285. }
  1286. function setFormTarget()
  1287. {
  1288. <xsl:choose>
  1289. <xsl:when test="key('request-param','addEntriesPopUp')='true' and key('request-param','addEntriesPopUpTarget')!=''">
  1290. document.<xsl:value-of select="key('request-param','formName')"/>.target = '<xsl:value-of select="key('request-param','addEntriesPopUpTarget')"/>';
  1291. </xsl:when>
  1292. <xsl:when test="key('request-param','addEntriesPopUp')='true'">
  1293. document.<xsl:value-of select="key('request-param','formName')"/>.target = 'addEntriesFrame';
  1294. </xsl:when>
  1295. </xsl:choose>
  1296. return;
  1297. }
  1298. function unsetFormTarget()
  1299. {
  1300. <xsl:if test="key('request-param','addEntriesPopUp')='true'">
  1301. document.<xsl:value-of select="key('request-param','formName')"/>.target = '';
  1302. </xsl:if>
  1303. return;
  1304. }
  1305. <!-- convert less than and greater than to text references -->
  1306. function htmlEncode(string)
  1307. {
  1308. var returnString = string.replace(/&amp;/g, "&amp;amp;");
  1309. returnString = returnString.replace(/&quot;/g, "&amp;quot;");
  1310. returnString = returnString.replace(/&lt;/g, "&amp;lt;");
  1311. returnString = returnString.replace(/&gt;/g, "&amp;gt;");
  1312. return returnString;
  1313. }
  1314. <!-- used to replace linefeeds to </br> for the html version of the body -->
  1315. function replaceCarriageReturns(string, replaceWith)
  1316. {
  1317. <!-- encode textarea string's carriage returns -->
  1318. string = escape(string);
  1319. <!--loop through string, replacing carriage return encoding with HTML break tag-->
  1320. for(i=0; i&lt;string.length; i++)
  1321. {
  1322. if(string.indexOf("%0D%0A") > -1)
  1323. {
  1324. <!-- Windows encodes returns as \r\n hex-->
  1325. string=string.replace("%0D%0A",replaceWith);
  1326. }
  1327. else if(string.indexOf("%0A") > -1)
  1328. {
  1329. <!-- Unix encodes returns as \n hex-->
  1330. string=string.replace("%0A",replaceWith);
  1331. }
  1332. else if(string.indexOf("%0D") > -1)
  1333. {
  1334. <!-- Macintosh encodes returns as \r hex -->
  1335. string=string.replace("%0D",replaceWith);
  1336. }
  1337. }
  1338. string=unescape(string) <!-- unescape all other encoded characters -->
  1339. return string;
  1340. }
  1341. function changeModes()
  1342. {
  1343. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1344. if (frm.richEditMode.value == 'true')
  1345. {
  1346. frm.email_body.value = email_body_iframe.document.body.innerText;
  1347. frm.richEditMode.value = 'false';
  1348. }
  1349. else
  1350. {
  1351. frm.richEditMode.value = 'true';
  1352. }
  1353. controller_submitForm('default');
  1354. }
  1355. function initInsertTable()
  1356. {
  1357. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1358. frm.richEditControl_tableColumns.value = '2';
  1359. frm.richEditControl_tableRows.value = '2';
  1360. email_body_iframe.focus();
  1361. textRange = email_body_iframe.document.selection.createRange();
  1362. }
  1363. function insertTableIntoBody()
  1364. {
  1365. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1366. <xsl:variable name="maxColumns">
  1367. <xsl:choose>
  1368. <xsl:when test="/root/system/param[@name='max-table-columns']!=''">
  1369. <xsl:value-of select="/root/system/param[@name='max-table-columns']"/>
  1370. </xsl:when>
  1371. <xsl:otherwise>20</xsl:otherwise>
  1372. </xsl:choose>
  1373. </xsl:variable>
  1374. <xsl:variable name="maxRows">
  1375. <xsl:choose>
  1376. <xsl:when test="/root/system/param[@name='max-table-rows']!=''">
  1377. <xsl:value-of select="/root/system/param[@name='max-table-rows']"/>
  1378. </xsl:when>
  1379. <xsl:otherwise>100</xsl:otherwise>
  1380. </xsl:choose>
  1381. </xsl:variable>
  1382. <!-- make sure the number of rows and columns are valid integers
  1383. and do not exceed the maximum. Default for maximum is 20 columns and 100 rows, but
  1384. can be changed via system.xml -->
  1385. if (!validate_positiveIntegerProp(frm.richEditControl_tableColumns, <xsl:value-of select="$maxColumns"/>))
  1386. {
  1387. var errorMsg = "<xts:string id="IDS_EMAIL_OPTIONS_MIN_MAX_COLUMNS" encode="javascript"><xts:param name="max">" + (<xsl:value-of select="$maxColumns"/>) + "</xts:param></xts:string>";
  1388. window.alert(errorMsg);
  1389. frm.richEditControl_tableColumns.focus();
  1390. return;
  1391. }
  1392. if (!validate_positiveIntegerProp(frm.richEditControl_tableRows, <xsl:value-of select="$maxRows"/>))
  1393. {
  1394. var errorMsg = "<xts:string id="IDS_EMAIL_OPTIONS_MIN_MAX_ROWS" encode="javascript"><xts:param name="max">" + (<xsl:value-of select="$maxRows"/>) + "</xts:param></xts:string>";
  1395. window.alert(errorMsg);
  1396. frm.richEditControl_tableRows.focus();
  1397. return;
  1398. }
  1399. insertTablePopup.hide();
  1400. richEditControl_doTable();
  1401. }
  1402. <!-- required when user enters bad data and clicks off dialog leaving it hidden but active.
  1403. we don't want to reset a good entry back to defaults (bug 555470.1) -->
  1404. function validateHideTable()
  1405. {
  1406. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1407. if (!validate_positiveIntegerProp(frm.richEditControl_tableColumns, <xsl:value-of select="$maxColumns"/>))
  1408. {
  1409. return;
  1410. }
  1411. if (!validate_positiveIntegerProp(frm.richEditControl_tableRows, <xsl:value-of select="$maxRows"/>))
  1412. {
  1413. return;
  1414. }
  1415. return true;
  1416. }
  1417. function cancelCreateTable()
  1418. {
  1419. frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1420. <!-- need to reset the columns and rows or we might get a CAF error (bug 477423) -->
  1421. frm.richEditControl_tableColumns.value = '2';
  1422. frm.richEditControl_tableRows.value = '2';
  1423. }
  1424. <!-- Make sure the number of columns or rows is a positive integer (1,2,...) -->
  1425. function validate_positiveIntegerProp(e, max)
  1426. {
  1427. if (e.value &gt; max || e.value &lt; 1 || isNaN(e.value) || parseInt(e.value, 10) != e.value)
  1428. {
  1429. return false;
  1430. }
  1431. e.value = parseInt(e.value, 10);
  1432. return true;
  1433. }
  1434. <!--
  1435. - handles showing/hidding the bcc text field
  1436. - we have spans behind the bold, italic and underline since we use letters
  1437. instead of icons for localization. Make sure we move the span when we're showing/hidding
  1438. the bcc field
  1439. -->
  1440. function swapBccVisible()
  1441. {
  1442. if (document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value == 'false')
  1443. {
  1444. <!-- change the link text -->
  1445. document.getElementById('showHideAnchor').innerHTML = '<xts:string id="IDS_EMAIL_HIDE_BCC" encode="javascript"/>';
  1446. showDynamicDiv('emailBccDiv');
  1447. document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value = 'true';
  1448. <xsl:if test="$richEditMode = 'true'">
  1449. moveRichEditSpans(document.getElementById('bccEmailFieldTable').clientHeight);
  1450. </xsl:if>
  1451. }
  1452. else
  1453. {
  1454. <!-- change the link text -->
  1455. document.getElementById('showHideAnchor').innerHTML = '<xts:string id="IDS_EMAIL_SHOW_BCC" encode="javascript"/>';
  1456. hideDynamicDiv('emailBccDiv');
  1457. document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value = 'false';
  1458. <xsl:if test="$richEditMode = 'true'">
  1459. moveRichEditSpans(document.getElementById('bccEmailFieldTable').clientHeight * -1);
  1460. </xsl:if>
  1461. }
  1462. }
  1463. </script>
  1464. <!-- add a hidden iframe if we must show the added recipients in a popup -->
  1465. <xsl:if test="key('request-param','addEntriesPopUp')='true'">
  1466. <script language="javascript">
  1467. function show_div(div)
  1468. {
  1469. modalDiv = document.getElementById(div);
  1470. modalDiv.style.display = "block";
  1471. modalDiv.style.height = "100%";
  1472. modalDiv.style.width = "100%";
  1473. modalDiv.style.left = 0;
  1474. modalDiv.style.top = 0;
  1475. }
  1476. function show_iFrame(iframe)
  1477. {
  1478. iFrameAddEntries = document.getElementById(iframe);
  1479. iFrameAddEntries.style.display = "block";
  1480. iFrameAddEntries.style.height = "70%";
  1481. iFrameAddEntries.style.width = "85%";
  1482. iFrameAddEntries.style.border = "1px solid";
  1483. if ((document.body.clientWidth - iFrameAddEntries.scrollWidth) &lt; 0)
  1484. {
  1485. iFrameAddEntries.style.left = 0;
  1486. }
  1487. else
  1488. {
  1489. iFrameAddEntries.style.left = ((document.body.clientWidth - iFrameAddEntries.scrollWidth) / 2) + document.body.scrollLeft;
  1490. }
  1491. }
  1492. </script>
  1493. <div id="makeModalDiv" style="z-index:49; display:none; position: absolute;">
  1494. <table width="100%" height="100%">
  1495. <tr>
  1496. <td/>
  1497. </tr>
  1498. </table>
  1499. </div>
  1500. <iframe width="0" height="0" id="addEntriesFrame" src="../common/blank.html" name="addEntriesFrame" frameborder="0" style="display:none; z-index:50; display:block; position: absolute;"></iframe>
  1501. </xsl:if>
  1502. <!-- generate table popup -->
  1503. <xsl:if test="$richEditMode = 'true'">
  1504. <!-- Set the search options dialog wrap it in a div so it doesn't expand the td we're in -->
  1505. <div>
  1506. <cp:genericDialog id="insertTablePopup" interactive="true" align="left" width="300" positionVertical="true" positionHorizontal="true" closeOnClick="cancelCreateTable();">
  1507. <cp:param name="title"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_TABLE_TITLE"/></cp:param>
  1508. <cp:param name="body">
  1509. <lyt:layout style="1">
  1510. <lyt:section>
  1511. <dp:list>
  1512. <dp:section>
  1513. <dp:label><label for="richEditControl_tableColumns"><xts:string id="IDS_EMAIL_OPTIONS_NUMBER_OF_COLUMNS"/></label></dp:label>
  1514. </dp:section>
  1515. <dp:section>
  1516. <!-- column default is always 2 -->
  1517. <input type="text" id="richEditControl_tableColumns" name="richEditControl_tableColumns" value="2" size="2"/>
  1518. </dp:section>
  1519. </dp:list>
  1520. </lyt:section>
  1521. <lyt:section>
  1522. <dp:list>
  1523. <dp:section>
  1524. <dp:label><label for="richEditControl_tableRows"><xts:string id="IDS_EMAIL_OPTIONS_NUMBER_OF_ROWS"/></label></dp:label>
  1525. </dp:section>
  1526. <dp:section>
  1527. <!-- rows default is always 2 -->
  1528. <input type="text" id="richEditControl_tableRows" name="richEditControl_tableRows" value="2" size="2"/>
  1529. </dp:section>
  1530. <dp:section>
  1531. <img height="15" width="5" src="{$webcontent}/images/space.gif" alt=""/>
  1532. </dp:section>
  1533. </dp:list>
  1534. </lyt:section>
  1535. </lyt:layout>
  1536. </cp:param>
  1537. <cp:param name="footer">
  1538. <dp:simpleFooter>
  1539. <df:button df:id="IDS_OK" df:style="href" df:href="javascript:insertTableIntoBody();"/>
  1540. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:cancelCreateTable();javascript:insertTablePopup.hide();"/>
  1541. </dp:simpleFooter>
  1542. </cp:param>
  1543. </cp:genericDialog>
  1544. </div>
  1545. </xsl:if>
  1546. <lyt:layout style="2">
  1547. <lyt:section>
  1548. <xsl:variable name="inputSize">
  1549. <xsl:choose>
  1550. <xsl:when test="$agentStudio">50</xsl:when>
  1551. <xsl:otherwise>55</xsl:otherwise>
  1552. </xsl:choose>
  1553. </xsl:variable>
  1554. <xsl:if test="key('request-param','burst')!='true'">
  1555. <!-- need to put the email to, cc, bcc and links in one table
  1556. to get the links to right align properly -->
  1557. <table border="0" cellspacing="0" cellpadding="0">
  1558. <tr>
  1559. <td>
  1560. <!-- email to -->
  1561. <dp:list>
  1562. <dp:section>
  1563. <dp:label><label for="email_to"><xts:string id="IDS_EMAIL_OPTIONS_TO"/></label></dp:label>
  1564. </dp:section>
  1565. </dp:list>
  1566. <!--display the "To" value as readonly text when part of a subscription -->
  1567. <xsl:if test="$subscription">
  1568. <table border="0" cellspacing="0" cellpadding="1">
  1569. <tr>
  1570. <td nowrap="nowrap">
  1571. <dp:list>
  1572. <dp:section>
  1573. <xsl:value-of select="key('env-param','email_to')"/>
  1574. </dp:section>
  1575. </dp:list>
  1576. </td>
  1577. </tr>
  1578. </table>
  1579. </xsl:if>
  1580. <table border="0" cellspacing="0" cellpadding="1">
  1581. <tr>
  1582. <xsl:if test="$agentStudio and not($hideInsertButton)">
  1583. <td valign="top" nowrap="nowrap">
  1584. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  1585. <tr valign="top">
  1586. <dp:columnButton>
  1587. <img align="middle" height="18" name="insert_to" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_to');">
  1588. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  1589. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  1590. </img>
  1591. </dp:columnButton>
  1592. </tr>
  1593. </table>
  1594. </td>
  1595. <td nowrap="nowrap">
  1596. <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
  1597. </td>
  1598. </xsl:if>
  1599. <td nowrap="nowrap">
  1600. <input name="email_to" id="email_to" size="{$inputSize}" onchange="changedEmailRecipients();">
  1601. <!-- make the input hidden if part of a subscription -->
  1602. <xsl:attribute name="type">
  1603. <xsl:choose>
  1604. <xsl:when test="$subscription">
  1605. <xsl:text>hidden</xsl:text>
  1606. </xsl:when>
  1607. <xsl:otherwise>
  1608. <xsl:text>text</xsl:text>
  1609. </xsl:otherwise>
  1610. </xsl:choose>
  1611. </xsl:attribute>
  1612. <xsl:attribute name="value">
  1613. <xsl:value-of select="key('env-param','email_to')"/>
  1614. </xsl:attribute>
  1615. </input>
  1616. </td>
  1617. </tr>
  1618. </table>
  1619. <!-- do not show the CC or BCC section if part of a subscription -->
  1620. <xsl:if test="not($subscription)">
  1621. <!-- email cc -->
  1622. <dp:list>
  1623. <dp:section>
  1624. <dp:label><label for="email_cc"><xts:string id="IDS_EMAIL_OPTIONS_CC"/></label></dp:label>
  1625. </dp:section>
  1626. </dp:list>
  1627. <table border="0" cellspacing="0" cellpadding="1">
  1628. <tr>
  1629. <xsl:if test="$agentStudio and not($hideInsertButton)">
  1630. <td valign="top" nowrap="nowrap">
  1631. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  1632. <tr valign="top">
  1633. <dp:columnButton>
  1634. <img align="middle" height="18" name="insert_cc" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_cc');">
  1635. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  1636. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  1637. </img>
  1638. </dp:columnButton>
  1639. </tr>
  1640. </table>
  1641. </td>
  1642. <td nowrap="nowrap">
  1643. <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
  1644. </td>
  1645. </xsl:if>
  1646. <td nowrap="nowrap">
  1647. <input type="text" name="email_cc" id="email_cc" size="{$inputSize}" onchange="changedEmailRecipients();">
  1648. <xsl:attribute name="value">
  1649. <xsl:value-of select="key('env-param','email_cc')"/>
  1650. </xsl:attribute>
  1651. </input>
  1652. </td>
  1653. </tr>
  1654. </table>
  1655. <!-- email bcc -->
  1656. <cf:dynamicDiv name="emailBccDiv" runTimeVisibleCheck="$bccVisible = 'true'">
  1657. <!-- need to put all this in one table since we need the height of table for
  1658. calculations when hiding/showing the bcc field -->
  1659. <table id="bccEmailFieldTable" border="0" cellspacing="0" cellpadding="1">
  1660. <tr>
  1661. <td>
  1662. <xsl:if test="$agentStudio">
  1663. <xsl:attribute name="colspan">3</xsl:attribute>
  1664. </xsl:if>
  1665. <dp:list>
  1666. <dp:section>
  1667. <dp:label><label for="email_bcc"><xts:string id="IDS_EMAIL_OPTIONS_BCC"/></label></dp:label>
  1668. </dp:section>
  1669. </dp:list>
  1670. </td>
  1671. </tr>
  1672. <tr>
  1673. <xsl:if test="$agentStudio and not($hideInsertButton)">
  1674. <td valign="top" nowrap="nowrap">
  1675. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  1676. <tr valign="top">
  1677. <dp:columnButton>
  1678. <img align="middle" height="18" name="insert_bcc" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_bcc');">
  1679. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  1680. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  1681. </img>
  1682. </dp:columnButton>
  1683. </tr>
  1684. </table>
  1685. </td>
  1686. <td nowrap="nowrap">
  1687. <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
  1688. </td>
  1689. </xsl:if>
  1690. <td nowrap="nowrap">
  1691. <input type="text" name="email_bcc" id="email_bcc" size="{$inputSize}" onchange="changedEmailRecipients();">
  1692. <xsl:attribute name="value">
  1693. <xsl:value-of select="key('env-param','email_bcc')"/>
  1694. </xsl:attribute>
  1695. </input>
  1696. </td>
  1697. </tr>
  1698. </table>
  1699. </cf:dynamicDiv>
  1700. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  1701. <tr align="right" class="formLink">
  1702. <td nowrap="nowrap" align="right">
  1703. <!-- select recipients -->
  1704. <dp:link align="right">
  1705. <a href="#" onclick="setFormTarget(); controller_doSubmit('addEntries', 'navigate', 'stack-up'); unsetFormTarget();">
  1706. <xts:string id="IDS_EMAIL_OPTIONS_SELECT_RECIPIENTS"/>
  1707. </a>
  1708. </dp:link>
  1709. &#160;&#160;
  1710. <!-- show/hide Bcc -->
  1711. <dp:link align="right">
  1712. <a id="showHideAnchor" href="#" onclick="swapBccVisible()">
  1713. <xsl:choose>
  1714. <xsl:when test="$bccVisible='true'"><xts:string id="IDS_EMAIL_HIDE_BCC"/></xsl:when>
  1715. <xsl:otherwise><xts:string id="IDS_EMAIL_SHOW_BCC"/></xsl:otherwise>
  1716. </xsl:choose>
  1717. </a>
  1718. </dp:link>
  1719. </td>
  1720. </tr>
  1721. </table>
  1722. </xsl:if>
  1723. </td>
  1724. </tr>
  1725. </table>
  1726. </xsl:if>
  1727. </lyt:section>
  1728. <!-- task name -->
  1729. <lyt:section>
  1730. <xsl:if test="$agentStudio">
  1731. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  1732. </xsl:if>
  1733. </lyt:section>
  1734. </lyt:layout>
  1735. <lyt:layout style="1">
  1736. <lyt:section>
  1737. <xsl:variable name="controlsWidth">
  1738. <xsl:choose>
  1739. <xsl:when test="$agentStudio">650</xsl:when>
  1740. <xsl:otherwise>680</xsl:otherwise>
  1741. </xsl:choose>
  1742. </xsl:variable>
  1743. <!-- subject -->
  1744. <dp:list>
  1745. <dp:section>
  1746. <dp:label><label for="email_subject"><xts:string id="IDS_EMAIL_OPTIONS_SUBJECT"/></label></dp:label>
  1747. </dp:section>
  1748. </dp:list>
  1749. <table border="0" cellspacing="0" cellpadding="1">
  1750. <tr>
  1751. <xsl:if test="$agentStudio and not($hideInsertButton)">
  1752. <td valign="top" nowrap="nowrap">
  1753. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  1754. <tr valign="top">
  1755. <dp:columnButton>
  1756. <img align="middle" height="18" name="insert_subject" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_subject');">
  1757. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  1758. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  1759. </img>
  1760. </dp:columnButton>
  1761. </tr>
  1762. </table>
  1763. </td>
  1764. <td nowrap="nowrap">
  1765. <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
  1766. </td>
  1767. </xsl:if>
  1768. <td nowrap="nowrap">
  1769. <input type="text" name="email_subject" id="email_subject" style="width:{$controlsWidth}px">
  1770. <xsl:attribute name="value">
  1771. <xsl:value-of select="key('env-param','email_subject')"/>
  1772. </xsl:attribute>
  1773. </input>
  1774. </td>
  1775. </tr>
  1776. <tr>
  1777. <td nowrap="nowrap">
  1778. <img height="5" width="1" src="{$webcontent}/images/space.gif" alt=""/>
  1779. </td>
  1780. </tr>
  1781. </table>
  1782. <!-- body -->
  1783. <table border="0" cellspacing="0" cellpadding="0">
  1784. <!-- in agent studio we have to take into account the add selected items button -->
  1785. <xsl:attribute name="style">
  1786. <xsl:choose>
  1787. <xsl:when test="$agentStudio">width:<xsl:value-of select="$controlsWidth + 30"/>px</xsl:when>
  1788. <xsl:otherwise>width:<xsl:value-of select="$controlsWidth"/>px</xsl:otherwise>
  1789. </xsl:choose>
  1790. </xsl:attribute>
  1791. <tr>
  1792. <td style="white-space:nowrap;" class="formLabel" valign="bottom"><label for="email_body"><xts:string id="IDS_EMAIL_OPTIONS_BODY"/></label></td>
  1793. <xsl:if test="$browser = 'ie'">
  1794. <xsl:choose>
  1795. <xsl:when test="$richEditMode = 'true'">
  1796. <td width="100%" align="right" class="formLink" nowrap="nowrap" valign="bottom">
  1797. <a href="#" onclick="javascript:changeModes();"><xts:string id="IDS_EMAIL_OPTIONS_PLAIN_TEXT"/></a>
  1798. </td>
  1799. <td valign="bottom" nowrap="nowrap">
  1800. <img height="5" width="3" src="{$webcontent}/images/space.gif" alt=""/>
  1801. <img src="{$skin_images}prompt_option_to_right.gif" alt=""/>
  1802. <img height="5" width="10" src="{$webcontent}/images/space.gif" alt=""/>
  1803. </td>
  1804. </xsl:when>
  1805. <xsl:otherwise>
  1806. <td width="100%" align="right" valign="bottom">
  1807. <img src="{$skin_images}prompt_option_to_left.gif" alt=""/>
  1808. <img height="5" width="3" src="{$webcontent}/images/space.gif" alt=""/>
  1809. </td>
  1810. <td class="formLink" nowrap="nowrap" valign="bottom">
  1811. <a href="#" onclick="javascript:changeModes();"><xts:string id="IDS_EMAIL_OPTIONS_HTML_TEXT"/></a>
  1812. </td>
  1813. </xsl:otherwise>
  1814. </xsl:choose>
  1815. <xsl:if test="$richEditMode = 'true'">
  1816. <xsl:call-template name="richEditControls"/>
  1817. </xsl:if>
  1818. </xsl:if>
  1819. </tr>
  1820. <tr>
  1821. <td>
  1822. <img height="3" width="1" src="{$webcontent}/images/space.gif" alt=""/>
  1823. </td>
  1824. </tr>
  1825. </table>
  1826. <table border="0" cellspacing="0" cellpadding="1">
  1827. <xsl:choose>
  1828. <xsl:when test="$agentStudio">
  1829. <tr>
  1830. <xsl:if test="not($hideInsertButton)">
  1831. <td valign="top" nowrap="nowrap">
  1832. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  1833. <tr valign="top">
  1834. <dp:columnButton>
  1835. <img align="middle" height="18" name="insert_body">
  1836. <xsl:attribute name="onclick">
  1837. <xsl:choose>
  1838. <xsl:when test="$richEditMode = 'true'">javascript:parent.dropFrame=window.name;parent.insertStartMC('editbody');</xsl:when>
  1839. <xsl:otherwise>javascript:parent.dropFrame=window.name;parent.insertStartMC('email_body');</xsl:otherwise>
  1840. </xsl:choose>
  1841. </xsl:attribute>
  1842. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  1843. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  1844. </img>
  1845. </dp:columnButton>
  1846. </tr>
  1847. </table>
  1848. </td>
  1849. <td nowrap="nowrap">
  1850. <img width="3" src="{$webcontent}/images/space.gif" alt=""></img>
  1851. </td>
  1852. </xsl:if>
  1853. <td nowrap="nowrap">
  1854. <table cellspacing="0" cellpadding="0" border="0" width="{$controlsWidth}">
  1855. <tr>
  1856. <!-- body -->
  1857. <td class="emailBodyTableRow">
  1858. <xsl:call-template name="emailBody">
  1859. <xsl:with-param name="inputSize">
  1860. <xsl:value-of select="$controlsWidth"/>
  1861. </xsl:with-param>
  1862. <xsl:with-param name="richEditMode" select="$richEditMode"/>
  1863. </xsl:call-template>
  1864. </td>
  1865. </tr>
  1866. <xsl:if test="/root/*[local-name()='links']/*[local-name()='item']">
  1867. <tr>
  1868. <!-- links -->
  1869. <td class="emailLinksAttachmentTableRow" width="100%">
  1870. <xsl:for-each select="/root/*[local-name()='links']/*[local-name()='item']">
  1871. <input type="hidden" name="deleted_link_{position()}" value=""/>
  1872. <table id="linkTable_{position()}" class="emailItem" height="20" cellspacing="2" cellpadding="2" border="0" style="text-decoration: underline;float:left;clear:none;cursor:pointer;cursor:hand;position:relative;" onmousedown="mouseDownLinkAttach(this)" onmouseover="mouseOverLinkAttach(this)" onmouseout="mouseOutLinkAttach(this)">
  1873. <tr>
  1874. <td valign="middle" align="center">
  1875. <xsl:call-template name="gen-icon">
  1876. <xsl:with-param name="showAction" select="false()"/>
  1877. <xsl:with-param name="class" select="*[local-name()='objectClass']"/>
  1878. </xsl:call-template>
  1879. </td>
  1880. <td valign="middle" align="center" class="formText" nowrap="nowrap">
  1881. <xsl:value-of select="*[local-name()='displayName']"/>
  1882. </td>
  1883. </tr>
  1884. </table>
  1885. </xsl:for-each>
  1886. </td>
  1887. </tr>
  1888. </xsl:if>
  1889. <xsl:if test="/root/*[local-name()='attachments']/*[local-name()='item']">
  1890. <tr>
  1891. <!-- attachments -->
  1892. <td class="emailLinksAttachmentTableRow" width="100%">
  1893. <xsl:for-each select="/root/*[local-name()='attachments']/*[local-name()='item']">
  1894. <input type="hidden" name="deleted_attachment_{position()}" value=""/>
  1895. <xsl:variable name="format">
  1896. <xsl:choose>
  1897. <xsl:when test="not(normalize-space(*[local-name()='format']))">
  1898. <xsl:value-of select="/root/user/param[@name='format']"/>
  1899. </xsl:when>
  1900. <xsl:otherwise>
  1901. <xsl:value-of select="*[local-name()='format']"/>
  1902. </xsl:otherwise>
  1903. </xsl:choose>
  1904. </xsl:variable>
  1905. <xsl:variable name="locale">
  1906. <xsl:choose>
  1907. <xsl:when test="not(normalize-space(*[local-name()='locale']))">
  1908. <xsl:value-of select="/root/user/param[@name='contentLocale']"/>
  1909. </xsl:when>
  1910. <xsl:otherwise>
  1911. <xsl:value-of select="*[local-name()='locale']"/>
  1912. </xsl:otherwise>
  1913. </xsl:choose>
  1914. </xsl:variable>
  1915. <table id="attachTable_{position()}" border="0" cellspacing="0" cellpadding="0" class="emailItem" style="text-decoration:none;float:left;clear:none;cursor:pointer;cursor:hand;position:relative;" onmousedown="mouseDownLinkAttach(this)" onmouseover="mouseOverLinkAttach(this)" onmouseout="mouseOutLinkAttach(this)" width="40" title="{*[local-name()='defaultName']}">
  1916. <tr>
  1917. <td align="center">
  1918. <img>
  1919. <xsl:attribute name="src">
  1920. <xsl:choose>
  1921. <!-- use the HTML icon for the event list -->
  1922. <xsl:when test="*[local-name()='searchPath']='eventOutput'">
  1923. <xsl:value-of select="concat($image_root,'icon_result_html_32.gif')"/>
  1924. </xsl:when>
  1925. <xsl:otherwise>
  1926. <xsl:choose>
  1927. <xsl:when test="$format = 'singleXLS'">
  1928. <xsl:value-of select="concat($image_root,'icon_result_excel_single_32.gif')"/>
  1929. </xsl:when>
  1930. <xsl:when test="$format= 'XLS'">
  1931. <xsl:value-of select="concat($image_root,'icon_result_excel_32.gif')"/>
  1932. </xsl:when>
  1933. <xsl:when test="$format = 'XLWA'">
  1934. <xsl:value-of select="concat($image_root,'icon_result_excel_web_arch_32.gif')"/>
  1935. </xsl:when>
  1936. <xsl:when test="$format = 'spreadsheetML'">
  1937. <xsl:value-of select="concat($image_root,'icon_result_excel_2007_32.gif')"/>
  1938. </xsl:when>
  1939. <xsl:when test="$format = 'xlsxData'">
  1940. <xsl:value-of select="concat($image_root,'icon_result_xlsxdata_32.gif')"/>
  1941. </xsl:when>
  1942. <xsl:otherwise>
  1943. <!-- need to convert the format to lowercase for linux -->
  1944. <xsl:variable name="convertedFormat">
  1945. <xsl:value-of select="translate( $format, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' )"/>
  1946. </xsl:variable>
  1947. <xsl:value-of select="concat($image_root,'icon_result_', $convertedFormat,'_32.gif')"/>
  1948. </xsl:otherwise>
  1949. </xsl:choose>
  1950. </xsl:otherwise>
  1951. </xsl:choose>
  1952. </xsl:attribute>
  1953. </img>
  1954. </td>
  1955. </tr>
  1956. <tr>
  1957. <td nowrap="nowrap" align="center" class="formText"><xsl:value-of select="*[local-name()='attachmentName']"/></td>
  1958. </tr>
  1959. <tr>
  1960. <td nowrap="nowrap" align="center" class="formText">
  1961. <xsl:choose>
  1962. <xsl:when test="$format !='' and $locale!=''">
  1963. <xts:string id="IDS_EMAIL_OPTIONS_FORMAT_LOCALE">
  1964. <xts:param name="format"><xsl:value-of select="$format"/></xts:param>
  1965. <xts:param name="locale"><xsl:value-of select="$locale"/></xts:param>
  1966. </xts:string>
  1967. </xsl:when>
  1968. <xsl:otherwise>&#160;</xsl:otherwise>
  1969. </xsl:choose>
  1970. </td>
  1971. </tr>
  1972. </table>
  1973. </xsl:for-each>
  1974. </td>
  1975. </tr>
  1976. </xsl:if>
  1977. <!-- attachment and link links -->
  1978. <tr>
  1979. <td>
  1980. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  1981. <tr>
  1982. <td class="formLink" width="100%" align="right">
  1983. <xsl:if test="key('business-rules','allowAttachMenu')='true'">
  1984. <!-- code from agent studio for the flyout -->
  1985. <table border="0" cellpadding="0" cellspacing="0" style="cursor:hand">
  1986. <tr>
  1987. <td id="attachmentDropdown" height="0px" valign="bottom"/>
  1988. <td class="formLink">
  1989. <a href="#" onkeypress="if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
  1990. <xts:string id="IDS_ADDENTRIES_ATTACHMENT_COLUMN"/>
  1991. </a>
  1992. </td>
  1993. <td onkeypress="if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
  1994. <img border="0" title="" src="{$skin_shared_images}dropdown_arrow.gif"/>
  1995. </td>
  1996. </tr>
  1997. </table>
  1998. <script language="Javascript">
  1999. var menuItemStyle = new CUIStyle('menuItem_normal', 'menuItem_hover', '', '', 'task_active');
  2000. var menuStyle = new CUIStyle('menuContainer', '', '', '', '');
  2001. var attachmentMenu = new CMenu('attachmentDropdown1',menuStyle);
  2002. attachmentMenu.setHTMLContainer(document.getElementById('attachmentDropdown'));
  2003. <xsl:for-each select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*">
  2004. <xsl:variable name="menuName">
  2005. <xsl:choose>
  2006. <xsl:when test="local-name()='eventOutput'"><xts:string id="IDS_EMAIL_OPTIONS_ATTACH_EVENT_OUTPUT"/></xsl:when>
  2007. <xsl:otherwise>
  2008. <xts:string id="IDS_EMAIL_OPTIONS_ATTACH_REPORT">
  2009. <xts:param name="obj">
  2010. <xsl:value-of select="*[local-name()='defaultName']"/>
  2011. </xts:param>
  2012. </xts:string>
  2013. </xsl:otherwise>
  2014. </xsl:choose>
  2015. </xsl:variable>
  2016. new CMenuItem(attachmentMenu, &quot;<xsl:value-of select="xtsext:javascriptencode(string($menuName))"/>&quot;,&quot;<xsl:value-of select="xtsext:javascriptencode(concat('task', position()))"/>&quot;,"attach('<xsl:value-of select="position()"/>')", '', menuItemStyle, &quot;<xsl:value-of select="xtsext:javascriptencode(string($menuName))"/>&quot;);
  2017. </xsl:for-each>
  2018. //The call to this is done in the onmouseup event only.
  2019. //We cannot put in the function below. Because the function
  2020. //below can be called by the observer.
  2021. function removeAttachmentMenuListener() {
  2022. document.body.getWndObserver().removeListener(attachmentMenu);
  2023. }
  2024. function showMenu(event) {
  2025. if (attachmentMenu &amp;&amp; attachmentMenu.isVisible()) {
  2026. attachmentMenu.remove();
  2027. if (document.body.getWndObserver &amp;&amp; parent.document.body.getWndObserver) {
  2028. document.body.getWndObserver().removeWhenDone(attachmentMenu);
  2029. }
  2030. } else {
  2031. //Must always be first to be able to delete the marked observer, before it shows it.
  2032. if (document.body.getWndObserver &amp;&amp; parent.document.body.getWndObserver) {
  2033. //Notify parent that mouseup occured.
  2034. parent.document.body.getWndObserver().notify(attachmentMenu,"mouseup");
  2035. document.body.getWndObserver().addListener(attachmentMenu, showMenu, "mouseup");
  2036. }
  2037. attachmentMenu.draw();
  2038. attachmentMenu.show();
  2039. }
  2040. }
  2041. function attachmentMenu_cancelBub(evt)
  2042. {
  2043. //get the event in a cross-browser fashion
  2044. evt = (evt) ? evt : ((event) ? event : null);
  2045. //prevent the click from proceeding to other nodes
  2046. if (typeof evt.cancelBubble != 'undefined')
  2047. {
  2048. evt.cancelBubble = true;
  2049. }
  2050. if (typeof evt.stopPropagation != 'undefined')
  2051. {
  2052. evt.stopPropagation();
  2053. }
  2054. }
  2055. </script>
  2056. </xsl:if>
  2057. </td>
  2058. <td class="formLink" nowrap="nowrap">
  2059. <xsl:if test="key('business-rules','allowAddLinksAction')='true'">
  2060. &#160;&#160;
  2061. <a href="#" onclick="setFormTarget(); document.{key('request-param','formName')}.addingLinks.value='true'; controller_doSubmit('addLinks', 'navigate', 'stack-up'); unsetFormTarget();">
  2062. <xts:string id="IDS_EMAIL_OPTIONS_SELECT_LINKS"/>
  2063. </a>
  2064. </xsl:if>
  2065. </td>
  2066. </tr>
  2067. </table>
  2068. </td>
  2069. </tr>
  2070. </table>
  2071. </td>
  2072. </tr>
  2073. </xsl:when>
  2074. <xsl:otherwise>
  2075. <tr>
  2076. <td>
  2077. <xsl:if test="$richEditMode = 'true'">
  2078. <xsl:attribute name="class">emailBodyTableRow</xsl:attribute>
  2079. </xsl:if>
  2080. <xsl:call-template name="emailBody">
  2081. <xsl:with-param name="inputSize" select="$controlsWidth"/>
  2082. <xsl:with-param name="richEditMode" select="$richEditMode"/>
  2083. </xsl:call-template>
  2084. </td>
  2085. </tr>
  2086. </xsl:otherwise>
  2087. </xsl:choose>
  2088. <tr>
  2089. <td nowrap="nowrap">
  2090. <img height="5" width="1" src="{$webcontent}/images/space.gif" alt=""/>
  2091. </td>
  2092. </tr>
  2093. </table>
  2094. </lyt:section>
  2095. </lyt:layout>
  2096. <xsl:if test="(key('business-rules','allowLinkToReport')='true') or (key('business-rules','allowEmailAsAttachment')='true' or key('env-param','m_ro_emailAsAttachment')='true')">
  2097. <lyt:layout style="1">
  2098. <lyt:section>
  2099. <dp:choice>
  2100. <xsl:if test="key('business-rules','allowLinkToReport')='true'">
  2101. <dp:section1>
  2102. <input type="checkbox" name="m_ro_emailAsURL" id="m_ro_emailAsURL" value="true">
  2103. <xsl:if test="key('env-param','m_ro_emailAsURL')='true'">
  2104. <xsl:attribute name="checked">checked</xsl:attribute>
  2105. </xsl:if>
  2106. </input>
  2107. </dp:section1>
  2108. <dp:section2>
  2109. <label for="m_ro_emailAsURL">
  2110. <xsl:choose>
  2111. <xsl:when test="key('request-param','objectClass')='jobDefinition'">
  2112. <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_LINKS"/>
  2113. </xsl:when>
  2114. <xsl:otherwise>
  2115. <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_LINK"/>
  2116. </xsl:otherwise>
  2117. </xsl:choose>
  2118. </label>
  2119. </dp:section2>
  2120. </xsl:if>
  2121. <xsl:if test="key('business-rules','allowEmailAsAttachment')='true' or key('env-param','m_ro_emailAsAttachment')='true'">
  2122. <dp:section1>
  2123. <input type="checkbox" name="m_ro_emailAsAttachment" id="m_ro_emailAsAttachment" value="true">
  2124. <xsl:if test="key('env-param','m_ro_emailAsAttachment')='true'">
  2125. <xsl:attribute name="checked">checked</xsl:attribute>
  2126. </xsl:if>
  2127. </input>
  2128. </dp:section1>
  2129. <dp:section2>
  2130. <label for="m_ro_emailAsAttachment">
  2131. <xsl:choose>
  2132. <xsl:when test="key('request-param','objectClass')='jobDefinition'">
  2133. <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_OUTPUTS"/>
  2134. </xsl:when>
  2135. <xsl:otherwise>
  2136. <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_OUTPUT"/>
  2137. </xsl:otherwise>
  2138. </xsl:choose>
  2139. </label>
  2140. </dp:section2>
  2141. </xsl:if>
  2142. </dp:choice>
  2143. </lyt:section>
  2144. </lyt:layout>
  2145. </xsl:if>
  2146. <!-- footer -->
  2147. <xsl:choose>
  2148. <xsl:when test="key('request-param','displayButtons') != 'false'">
  2149. <dp:footer>
  2150. <xsl:choose>
  2151. <xsl:when test="key('request-param','inWizard') = 'true'">
  2152. <dlgctrl:wizardButtons validateFunction="validate"/>
  2153. </xsl:when>
  2154. <xsl:otherwise>
  2155. <dlgctrl:okCancelButtons validateFunction="validate"/>
  2156. </xsl:otherwise>
  2157. </xsl:choose>
  2158. </dp:footer>
  2159. </xsl:when>
  2160. <xsl:otherwise>
  2161. <dp:emptyFooter/>
  2162. </xsl:otherwise>
  2163. </xsl:choose>
  2164. <xsl:if test="key('env-param','duplicateEntryAdded') = 'true'">
  2165. <script language="javascript">
  2166. window.alert("<xts:string id="IDS_DUPLICATE_ENTRY" encode="javascript"/>");
  2167. </script>
  2168. </xsl:if>
  2169. <xsl:if test="not(key('env-param','visited_email_options')) and /root/selectedEntries/item/unknown='true'">
  2170. <script language="javascript">
  2171. alert("<xts:string id="IDS_OTHERRUN_EMAIL_WARN_UNKNOWN_RECIPIENT" encode="javascript"/>");
  2172. </script>
  2173. </xsl:if>
  2174. </xts:transform>
  2175. </markup>
  2176. <browserTitle>
  2177. <xsl:if test="key('business-rules','browserTitle') != ''">
  2178. <xts:transform name="XMLEncode">
  2179. <xsl:value-of select="key('business-rules','browserTitle')"/>
  2180. </xts:transform>
  2181. </xsl:if>
  2182. </browserTitle>
  2183. </xsl:element>
  2184. </xos:entityBody>
  2185. </xos:part>
  2186. </xts:append>
  2187. </xts:sequence>
  2188. </xsl:template>
  2189. <xsl:template name="emailBody">
  2190. <xsl:param name="inputSize"/>
  2191. <xsl:param name="richEditMode"/>
  2192. <xsl:choose>
  2193. <xsl:when test="$richEditMode = 'true'">
  2194. <iframe id="email_body_iframe" src="../common/blank.html" frameborder="0" contentEditable="true" onblur="richEditControl_doEditBlur();" marginwidth="2" marginheight="2">
  2195. <!-- for rich edit body we're using the table border and not the textarea border -->
  2196. <xsl:attribute name="style">width:<xsl:value-of select="$inputSize - 6"/>px;height:95px;</xsl:attribute>
  2197. </iframe>
  2198. <input type="hidden" name="hidden_richEditBody" value="{key('env-param','hidden_richEditBody')}"/>
  2199. <input type="hidden" name="email_body" value="{key('env-param','email_body')}"/>
  2200. </xsl:when>
  2201. <xsl:otherwise>
  2202. <textarea rows="6" name="email_body" id="email_body">
  2203. <xsl:attribute name="style">
  2204. <xsl:choose>
  2205. <!-- for agent studio we're using the table border and not the textarea border -->
  2206. <xsl:when test="key('request-param','agentStudio')='true'">
  2207. width:<xsl:value-of select="$inputSize - 6"/>px;
  2208. </xsl:when>
  2209. <xsl:otherwise>
  2210. width:<xsl:value-of select="$inputSize"/>px;
  2211. px;</xsl:otherwise>
  2212. </xsl:choose>
  2213. OVERFLOW:auto; PADDING: 2px;
  2214. <xsl:if test="key('request-param','agentStudio')='true'">BORDER-WIDTH: 0px;</xsl:if>
  2215. </xsl:attribute>
  2216. <xsl:value-of select="key('env-param','email_body')"/>
  2217. </textarea>
  2218. <input type="hidden" name="hidden_richEditBody" value=""/>
  2219. </xsl:otherwise>
  2220. </xsl:choose>
  2221. </xsl:template>
  2222. <xsl:template name="richEditControls">
  2223. <script type="text/javascript">
  2224. // Makes button look sunken when button is clicked
  2225. function richEditControl_buttonDown()
  2226. {
  2227. if (window.event.srcElement.className == 'toolbarImagePressed')
  2228. {
  2229. window.event.srcElement.className = "toolbarImageNormal";
  2230. }
  2231. else if (window.event.srcElement.className == 'toolbarImageNormal' || window.event.srcElement.className == 'toolbarImageOver')
  2232. {
  2233. window.event.srcElement.className = "toolbarImagePressed";
  2234. }
  2235. }
  2236. // Makes button look raised when button is released
  2237. function richEditControl_buttonOut(obj)
  2238. {
  2239. obj.className = "toolbarImageNormal";
  2240. }
  2241. function richEditControl_buttonOver(obj)
  2242. {
  2243. if (obj.className == 'toolbarImageNormal') {
  2244. obj.className = 'toolbarImageOver';
  2245. }
  2246. }
  2247. function richEditControl_doBold()
  2248. {
  2249. email_body_iframe.focus();
  2250. email_body_iframe.document.execCommand('bold', false, null);
  2251. }
  2252. function richEditControl_doItalic()
  2253. {
  2254. email_body_iframe.focus();
  2255. email_body_iframe.document.execCommand('italic', false, null);
  2256. }
  2257. function richEditControl_doUnderline()
  2258. {
  2259. email_body_iframe.focus();
  2260. email_body_iframe.document.execCommand('underline', false, null);
  2261. }
  2262. function richEditControl_doLeft()
  2263. {
  2264. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  2265. <!-- make sure the other alignment buttons aren no longer selected -->
  2266. document.getElementById('action_align_center').className = "toolbarImageNormal";
  2267. document.getElementById('action_align_right').className = "toolbarImageNormal";
  2268. document.getElementById('action_justify').className = "toolbarImageNormal";
  2269. email_body_iframe.focus();
  2270. email_body_iframe.document.execCommand('justifyleft', false, null);
  2271. }
  2272. function richEditControl_doCenter()
  2273. {
  2274. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  2275. <!-- make sure the other alignment buttons aren no longer selected -->
  2276. document.getElementById('action_align_left').className = "toolbarImageNormal";
  2277. document.getElementById('action_align_right').className = "toolbarImageNormal";
  2278. document.getElementById('action_justify').className = "toolbarImageNormal";
  2279. email_body_iframe.focus();
  2280. email_body_iframe.document.execCommand('justifycenter', false, null);
  2281. }
  2282. function richEditControl_doRight()
  2283. {
  2284. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  2285. <!-- make sure the other alignment buttons aren no longer selected -->
  2286. document.getElementById('action_align_left').className = "toolbarImageNormal";
  2287. document.getElementById('action_align_center').className = "toolbarImageNormal";
  2288. document.getElementById('action_justify').className = "toolbarImageNormal";
  2289. email_body_iframe.focus();
  2290. email_body_iframe.document.execCommand('justifyright', false, null);
  2291. }
  2292. function richEditControl_doJustify()
  2293. {
  2294. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  2295. <!-- make sure the other alignment buttons aren no longer selected -->
  2296. document.getElementById('action_align_left').className = "toolbarImageNormal";
  2297. document.getElementById('action_align_center').className = "toolbarImageNormal";
  2298. document.getElementById('action_align_right').className = "toolbarImageNormal";
  2299. email_body_iframe.focus();
  2300. email_body_iframe.document.execCommand('JustifyFull', false, null);
  2301. }
  2302. function richEditControl_doOrdList()
  2303. {
  2304. email_body_iframe.focus();
  2305. email_body_iframe.document.execCommand('insertorderedlist', false, null);
  2306. }
  2307. function richEditControl_doBulList()
  2308. {
  2309. email_body_iframe.focus();
  2310. email_body_iframe.document.execCommand('insertunorderedlist', false, null);
  2311. }
  2312. function richEditControl_doIndent()
  2313. {
  2314. email_body_iframe.focus();
  2315. email_body_iframe.document.execCommand('Indent', false, null);
  2316. }
  2317. function richEditControl_doOutdent()
  2318. {
  2319. email_body_iframe.focus();
  2320. email_body_iframe.document.execCommand('Outdent', false, null);
  2321. }
  2322. function richEditControl_doForeCol(color)
  2323. {
  2324. toggledynamicDiv('fontColor');
  2325. email_body_iframe.focus();
  2326. email_body_iframe.document.execCommand('forecolor', false, color);
  2327. }
  2328. function richEditControl_doFont(obj)
  2329. {
  2330. email_body_iframe.focus();
  2331. email_body_iframe.document.execCommand('fontname', false, obj.value);
  2332. }
  2333. function richEditControl_doSize(obj)
  2334. {
  2335. email_body_iframe.focus();
  2336. email_body_iframe.document.execCommand('fontsize', false, obj.value);
  2337. }
  2338. function richEditControl_doTable()
  2339. {
  2340. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  2341. email_body_iframe.focus();
  2342. var rows = frm.richEditControl_tableRows.value;
  2343. var columns = frm.richEditControl_tableColumns.value;
  2344. var html = "&lt;table border=\&quot;1\&quot; cellpadding=\&quot;0\&quot; cellspacing=\&quot;0\&quot;&gt;";
  2345. for (var i = 0; i &lt; rows; ++i ) {
  2346. html += "&lt;tr&gt;";
  2347. for (var j = 0; j &lt; columns; ++j ) {
  2348. html += "&lt;td&gt;<xts:string id="IDS_EMAIL_INSERT_TEXT" encode="javascript"/>&lt;/td&gt;";
  2349. }
  2350. html += "&lt;/tr&gt;";
  2351. }
  2352. html += "&lt;/table&gt;";
  2353. var range = email_body_iframe.document.selection.createRange();
  2354. if (textRange.getBookmark())
  2355. {
  2356. range.moveToBookmark(textRange.getBookmark());
  2357. }
  2358. <!-- for some reason, when the cursor is at the end of a line, the moveToBookmark places the ending
  2359. point one character farther then it should be -->
  2360. if (range.compareEndPoints('EndToEnd',textRange) == 1)
  2361. {
  2362. range.moveEnd('character',-1);
  2363. }
  2364. range.pasteHTML(html);
  2365. textRange = null;
  2366. }
  2367. function richEditControl_doHorizontalRule()
  2368. {
  2369. email_body_iframe.focus();
  2370. var range = email_body_iframe.document.selection.createRange();
  2371. range.pasteHTML("&lt;hr&gt;");
  2372. }
  2373. function richEditControl_removeLinks()
  2374. {
  2375. <xsl:if test="not(key('system-param','allow-email-links')='true')">
  2376. // remove all links from email_body for security reasons
  2377. for (i=0; i &lt; email_body_iframe.document.links.length; i++) {
  2378. var tr = email_body_iframe.document.links[i].parentTextEdit.createTextRange();
  2379. tr.moveToElementText(email_body_iframe.document.links[i]);
  2380. tr.execCommand("Unlink",false);
  2381. tr.execCommand("Unselect",false);
  2382. i--;
  2383. }
  2384. </xsl:if>
  2385. // remove all images from email_body for security reasons
  2386. for (i=0; i &lt; email_body_iframe.document.images.length; i++) {
  2387. var tr = email_body_iframe.document.images[i].parentTextEdit.createTextRange();
  2388. tr.moveToElementText(email_body_iframe.document.images[i]);
  2389. tr.execCommand("Delete",false);
  2390. i--;
  2391. }
  2392. }
  2393. function richEditControl_convertToXHTML()
  2394. {
  2395. var element = email_body_iframe.document.body;
  2396. return richEditControl_doTree(element);
  2397. }
  2398. function richEditControl_doTree(element)
  2399. {
  2400. var node = "";
  2401. if (element.nodeType == 1) {
  2402. // add the start of the node
  2403. node = "&lt;" + element.tagName;
  2404. for (var i = 0; i &lt; element.attributes.length; ++i) {
  2405. if (element.attributes[i].nodeValue != null &amp;&amp;
  2406. element.attributes[i].nodeValue.length > 0 &amp;&amp;
  2407. element.attributes[i].nodeName != &quot;contentEditable&quot;) {
  2408. node += " " + element.attributes[i].nodeName + "=\&quot;" + htmlEncode(element.attributes[i].nodeValue) + "\&quot;";
  2409. }
  2410. }
  2411. if (element.childNodes != null &amp;&amp; element.childNodes.length > 0) {
  2412. node += ">";
  2413. for (var j = 0; j &lt; element.childNodes.length; ++j) {
  2414. node += richEditControl_doTree(element.childNodes[j]);
  2415. }
  2416. node += "&lt;/" + element.tagName + "&gt;";
  2417. } else {
  2418. node += "/&gt;";
  2419. }
  2420. } else if (element.nodeType == 3) {
  2421. <!-- Make sure we encode special HTML characters (&, ", <, >) -->
  2422. node = htmlEncode(element.data);
  2423. }
  2424. return node;
  2425. }
  2426. function richEditControl_doEditBlur()
  2427. {
  2428. richEditControl_removeLinks();
  2429. // copy the contents of the edit window into a form field
  2430. document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody.value = richEditControl_convertToXHTML();
  2431. }
  2432. // handles moving the bold, italic and underline spans
  2433. function moveRichEditSpans(moveBy)
  2434. {
  2435. document.getElementById('fix_bold').style.pixelTop += moveBy;
  2436. document.getElementById('fix_italic').style.pixelTop += moveBy;
  2437. document.getElementById('fix_underline').style.pixelTop += moveBy;
  2438. }
  2439. // function to initialize the script for the contents of the screen
  2440. function richEditControl_init()
  2441. {
  2442. var Editor = email_body_iframe.document;
  2443. Editor.designMode = "On";
  2444. // set up the body of the Iframe
  2445. <xsl:choose>
  2446. <xsl:when test="key('env-param','hidden_richEditBody') != ''">
  2447. email_body_iframe.document.write('<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','hidden_richEditBody')))"/>');
  2448. </xsl:when>
  2449. <xsl:when test="key('env-param','email_body') != ''">
  2450. <!-- encode textarea string's carriage returns -->
  2451. emailBodyString = replaceCarriageReturns(htmlEncode('<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','email_body')))"/>'),'&lt;br/&gt;');
  2452. email_body_iframe.document.write("&lt;BODY id=\&quot;editbody\&quot;&gt;" + emailBodyString + "&lt;/BODY&gt;");
  2453. </xsl:when>
  2454. <xsl:otherwise>
  2455. email_body_iframe.document.write("&lt;BODY id=\&quot;editbody\&quot;&gt;&lt;/BODY&gt;");
  2456. </xsl:otherwise>
  2457. </xsl:choose>
  2458. // set up the drag drop for the HTML edit body too
  2459. <xsl:if test="$agentStudio">
  2460. var dropZone = new DropZone("editbody","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;);
  2461. droppy.registerDropZoneObject(dropZone);
  2462. //pass the group to a listener in case number of members dynamically changes
  2463. droppy.registerDropZoneGroup(new Array(dropZone), &quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;);
  2464. </xsl:if>
  2465. <!-- nasty, but we have to reposition the blank images so they cover the padding and border around the
  2466. bold, italic and underline buttons -->
  2467. document.getElementById('fix_bold').style.pixelLeft = document.getElementById('fix_bold').offsetLeft - 2;
  2468. document.getElementById('fix_bold').style.pixelTop = document.getElementById('fix_bold').offsetTop - 2;
  2469. document.getElementById('fix_italic').style.pixelLeft = document.getElementById('fix_italic').offsetLeft - 2;
  2470. document.getElementById('fix_italic').style.pixelTop = document.getElementById('fix_italic').offsetTop - 2;
  2471. document.getElementById('fix_underline').style.pixelLeft = document.getElementById('fix_underline').offsetLeft - 2;
  2472. document.getElementById('fix_underline').style.pixelTop = document.getElementById('fix_underline').offsetTop - 2;
  2473. if (document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody)
  2474. {
  2475. // copy the contents of the edit window into a form field
  2476. document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody.value = richEditControl_convertToXHTML();
  2477. }
  2478. }
  2479. </script>
  2480. <!-- bold -->
  2481. <xsl:call-template name="richEditControl_button">
  2482. <xsl:with-param name="onclick">richEditControl_doBold();</xsl:with-param>
  2483. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_BOLD"/></xsl:with-param>
  2484. <xsl:with-param name="text"><xts:string id="IDS_BOLD"/></xsl:with-param>
  2485. <xsl:with-param name="textClass" select="'toolbarTextBold'"/>
  2486. <xsl:with-param name="id">bold</xsl:with-param>
  2487. </xsl:call-template>
  2488. <!-- italic -->
  2489. <xsl:call-template name="richEditControl_button">
  2490. <xsl:with-param name="onclick">richEditControl_doItalic();</xsl:with-param>
  2491. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_ITALIC"/></xsl:with-param>
  2492. <xsl:with-param name="text"><xts:string id="IDS_ITALIC"/></xsl:with-param>
  2493. <xsl:with-param name="textClass" select="'toolbarTextItalic'"/>
  2494. <xsl:with-param name="id">italic</xsl:with-param>
  2495. </xsl:call-template>
  2496. <!-- underline -->
  2497. <xsl:call-template name="richEditControl_button">
  2498. <xsl:with-param name="onclick">richEditControl_doUnderline();</xsl:with-param>
  2499. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_UNDERLINE"/></xsl:with-param>
  2500. <xsl:with-param name="text"><xts:string id="IDS_UNDERLINE"/></xsl:with-param>
  2501. <xsl:with-param name="textClass" select="'toolbarTextUnderline'"/>
  2502. <xsl:with-param name="id">underline</xsl:with-param>
  2503. <xsl:with-param name="last">true</xsl:with-param>
  2504. </xsl:call-template>
  2505. <!-- spacer -->
  2506. <td>
  2507. <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
  2508. </td>
  2509. <!-- left align -->
  2510. <xsl:call-template name="richEditControl_button">
  2511. <xsl:with-param name="onclick">richEditControl_doLeft();</xsl:with-param>
  2512. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_ALIGN_LEFT"/></xsl:with-param>
  2513. <xsl:with-param name="icon">action_align_left.gif</xsl:with-param>
  2514. <xsl:with-param name="id">action_align_left</xsl:with-param>
  2515. </xsl:call-template>
  2516. <!-- center align -->
  2517. <xsl:call-template name="richEditControl_button">
  2518. <xsl:with-param name="onclick">richEditControl_doCenter();</xsl:with-param>
  2519. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_CENTER"/></xsl:with-param>
  2520. <xsl:with-param name="icon">action_align_center.gif</xsl:with-param>
  2521. <xsl:with-param name="id">action_align_center</xsl:with-param>
  2522. </xsl:call-template>
  2523. <!-- right align -->
  2524. <xsl:call-template name="richEditControl_button">
  2525. <xsl:with-param name="onclick">richEditControl_doRight();</xsl:with-param>
  2526. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_ALIGN_RIGHT"/></xsl:with-param>
  2527. <xsl:with-param name="icon">action_align_right.gif</xsl:with-param>
  2528. <xsl:with-param name="id">action_align_right</xsl:with-param>
  2529. </xsl:call-template>
  2530. <!-- justify -->
  2531. <xsl:call-template name="richEditControl_button">
  2532. <xsl:with-param name="onclick">richEditControl_doJustify();</xsl:with-param>
  2533. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_JUSTIFY"/></xsl:with-param>
  2534. <xsl:with-param name="icon">action_justify.gif</xsl:with-param>
  2535. <xsl:with-param name="id">action_justify</xsl:with-param>
  2536. <xsl:with-param name="last">true</xsl:with-param>
  2537. </xsl:call-template>
  2538. <!-- spacer -->
  2539. <td>
  2540. <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
  2541. </td>
  2542. <!-- ordered list -->
  2543. <xsl:call-template name="richEditControl_button">
  2544. <xsl:with-param name="onclick">richEditControl_doOrdList();</xsl:with-param>
  2545. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_NUMBERING"/></xsl:with-param>
  2546. <xsl:with-param name="icon">action_numbering.gif</xsl:with-param>
  2547. </xsl:call-template>
  2548. <!-- bullet list -->
  2549. <xsl:call-template name="richEditControl_button">
  2550. <xsl:with-param name="onclick">richEditControl_doBulList();</xsl:with-param>
  2551. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_BULLETS"/></xsl:with-param>
  2552. <xsl:with-param name="icon">action_bullets.gif</xsl:with-param>
  2553. </xsl:call-template>
  2554. <!-- Outdent -->
  2555. <xsl:call-template name="richEditControl_button">
  2556. <xsl:with-param name="onclick">richEditControl_doOutdent();</xsl:with-param>
  2557. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_DECREASE_INDENT"/></xsl:with-param>
  2558. <xsl:with-param name="icon">action_decrease_indent.gif</xsl:with-param>
  2559. </xsl:call-template>
  2560. <!-- Indent -->
  2561. <xsl:call-template name="richEditControl_button">
  2562. <xsl:with-param name="onclick">richEditControl_doIndent();</xsl:with-param>
  2563. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INCREASE_INDENT"/></xsl:with-param>
  2564. <xsl:with-param name="icon">action_increase_indent.gif</xsl:with-param>
  2565. <xsl:with-param name="last">true</xsl:with-param>
  2566. </xsl:call-template>
  2567. <!-- spacer -->
  2568. <td>
  2569. <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
  2570. </td>
  2571. <!-- insert table -->
  2572. <xsl:call-template name="richEditControl_button">
  2573. <xsl:with-param name="onclick">initInsertTable();insertTablePopup.show();</xsl:with-param>
  2574. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_TABLE"/></xsl:with-param>
  2575. <xsl:with-param name="icon">action_insert_table.gif</xsl:with-param>
  2576. </xsl:call-template>
  2577. <!-- Horizontal Rule -->
  2578. <xsl:call-template name="richEditControl_button">
  2579. <xsl:with-param name="onclick">richEditControl_doHorizontalRule();</xsl:with-param>
  2580. <xsl:with-param name="alt"><xts:string id="IDS_EMAIL_OPTIONS_HORIZONAL_RULE"/></xsl:with-param>
  2581. <xsl:with-param name="icon">action_insert_line.gif</xsl:with-param>
  2582. <xsl:with-param name="last">true</xsl:with-param>
  2583. </xsl:call-template>
  2584. </xsl:template>
  2585. <!-- template to generate a button for the rich edit control -->
  2586. <xsl:template name="richEditControl_button">
  2587. <xsl:param name="onclick"/>
  2588. <xsl:param name="alt"/>
  2589. <xsl:param name="icon"/>
  2590. <xsl:param name="text"/>
  2591. <xsl:param name="id" select="''"/>
  2592. <xsl:param name="textClass"/>
  2593. <xsl:param name="last" select="'false'"/>
  2594. <td id="{$id}" class="toolbarImageNormal" alt="{$alt}" onmouseover="richEditControl_buttonOver(this);" onmouseout="richEditControl_buttonOut(this);" align="center" valign="bottom">
  2595. <xsl:choose>
  2596. <xsl:when test="$icon != ''">
  2597. <a href="javascript:{$onclick}"><img border="0" style="width:16px;height:16px;" src="{$image_root}{$icon}" alt="{$alt}"/></a>
  2598. </xsl:when>
  2599. <xsl:when test="$text != ''">
  2600. <span id="fix_{$id}" style="position:absolute;display:block;width:16px;height:16px;">
  2601. <a href="javascript:{$onclick}"><img border="0" height="21" width="21" src="{$webcontent}/images/space.gif" alt="{$alt}"/></a>
  2602. </span>
  2603. <div class="{$textClass}" style="width:16px;height:16px;"><xsl:value-of select="$text"/></div>
  2604. </xsl:when>
  2605. </xsl:choose>
  2606. </td>
  2607. <!-- spacer -->
  2608. <xsl:if test="$last = 'false'">
  2609. <td>
  2610. <img height="1" width="3" src="{$webcontent}/images/space.gif" alt=""/>
  2611. </td>
  2612. </xsl:if>
  2613. </xsl:template>
  2614. </xsl:stylesheet>
  2615. </xts:block>
  2616. <!--
  2617. ===============================================================================================
  2618. debug - special debug block for nested requests
  2619. ===============================================================================================
  2620. -->
  2621. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup processResponse returnResult" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  2622. <!-- get the debug logic sheet -->
  2623. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  2624. <xsl:stylesheet version="1.0"
  2625. xmlns:xos="http://developer.cognos.com/schemas/xts/output/"
  2626. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2627. xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/"
  2628. exclude-result-prefixes="dbg xos">
  2629. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
  2630. <xsl:template match="/">
  2631. <xts:sequence>
  2632. <xsl:variable name="resultNode" select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='resultNode']"/>
  2633. <xts:append select="/root/output/*[local-name() = 'part']/*[local-name() = 'entityBody']/*[local-name()='{$resultNode}']">
  2634. <debugDump>
  2635. <xts:transform name="XMLEncode">
  2636. <dbg:dumpxml select="/root/*[local-name()!='header' and local-name()!='output' and local-name()!='system' and local-name()!='http' and local-name()!='session']">
  2637. <dbg:title>email_options.xts</dbg:title>
  2638. </dbg:dumpxml>
  2639. </xts:transform>
  2640. </debugDump>
  2641. </xts:append>
  2642. </xts:sequence>
  2643. </xsl:template>
  2644. </xsl:stylesheet>
  2645. </xts:block>
  2646. </xts:morphlet>