task_options.xts 301 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: ASV
  5. (C) Copyright IBM Corp. 2005, 2014
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <!--
  9. =================================================================================================================================
  10. email_options.xts
  11. view email_interface.xml for information on the API.
  12. =================================================================================================================================
  13. -->
  14. <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml, messages/subscribe.xml">
  15. <!--
  16. ===============================================================================================
  17. processRequestParams - Default any params that weren't passed in. Also this is where we would
  18. do validation (when time permits).
  19. ===============================================================================================
  20. -->
  21. <xts:block id="processRequestParams" processor="XSLT" type="exec" nodeList="/root/*[local-name()='requestParams']">
  22. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl">
  23. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  24. <xsl:template match="/">
  25. <xts:sequence>
  26. <xts:append select="/root/*[local-name()='requestParams']">
  27. <xts:transform src="portal/controls/gen_default_parameters.xslt" processor="XSLT">
  28. <root>
  29. <xts:transform name="XML">
  30. <xts:param name="systemId">subscribe/taskOptions/task_interface.xml</xts:param>
  31. </xts:transform>
  32. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  33. </root>
  34. </xts:transform>
  35. </xts:append>
  36. </xts:sequence>
  37. </xsl:template>
  38. </xsl:stylesheet>
  39. </xts:block>
  40. <!--
  41. ===============================================================================================
  42. returnResult - We're done with the email options morphlet, so return the appropriate response
  43. ===============================================================================================
  44. -->
  45. <xts:block id="processUsers" 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">
  46. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  47. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" exclude-result-prefixes="xsl xos xtsext">
  48. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  49. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  50. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  51. <xsl:key name="session-param" match="/root/session/param" use="@name"/>
  52. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  53. <xsl:template match="/">
  54. <xts:sequence>
  55. <xts:append select="/root">
  56. <processedUsers>
  57. <xsl:choose>
  58. <xsl:when test="key('request-param','requestState') = 'genDefault'">
  59. <param name="to">
  60. <param name="to">
  61. <xsl:value-of select="key('session-param','e_hp')"/>
  62. </param>
  63. </param>
  64. </xsl:when>
  65. <xsl:otherwise>
  66. <xts:transform src="subscribe/taskOptions/transforms/process_email_address.xslt" processor="XSLT">
  67. <root>
  68. <xsl:copy-of select="/root/env"/>
  69. <xsl:if test="key('env-param','addedRecipients') != ''">
  70. <xsl:choose>
  71. <!-- if the 'to', 'cc' fields have changed then rebuild the addedRecipients list -->
  72. <xsl:when test="key('env-param','recipientsChanged')='true'">
  73. <xts:transform src="subscribe/taskOptions/transforms/move_recipients.xslt" processor="XSLT">
  74. <root>
  75. <addedRecipients>
  76. <xts:transform name="XMLDecode">
  77. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
  78. </xts:transform>
  79. </addedRecipients>
  80. <toField>
  81. <xsl:value-of select="key('env-param','email_to')"/>
  82. </toField>
  83. <ccField>
  84. <xsl:value-of select="key('env-param','email_cc')"/>
  85. </ccField>
  86. <bccField>
  87. <xsl:value-of select="key('env-param','email_bcc')"/>
  88. </bccField>
  89. </root>
  90. </xts:transform>
  91. </xsl:when>
  92. <xsl:otherwise>
  93. <addedRecipients>
  94. <xts:transform name="XMLDecode">
  95. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
  96. </xts:transform>
  97. </addedRecipients>
  98. </xsl:otherwise>
  99. </xsl:choose>
  100. </xsl:if>
  101. </root>
  102. </xts:transform>
  103. </xsl:otherwise>
  104. </xsl:choose>
  105. </processedUsers>
  106. </xts:append>
  107. </xts:sequence>
  108. </xsl:template>
  109. </xsl:stylesheet>
  110. </xts:block>
  111. <!--
  112. ===============================================================================================
  113. returnResult - We're done with the email options morphlet, so return the appropriate response
  114. ===============================================================================================
  115. -->
  116. <xts:block id="returnResult" type="exec" processor="XSLT" dependency="processUsers" 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">
  117. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  118. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" exclude-result-prefixes="xsl xos xtsext">
  119. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  120. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  121. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  122. <xsl:key name="session-param" match="/root/session/param" use="@name"/>
  123. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  124. <xsl:template match="/">
  125. <xts:sequence>
  126. <xts:append select="/root/output">
  127. <!-- build a part -->
  128. <xts:transform name="Null" option="part" mimeType="text/xml">
  129. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  130. <xsl:choose>
  131. <xsl:when test="key('request-param','requestState') = 'canceled'">
  132. <canceled/>
  133. </xsl:when>
  134. <!-- generate default delivery options -->
  135. <xsl:when test="key('request-param','requestState') = 'genDefault'">
  136. <taskOptions>
  137. <xsl:call-template name="buildTaskOptions"/>
  138. </taskOptions>
  139. <!-- return the task name -->
  140. <xsl:if test="key('request-param','agentStudio') = 'true' or key('request-param','subscription') = 'true'">
  141. <xsl:call-template name="buildAgentVars"/>
  142. </xsl:if>
  143. </xsl:when>
  144. <xsl:otherwise>
  145. <taskOptions>
  146. <xsl:call-template name="buildTaskOptions"/>
  147. </taskOptions>
  148. <!-- return the task name -->
  149. <xsl:if test="key('request-param','agentStudio') = 'true' or key('request-param','subscription') = 'true'">
  150. <xsl:call-template name="buildAgentVars"/>
  151. </xsl:if>
  152. </xsl:otherwise>
  153. </xsl:choose>
  154. </xsl:element>
  155. </xts:transform>
  156. </xts:append>
  157. </xts:sequence>
  158. </xsl:template>
  159. <xsl:template name="buildTaskOptions">
  160. <xsl:choose>
  161. <xsl:when test="key('request-param','taskType')='approval'">
  162. <xsl:choose>
  163. <!-- generate default delivery options -->
  164. <xsl:when test="key('request-param','requestState') = 'genDefault'">
  165. <xts:transform src="subscribe/taskOptions/transforms/buildApproval.xslt" processor="XSLT">
  166. <root>
  167. <!-- copy the already created processed users -->
  168. <xsl:copy-of select="/root/processedUsers/*"/>
  169. <xsl:choose>
  170. <xsl:when test="key('request-param','hideLinkToReport')='false'">
  171. <param name="m_ro_taskAsURL">true</param>
  172. </xsl:when>
  173. <xsl:otherwise>
  174. <param name="m_ro_taskAsURL">false</param>
  175. </xsl:otherwise>
  176. </xsl:choose>
  177. <param name="m_ro_priority">3</param>
  178. <param name="email_subject">
  179. <xsl:choose>
  180. <!-- use the supplied subject when we're given one - else we just make it up -->
  181. <xsl:when test="key('request-param','defaultSubject')">
  182. <xsl:value-of select="key('request-param','defaultSubject')"/>
  183. </xsl:when>
  184. <!-- only time we'd be defaulting the delivery options and we have a step class if for reports -->
  185. <!-- Don't pretty print the following section since it'll add spaces in the default subject -->
  186. <xsl:when test="key('env-param','step-class') != ''">
  187. <xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/>
  188. <xsl:value-of select="concat(' ',key('env-param','step_default_name'))"/>
  189. </xsl:when>
  190. <xsl:when test="key('env-param','m_class')='jobDefinition' or key('env-param','m_new_class')='jobDefinition'">
  191. <xts:string id="IDS_EMAIL_OPTIONS_JOB_PREFIX"/>
  192. <xsl:choose>
  193. <xsl:when test="key('env-param','m_p_defaultName')">
  194. <xsl:value-of select="concat(' ',key('env-param','m_p_defaultName'))"/>
  195. </xsl:when>
  196. <xsl:otherwise>
  197. <xsl:value-of select="concat(' ',key('env-param','m_name'))"/>
  198. </xsl:otherwise>
  199. </xsl:choose>
  200. </xsl:when>
  201. <xsl:otherwise>
  202. <xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/>
  203. <xsl:choose>
  204. <xsl:when test="key('env-param','ui.name')">
  205. <xsl:value-of select="concat(' ',key('env-param','ui.name'))"/>
  206. </xsl:when>
  207. <xsl:otherwise>
  208. <xsl:value-of select="concat(' ',key('env-param','m_name'))"/>
  209. </xsl:otherwise>
  210. </xsl:choose>
  211. </xsl:otherwise>
  212. </xsl:choose>
  213. </param>
  214. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  215. <!-- we also need all the information about each recipient -->
  216. </root>
  217. </xts:transform>
  218. </xsl:when>
  219. <xsl:otherwise>
  220. <xts:transform src="subscribe/taskOptions/transforms/buildApproval.xslt" processor="XSLT">
  221. <root>
  222. <!-- copy the already created processed users -->
  223. <xsl:copy-of select="/root/processedUsers/*"/>
  224. <!-- links and attachments -->
  225. <xsl:if test="key('env-param','links') != ''">
  226. <links>
  227. <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  228. <root>
  229. <xts:transform name="XMLDecode">
  230. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
  231. </xts:transform>
  232. <deleted>
  233. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
  234. </deleted>
  235. </root>
  236. </xts:transform>
  237. </links>
  238. </xsl:if>
  239. <!-- attachments -->
  240. <xsl:if test="key('env-param','attachments') != ''">
  241. <attachments>
  242. <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  243. <root>
  244. <xts:transform name="XMLDecode">
  245. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
  246. </xts:transform>
  247. <deleted>
  248. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
  249. </deleted>
  250. </root>
  251. </xts:transform>
  252. </attachments>
  253. </xsl:if>
  254. <!-- futureTasks -->
  255. <xsl:if test="/root/env/param[starts-with(@name,'m_ro_agentTaskItem_')]">
  256. <futureTasks>
  257. <xts:transform src="subscribe/taskOptions/transforms/update_futureTasks.xslt" processor="XSLT">
  258. <root>
  259. <xts:transform name="XMLDecode">
  260. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','possible_futureTasks'))),true())"/>
  261. </xts:transform>
  262. <futureTasks>
  263. <xsl:copy-of select="/root/env/param[starts-with(@name,'m_ro_agentTaskItem_')]"/>
  264. </futureTasks>
  265. </root>
  266. </xts:transform>
  267. </futureTasks>
  268. </xsl:if>
  269. <!-- richEditBody - validate HTML for allowed tags only-->
  270. <!-- only perform this transform when we are in Rich Edit Mode -->
  271. <xsl:if test="key('env-param','hidden_richEditBody') != '' and key('env-param','richEditMode')='true'">
  272. <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE">
  273. <xsl:choose>
  274. <xsl:when test="key('system-param','allow-email-links')='true'">
  275. <xts:param name="noNamespaceSchemaLocation">subscribe/taskOptions/schemas/richEditBodyPartial.xsd</xts:param>
  276. </xsl:when>
  277. <xsl:otherwise>
  278. <xts:param name="noNamespaceSchemaLocation">subscribe/taskOptions/schemas/richEditBodyFull.xsd</xts:param>
  279. </xsl:otherwise>
  280. </xsl:choose>
  281. <!-- use the normalizeEmailBody transform to change all element names to uppercase and all atrributes to lowercase -->
  282. <xts:transform src="subscribe/taskOptions/transforms/normalizeEmailBody.xslt" processor="XSLT">
  283. <xsl:value-of select="/root/env/param[@name='hidden_richEditBody']" disable-output-escaping="yes"/>
  284. </xts:transform>
  285. </xts:transform>
  286. </xsl:if>
  287. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  288. <!-- we also need all the information about each recipient -->
  289. </root>
  290. </xts:transform>
  291. </xsl:otherwise>
  292. </xsl:choose>
  293. </xsl:when>
  294. <xsl:otherwise>
  295. <!-- this is a notification task -->
  296. <xsl:choose>
  297. <!-- generate default delivery options -->
  298. <xsl:when test="key('request-param','requestState') = 'genDefault'">
  299. <xts:transform src="subscribe/taskOptions/transforms/buildNotification.xslt" processor="XSLT">
  300. <root>
  301. <!-- copy the already created processed users -->
  302. <xsl:copy-of select="/root/processedUsers/*"/>
  303. <xsl:choose>
  304. <xsl:when test="key('request-param','hideLinkToReport')='false'">
  305. <param name="m_ro_taskAsURL">true</param>
  306. </xsl:when>
  307. <xsl:otherwise>
  308. <param name="m_ro_taskAsURL">false</param>
  309. </xsl:otherwise>
  310. </xsl:choose>
  311. <param name="m_ro_priority">3</param>
  312. <param name="email_subject">
  313. <xsl:choose>
  314. <!-- use the supplied subject when we're given one - else we just make it up -->
  315. <xsl:when test="key('request-param','defaultSubject')">
  316. <xsl:value-of select="key('request-param','defaultSubject')"/>
  317. </xsl:when>
  318. <!-- only time we'd be defaulting the delivery options and we have a step class if for reports -->
  319. <!-- Don't pretty print the following section since it'll add spaces in the default subject -->
  320. <xsl:when test="key('env-param','step-class') != ''">
  321. <xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/>
  322. <xsl:value-of select="concat(' ',key('env-param','step_default_name'))"/>
  323. </xsl:when>
  324. <xsl:when test="key('env-param','m_class')='jobDefinition' or key('env-param','m_new_class')='jobDefinition'">
  325. <xts:string id="IDS_EMAIL_OPTIONS_JOB_PREFIX"/>
  326. <xsl:choose>
  327. <xsl:when test="key('env-param','m_p_defaultName')">
  328. <xsl:value-of select="concat(' ',key('env-param','m_p_defaultName'))"/>
  329. </xsl:when>
  330. <xsl:otherwise>
  331. <xsl:value-of select="concat(' ',key('env-param','m_name'))"/>
  332. </xsl:otherwise>
  333. </xsl:choose>
  334. </xsl:when>
  335. <xsl:otherwise>
  336. <xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/>
  337. <xsl:choose>
  338. <xsl:when test="key('env-param','ui.name')">
  339. <xsl:value-of select="concat(' ',key('env-param','ui.name'))"/>
  340. </xsl:when>
  341. <xsl:otherwise>
  342. <xsl:value-of select="concat(' ',key('env-param','m_name'))"/>
  343. </xsl:otherwise>
  344. </xsl:choose>
  345. </xsl:otherwise>
  346. </xsl:choose>
  347. </param>
  348. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  349. </root>
  350. </xts:transform>
  351. </xsl:when>
  352. <xsl:otherwise>
  353. <xts:transform src="subscribe/taskOptions/transforms/buildNotification.xslt" processor="XSLT">
  354. <root>
  355. <!-- copy the already created processed users -->
  356. <xsl:copy-of select="/root/processedUsers/*"/>
  357. <!-- links and attachments -->
  358. <xsl:if test="key('env-param','links') != ''">
  359. <links>
  360. <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  361. <root>
  362. <xts:transform name="XMLDecode">
  363. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
  364. </xts:transform>
  365. <deleted>
  366. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
  367. </deleted>
  368. </root>
  369. </xts:transform>
  370. </links>
  371. </xsl:if>
  372. <!-- attachments -->
  373. <xsl:if test="key('env-param','attachments') != ''">
  374. <attachments>
  375. <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  376. <root>
  377. <xts:transform name="XMLDecode">
  378. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
  379. </xts:transform>
  380. <deleted>
  381. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
  382. </deleted>
  383. </root>
  384. </xts:transform>
  385. </attachments>
  386. </xsl:if>
  387. <!-- richEditBody - validate HTML for allowed tags only-->
  388. <!-- only perform this transform when we are in Rich Edit Mode -->
  389. <xsl:if test="key('env-param','hidden_richEditBody') != '' and key('env-param','richEditMode')='true'">
  390. <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE">
  391. <xsl:choose>
  392. <xsl:when test="key('system-param','allow-email-links')='true'">
  393. <xts:param name="noNamespaceSchemaLocation">subscribe/taskOptions/schemas/richEditBodyPartial.xsd</xts:param>
  394. </xsl:when>
  395. <xsl:otherwise>
  396. <xts:param name="noNamespaceSchemaLocation">subscribe/taskOptions/schemas/richEditBodyFull.xsd</xts:param>
  397. </xsl:otherwise>
  398. </xsl:choose>
  399. <!-- use the normalizeEmailBody transform to change all element names to uppercase and all atrributes to lowercase -->
  400. <xts:transform src="subscribe/taskOptions/transforms/normalizeEmailBody.xslt" processor="XSLT">
  401. <xsl:value-of select="/root/env/param[@name='hidden_richEditBody']" disable-output-escaping="yes"/>
  402. </xts:transform>
  403. </xts:transform>
  404. </xsl:if>
  405. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  406. <!-- we also need all the information about each recipient -->
  407. </root>
  408. </xts:transform>
  409. </xsl:otherwise>
  410. </xsl:choose>
  411. </xsl:otherwise>
  412. </xsl:choose>
  413. </xsl:template>
  414. <xsl:template name="buildAgentVars">
  415. <!-- taskName isn't shown in the UI anymore (trakker bug 478414). Agent studio wants the email subject
  416. returned as the taskName -->
  417. <xsl:variable name="quote">"</xsl:variable>
  418. <xsl:variable name="apos">'</xsl:variable>
  419. <xsl:variable name="task_name">
  420. <xsl:choose>
  421. <xsl:when test="key('env-param','email_subject') and key('env-param','email_subject')!=''">
  422. <xsl:value-of select="key('env-param','email_subject')"/>
  423. </xsl:when>
  424. <xsl:when test="key('request-param','defaultSubject') and key('request-param','defaultSubject')!=''">
  425. <xsl:value-of select="key('request-param','defaultSubject')"/>
  426. </xsl:when>
  427. <xsl:otherwise>
  428. <xsl:value-of select="key('request-param','taskName')"/>
  429. </xsl:otherwise>
  430. </xsl:choose>
  431. </xsl:variable>
  432. <taskName>
  433. <xsl:choose>
  434. <xsl:when test="contains($task_name,$quote) and contains($task_name,$apos)">
  435. <xsl:value-of select="translate($task_name,$quote,$apos)"/>
  436. </xsl:when>
  437. <xsl:otherwise>
  438. <xsl:value-of select="$task_name"/>
  439. </xsl:otherwise>
  440. </xsl:choose>
  441. </taskName>
  442. <hasAttachment>
  443. <xsl:choose>
  444. <xsl:when test="key('env-param','attachments') != '' or key('env-param','links') != ''">true</xsl:when>
  445. <xsl:otherwise>false</xsl:otherwise>
  446. </xsl:choose>
  447. </hasAttachment>
  448. <!-- for subscription - becuase we have an email and a task on the same page - we need to alter the names of the variables which are returned -->
  449. <xsl:if test="key('request-param','subscription') = 'true'">
  450. <subscription>true</subscription>
  451. </xsl:if>
  452. </xsl:template>
  453. </xsl:stylesheet>
  454. </xts:block>
  455. <!--
  456. ===============================================================================================
  457. callMorphlet - Calls the appropriate morphlet using the passed in params which will return
  458. markup to be displayed or the expected results
  459. ===============================================================================================
  460. -->
  461. <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') or starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addRoles') or starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'setLabels')]" mandatory="false">
  462. <xts:logicsheet path="logicsheets/portal.xsl"/>
  463. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  464. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:req-params="http://developer.cognos.com/schemas/request/params" exclude-result-prefixes="xsl dlgctrl xtsext req-params">
  465. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  466. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  467. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  468. <xsl:template match="/">
  469. <xsl:variable name="taskType"><xsl:value-of select="key('request-param','taskType')"/></xsl:variable>
  470. <xsl:variable name="addEntriesUI">
  471. <xsl:choose>
  472. <xsl:when test="$taskType = 'notification'">recipients</xsl:when>
  473. <xsl:when test="$taskType = 'approval'">humanTask</xsl:when>
  474. <xsl:otherwise>recipients</xsl:otherwise>
  475. </xsl:choose>
  476. </xsl:variable>
  477. <xts:sequence>
  478. <xsl:choose>
  479. <xsl:when test="starts-with(key('request-param','requestState'),'addEntries')">
  480. <dlgctrl:XTS2Request>
  481. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  482. <dlgctrl:stackName>add_entries</dlgctrl:stackName>
  483. <req-params:param name="defaultTarget">
  484. <xsl:value-of select="key('request-param','defaultTarget')"/>
  485. </req-params:param>
  486. <req-params:param name="titlePostfix">
  487. <xsl:value-of select="key('request-param','titlePostfix')"/>
  488. </req-params:param>
  489. <req-params:param name="defaultSearchPath">/directory</req-params:param>
  490. <req-params:param name="showUsers">true</req-params:param>
  491. <req-params:param name="addEntriesUI"><xsl:value-of select="$addEntriesUI"/></req-params:param>
  492. <req-params:param name="withBCC">false</req-params:param>
  493. <req-params:param name="returnProperties">
  494. <req-params:property name="userName"/>
  495. </req-params:param>
  496. <req-params:param name="isPopup">
  497. <xsl:value-of select="key('request-param','addEntriesPopUp')"/>
  498. </req-params:param>
  499. <req-params:param name="agentStudio">
  500. <xsl:value-of select="key('request-param','agentStudio')"/>
  501. </req-params:param>
  502. </dlgctrl:XTS2Request>
  503. </xsl:when>
  504. <xsl:when test="starts-with(key('request-param','requestState'),'addRoles')">
  505. <dlgctrl:XTS2Request>
  506. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  507. <dlgctrl:stackName>add_entries</dlgctrl:stackName>
  508. <req-params:param name="defaultTarget">
  509. <xsl:value-of select="key('request-param','defaultTarget')"/>
  510. </req-params:param>
  511. <req-params:param name="titlePostfix">
  512. <xsl:value-of select="key('request-param','titlePostfix')"/>
  513. </req-params:param>
  514. <req-params:param name="defaultSearchPath">/directory</req-params:param>
  515. <req-params:param name="showUsers">true</req-params:param>
  516. <req-params:param name="addEntriesUI">
  517. <xsl:value-of select="'privileges'"/>
  518. </req-params:param>
  519. <req-params:param name="returnProperties">
  520. <req-params:property name="userName"/>
  521. </req-params:param>
  522. <req-params:param name="isPopup">
  523. <xsl:value-of select="key('request-param','addEntriesPopUp')"/>
  524. </req-params:param>
  525. <req-params:param name="agentStudio">
  526. <xsl:value-of select="key('request-param','agentStudio')"/>
  527. </req-params:param>
  528. </dlgctrl:XTS2Request>
  529. </xsl:when>
  530. <xsl:when test="starts-with(key('request-param','requestState'),'addLinks')">
  531. <dlgctrl:XTS2Request>
  532. <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
  533. <dlgctrl:stackName>add_entries</dlgctrl:stackName>
  534. <req-params:param name="defaultTarget">
  535. <xsl:value-of select="key('request-param','defaultTarget')"/>
  536. </req-params:param>
  537. <req-params:param name="titlePostfix">
  538. <xsl:value-of select="key('request-param','titlePostfix')"/>
  539. </req-params:param>
  540. <req-params:param name="defaultSearchPath">/content</req-params:param>
  541. <req-params:param name="addEntriesUI">
  542. <xsl:value-of select="'links'"/>
  543. </req-params:param>
  544. <req-params:param name="returnProperties">
  545. <req-params:property name="userName"/>
  546. </req-params:param>
  547. <req-params:param name="isPopup">
  548. <xsl:value-of select="key('request-param','addEntriesPopUp')"/>
  549. </req-params:param>
  550. <req-params:param name="allowRootBrowsing">
  551. <xsl:value-of select="'true'"/>
  552. </req-params:param>
  553. <req-params:param name="agentStudio">
  554. <xsl:value-of select="key('request-param','agentStudio')"/>
  555. </req-params:param>
  556. </dlgctrl:XTS2Request>
  557. </xsl:when>
  558. <xsl:when test="starts-with(key('request-param','requestState'),'setLabels')">
  559. <dlgctrl:XTS2Request>
  560. <dlgctrl:target>/subscribe/setLabels/setLabels.xts</dlgctrl:target>
  561. <dlgctrl:stackName>set_labels</dlgctrl:stackName>
  562. <req-params:param name="defaultTarget">
  563. <xsl:value-of select="key('request-param','defaultTarget')"/>
  564. </req-params:param>
  565. <req-params:param name="titlePostfix">
  566. <xsl:value-of select="key('request-param','titlePostfix')"/>
  567. </req-params:param>
  568. <req-params:param name="approveText">
  569. <xsl:value-of select="key('env-param','m_ro_approveValue')"/>
  570. </req-params:param>
  571. <req-params:param name="rejectText">
  572. <xsl:value-of select="key('env-param','m_ro_rejectValue')"/>
  573. </req-params:param>
  574. <req-params:param name="submitText">
  575. <xsl:value-of select="key('env-param','m_ro_submitValue')"/>
  576. </req-params:param>
  577. <req-params:param name="futureTasks">
  578. <futureTasks>
  579. <xsl:if test="key('env-param','possible_futureTasks')">
  580. <xts:transform src="subscribe/taskOptions/transforms/update_futureTasks.xslt" processor="XSLT">
  581. <root>
  582. <xts:transform name="XMLDecode">
  583. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','possible_futureTasks'))),true())"/>
  584. </xts:transform>
  585. <futureTasks>
  586. <xsl:copy-of select="/root/env/param[starts-with(@name,'m_ro_agentTaskItem_')]"/>
  587. </futureTasks>
  588. <allTasks>true</allTasks>
  589. </root>
  590. </xts:transform>
  591. </xsl:if>
  592. </futureTasks>
  593. </req-params:param>
  594. <req-params:param name="owner_action">
  595. <xsl:value-of select="key('env-param','m_ro_owner_action')"/>
  596. </req-params:param>
  597. <req-params:param name="isPopup">
  598. <xsl:value-of select="string(true())"/>
  599. </req-params:param>
  600. </dlgctrl:XTS2Request>
  601. </xsl:when>
  602. </xsl:choose>
  603. </xts:sequence>
  604. </xsl:template>
  605. </xsl:stylesheet>
  606. </xts:block>
  607. <!--
  608. ===============================================================================================
  609. processReponse - Process the response from the callMorphlet block and either displays
  610. the markup or processes the results - but only from the add entries links
  611. ===============================================================================================
  612. -->
  613. <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') or starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addRoles')]" mandatory="false">
  614. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  615. <xts:logicsheet path="logicsheets/portal.xsl"/>
  616. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl dlgctrl xtsext pf">
  617. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  618. <xsl:template match="/">
  619. <xts:sequence>
  620. <dlgctrl:processXTS2Response>
  621. <dlgctrl:stackName>add_entries</dlgctrl:stackName>
  622. <!-- if we got markup back, then simply send it back to the calling morphlet.
  623. email options should never have to take care of displaying the add entries markup -->
  624. <dlgctrl:mode match="markup"/>
  625. <!-- got back selected entries -->
  626. <dlgctrl:mode match="selectedEntries">
  627. <xsl:if test="/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'] != ''">
  628. <xts:append select="/root">
  629. <selectedEntries>
  630. <xts:transform name="XMLDecode">
  631. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'])), true())"/>
  632. </xts:transform>
  633. </selectedEntries>
  634. </xts:append>
  635. </xsl:if>
  636. </dlgctrl:mode>
  637. </dlgctrl:processXTS2Response>
  638. </xts:sequence>
  639. </xsl:template>
  640. </xsl:stylesheet>
  641. </xts:block>
  642. <!--
  643. ===============================================================================================
  644. processReponse2 - Process the response from the callMorphlet block and either displays
  645. the markup or processes the results - but only from setlables
  646. ===============================================================================================
  647. -->
  648. <xts:block id="processResponse2" processor="XSLT" dependency="processResponse" type="exec" condition=".[ starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'setLabels')]" mandatory="false">
  649. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  650. <xts:logicsheet path="logicsheets/portal.xsl"/>
  651. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" exclude-result-prefixes="xsl dlgctrl xtsext pf">
  652. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  653. <xsl:template match="/">
  654. <xts:sequence>
  655. <dlgctrl:processXTS2Response>
  656. <dlgctrl:stackName>set_labels</dlgctrl:stackName>
  657. <!-- if we got markup back, then simply send it back to the calling morphlet.
  658. email options should never have to take care of displaying the add entries markup -->
  659. <dlgctrl:mode match="markup"/>
  660. <!-- got back selected entries -->
  661. <dlgctrl:mode match="setLabels">
  662. <dlgctrl:morphletResponse/>
  663. </dlgctrl:mode>
  664. </dlgctrl:processXTS2Response>
  665. </xts:sequence>
  666. </xsl:template>
  667. </xsl:stylesheet>
  668. </xts:block>
  669. <!--
  670. ===============================================================================================
  671. businessRules - Take care off any business logic to simplify the UI generation
  672. ===============================================================================================
  673. -->
  674. <xts:block id="businessRules" type="exec" processor="XSLT" dependency="processResponse2 processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='setLabels' or local-name()='canceled']]" mandatory="false">
  675. <xts:logicsheet path="logicsheets/portal.xsl"/>
  676. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  677. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" exclude-result-prefixes="xsl xtsext">
  678. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  679. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  680. <xsl:key name="env-param" match="/root/env/param" use="@name"/>
  681. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  682. <pf:variables/>
  683. <xsl:template match="/">
  684. <xts:sequence>
  685. <!-- if it's the first time we hit this page -->
  686. <xsl:if test="not(/root/env/param[@name='email_body']) and not(/root/env/param[@name='hidden_richEditBody'])">
  687. <xts:append select="/root">
  688. <defaultOptions>
  689. <!-- transform the options blob passed in into env params -->
  690. <xsl:if test="key('request-param','taskOptions') != ''">
  691. <xts:transform src="subscribe/taskOptions/transforms/parse_options.xslt" processor="XSLT">
  692. <root>
  693. <xts:transform src="subscribe/transforms/getChildren.xslt" processor="XSLT">
  694. <xts:transform name="XMLDecode">
  695. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('request-param','taskOptions'))), true())"/>
  696. </xts:transform>
  697. </xts:transform>
  698. <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
  699. </root>
  700. </xts:transform>
  701. </xsl:if>
  702. <!-- also have to keep the list of possible future tasks -->
  703. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  704. <param name="possible_futureTasks">
  705. <passport>
  706. <xsl:value-of select="$passport"/>
  707. </passport>
  708. <markup>
  709. <xts:transform name="XMLEncode">
  710. <followingTaskList>
  711. <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='followingTaskList']/*"/>
  712. </followingTaskList>
  713. </xts:transform>
  714. </markup>
  715. </param>
  716. </xts:transform>
  717. </defaultOptions>
  718. </xts:append>
  719. <!-- append all the params to env -->
  720. <xts:append select="/root/env">
  721. <xts:queryNode select="/root/defaultOptions/*[local-name() = 'param']"/>
  722. </xts:append>
  723. <!-- copy the contents of the followingTaskLists to the root -->
  724. <xts:append select="/root">
  725. <followingTaskList>
  726. <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='followingTaskList']/*"/>
  727. </followingTaskList>
  728. </xts:append>
  729. <!-- set the default values for the labels -->
  730. <xts:append select="/root/env">
  731. <param name="m_ro_approveValue">
  732. <xsl:text><xts:string id="IDS_TASK_LABEL_APPROVE"/></xsl:text>
  733. </param>
  734. <param name="m_ro_rejectValue">
  735. <xsl:text><xts:string id="IDS_TASK_LABEL_REJECT"/></xsl:text>
  736. </param>
  737. <param name="m_ro_submitValue">
  738. <xsl:text><xts:string id="IDS_TASK_LABEL_SUBMIT"/></xsl:text>
  739. </param>
  740. </xts:append>
  741. </xsl:if>
  742. <!-- decode the following task list into the root -->
  743. <xsl:if test="key('env-param','possible_futureTasks')">
  744. <xts:append select="/root">
  745. <xts:transform name="XMLDecode">
  746. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','possible_futureTasks'))),true())"/>
  747. </xts:transform>
  748. </xts:append>
  749. </xsl:if>
  750. <!-- handle the reply from selecting recipients for to/cc -->
  751. <xsl:if test="key('env-param','recipientsChanged')='true' and key('env-param','addedRecipients')!='' ">
  752. <!-- create the new added recipients list -->
  753. <xts:append select="/root">
  754. <xts:transform src="subscribe/taskOptions/transforms/move_recipients.xslt" processor="XSLT">
  755. <root>
  756. <addedRecipients>
  757. <xts:transform name="XMLDecode">
  758. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
  759. </xts:transform>
  760. </addedRecipients>
  761. <toField>
  762. <xsl:value-of select="key('env-param','email_to')"/>
  763. </toField>
  764. <ccField>
  765. <xsl:value-of select="key('env-param','email_cc')"/>
  766. </ccField>
  767. <bccField>
  768. <xsl:value-of select="key('env-param','email_bcc')"/>
  769. </bccField>
  770. </root>
  771. </xts:transform>
  772. </xts:append>
  773. <!-- delete the old list -->
  774. <xts:delete select="/root/env/param[starts-with(@name,'tmp_chkbox')]"/>
  775. <xts:delete select="/root/env/param[@name='addedRecipients']"/>
  776. <!-- web64 encode the new list -->
  777. <xts:append select="/root/env">
  778. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  779. <param name="addedRecipients">
  780. <passport>
  781. <xsl:value-of select="$passport"/>
  782. </passport>
  783. <markup>
  784. <xts:transform name="XMLEncode">
  785. <xts:queryNode select="/root/addedRecipients/*"/>
  786. </xts:transform>
  787. </markup>
  788. </param>
  789. </xts:transform>
  790. </xts:append>
  791. </xsl:if>
  792. <!-- if we're in Event studio, then deal with the links and attachments -->
  793. <xsl:if test="key('request-param','agentStudio') = 'true'">
  794. <!-- links -->
  795. <xsl:choose>
  796. <!-- if the user delete any links -->
  797. <xsl:when test="key('env-param','links') != '' and /root/env/param[starts-with(@name,'deleted_link_')]='true'">
  798. <xts:append select="/root">
  799. <links>
  800. <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  801. <root>
  802. <xts:transform name="XMLDecode">
  803. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
  804. </xts:transform>
  805. <deleted>
  806. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
  807. </deleted>
  808. </root>
  809. </xts:transform>
  810. </links>
  811. </xts:append>
  812. <!-- delete the old list -->
  813. <xts:delete select="/root/env/param[@name='links']"/>
  814. <!-- web64 encode the new list -->
  815. <xts:append select="/root/env">
  816. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  817. <param name="links">
  818. <passport>
  819. <xsl:value-of select="$passport"/>
  820. </passport>
  821. <markup>
  822. <xts:transform name="XMLEncode">
  823. <xts:queryNode select="/root/links/*"/>
  824. </xts:transform>
  825. </markup>
  826. </param>
  827. </xts:transform>
  828. </xts:append>
  829. </xsl:when>
  830. <!-- unpack the list of links and attachments -->
  831. <xsl:when test="key('env-param','links') != ''">
  832. <xts:append>
  833. <links>
  834. <xts:transform name="XMLDecode">
  835. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
  836. </xts:transform>
  837. </links>
  838. </xts:append>
  839. </xsl:when>
  840. </xsl:choose>
  841. <!-- attachments -->
  842. <xsl:choose>
  843. <!-- if the user delete any links -->
  844. <xsl:when test="key('env-param','attachments') != '' and /root/env/param[starts-with(@name,'deleted_attachment_')]='true'">
  845. <xts:append select="/root">
  846. <attachments>
  847. <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
  848. <root>
  849. <xts:transform name="XMLDecode">
  850. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
  851. </xts:transform>
  852. <deleted>
  853. <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
  854. </deleted>
  855. </root>
  856. </xts:transform>
  857. </attachments>
  858. </xts:append>
  859. <!-- delete the old list -->
  860. <xts:delete select="/root/env/param[@name='attachments']"/>
  861. <!-- web64 encode the new list -->
  862. <xts:append select="/root/env">
  863. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  864. <param name="attachments">
  865. <passport>
  866. <xsl:value-of select="$passport"/>
  867. </passport>
  868. <markup>
  869. <xts:transform name="XMLEncode">
  870. <xts:queryNode select="/root/attachments/*"/>
  871. </xts:transform>
  872. </markup>
  873. </param>
  874. </xts:transform>
  875. </xts:append>
  876. </xsl:when>
  877. <!-- unpack the list of links and attachments -->
  878. <xsl:when test="key('env-param','attachments') != ''">
  879. <xts:append>
  880. <attachments>
  881. <xts:transform name="XMLDecode">
  882. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
  883. </xts:transform>
  884. </attachments>
  885. </xts:append>
  886. </xsl:when>
  887. </xsl:choose>
  888. </xsl:if>
  889. <xts:append select="/root">
  890. <businessRules>
  891. <!-- choose the image -->
  892. <image>
  893. <xsl:choose>
  894. <xsl:when test="key('request-param','taskType') = 'notification' or key('request-param','taskType') = 'approval'">
  895. <xsl:value-of select="$webRoot"/>/<xsl:value-of select="key('request-param','taskImage')"/>
  896. </xsl:when>
  897. <xsl:otherwise>
  898. <xsl:value-of select="$image_root"/>icon_email_24.gif</xsl:otherwise>
  899. </xsl:choose>
  900. </image>
  901. <!-- browser title -->
  902. <browserTitle>
  903. <xsl:text/>
  904. <xsl:choose>
  905. <xsl:when test="key('request-param','titlePostfix') != ''">
  906. <xts:string id="IDS_COMBINE_TITLE">
  907. <xts:param name="prefix">
  908. <xsl:value-of select="key('request-param','titlePrefix')"/>
  909. </xts:param>
  910. <xts:param name="postfix">
  911. <xsl:value-of select="key('request-param','titlePostfix')"/>
  912. </xts:param>
  913. </xts:string>
  914. </xsl:when>
  915. <xsl:otherwise>
  916. <xsl:value-of select="key('request-param','titlePrefix')"/>
  917. </xsl:otherwise>
  918. </xsl:choose>
  919. <xsl:text/>
  920. </browserTitle>
  921. <!-- description -->
  922. <description>
  923. <xsl:choose>
  924. <xsl:when test="key('request-param','agentStudio') = 'true'">
  925. <xsl:choose>
  926. <xsl:when test="key('request-param','taskType') = 'approval' ">
  927. <xsl:text/>
  928. <xts:string id="IDS_TASK_OPTIONS_AGENT_STUDIO_APPROVE_INTRO"/>
  929. <xsl:text/>
  930. </xsl:when>
  931. <xsl:when test="key('request-param','taskType') = 'notification' ">
  932. <xsl:text/>
  933. <xts:string id="IDS_TASK_OPTIONS_AGENT_STUDIO_NOTIFICATION_INTRO"/>
  934. <xsl:text/>
  935. </xsl:when>
  936. </xsl:choose>
  937. </xsl:when>
  938. <xsl:when test="key('request-param','burst') = 'true'">
  939. <xsl:text/>
  940. <xts:string id="IDS_TASK_OPTIONS_BURST_INTRO"/>
  941. <xsl:text/>
  942. </xsl:when>
  943. <xsl:when test="key('request-param','subscription') = 'true'">
  944. <xsl:text/>
  945. <xts:string id="IDS_TASK_OPTIONS_SUBSCRIPTION_INTRO"/>
  946. <xsl:text/>
  947. </xsl:when>
  948. <xsl:otherwise>
  949. <xsl:text/>
  950. <xts:string id="IDS_TASK_OPTIONS_INTRODUCTION"/>
  951. <xsl:text/>
  952. </xsl:otherwise>
  953. </xsl:choose>
  954. </description>
  955. <!-- should we show the email as attachment checkbox -->
  956. <allowEmailAsAttachment>
  957. <xsl:variable name="s" select="concat(' ', key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment/@show, ' ')"/>
  958. <xsl:choose>
  959. <xsl:when test="key('request-param', 'agentStudio')='true' and not(key('request-param','hideEmailAsAttachment'))">false</xsl:when>
  960. <xsl:when test="key('request-param','hideEmailAsAttachment') = 'true'">false</xsl:when>
  961. <xsl:when test="
  962. not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)
  963. or
  964. (
  965. key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment
  966. and
  967. (
  968. (contains($s, 'Administrators') and $hasAdminCapability) or
  969. (contains($s, 'QSUsers') and $hasFullQSCapability) or
  970. (contains($s, 'RSUsers') and $hasFullRSCapability) or
  971. (contains($s, 'Consumers') and $is-named='1') or
  972. (contains($s, 'Anonymous') and $is-named='0') or
  973. (key('system-param', 'ui_groups')/group[contains($s, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])
  974. )
  975. )">
  976. <xsl:value-of select="'true'"/>
  977. </xsl:when>
  978. <xsl:otherwise>
  979. <xsl:value-of select="'false'"/>
  980. </xsl:otherwise>
  981. </xsl:choose>
  982. </allowEmailAsAttachment>
  983. <allowLinkToReport>
  984. <xsl:choose>
  985. <xsl:when test="key('request-param','agentStudio')='true' and not(key('request-param','hideLinkToReport'))">false</xsl:when>
  986. <xsl:when test="key('request-param','hideLinkToReport')='false'">true</xsl:when>
  987. <xsl:otherwise>false</xsl:otherwise>
  988. </xsl:choose>
  989. </allowLinkToReport>
  990. <allowAttachMenu>
  991. <xsl:choose>
  992. <xsl:when test="key('request-param','hideAttachMenu')='false'">true</xsl:when>
  993. <xsl:otherwise>false</xsl:otherwise>
  994. </xsl:choose>
  995. </allowAttachMenu>
  996. <allowAddLinksAction>
  997. <xsl:choose>
  998. <xsl:when test="key('request-param','hideAddLinks')='false'">true</xsl:when>
  999. <xsl:otherwise>false</xsl:otherwise>
  1000. </xsl:choose>
  1001. </allowAddLinksAction>
  1002. </businessRules>
  1003. </xts:append>
  1004. <!-- handle updating the labels -->
  1005. <xsl:if test="/root/morphletResponse/setLabels">
  1006. <xsl:for-each select="/root/morphletResponse/setLabels/param">
  1007. <xts:replace select="/root/env/param[@name='{@name}']">
  1008. <xsl:copy-of select="."/>
  1009. </xts:replace>
  1010. </xsl:for-each>
  1011. </xsl:if>
  1012. </xts:sequence>
  1013. </xsl:template>
  1014. </xsl:stylesheet>
  1015. </xts:block>
  1016. <!--
  1017. ===============================================================================================
  1018. businessRules - Take care off any business logic to simplify the UI generation
  1019. ===============================================================================================
  1020. -->
  1021. <xts:block id="businessRules2" type="exec" processor="XSLT" dependency="businessRules" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='setLabels' or local-name()='canceled']]" mandatory="false">
  1022. <xts:logicsheet path="logicsheets/portal.xsl"/>
  1023. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  1024. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" exclude-result-prefixes="xsl xtsext">
  1025. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  1026. <xsl:key name="default-options" match="/root/*[local-name()='defaultOptions']/*" use="local-name()"/>
  1027. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  1028. <xsl:key name="session-param" match="/root/session/param" use="@name"/>
  1029. <pf:variables/>
  1030. <xsl:template match="/">
  1031. <xts:sequence>
  1032. <xsl:if test="key('request-param','agentStudio') = 'true' and not(key('default-options','to')) and not(key('default-options','cc')) and key('session-param','e_hp')">
  1033. <!--we can set the default stakeholder to be the curent user -->
  1034. <xts:append select="/root/defaultOptions">
  1035. <cc>
  1036. <searchPath><xsl:value-of select="key('session-param','e_hp')"/></searchPath>
  1037. </cc>
  1038. </xts:append>
  1039. </xsl:if>
  1040. </xts:sequence>
  1041. </xsl:template>
  1042. </xsl:stylesheet>
  1043. </xts:block>
  1044. <!--
  1045. ===============================================================================================
  1046. queryCMForOptionsInfo - If the options blob passed had recipients which referenced CM, then
  1047. we must query for those recipients. Also if the options blob had attachments or links then
  1048. query CM for the information need to display the UI
  1049. ===============================================================================================
  1050. -->
  1051. <xts:block id="queryCMForOptionsInfo" type="exec" processor="XSLT" dependency="businessRules2" 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">
  1052. <xts:logicsheet path="logicsheets/buslogic.xslt"/>
  1053. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" exclude-result-prefixes="xsl send">
  1054. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  1055. <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="."/>
  1056. <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="."/>
  1057. <xsl:key name="default-options" match="/root/*[local-name()='defaultOptions']/*" use="local-name()"/>
  1058. <xsl:variable name="passport">
  1059. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  1060. </xsl:variable>
  1061. <xsl:template match="/">
  1062. <!-- recipients -->
  1063. <xts:sequence>
  1064. <xsl:if test="key('default-options','to') or key('default-options','cc') or key('default-options','bcc')">
  1065. <xts:append select="/root">
  1066. <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',.))]"/>
  1067. <selectedEntries>
  1068. <!-- Make sure we add 'unknown' items in our list for every nil queryReply we got back from CM -->
  1069. <xts:transform src="subscribe/taskOptions/transforms/add-unknown-entries.xslt" processor="XSLT">
  1070. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  1071. <root>
  1072. <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
  1073. the same transforms to update the email fields and the recipients blob -->
  1074. <xts:transform src="subscribe/taskOptions/transforms/gen-standard-list.xslt" processor="XSLT">
  1075. <root>
  1076. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  1077. <send:request provider="cm">
  1078. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  1079. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  1080. <cm:requests>
  1081. <xsl:for-each select="$unique-search-paths">
  1082. <!-- only query CM for valid search paths -->
  1083. <xsl:if test=". != '' and not(starts-with(.,'['))">
  1084. <cm:query>
  1085. <cm:search>
  1086. <xsl:value-of select="."/>
  1087. </cm:search>
  1088. <cm:properties>
  1089. <cm:property name="defaultName"/>
  1090. <cm:property name="searchPath"/>
  1091. <cm:property name="userName"/>
  1092. <cm:property name="iconURI"/>
  1093. <cm:property name="objectClass"/>
  1094. </cm:properties>
  1095. </cm:query>
  1096. </xsl:if>
  1097. </xsl:for-each>
  1098. </cm:requests>
  1099. </cm:query>
  1100. </xts:transform>
  1101. </send:request>
  1102. </xts:transform>
  1103. <defaultOptions>
  1104. <xsl:copy-of select="/root/defaultOptions/*[local-name()='to' or local-name()='cc' or local-name()='bcc']"/>
  1105. </defaultOptions>
  1106. <action>recipients</action>
  1107. </root>
  1108. </xts:transform>
  1109. <defaultOptions>
  1110. <xsl:copy-of select="/root/defaultOptions/*[local-name()='to' or local-name()='cc' or local-name()='bcc']"/>
  1111. </defaultOptions>
  1112. </root>
  1113. </xts:transform>
  1114. </selectedEntries>
  1115. </xts:append>
  1116. </xsl:if>
  1117. </xts:sequence>
  1118. <!-- links -->
  1119. <xts:sequence>
  1120. <xsl:if test="key('default-options','link') and /root/*[local-name()='defaultOptions']/*[local-name()='link']/*[local-name()='item']/*[local-name()='searchPath'] != ''">
  1121. <xts:append select="/root">
  1122. <links>
  1123. <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
  1124. the same transforms to update the email fields and the recipients blob -->
  1125. <xts:transform src="subscribe/taskOptions/transforms/gen-standard-list.xslt" processor="XSLT">
  1126. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  1127. <root>
  1128. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  1129. <send:request provider="cm">
  1130. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  1131. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  1132. <cm:requests>
  1133. <xsl:for-each select="/root/*[local-name()='defaultOptions']/*[local-name()='link']/*[local-name()='item']/*[local-name()='searchPath' and .!='']">
  1134. <cm:query>
  1135. <cm:search>
  1136. <xsl:value-of select="."/>
  1137. <xsl:value-of select="/root/system/param[@name='visible']"/>
  1138. </cm:search>
  1139. <cm:properties>
  1140. <cm:property name="defaultName"/>
  1141. <cm:property name="searchPath"/>
  1142. <cm:property name="iconURI"/>
  1143. <cm:property name="storeID"/>
  1144. </cm:properties>
  1145. </cm:query>
  1146. </xsl:for-each>
  1147. </cm:requests>
  1148. </cm:query>
  1149. </xts:transform>
  1150. </send:request>
  1151. </xts:transform>
  1152. <action>links</action>
  1153. </root>
  1154. </xts:transform>
  1155. </links>
  1156. </xts:append>
  1157. <!-- web64 encode the list of links -->
  1158. <xts:append select="/root/env">
  1159. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  1160. <param name="links">
  1161. <passport>
  1162. <xsl:value-of select="$passport"/>
  1163. </passport>
  1164. <markup>
  1165. <xts:transform name="XMLEncode">
  1166. <xts:queryNode select="/root/links/*"/>
  1167. </xts:transform>
  1168. </markup>
  1169. </param>
  1170. </xts:transform>
  1171. </xts:append>
  1172. </xsl:if>
  1173. </xts:sequence>
  1174. <!-- attachments -->
  1175. <xts:sequence>
  1176. <xsl:if test="key('default-options','attachments') or key('default-options','eventOutput')">
  1177. <xts:append select="/root">
  1178. <attachments>
  1179. <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
  1180. the same transforms to update the email fields and the recipients blob -->
  1181. <xts:transform src="subscribe/taskOptions/transforms/gen-standard-list.xslt" processor="XSLT">
  1182. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  1183. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  1184. <root>
  1185. <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-'))] != ''">
  1186. <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
  1187. <send:request provider="cm">
  1188. <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
  1189. <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
  1190. <cm:requests>
  1191. <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-'))]">
  1192. <cm:query>
  1193. <cm:search>
  1194. <xsl:value-of select="."/>
  1195. <xsl:value-of select="/root/system/param[@name='visible']"/>
  1196. </cm:search>
  1197. <cm:properties>
  1198. <cm:property name="defaultName"/>
  1199. <cm:property name="searchPath"/>
  1200. <cm:property name="iconURI"/>
  1201. </cm:properties>
  1202. </cm:query>
  1203. </xsl:for-each>
  1204. </cm:requests>
  1205. </cm:query>
  1206. </xts:transform>
  1207. </send:request>
  1208. </xts:transform>
  1209. </xsl:if>
  1210. <action>attachments</action>
  1211. <defaultOptions>
  1212. <xsl:copy-of select="/root/defaultOptions/*[local-name()='attachments']"/>
  1213. <eventOutput>
  1214. <xsl:copy-of select="/root/defaultOptions/*[local-name()='eventOutput']"/>
  1215. </eventOutput>
  1216. </defaultOptions>
  1217. <attachParam>
  1218. <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*"/>
  1219. </attachParam>
  1220. </root>
  1221. </xts:transform>
  1222. </attachments>
  1223. </xts:append>
  1224. <!-- web64 encode the list of links -->
  1225. <xts:append select="/root/env">
  1226. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  1227. <param name="attachments">
  1228. <passport>
  1229. <xsl:value-of select="$passport"/>
  1230. </passport>
  1231. <markup>
  1232. <xts:transform name="XMLEncode">
  1233. <xts:queryNode select="/root/attachments/*"/>
  1234. </xts:transform>
  1235. </markup>
  1236. </param>
  1237. </xts:transform>
  1238. </xts:append>
  1239. </xsl:if>
  1240. </xts:sequence>
  1241. </xsl:template>
  1242. </xsl:stylesheet>
  1243. </xts:block>
  1244. <!--
  1245. ===============================================================================================
  1246. updateAddedLists
  1247. ===============================================================================================
  1248. -->
  1249. <xts:block id="updateAddedLists" type="exec" processor="XSLT" dependency="processResponse processRequestParams queryCMForOptionsInfo" condition=".[/root/*[local-name()='selectedEntries'] or /root/env/param[@name='addAttachment']!='']" mandatory="false">
  1250. <xts:logicsheet path="logicsheets/portal.xsl"/>
  1251. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:send="http://developer.cognos.com/schemas/xts/logic-sheet/xslt/brl/1/" exclude-result-prefixes="xsl send xtsext pf">
  1252. <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
  1253. <pf:serialize-xml/>
  1254. <!-- Session variables -->
  1255. <xsl:variable name="passport">
  1256. <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
  1257. </xsl:variable>
  1258. <xsl:template match="/">
  1259. <xts:sequence>
  1260. <xsl:choose>
  1261. <!-- adding attachments -->
  1262. <xsl:when test="/root/env/param[@name='addAttachment'] != ''">
  1263. <xts:delete select="/root/attachments"/>
  1264. <xts:append select="/root">
  1265. <attachments>
  1266. <xts:transform src="subscribe/taskOptions/transforms/update_entries_list.xslt" processor="XSLT">
  1267. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  1268. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  1269. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  1270. <root>
  1271. <createWeb64Param>false</createWeb64Param>
  1272. <action>addingAttachments</action>
  1273. <attachmentToAdd>
  1274. <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment'])]/*"/>
  1275. <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'])">
  1276. <locale/>
  1277. </xsl:if>
  1278. <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'])">
  1279. <format/>
  1280. </xsl:if>
  1281. <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']">
  1282. <eventOutput>true</eventOutput>
  1283. </xsl:if>
  1284. </attachmentToAdd>
  1285. <xsl:if test="/root/env/param[@name='attachments'] != ''">
  1286. <previouslyAdded>
  1287. <xts:transform name="XMLDecode">
  1288. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='attachments'])), true())"/>
  1289. </xts:transform>
  1290. </previouslyAdded>
  1291. </xsl:if>
  1292. </root>
  1293. </xts:transform>
  1294. </attachments>
  1295. </xts:append>
  1296. <!-- web64 the list of links and attachments -->
  1297. <xts:delete select="/root/env/param[@name='attachments']"/>
  1298. <xts:append select="/root/env">
  1299. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  1300. <param name="attachments">
  1301. <passport>
  1302. <xsl:value-of select="$passport"/>
  1303. </passport>
  1304. <markup>
  1305. <xts:transform name="XMLEncode">
  1306. <xts:queryNode select="/root/attachments/*"/>
  1307. </xts:transform>
  1308. </markup>
  1309. </param>
  1310. </xts:transform>
  1311. </xts:append>
  1312. </xsl:when>
  1313. <!-- added links -->
  1314. <xsl:when test="/root/env/param[@name='addingLinks']='true'">
  1315. <xts:delete select="/root/links"/>
  1316. <xts:append select="/root">
  1317. <links>
  1318. <xts:transform src="subscribe/taskOptions/transforms/update_entries_list.xslt" processor="XSLT">
  1319. <xts:param name="messageBase">/messages/portal.xml</xts:param>
  1320. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  1321. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  1322. <root>
  1323. <createWeb64Param>false</createWeb64Param>
  1324. <selectedEntries>
  1325. <xts:queryNode select="/root/selectedEntries/*"/>
  1326. </selectedEntries>
  1327. <action>addingLinks</action>
  1328. <xsl:if test="/root/env/param[@name='links'] != ''">
  1329. <previouslyAdded>
  1330. <xts:transform name="XMLDecode">
  1331. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='links'])), true())"/>
  1332. </xts:transform>
  1333. </previouslyAdded>
  1334. </xsl:if>
  1335. </root>
  1336. </xts:transform>
  1337. </links>
  1338. </xts:append>
  1339. <!-- web64 the list of links and attachments -->
  1340. <xts:delete select="/root/env/param[@name='links']"/>
  1341. <xts:append select="/root/env">
  1342. <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
  1343. <param name="links">
  1344. <passport>
  1345. <xsl:value-of select="$passport"/>
  1346. </passport>
  1347. <markup>
  1348. <xts:transform name="XMLEncode">
  1349. <xts:queryNode select="/root/links/*"/>
  1350. </xts:transform>
  1351. </markup>
  1352. </param>
  1353. </xts:transform>
  1354. </xts:append>
  1355. </xsl:when>
  1356. <!-- added recipients -->
  1357. <xsl:otherwise>
  1358. <xsl:variable name="env" select="/root/env"/>
  1359. <xts:delete select="/root/env/param[@name='email_to' or @name='email_cc' or @name='email_bcc' or @name='addedRecipients']"/>
  1360. <xts:append select="/root/env">
  1361. <xts:transform src="subscribe/taskOptions/transforms/update_email_recipients.xslt" processor="XSLT">
  1362. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  1363. <root>
  1364. <xsl:copy-of select="$env"/>
  1365. <selectedEntries>
  1366. <xts:queryNode select="/root/selectedEntries/*"/>
  1367. </selectedEntries>
  1368. <xsl:if test="/root/env/param[@name='addedRecipients'] != ''">
  1369. <previouslyAdded>
  1370. <xts:transform name="XMLDecode">
  1371. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addedRecipients'])), true())"/>
  1372. </xts:transform>
  1373. </previouslyAdded>
  1374. </xsl:if>
  1375. </root>
  1376. </xts:transform>
  1377. <xts:transform src="subscribe/taskOptions/transforms/update_entries_list.xslt" processor="XSLT">
  1378. <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
  1379. <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
  1380. <root>
  1381. <passport>
  1382. <xsl:value-of select="$passport"/>
  1383. </passport>
  1384. <paramName>addedRecipients</paramName>
  1385. <selectedEntries>
  1386. <xts:queryNode select="/root/selectedEntries/*"/>
  1387. </selectedEntries>
  1388. <xsl:if test="/root/env/param[@name='addedRecipients'] != ''">
  1389. <previouslyAdded>
  1390. <xts:transform name="XMLDecode">
  1391. <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addedRecipients'])), true())"/>
  1392. </xts:transform>
  1393. </previouslyAdded>
  1394. </xsl:if>
  1395. <action>addingRecipients</action>
  1396. </root>
  1397. </xts:transform>
  1398. </xts:append>
  1399. </xsl:otherwise>
  1400. </xsl:choose>
  1401. </xts:sequence>
  1402. </xsl:template>
  1403. </xsl:stylesheet>
  1404. </xts:block>
  1405. <!--
  1406. ===============================================================================================
  1407. genMarkup -
  1408. ===============================================================================================
  1409. -->
  1410. <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="updateAddedLists queryCMForOptionsInfo businessRules2 processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='setLabels' or local-name()='canceled']]" mandatory="false">
  1411. <!-- logicsheets -->
  1412. <!-- portal specific information -->
  1413. <xts:logicsheet path="logicsheets/portal.xsl"/>
  1414. <!-- Dialog specific logicsheets -->
  1415. <xts:logicsheet path="subscribe/taskOptions/logicsheets/ui-templates.xsl"/>
  1416. <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
  1417. <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
  1418. <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
  1419. <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
  1420. <!-- Generic logicsheets -->
  1421. <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
  1422. <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
  1423. <xts:logicsheet path="logicsheets/validation.xslt"/>
  1424. <xts:logicsheet path="logicsheets/formlogic.xslt"/>
  1425. <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
  1426. <xsl:stylesheet version="1.0" xmlns:utml="http://developer.cognos.com/schemas/xts/logicsheet/xslt/formlogic/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/" xmlns:pf="http://developer.cognos.com/schemas/xts/pf" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:lyt="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/layout/" xmlns:dp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/presentation/" xmlns:df="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/framework/" xmlns:cf="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/framework/" xmlns:dlgctrl="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/dialog/controller-templates/" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:eut="http://developer.cognos.com/schemas/xts/logicsheets/xslt/emailOptions/logicsheets/" xmlns:cp="http://developer.cognos.com/schemas/xts/logicsheets/xslt/presentation/controls/presentation/" exclude-result-prefixes="xts xsl cm pf xtsext lyt dp df cf cp xos dlgctrl eut utml">
  1427. <xsl:output method="xml" encoding="utf-8" indent="no"/>
  1428. <xsl:key name="business-rules" match="/root/businessRules/*" use="local-name()"/>
  1429. <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
  1430. <xsl:key name="system-param" match="/root/system/param" use="@name"/>
  1431. <pf:variables/>
  1432. <pf:gen-icon/>
  1433. <xsl:variable name="agentStudio" select="key('request-param','agentStudio') = 'true'"/>
  1434. <xsl:variable name="inWizard" select="key('request-param','inWizard') = 'true'"/>
  1435. <xsl:variable name="subscription" select="key('request-param','subscription') = 'true'"/>
  1436. <xsl:variable name="taskType" select="key('request-param','taskType')"/>
  1437. <xsl:variable name="richEditMode">
  1438. <xsl:choose>
  1439. <xsl:when test="$browser = 'ie' and not(key('env-param','richEditMode'))">true</xsl:when>
  1440. <xsl:when test="$browser = 'ie'">
  1441. <xsl:value-of select="key('env-param','richEditMode')"/>
  1442. </xsl:when>
  1443. <xsl:otherwise>false</xsl:otherwise>
  1444. </xsl:choose>
  1445. </xsl:variable>
  1446. <xsl:template match="/">
  1447. <xts:sequence>
  1448. <xts:append select="/root/output">
  1449. <xos:part>
  1450. <xos:entityHeader>
  1451. <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
  1452. </xos:entityHeader>
  1453. <xos:entityBody>
  1454. <xsl:element name="{key('request-param','resultNode')}" namespace="">
  1455. <markup>
  1456. <xts:transform name="XMLEncode">
  1457. <!-- adds standard hidden inputs and javascript -->
  1458. <dlgctrl:markupHelper/>
  1459. <input type="hidden" name="addedRecipients" value="{key('env-param','addedRecipients')}"/>
  1460. <input type="hidden" name="links" value="{key('env-param','links')}"/>
  1461. <input type="hidden" name="attachments" value="{key('env-param','attachments')}"/>
  1462. <input type="hidden" name="recipientsChanged" value="false"/>
  1463. <input type="hidden" name="addingLinks" value="false"/>
  1464. <input type="hidden" name="addAttachment" value=""/>
  1465. <input type="hidden" name="richEditMode" value="{$richEditMode}"/>
  1466. <input type="hidden" name="visited_email_options" value="true"/>
  1467. <!-- hidden variables to define what labels we're setting -->
  1468. <input type="hidden" name="m_ro_approveValue" value="{key('env-param','m_ro_approveValue')}"/>
  1469. <input type="hidden" name="m_ro_rejectValue" value="{key('env-param','m_ro_rejectValue')}"/>
  1470. <input type="hidden" name="m_ro_submitValue" value="{key('env-param','m_ro_submitValue')}"/>
  1471. <!-- hidden variable for the type of task - notification or approve -->
  1472. <input type="hidden" name="taskType" value="{$taskType}"/>
  1473. <xsl:if test="key('request-param', 'usePowerPlay8Options') = 'true'">
  1474. <input type="hidden" name="usePowerPlay8Options" value="true"/>
  1475. </xsl:if>
  1476. <pf:help context="HID_DISTRIBUTION"/>
  1477. <xsl:choose>
  1478. <xsl:when test="key('request-param','headerStyle')='page'">
  1479. <eut:header close="false" border="false" help="false">
  1480. <dp:image>
  1481. <img alt="" border="0" src="{key('business-rules','image')}"/>
  1482. </dp:image>
  1483. <dp:title>
  1484. <xsl:value-of select="key('business-rules','browserTitle')"/>
  1485. </dp:title>
  1486. <dp:description>
  1487. <xsl:value-of select="key('business-rules','description')"/>
  1488. </dp:description>
  1489. </eut:header>
  1490. </xsl:when>
  1491. <xsl:otherwise>
  1492. <dp:header>
  1493. <dp:title>
  1494. <xsl:value-of select="key('business-rules','browserTitle')"/>
  1495. </dp:title>
  1496. <dp:description>
  1497. <xsl:value-of select="key('business-rules','description')"/>
  1498. </dp:description>
  1499. <dp:close>
  1500. <a href="#" onclick="controller_changeState('canceled'); controller_submitForm('cancel');">
  1501. <dp:closeMarker/>
  1502. </a>
  1503. </dp:close>
  1504. </dp:header>
  1505. </xsl:otherwise>
  1506. </xsl:choose>
  1507. <xsl:if test="$agentStudio">
  1508. <script type="text/javascript" src="{$webRoot}/ags/dragDropHandler.js"/>
  1509. <script type="text/javascript" src="{$webRoot}/ags/layout.js"/>
  1510. </xsl:if>
  1511. <xsl:if test="key('request-param','taskType') = 'notification'">
  1512. <script language="javascript">
  1513. function requestAcknowledgedChecked(checkbox) {
  1514. var target = 'm_ro_readExpiry_start';
  1515. var cb = document.getElementById(target);
  1516. if(!checkbox.checked){
  1517. //alert("uncheck ack" + checkbox.id);
  1518. cb.checked = false;
  1519. }
  1520. }
  1521. function expiryChecked(checkbox){
  1522. var target = 'm_ro_readReceipt';
  1523. var cb = document.getElementById(target);
  1524. var cb_tmp = document.getElementById('tmp_chkbox_' + target);
  1525. if(checkbox.checked){
  1526. cb.checked = 'true';
  1527. cb_tmp.checked = true;
  1528. }
  1529. }
  1530. </script>
  1531. </xsl:if>
  1532. <xsl:if test="key('request-param','taskType') = 'approval'">
  1533. <script language="javascript">
  1534. var cb_prefix='tmp_chkbox_';
  1535. var cb_statechange_parent=cb_prefix+'m_ro_sub_notifyOnStateChange';
  1536. var cb_statechange_children=cb_prefix+'m_ro_sub_notifyOnStateChange_';
  1537. /*
  1538. * Get all child state change checkboxes
  1539. */
  1540. function getSubscriptionCheckboxes(node) {
  1541. var subscriptionCheckboxes = new Array();
  1542. var checkboxes = new Object();
  1543. var checkboxes = node.getElementsByTagName('INPUT');
  1544. var count=0;
  1545. for (var i=0;i&lt;checkboxes.length;i++) {
  1546. if (checkboxes[i].type =='checkbox' &amp;&amp; checkboxes[i].id.match("^"+cb_statechange_children)==cb_statechange_children ) {
  1547. subscriptionCheckboxes[count]=checkboxes[i];
  1548. count++;
  1549. }
  1550. }
  1551. return subscriptionCheckboxes;
  1552. }
  1553. /*
  1554. * Update the radio buttons for approve/agent tasks - when link or checkbox is changed
  1555. */
  1556. function updateApproveAgentRadio(value) {
  1557. document.getElementById('m_ro_owner_action_' + value).checked='true'
  1558. }
  1559. /*
  1560. * Update the state change checkboxes
  1561. */
  1562. <!--function setSubscriptions() {
  1563. for (eventx in subscriptionObj.events) {
  1564. checkboxes = getSubscriptionCheckboxes(document);
  1565. for (var i=0;i&lt;checkboxes.length;i++) {
  1566. var cb = checkboxes[i];
  1567. cb.checked=subscriptionObj.events[cb.value];
  1568. }
  1569. }
  1570. }-->
  1571. /*
  1572. * If we have at least one child state change checkbox checked then select the parent otherwise deselected
  1573. */
  1574. function initialiseCheckboxes() {
  1575. var containerId = 'taskOptionsTableId';
  1576. var containerNode = document.getElementById(containerId);
  1577. var parentCb = document.getElementById(cb_statechange_parent);
  1578. if (parentCb &amp;&amp; containerNode) {
  1579. parentCb.checked= isStateChangeSelected(containerNode);
  1580. }
  1581. }
  1582. /*
  1583. * A checkbox has been selected. This function is attache to the checkbox onclick handler
  1584. */
  1585. function checkboxSelected(id,containerId) {
  1586. //we have clicked the parent checkbox so select/deselect all state change options
  1587. var node = document.getElementById(containerId);
  1588. if (id==cb_statechange_parent) {
  1589. var cb = document.getElementById(id);
  1590. processCheckBoxes(node,cb.checked);
  1591. }
  1592. //we have selected a state change option so select the parent checkbox too
  1593. else {
  1594. var parentCb = document.getElementById(cb_statechange_parent);
  1595. parentCb.checked= isStateChangeSelected(node);
  1596. }
  1597. }
  1598. /*
  1599. * Loop through the state change checkboxes selecting/deselecting each one
  1600. */
  1601. function processCheckBoxes(node,subscribe) {
  1602. for (var i=0; i &lt; node.childNodes.length; i++){
  1603. var childNode = node.childNodes[i];
  1604. if (childNode.nodeName=='INPUT' &amp;&amp; childNode.type=='checkbox' &amp;&amp; node.id != cb_statechange_parent &amp;&amp; childNode.id.indexOf(cb_statechange_children)==0) {
  1605. if (childNode.checked != subscribe) {
  1606. childNode.checked=subscribe;
  1607. fireClickEvent(childNode.id);
  1608. }
  1609. }
  1610. processCheckBoxes(childNode,subscribe);
  1611. }
  1612. }
  1613. /*
  1614. *Loop through the state change options. If at least one is selected then return true
  1615. */
  1616. function isStateChangeSelected(node) {
  1617. var found = true;
  1618. var checkboxes = node.getElementsByTagName('INPUT');
  1619. for (var i=0;i &lt; checkboxes.length;i++) {
  1620. if (checkboxes[i].type =='checkbox' &amp;&amp; checkboxes[i].id.indexOf(cb_statechange_children) != -1 &amp;&amp; checkboxes[i].id != cb_statechange_parent) {
  1621. found = checkboxes[i].checked;
  1622. //found a selected state change option so break
  1623. if (found) {
  1624. break;
  1625. }
  1626. }
  1627. }
  1628. return found;
  1629. }
  1630. function fireClickEvent(elementId) {
  1631. var element = document.getElementById(elementId);
  1632. //IE
  1633. if (element.fireEvent) {
  1634. var e = document.createEventObject();
  1635. element.fireEvent('onclick', e);
  1636. }
  1637. //Firefox
  1638. else {
  1639. var e = document.createEvent('MouseEvents');
  1640. e.initEvent('click', true, true);
  1641. element.dispatchEvent(e);
  1642. }
  1643. }
  1644. </script>
  1645. </xsl:if>
  1646. <script language="javascript">
  1647. <xsl:choose>
  1648. <xsl:when test="$agentStudio">
  1649. var textRange;
  1650. function init()
  1651. {
  1652. <xsl:variable name="tab" select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>
  1653. droppy.registerDropZone("email_to","","",'true',&quot;<xsl:value-of select="$tab"/>&quot;,true);
  1654. droppy.registerDropZone("email_cc","","",'true',&quot;<xsl:value-of select="$tab"/>&quot;,true);
  1655. droppy.registerDropZone("email_subject","","",'true',&quot;<xsl:value-of select="$tab"/>&quot;,false);
  1656. droppy.registerDropZone("m_ro_priority_item","","",'true',&quot;<xsl:value-of select="$tab"/>&quot;,true);
  1657. <xsl:if test="key('request-param','taskType') = 'approval' ">
  1658. droppy.registerDropZone("m_ro_icon_item","","",'true',&quot;<xsl:value-of select="$tab"/>&quot;,true);
  1659. </xsl:if>
  1660. if (document.<xsl:value-of select="key('request-param','formName')"/>.richEditMode.value == 'true')
  1661. {
  1662. richEditControl_init();
  1663. }
  1664. else
  1665. {
  1666. var dropZone = new DropZone("email_body","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;);
  1667. droppy.registerDropZoneObject(dropZone);
  1668. //pass the dropzone as a group to let the listener process swaps to the html body
  1669. droppy.registerDropZoneGroup(new Array(dropZone), &quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;);
  1670. }
  1671. //set the default for the priority radio button
  1672. <xsl:if test="not(key('env-param','m_ro_priority_radio'))">
  1673. document.getElementById('m_ro_priority_radio_default').checked="true";
  1674. </xsl:if>
  1675. //set the default label radio button(only for approval tasks)
  1676. <xsl:if test="key('request-param','taskType')='approval'">
  1677. <xsl:if test="not(key('env-param','m_ro_owner_action'))">
  1678. document.getElementById('m_ro_owner_action_approve').checked="true";
  1679. </xsl:if>
  1680. <xsl:if test="not(key('env-param','m_ro_icon_radio'))">
  1681. document.getElementById('m_ro_icon_radio_default').checked="true";
  1682. </xsl:if>
  1683. //set the parent state change checkbox
  1684. initialiseCheckboxes();
  1685. </xsl:if>
  1686. }
  1687. function deleteLinksAndAttachments()
  1688. {
  1689. var foundSelectedItems = false;
  1690. <xsl:variable name="linksCount" select="count(/root/*[local-name()='links']/*[local-name()='item'])+1"/>
  1691. frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1692. for (var i=1; i&lt;<xsl:value-of select="$linksCount"/>; i++)
  1693. {
  1694. tableName = 'linkTable_' + i;
  1695. table = document.getElementById(tableName);
  1696. if (table &amp;&amp; table.className == 'emailItem_active')
  1697. {
  1698. table.className = 'hidden';
  1699. hiddenInputName = 'deleted_link_' + i;
  1700. document.getElementById(hiddenInputName).value = 'true';
  1701. foundSelectedItems = true;
  1702. }
  1703. }
  1704. <xsl:variable name="attachmentCount" select="count(/root/*[local-name()='attachments']/*[local-name()='item'])+1"/>
  1705. for (var i=1; i&lt;<xsl:value-of select="$attachmentCount"/>; i++)
  1706. {
  1707. tableName = 'attachTable_' + i;
  1708. table = document.getElementById(tableName);
  1709. if (table &amp;&amp; table.className == 'emailItem_active')
  1710. {
  1711. table.className = 'hidden';
  1712. hiddenInputName = 'deleted_attachment_' + i;
  1713. document.getElementById(hiddenInputName).value = 'true';
  1714. foundSelectedItems = true;
  1715. }
  1716. }
  1717. return foundSelectedItems;
  1718. }
  1719. function mouseOverLinkAttach(item)
  1720. {
  1721. if (item.className == 'emailItem')
  1722. {
  1723. item.className = 'emailItem_hover';
  1724. }
  1725. }
  1726. function mouseOutLinkAttach(item)
  1727. {
  1728. if (item.className == 'emailItem_hover')
  1729. {
  1730. item.className = 'emailItem';
  1731. }
  1732. }
  1733. function mouseDownLinkAttach(item)
  1734. {
  1735. if (item.className == 'emailItem_active')
  1736. {
  1737. item.className = 'emailItem';
  1738. }
  1739. else if (item.className == 'emailItem' || item.className == 'emailItem_hover')
  1740. {
  1741. item.className = 'emailItem_active';
  1742. }
  1743. }
  1744. function attach(position)
  1745. {
  1746. if (document.<xsl:value-of select="key('request-param','formName')"/>.addAttachment)
  1747. document.<xsl:value-of select="key('request-param','formName')"/>.addAttachment.value = position;
  1748. controller_submitForm('default');
  1749. }
  1750. </xsl:when>
  1751. <xsl:otherwise>
  1752. function init()
  1753. {
  1754. //set the read receipt checkbox if a deadline has been set
  1755. <xsl:if test="key('env-param','m_ro_readExpiry_start')='true'">
  1756. var expiryStart = document.getElementById('m_ro_readExpiry_start');
  1757. if (expiryStart) {
  1758. expiryChecked(expiryStart);
  1759. }
  1760. </xsl:if>
  1761. if (document.<xsl:value-of select="key('request-param','formName')"/>.richEditMode.value == 'true')
  1762. richEditControl_init();
  1763. if (document.<xsl:value-of select="key('request-param','formName')"/>.controller_state)
  1764. {
  1765. document.<xsl:value-of select="key('request-param','formName')"/>.controller_state.value = '<xsl:value-of select="xtsext:javascriptencode(key('env-param','controller_state'))"/>';
  1766. }
  1767. }
  1768. </xsl:otherwise>
  1769. </xsl:choose>
  1770. function setRadioButton(radioId) {
  1771. var radio = document.getElementById(radioId);
  1772. if (radio) {
  1773. radio.checked="true";
  1774. }
  1775. }
  1776. function setInputValue(elementId,inputValue) {
  1777. var element = document.getElementById(elementId);
  1778. if (element) {
  1779. element.value=inputValue;
  1780. }
  1781. }
  1782. function changedEmailRecipients()
  1783. {
  1784. <!-- update the changed flag so we know that we should regenerate the added entries blob -->
  1785. document.<xsl:value-of select="key('request-param','formName')"/>.recipientsChanged.value = 'true';
  1786. }
  1787. function handleKeydown(e) {
  1788. var evt = (window.event) ? event:e;
  1789. var charCode = ((evt.keyCode) ? evt.keyCode : evt.which);
  1790. if (charCode == 8 || // backspace
  1791. charCode == 9 || // tab
  1792. charCode == 16 || //shift key??
  1793. charCode == 37 || // let arrow
  1794. charCode == 39 || // right arrow
  1795. charCode == 46 ) // delete
  1796. {
  1797. return true;
  1798. } else {
  1799. if (typeof evt.cancelBubble != 'undefined')
  1800. {
  1801. evt.cancelBubble = true;
  1802. }
  1803. if (typeof evt.stopPropagation != 'undefined')
  1804. {
  1805. evt.stopPropagation();
  1806. }
  1807. return false;
  1808. }
  1809. }
  1810. function validate()
  1811. {
  1812. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1813. <xsl:if test="key('request-param','burst')!='true'">
  1814. if ( frm.email_to.value == '' &amp;&amp; frm.email_cc.value == '')
  1815. {
  1816. alert("<xts:string id="IDS_EMAIL_OPTIONS_NO_RECIPIENTS" encode="javascript"/>");
  1817. return false;
  1818. }
  1819. </xsl:if>
  1820. leavingDialog();
  1821. return true;
  1822. }
  1823. <!-- makes sure all the hidden inputs are properlly set before leavingt the
  1824. email options dialog -->
  1825. function leavingDialog()
  1826. {
  1827. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1828. <!-- we need to get the plain text body since the memopart needs both the html and plain text body -->
  1829. if (frm.richEditMode &amp;&amp; frm.richEditMode.value == 'true')
  1830. {
  1831. frm.email_body.value = email_body_iframe.document.body.innerText;
  1832. if (frm.hidden_richEditBody)
  1833. {
  1834. // copy the contents of the edit window into a form field
  1835. frm.hidden_richEditBody.value = richEditControl_convertToXHTML();
  1836. }
  1837. }
  1838. <!-- we're in plain text mode, so make sure the hidden HTML input gets updated -->
  1839. else
  1840. {
  1841. if (frm.hidden_richEditBody)
  1842. {
  1843. frm.hidden_richEditBody.value = replaceCarriageReturns(htmlEncode(frm.email_body.value),'&lt;br/&gt;');
  1844. }
  1845. }
  1846. }
  1847. function setFormTarget()
  1848. {
  1849. <xsl:choose>
  1850. <xsl:when test="key('request-param','addEntriesPopUp')='true' and key('request-param','addEntriesPopUpTarget')!=''">
  1851. document.<xsl:value-of select="key('request-param','formName')"/>.target = '<xsl:value-of select="key('request-param','addEntriesPopUpTarget')"/>';
  1852. </xsl:when>
  1853. <xsl:when test="key('request-param','addEntriesPopUp')='true'">
  1854. document.<xsl:value-of select="key('request-param','formName')"/>.target = 'addEntriesFrame';
  1855. </xsl:when>
  1856. </xsl:choose>
  1857. }
  1858. function unsetFormTarget()
  1859. {
  1860. <xsl:if test="key('request-param','addEntriesPopUp')='true'">
  1861. document.<xsl:value-of select="key('request-param','formName')"/>.target = '';
  1862. </xsl:if>
  1863. }
  1864. <!-- convert less than and greater than to text references -->
  1865. function htmlEncode(string)
  1866. {
  1867. var returnString = string.replace(/&amp;/g, "&amp;amp;");
  1868. returnString = returnString.replace(/&quot;/g, "&amp;quot;");
  1869. returnString = returnString.replace(/&lt;/g, "&amp;lt;");
  1870. returnString = returnString.replace(/&gt;/g, "&amp;gt;");
  1871. return returnString;
  1872. }
  1873. <!-- used to replace linefeeds to </br> for the html version of the body -->
  1874. function replaceCarriageReturns(string, replaceWith)
  1875. {
  1876. <!-- encode textarea string's carriage returns -->
  1877. string = escape(string);
  1878. <!--loop through string, replacing carriage return encoding with HTML break tag-->
  1879. for(i=0; i&lt;string.length; i++)
  1880. {
  1881. if(string.indexOf("%0D%0A") > -1)
  1882. {
  1883. <!-- Windows encodes returns as \r\n hex-->
  1884. string=string.replace("%0D%0A",replaceWith);
  1885. }
  1886. else if(string.indexOf("%0A") > -1)
  1887. {
  1888. <!-- Unix encodes returns as \n hex-->
  1889. string=string.replace("%0A",replaceWith);
  1890. }
  1891. else if(string.indexOf("%0D") > -1)
  1892. {
  1893. <!-- Macintosh encodes returns as \r hex -->
  1894. string=string.replace("%0D",replaceWith);
  1895. }
  1896. }
  1897. string=unescape(string) <!-- unescape all other encoded characters -->
  1898. return string;
  1899. }
  1900. function changeModes()
  1901. {
  1902. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1903. if (frm.richEditMode.value == 'true')
  1904. {
  1905. frm.email_body.value = email_body_iframe.document.body.innerText;
  1906. frm.richEditMode.value = 'false';
  1907. }
  1908. else
  1909. {
  1910. frm.richEditMode.value = 'true';
  1911. }
  1912. controller_submitForm('default');
  1913. }
  1914. function initInsertTable()
  1915. {
  1916. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1917. frm.richEditControl_tableColumns.value = '2';
  1918. frm.richEditControl_tableRows.value = '2';
  1919. email_body_iframe.focus();
  1920. textRange = email_body_iframe.document.selection.createRange();
  1921. }
  1922. function insertTableIntoBody()
  1923. {
  1924. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1925. <xsl:variable name="maxColumns">
  1926. <xsl:choose>
  1927. <xsl:when test="/root/system/param[@name='max-table-columns']!=''">
  1928. <xsl:value-of select="/root/system/param[@name='max-table-columns']"/>
  1929. </xsl:when>
  1930. <xsl:otherwise>20</xsl:otherwise>
  1931. </xsl:choose>
  1932. </xsl:variable>
  1933. <xsl:variable name="maxRows">
  1934. <xsl:choose>
  1935. <xsl:when test="/root/system/param[@name='max-table-rows']!=''">
  1936. <xsl:value-of select="/root/system/param[@name='max-table-rows']"/>
  1937. </xsl:when>
  1938. <xsl:otherwise>100</xsl:otherwise>
  1939. </xsl:choose>
  1940. </xsl:variable>
  1941. <!-- make sure the number of rows and columns are valid integers
  1942. and do not exceed the maximum. Default for maximum is 20 columns and 100 rows, but
  1943. can be changed via system.xml -->
  1944. if (!validate_positiveIntegerProp(frm.richEditControl_tableColumns, <xsl:value-of select="$maxColumns"/>))
  1945. {
  1946. var errorMsg = "<xts:string id="IDS_EMAIL_OPTIONS_MIN_MAX_COLUMNS" encode="javascript">
  1947. <xts:param name="max">" + (<xsl:value-of select="$maxColumns"/>) + "</xts:param>
  1948. </xts:string>";
  1949. window.alert(errorMsg);
  1950. frm.richEditControl_tableColumns.focus();
  1951. return;
  1952. }
  1953. if (!validate_positiveIntegerProp(frm.richEditControl_tableRows, <xsl:value-of select="$maxRows"/>))
  1954. {
  1955. var errorMsg = "<xts:string id="IDS_EMAIL_OPTIONS_MIN_MAX_ROWS" encode="javascript">
  1956. <xts:param name="max">" + (<xsl:value-of select="$maxRows"/>) + "</xts:param>
  1957. </xts:string>";
  1958. window.alert(errorMsg);
  1959. frm.richEditControl_tableRows.focus();
  1960. return;
  1961. }
  1962. insertTablePopup.hide();
  1963. richEditControl_doTable();
  1964. }
  1965. <!-- required when user enters bad data and clicks off dialog leaving it hidden but active.
  1966. we don't want to reset a good entry back to defaults (bug 555470.1) -->
  1967. function validateHideTable()
  1968. {
  1969. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1970. if (!validate_positiveIntegerProp(frm.richEditControl_tableColumns, <xsl:value-of select="$maxColumns"/>))
  1971. {
  1972. return;
  1973. }
  1974. if (!validate_positiveIntegerProp(frm.richEditControl_tableRows, <xsl:value-of select="$maxRows"/>))
  1975. {
  1976. return;
  1977. }
  1978. return true;
  1979. }
  1980. function cancelCreateTable()
  1981. {
  1982. frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  1983. <!-- need to reset the columns and rows or we might get a CAF error (bug 477423) -->
  1984. frm.richEditControl_tableColumns.value = '2';
  1985. frm.richEditControl_tableRows.value = '2';
  1986. }
  1987. <!-- Make sure the number of columns or rows is a positive integer (1,2,...) -->
  1988. function validate_positiveIntegerProp(e, max)
  1989. {
  1990. if (e.value &gt; max || e.value &lt; 1 || isNaN(e.value) || parseInt(e.value, 10) != e.value)
  1991. {
  1992. return false;
  1993. }
  1994. e.value = parseInt(e.value, 10);
  1995. return true;
  1996. }
  1997. </script>
  1998. <!-- add a hidden iframe if we must show the added recipients in a popup -->
  1999. <xsl:if test="key('request-param','addEntriesPopUp')='true'">
  2000. <script language="javascript">
  2001. function show_div(div)
  2002. {
  2003. modalDiv = document.getElementById(div);
  2004. modalDiv.style.display = "block";
  2005. modalDiv.style.height = "100%";
  2006. modalDiv.style.width = "100%";
  2007. modalDiv.style.left = 0;
  2008. modalDiv.style.top = 0;
  2009. }
  2010. function show_iFrame(iframe)
  2011. {
  2012. iFrameAddEntries = document.getElementById(iframe);
  2013. iFrameAddEntries.style.display = "block";
  2014. iFrameAddEntries.style.height = "70%";
  2015. iFrameAddEntries.style.width = "85%";
  2016. iFrameAddEntries.style.border = "1px solid";
  2017. if ((document.body.clientWidth - iFrameAddEntries.scrollWidth) &lt; 0)
  2018. {
  2019. iFrameAddEntries.style.left = 0;
  2020. }
  2021. else
  2022. {
  2023. iFrameAddEntries.style.left = ((document.body.clientWidth - iFrameAddEntries.scrollWidth) / 2) + document.body.scrollLeft;
  2024. }
  2025. }
  2026. </script>
  2027. <div id="makeModalDiv" style="z-index:49; display:none; position: absolute;">
  2028. <table width="100%" height="100%">
  2029. <tr>
  2030. <td/>
  2031. </tr>
  2032. </table>
  2033. </div>
  2034. <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;"/>
  2035. </xsl:if>
  2036. <!-- generate table popup -->
  2037. <xsl:if test="$richEditMode = 'true'">
  2038. <!-- Set the search options dialog wrap it in a div so it doesn't expand the td we're in -->
  2039. <div>
  2040. <cp:genericDialog id="insertTablePopup" interactive="true" align="left" width="300" positionVertical="true" positionHorizontal="true" closeOnClick="cancelCreateTable();">
  2041. <cp:param name="title">
  2042. <xts:string id="IDS_EMAIL_OPTIONS_INSERT_TABLE_TITLE"/>
  2043. </cp:param>
  2044. <cp:param name="body">
  2045. <lyt:layout style="1">
  2046. <lyt:section>
  2047. <dp:list>
  2048. <dp:section>
  2049. <dp:label>
  2050. <xts:string id="IDS_EMAIL_OPTIONS_NUMBER_OF_COLUMNS"/>
  2051. </dp:label>
  2052. </dp:section>
  2053. <dp:section>
  2054. <!-- column default is always 2 -->
  2055. <input type="text" name="richEditControl_tableColumns" value="2" size="2"/>
  2056. </dp:section>
  2057. </dp:list>
  2058. </lyt:section>
  2059. <lyt:section>
  2060. <dp:list>
  2061. <dp:section>
  2062. <dp:label>
  2063. <xts:string id="IDS_EMAIL_OPTIONS_NUMBER_OF_ROWS"/>
  2064. </dp:label>
  2065. </dp:section>
  2066. <dp:section>
  2067. <!-- rows default is always 2 -->
  2068. <input type="text" name="richEditControl_tableRows" value="2" size="2"/>
  2069. </dp:section>
  2070. <dp:section>
  2071. <img height="15" width="5" src="{$webcontent}/images/space.gif" alt=""/>
  2072. </dp:section>
  2073. </dp:list>
  2074. </lyt:section>
  2075. </lyt:layout>
  2076. </cp:param>
  2077. <cp:param name="footer">
  2078. <dp:simpleFooter>
  2079. <df:button df:id="IDS_OK" df:style="href" df:href="javascript:insertTableIntoBody();"/>
  2080. <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:cancelCreateTable();javascript:insertTablePopup.hide();"/>
  2081. </dp:simpleFooter>
  2082. </cp:param>
  2083. </cp:genericDialog>
  2084. </div>
  2085. </xsl:if>
  2086. <lyt:layout style="2">
  2087. <lyt:section>
  2088. <xsl:variable name="inputSize">
  2089. <xsl:choose>
  2090. <xsl:when test="$agentStudio">50</xsl:when>
  2091. <xsl:otherwise>55</xsl:otherwise>
  2092. </xsl:choose>
  2093. </xsl:variable>
  2094. <xsl:if test="key('request-param','burst')!='true'">
  2095. <!-- need to put the email to, cc and links in one table
  2096. to get the links to right align properly -->
  2097. <table border="0" cellspacing="0" cellpadding="0">
  2098. <tr>
  2099. <td>
  2100. <!-- email to -->
  2101. <dp:list>
  2102. <dp:section>
  2103. <dp:label>
  2104. <label for="email_to">
  2105. <xsl:choose>
  2106. <xsl:when test="key('request-param','taskType')='approval'">
  2107. <xts:string id="IDS_EMAIL_OPTIONS_ASSIGN_TO"/>
  2108. </xsl:when>
  2109. <xsl:otherwise>
  2110. <xts:string id="IDS_EMAIL_OPTIONS_TO"/>
  2111. </xsl:otherwise>
  2112. </xsl:choose>
  2113. </label>
  2114. </dp:label>
  2115. </dp:section>
  2116. </dp:list>
  2117. <table border="0" cellspacing="0" cellpadding="1">
  2118. <tr>
  2119. <xsl:if test="$agentStudio">
  2120. <td valign="top" nowrap="nowrap">
  2121. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  2122. <tr valign="top">
  2123. <dp:columnButton>
  2124. <img align="middle" height="18" name="insert_to" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_to');">
  2125. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  2126. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  2127. </img>
  2128. </dp:columnButton>
  2129. </tr>
  2130. </table>
  2131. </td>
  2132. <td nowrap="nowrap">
  2133. <img width="3" src="{$webcontent}/images/space.gif" alt=""/>
  2134. </td>
  2135. </xsl:if>
  2136. <td nowrap="nowrap">
  2137. <input name="email_to" id="email_to" size="{$inputSize}" oncontextmenu="return false;" onkeydown="return handleKeydown(event);" onchange="changedEmailRecipients();">
  2138. <!-- make the input hidden if part of a subscription -->
  2139. <xsl:attribute name="type"><xsl:text>text</xsl:text></xsl:attribute>
  2140. <xsl:attribute name="value"><xsl:value-of select="key('env-param','email_to')"/></xsl:attribute>
  2141. </input>
  2142. </td>
  2143. </tr>
  2144. </table>
  2145. <!-- do not show the CC section if part of a subscription -->
  2146. <!-- email cc -->
  2147. <dp:list>
  2148. <dp:section>
  2149. <dp:label>
  2150. <label for="email_cc">
  2151. <xsl:choose>
  2152. <xsl:when test="key('request-param','taskType')='approval'">
  2153. <xts:string id="IDS_EMAIL_OPTIONS_STAKEHOLDERS"/>
  2154. </xsl:when>
  2155. <xsl:otherwise>
  2156. <xts:string id="IDS_EMAIL_OPTIONS_CC"/>
  2157. </xsl:otherwise>
  2158. </xsl:choose>
  2159. </label>
  2160. </dp:label>
  2161. </dp:section>
  2162. </dp:list>
  2163. <table border="0" cellspacing="0" cellpadding="1">
  2164. <tr>
  2165. <xsl:if test="$agentStudio">
  2166. <td valign="top" nowrap="nowrap">
  2167. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  2168. <tr valign="top">
  2169. <dp:columnButton>
  2170. <img align="middle" height="18" name="insert_cc" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_cc');">
  2171. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  2172. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  2173. </img>
  2174. </dp:columnButton>
  2175. </tr>
  2176. </table>
  2177. </td>
  2178. <td nowrap="nowrap">
  2179. <img width="3" src="{$webcontent}/images/space.gif" alt=""/>
  2180. </td>
  2181. </xsl:if>
  2182. <td nowrap="nowrap">
  2183. <input type="text" name="email_cc" id="email_cc" size="{$inputSize}" oncontextmenu="return false;" onkeydown="return handleKeydown(event);" onchange="changedEmailRecipients();">
  2184. <xsl:attribute name="value"><xsl:value-of select="key('env-param','email_cc')"/></xsl:attribute>
  2185. </input>
  2186. </td>
  2187. </tr>
  2188. </table>
  2189. <table border="0" cellspacing="0" cellpadding="1" width="100%">
  2190. <tr align="right" class="formLink">
  2191. <td nowrap="nowrap" align="right">
  2192. <!-- select recipients -->
  2193. <dp:link align="right">
  2194. <a href="#" onclick="setFormTarget(); controller_doSubmit('addEntries', 'navigate', 'stack-up'); unsetFormTarget();">
  2195. <xts:string id="IDS_EMAIL_OPTIONS_SELECT_RECIPIENTS"/>
  2196. </a>
  2197. </dp:link>
  2198. &#160;&#160;
  2199. </td>
  2200. </tr>
  2201. </table>
  2202. </td>
  2203. </tr>
  2204. </table>
  2205. </xsl:if>
  2206. </lyt:section>
  2207. <!-- task name -->
  2208. <lyt:section>
  2209. <xsl:if test="$agentStudio">
  2210. <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
  2211. </xsl:if>
  2212. </lyt:section>
  2213. </lyt:layout>
  2214. <lyt:layout style="1">
  2215. <lyt:section>
  2216. <xsl:variable name="controlsWidth">
  2217. <xsl:choose>
  2218. <xsl:when test="$agentStudio">650</xsl:when>
  2219. <xsl:otherwise>680</xsl:otherwise>
  2220. </xsl:choose>
  2221. </xsl:variable>
  2222. <!-- subject -->
  2223. <dp:list>
  2224. <dp:section>
  2225. <dp:label>
  2226. <label for="email_subject">
  2227. <xts:string id="IDS_EMAIL_OPTIONS_SUBJECT"/>
  2228. </label>
  2229. </dp:label>
  2230. </dp:section>
  2231. </dp:list>
  2232. <table border="0" cellspacing="0" cellpadding="1">
  2233. <tr>
  2234. <xsl:if test="$agentStudio">
  2235. <td valign="top" nowrap="nowrap">
  2236. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  2237. <tr valign="top">
  2238. <dp:columnButton>
  2239. <img align="middle" height="18" name="insert_subject" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_subject');">
  2240. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  2241. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  2242. </img>
  2243. </dp:columnButton>
  2244. </tr>
  2245. </table>
  2246. </td>
  2247. <td nowrap="nowrap">
  2248. <img width="3" src="{$webcontent}/images/space.gif" alt=""/>
  2249. </td>
  2250. </xsl:if>
  2251. <td nowrap="nowrap">
  2252. <input type="text" name="email_subject" id="email_subject" style="width:{$controlsWidth}px">
  2253. <xsl:attribute name="value"><xsl:value-of select="key('env-param','email_subject')"/></xsl:attribute>
  2254. </input>
  2255. </td>
  2256. </tr>
  2257. <tr>
  2258. <td nowrap="nowrap">
  2259. <img height="5" width="1" src="{$webcontent}/images/space.gif" alt=""/>
  2260. </td>
  2261. </tr>
  2262. </table>
  2263. <!-- body -->
  2264. <table border="0" cellspacing="0" cellpadding="0">
  2265. <!-- in agent studio we have to take into account the add selected items button -->
  2266. <xsl:attribute name="style"><xsl:choose><xsl:when test="$agentStudio">width:<xsl:value-of select="$controlsWidth + 30"/>px</xsl:when><xsl:otherwise>width:<xsl:value-of select="$controlsWidth"/>px</xsl:otherwise></xsl:choose></xsl:attribute>
  2267. <tr>
  2268. <td style="white-space:nowrap;" class="formLabel" valign="bottom">
  2269. <label for="email_body">
  2270. <xts:string id="IDS_EMAIL_OPTIONS_BODY"/>
  2271. </label>
  2272. </td>
  2273. <xsl:if test="$browser = 'ie'">
  2274. <xsl:choose>
  2275. <xsl:when test="$richEditMode = 'true'">
  2276. <td width="100%" align="right" class="formLink" nowrap="nowrap" valign="bottom">
  2277. <a href="#" onclick="javascript:changeModes();">
  2278. <xts:string id="IDS_EMAIL_OPTIONS_PLAIN_TEXT"/>
  2279. </a>
  2280. </td>
  2281. <td valign="bottom" nowrap="nowrap">
  2282. <img height="5" width="3" src="{$webcontent}/images/space.gif" alt=""/>
  2283. <img src="{$skin_images}prompt_option_to_right.gif"/>
  2284. <img height="5" width="10" src="{$webcontent}/images/space.gif" alt=""/>
  2285. </td>
  2286. </xsl:when>
  2287. <xsl:otherwise>
  2288. <td width="100%" align="right" valign="bottom">
  2289. <img src="{$skin_images}prompt_option_to_left.gif"/>
  2290. <img height="5" width="3" src="{$webcontent}/images/space.gif" alt=""/>
  2291. </td>
  2292. <td class="formLink" nowrap="nowrap" valign="bottom">
  2293. <a href="#" onclick="javascript:changeModes();">
  2294. <xts:string id="IDS_EMAIL_OPTIONS_HTML_TEXT"/>
  2295. </a>
  2296. </td>
  2297. </xsl:otherwise>
  2298. </xsl:choose>
  2299. <xsl:if test="$richEditMode = 'true'">
  2300. <xsl:call-template name="richEditControls"/>
  2301. </xsl:if>
  2302. </xsl:if>
  2303. </tr>
  2304. <tr>
  2305. <td>
  2306. <img height="3" width="1" src="{$webcontent}/images/space.gif" alt=""/>
  2307. </td>
  2308. </tr>
  2309. </table>
  2310. <table border="0" cellspacing="0" cellpadding="1">
  2311. <xsl:choose>
  2312. <xsl:when test="$agentStudio">
  2313. <tr>
  2314. <td valign="top" nowrap="nowrap">
  2315. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  2316. <tr valign="top">
  2317. <dp:columnButton>
  2318. <img align="middle" height="18" name="insert_body">
  2319. <xsl:attribute name="onclick"><xsl:choose><xsl:when test="$richEditMode = 'true'">javascript:parent.dropFrame=window.name;parent.insertStartMC('editbody');</xsl:when><xsl:otherwise>javascript:parent.dropFrame=window.name;parent.insertStartMC('email_body');</xsl:otherwise></xsl:choose></xsl:attribute>
  2320. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  2321. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  2322. </img>
  2323. </dp:columnButton>
  2324. </tr>
  2325. </table>
  2326. </td>
  2327. <td nowrap="nowrap">
  2328. <img width="3" src="{$webcontent}/images/space.gif" alt=""/>
  2329. </td>
  2330. <td nowrap="nowrap">
  2331. <table cellspacing="0" cellpadding="0" border="0" width="{$controlsWidth}">
  2332. <tr>
  2333. <!-- body -->
  2334. <td class="emailBodyTableRow">
  2335. <xsl:call-template name="emailBody">
  2336. <xsl:with-param name="inputSize">
  2337. <xsl:value-of select="$controlsWidth"/>
  2338. </xsl:with-param>
  2339. <xsl:with-param name="richEditMode" select="$richEditMode"/>
  2340. </xsl:call-template>
  2341. </td>
  2342. </tr>
  2343. <xsl:if test="/root/*[local-name()='links']/*[local-name()='item']">
  2344. <tr>
  2345. <!-- links -->
  2346. <td class="emailLinksAttachmentTableRow" width="100%">
  2347. <xsl:for-each select="/root/*[local-name()='links']/*[local-name()='item']">
  2348. <input type="hidden" name="deleted_link_{position()}" value=""/>
  2349. <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)">
  2350. <tr>
  2351. <td valign="middle" align="center">
  2352. <xsl:call-template name="gen-icon">
  2353. <xsl:with-param name="showAction" select="false()"/>
  2354. <xsl:with-param name="class" select="*[local-name()='objectClass']"/>
  2355. </xsl:call-template>
  2356. </td>
  2357. <td valign="middle" align="center" class="formText" nowrap="nowrap">
  2358. <xsl:value-of select="*[local-name()='displayName']"/>
  2359. </td>
  2360. </tr>
  2361. </table>
  2362. </xsl:for-each>
  2363. </td>
  2364. </tr>
  2365. </xsl:if>
  2366. <xsl:if test="/root/*[local-name()='attachments']/*[local-name()='item']">
  2367. <tr>
  2368. <!-- attachments -->
  2369. <td class="emailLinksAttachmentTableRow" width="100%">
  2370. <xsl:for-each select="/root/*[local-name()='attachments']/*[local-name()='item']">
  2371. <input type="hidden" name="deleted_attachment_{position()}" value=""/>
  2372. <xsl:variable name="format">
  2373. <xsl:choose>
  2374. <xsl:when test="not(normalize-space(*[local-name()='format']))">
  2375. <xsl:value-of select="/root/user/param[@name='format']"/>
  2376. </xsl:when>
  2377. <xsl:otherwise>
  2378. <xsl:value-of select="*[local-name()='format']"/>
  2379. </xsl:otherwise>
  2380. </xsl:choose>
  2381. </xsl:variable>
  2382. <xsl:variable name="locale">
  2383. <xsl:choose>
  2384. <xsl:when test="not(normalize-space(*[local-name()='locale']))">
  2385. <xsl:value-of select="/root/user/param[@name='contentLocale']"/>
  2386. </xsl:when>
  2387. <xsl:otherwise>
  2388. <xsl:value-of select="*[local-name()='locale']"/>
  2389. </xsl:otherwise>
  2390. </xsl:choose>
  2391. </xsl:variable>
  2392. <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']}">
  2393. <tr>
  2394. <td align="center">
  2395. <img>
  2396. <xsl:attribute name="src"><xsl:choose><!-- use the HTML icon for the event list --><xsl:when test="*[local-name()='searchPath']='eventOutput'"><xsl:value-of select="concat($image_root,'icon_result_html_32.gif')"/></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="$format = 'singleXLS'"><xsl:value-of select="concat($image_root,'icon_result_excel_single_32.gif')"/></xsl:when><xsl:when test="$format= 'XLS'"><xsl:value-of select="concat($image_root,'icon_result_excel_32.gif')"/></xsl:when><xsl:when test="$format = 'XLWA'"><xsl:value-of select="concat($image_root,'icon_result_excel_web_arch_32.gif')"/></xsl:when><xsl:when test="$format = 'spreadsheetML'"><xsl:value-of select="concat($image_root,'icon_result_excel_2007_32.gif')"/></xsl:when><xsl:when test="$format = 'xlsxData'"><xsl:value-of select="concat($image_root,'icon_result_xlsxdata_32.gif')"/></xsl:when><xsl:otherwise><!-- need to convert the format to lowercase for linux --><xsl:variable name="convertedFormat"><xsl:value-of select="translate( $format, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz' )"/></xsl:variable><xsl:value-of select="concat($image_root,'icon_result_', $convertedFormat,'_32.gif')"/></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
  2397. </img>
  2398. </td>
  2399. </tr>
  2400. <tr>
  2401. <td nowrap="nowrap" align="center" class="formText">
  2402. <xsl:value-of select="*[local-name()='attachmentName']"/>
  2403. </td>
  2404. </tr>
  2405. <tr>
  2406. <td nowrap="nowrap" align="center" class="formText">
  2407. <xsl:choose>
  2408. <xsl:when test="$format !='' and $locale!=''">
  2409. <xts:string id="IDS_EMAIL_OPTIONS_FORMAT_LOCALE">
  2410. <xts:param name="format">
  2411. <xsl:value-of select="$format"/>
  2412. </xts:param>
  2413. <xts:param name="locale">
  2414. <xsl:value-of select="$locale"/>
  2415. </xts:param>
  2416. </xts:string>
  2417. </xsl:when>
  2418. <xsl:otherwise>&#160;</xsl:otherwise>
  2419. </xsl:choose>
  2420. </td>
  2421. </tr>
  2422. </table>
  2423. </xsl:for-each>
  2424. </td>
  2425. </tr>
  2426. </xsl:if>
  2427. <!-- attachment and link links -->
  2428. <tr>
  2429. <td>
  2430. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  2431. <tr>
  2432. <td class="formLink" width="100%" align="right">
  2433. <xsl:if test="key('business-rules','allowAttachMenu')='true'">
  2434. <!-- code from agent studio for the flyout -->
  2435. <table border="0" cellpadding="0" cellspacing="0" style="cursor:hand">
  2436. <tr>
  2437. <td id="attachmentDropdown" height="0px" valign="bottom"/>
  2438. <td class="formLink">
  2439. <a href="#" onkeypress="if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
  2440. <xts:string id="IDS_ADDENTRIES_ATTACHMENT_COLUMN"/>
  2441. </a>
  2442. </td>
  2443. <td onkeypress="if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
  2444. <img border="0" title="" src="{$skin_shared_images}dropdown_arrow.gif"/>
  2445. </td>
  2446. </tr>
  2447. </table>
  2448. <script language="Javascript">
  2449. var menuItemStyle = new CUIStyle('menuItem_normal', 'menuItem_hover', '', '', 'task_active');
  2450. var menuStyle = new CUIStyle('menuContainer', '', '', '', '');
  2451. var attachmentMenu = new CMenu('attachmentDropdown1',menuStyle);
  2452. attachmentMenu.setHTMLContainer(document.getElementById('attachmentDropdown'));
  2453. <xsl:for-each select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*">
  2454. <xsl:variable name="menuName">
  2455. <xsl:choose>
  2456. <xsl:when test="local-name()='eventOutput'">
  2457. <xts:string id="IDS_EMAIL_OPTIONS_ATTACH_EVENT_OUTPUT"/>
  2458. </xsl:when>
  2459. <xsl:otherwise>
  2460. <xts:string id="IDS_EMAIL_OPTIONS_ATTACH_REPORT">
  2461. <xts:param name="obj">
  2462. <xsl:value-of select="*[local-name()='defaultName']"/>
  2463. </xts:param>
  2464. </xts:string>
  2465. </xsl:otherwise>
  2466. </xsl:choose>
  2467. </xsl:variable>
  2468. 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;);
  2469. </xsl:for-each>
  2470. //The call to this is done in the onmouseup event only.
  2471. //We cannot put in the function below. Because the function
  2472. //below can be called by the observer.
  2473. function removeAttachmentMenuListener() {
  2474. document.body.getWndObserver().removeListener(attachmentMenu);
  2475. }
  2476. function showMenu(event) {
  2477. if (attachmentMenu &amp;&amp; attachmentMenu.isVisible()) {
  2478. attachmentMenu.remove();
  2479. if (document.body.getWndObserver &amp;&amp; parent.document.body.getWndObserver) {
  2480. document.body.getWndObserver().removeWhenDone(attachmentMenu);
  2481. }
  2482. } else {
  2483. //Must always be first to be able to delete the marked observer, before it shows it.
  2484. if (document.body.getWndObserver &amp;&amp; parent.document.body.getWndObserver) {
  2485. //Notify parent that mouseup occured.
  2486. parent.document.body.getWndObserver().notify(attachmentMenu,"mouseup");
  2487. document.body.getWndObserver().addListener(attachmentMenu, showMenu, "mouseup");
  2488. }
  2489. attachmentMenu.draw();
  2490. attachmentMenu.show();
  2491. }
  2492. }
  2493. function attachmentMenu_cancelBub(evt)
  2494. {
  2495. //get the event in a cross-browser fashion
  2496. evt = (evt) ? evt : ((event) ? event : null);
  2497. //prevent the click from proceeding to other nodes
  2498. if (typeof evt.cancelBubble != 'undefined')
  2499. {
  2500. evt.cancelBubble = true;
  2501. }
  2502. if (typeof evt.stopPropagation != 'undefined')
  2503. {
  2504. evt.stopPropagation();
  2505. }
  2506. }
  2507. </script>
  2508. </xsl:if>
  2509. </td>
  2510. <td class="formLink" nowrap="nowrap">
  2511. <xsl:if test="key('business-rules','allowAddLinksAction')='true'">
  2512. &#160;&#160;
  2513. <a href="#" onclick="setFormTarget(); document.{key('request-param','formName')}.addingLinks.value='true'; controller_doSubmit('addLinks', 'navigate', 'stack-up'); unsetFormTarget();">
  2514. <xts:string id="IDS_EMAIL_OPTIONS_SELECT_LINKS"/>
  2515. </a>
  2516. </xsl:if>
  2517. </td>
  2518. </tr>
  2519. </table>
  2520. </td>
  2521. </tr>
  2522. </table>
  2523. </td>
  2524. </tr>
  2525. </xsl:when>
  2526. <xsl:otherwise>
  2527. <tr>
  2528. <td>
  2529. <xsl:if test="$richEditMode = 'true'">
  2530. <xsl:attribute name="class">emailBodyTableRow</xsl:attribute>
  2531. </xsl:if>
  2532. <xsl:call-template name="emailBody">
  2533. <xsl:with-param name="inputSize" select="$controlsWidth"/>
  2534. <xsl:with-param name="richEditMode" select="$richEditMode"/>
  2535. </xsl:call-template>
  2536. </td>
  2537. </tr>
  2538. </xsl:otherwise>
  2539. </xsl:choose>
  2540. <tr>
  2541. <td nowrap="nowrap">
  2542. <img height="5" width="1" src="{$webcontent}/images/space.gif" alt=""/>
  2543. </td>
  2544. </tr>
  2545. </table>
  2546. </lyt:section>
  2547. </lyt:layout>
  2548. <lyt:layout style="2">
  2549. <lyt:section>
  2550. <xsl:if test="key('request-param','taskType') = 'approval'">
  2551. <dp:list title="IDS_TASK_OPTIONS_DUEDATES_LABEL" width="100%">
  2552. <dp:section>
  2553. <dp:hint wrap="wrap">
  2554. <xts:string id="IDS_TASK_OPTIONS_DUEDATES_DESC"/>
  2555. </dp:hint>
  2556. </dp:section>
  2557. <dp:section>
  2558. <table border="0" cellspacing="0" callpadding="0">
  2559. <xsl:call-template name="renderDeadline">
  2560. <xsl:with-param name="label">
  2561. <xts:string id="IDS_TASK_OPTIONS_STARTWITHIN_LABEL"/>
  2562. </xsl:with-param>
  2563. <xsl:with-param name="suffix">_start</xsl:with-param>
  2564. </xsl:call-template>
  2565. <xsl:call-template name="renderDeadline">
  2566. <xsl:with-param name="label">
  2567. <xts:string id="IDS_TASK_OPTIONS_DUEWITHIN_LABEL"/>
  2568. </xsl:with-param>
  2569. <xsl:with-param name="suffix">_due</xsl:with-param>
  2570. </xsl:call-template>
  2571. </table>
  2572. </dp:section>
  2573. <dp:section>
  2574. </dp:section>
  2575. </dp:list>
  2576. </xsl:if>
  2577. <!-- the link to report -->
  2578. <table>
  2579. <xsl:if test="key('request-param','subscription')='true'">
  2580. <tr>
  2581. <td>
  2582. <dp:choice>
  2583. <dp:section1>
  2584. <input type="checkbox" name="m_ro_taskAsURL" id="m_ro_taskAsURL" value="true">
  2585. <xsl:if test="key('env-param','m_ro_taskAsURL')='true'">
  2586. <xsl:attribute name="checked">checked</xsl:attribute>
  2587. </xsl:if>
  2588. </input>
  2589. </dp:section1>
  2590. <dp:section2>
  2591. <label for="m_ro_taskAsURL">
  2592. <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_LINK"/>
  2593. </label>
  2594. </dp:section2>
  2595. </dp:choice>
  2596. </td>
  2597. </tr>
  2598. </xsl:if>
  2599. </table>
  2600. <!-- the priority -->
  2601. <dp:list>
  2602. <dp:section>
  2603. <dp:label>
  2604. <xts:string id="IDS_TASK_PRIORITY_LABEL"/>
  2605. </dp:label>
  2606. </dp:section>
  2607. <dp:section>
  2608. <table cellspacing="0" cellpadding="0" border="0">
  2609. <tr>
  2610. <!-- radio button for ES -->
  2611. <xsl:if test="key('request-param','agentStudio') = 'true'">
  2612. <td>
  2613. <input type="radio" id="m_ro_priority_radio_default" name="m_ro_priority_radio" value="priority">
  2614. <xsl:if test="key('env-param','m_ro_priority_radio')='priority'">
  2615. <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
  2616. </xsl:if>
  2617. </input>
  2618. </td>
  2619. </xsl:if>
  2620. <!-- combo box -->
  2621. <td>
  2622. <select onclick="javascript:setRadioButton('m_ro_priority_radio_default');" type="text" id="m_ro_priority" name="m_ro_priority">
  2623. <xsl:if test="key('request-param','agentStudio') = 'true' ">
  2624. <xsl:attribute name="style"><xsl:text>width:100%</xsl:text></xsl:attribute>
  2625. </xsl:if>
  2626. <option name="high" id="high" value="1">
  2627. <xsl:if test="key('env-param','m_ro_priority')='1' ">
  2628. <xsl:attribute name="selected"><xsl:text>selected</xsl:text></xsl:attribute>
  2629. </xsl:if>
  2630. <xsl:text>
  2631. <xts:string id="IDS_TASK_PRIORITY_HIGH"/>
  2632. </xsl:text>
  2633. </option>
  2634. <option name="normal" id="normal" value="3">
  2635. <xsl:if test="key('env-param','m_ro_priority')='3' or not(key('env-param','m_ro_priority'))">
  2636. <xsl:attribute name="selected"><xsl:text>selected</xsl:text></xsl:attribute>
  2637. </xsl:if>
  2638. <xsl:text>
  2639. <xts:string id="IDS_TASK_PRIORITY_NORMAL"/>
  2640. </xsl:text>
  2641. </option>
  2642. <option name="low" id="low" value="5">
  2643. <xsl:if test="key('env-param','m_ro_priority')='5' ">
  2644. <xsl:attribute name="selected"><xsl:text>selected</xsl:text></xsl:attribute>
  2645. </xsl:if>
  2646. <xsl:text>
  2647. <xts:string id="IDS_TASK_PRIORITY_LOW"/>
  2648. </xsl:text>
  2649. </option>
  2650. </select>
  2651. </td>
  2652. </tr>
  2653. <xsl:if test="key('request-param','agentStudio') = 'true'">
  2654. <!-- agent item radio button -->
  2655. <tr>
  2656. <td>
  2657. <input type="radio" id="m_ro_priority_radio_item" name="m_ro_priority_radio" value="item">
  2658. <xsl:if test="key('env-param','m_ro_priority_radio')='item'">
  2659. <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
  2660. </xsl:if>
  2661. </input>
  2662. </td>
  2663. <td class="formText">
  2664. <label for="m_ro_priority_radio_item">
  2665. <xts:string id="IDS_TASK_LABEL_ITEM"/>
  2666. </label>
  2667. <img width="1" height="15" src="{$webcontent}/images/space.gif" alt=""/>
  2668. </td>
  2669. </tr>
  2670. <tr>
  2671. <td/>
  2672. <td>
  2673. <table cellpadding="0" cellspacing="0">
  2674. <tr>
  2675. <!-- agent item insert image -->
  2676. <td valign="top" nowrap="nowrap">
  2677. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  2678. <tr valign="top">
  2679. <dp:columnButton>
  2680. <img align="middle" height="18" name="insert_subject" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('m_ro_priority_item');">
  2681. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  2682. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  2683. </img>
  2684. </dp:columnButton>
  2685. </tr>
  2686. </table>
  2687. </td>
  2688. <td nowrap="nowrap">
  2689. <img width="3" src="{$webcontent}/images/space.gif" alt="" title=""/>
  2690. </td>
  2691. <td nowrap="nowrap">
  2692. <!-- agent item text box -->
  2693. <input type="text" name="m_ro_priority_item" id="m_ro_priority_item" style="width:100px" onclick="javascript:setRadioButton('m_ro_priority_radio_item');" onfocus="javascript:setRadioButton('m_ro_priority_radio_item');">
  2694. <xsl:attribute name="value"><xsl:value-of select="key('env-param','m_ro_priority_item')"/></xsl:attribute>
  2695. </input>
  2696. </td>
  2697. </tr>
  2698. </table>
  2699. </td>
  2700. </tr>
  2701. </xsl:if>
  2702. </table>
  2703. </dp:section>
  2704. </dp:list>
  2705. <table id="taskOptionsTableId" cellspacing="0" cellpadding="0" border="0">
  2706. <tr>
  2707. <td>
  2708. <xsl:choose>
  2709. <xsl:when test="key('request-param','taskType') = 'approval'">
  2710. <dp:list title="IDS_TASK_OPTIONS_LABEL" noSpace="true">
  2711. <!-- notify recipients upon creation -->
  2712. <dp:section>
  2713. <xsl:call-template name="renderOption">
  2714. <xsl:with-param name="id">m_ro_sub_notifyOnCreation</xsl:with-param>
  2715. <xsl:with-param name="label">
  2716. <xts:string id="IDS_TASK_NOTIFY_ON_CREATION"/>
  2717. </xsl:with-param>
  2718. <xsl:with-param name="defaultChecked" select="true()"/>
  2719. </xsl:call-template>
  2720. </dp:section>
  2721. <!-- notify if not started by start by date-->
  2722. <dp:section>
  2723. <xsl:call-template name="renderOption">
  2724. <xsl:with-param name="id">m_ro_sub_notifyNotStarted</xsl:with-param>
  2725. <xsl:with-param name="label">
  2726. <xts:string id="IDS_TASK_NOTIFY_NOT_STARTED"/>
  2727. </xsl:with-param>
  2728. <xsl:with-param name="defaultChecked" select="true()"/>
  2729. </xsl:call-template>
  2730. </dp:section>
  2731. <!-- notify if not completed by due date-->
  2732. <dp:section>
  2733. <xsl:call-template name="renderOption">
  2734. <xsl:with-param name="id">m_ro_sub_notifyNotCompleted</xsl:with-param>
  2735. <xsl:with-param name="label">
  2736. <xts:string id="IDS_TASK_NOTIFY_NOT_COMPLETED"/>
  2737. </xsl:with-param>
  2738. <xsl:with-param name="defaultChecked" select="true()"/>
  2739. </xsl:call-template>
  2740. </dp:section>
  2741. <dp:section>
  2742. <xsl:call-template name="renderOption">
  2743. <xsl:with-param name="id">m_ro_sub_notifyOnStateChange</xsl:with-param>
  2744. <xsl:with-param name="label">
  2745. <xts:string id="IDS_TASK_NOTIFY_ON_STATECHANGE"/>
  2746. </xsl:with-param>
  2747. <xsl:with-param name="defaultChecked" select="true()"/>
  2748. <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
  2749. </xsl:call-template>
  2750. </dp:section>
  2751. <!-- send notification on state change -->
  2752. </dp:list>
  2753. <table cellspacing="0" cellpadding="0">
  2754. <tr>
  2755. <td>
  2756. <dp:list>
  2757. <dp:section>
  2758. <xsl:call-template name="renderOption">
  2759. <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_started</xsl:with-param>
  2760. <xsl:with-param name="label">
  2761. <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_STARTED"/>
  2762. </xsl:with-param>
  2763. <xsl:with-param name="indent">true</xsl:with-param>
  2764. <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
  2765. </xsl:call-template>
  2766. <xsl:call-template name="renderOption">
  2767. <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_owner</xsl:with-param>
  2768. <xsl:with-param name="indent">true</xsl:with-param>
  2769. <xsl:with-param name="label">
  2770. <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_OWNER_CHANGED"/>
  2771. </xsl:with-param>
  2772. <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
  2773. </xsl:call-template>
  2774. </dp:section>
  2775. <dp:section>
  2776. <xsl:call-template name="renderOption">
  2777. <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_comment</xsl:with-param>
  2778. <xsl:with-param name="label">
  2779. <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_COMMENT"/>
  2780. </xsl:with-param>
  2781. <xsl:with-param name="indent">true</xsl:with-param>
  2782. <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
  2783. </xsl:call-template>
  2784. <xsl:call-template name="renderOption">
  2785. <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_completed</xsl:with-param>
  2786. <xsl:with-param name="label">
  2787. <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_COMPLETED"/>
  2788. </xsl:with-param>
  2789. <xsl:with-param name="indent">true</xsl:with-param>
  2790. <xsl:with-param name="defaultChecked" select="true()"/>
  2791. <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
  2792. </xsl:call-template>
  2793. </dp:section>
  2794. <dp:section>
  2795. <xsl:call-template name="renderOption">
  2796. <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_cancelled</xsl:with-param>
  2797. <xsl:with-param name="label">
  2798. <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_CANCELLED"/>
  2799. </xsl:with-param>
  2800. <xsl:with-param name="indent">true</xsl:with-param>
  2801. <xsl:with-param name="defaultChecked" select="true()"/>
  2802. <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
  2803. </xsl:call-template>
  2804. </dp:section>
  2805. </dp:list>
  2806. </td>
  2807. </tr>
  2808. </table>
  2809. </xsl:when>
  2810. <xsl:otherwise>
  2811. <!-- the task options -->
  2812. <dp:list title="IDS_TASK_OPTIONS_LABEL" padding="0">
  2813. <dp:section>
  2814. <xsl:call-template name="renderOption">
  2815. <xsl:with-param name="id">m_ro_sub_notifyOnCreation</xsl:with-param>
  2816. <xsl:with-param name="label">
  2817. <xts:string id="IDS_TASK_CREATION_EMAIL_NOTIFICATION"/>
  2818. </xsl:with-param>
  2819. </xsl:call-template>
  2820. </dp:section>
  2821. <dp:section>
  2822. <xsl:call-template name="renderOption">
  2823. <xsl:with-param name="id">m_ro_readReceipt</xsl:with-param>
  2824. <xsl:with-param name="label">
  2825. <xts:string id="IDS_TASK_READ_RECIEPT"/>
  2826. </xsl:with-param>
  2827. <xsl:with-param name="onclick">requestAcknowledgedChecked(this);</xsl:with-param>
  2828. </xsl:call-template>
  2829. </dp:section>
  2830. <dp:section>
  2831. <table border="0" cellspacing="0" callpadding="0">
  2832. <xsl:call-template name="renderDeadline">
  2833. <xsl:with-param name="label">
  2834. <xts:string id="IDS_TASK_READ_EXPIREY"/>
  2835. </xsl:with-param>
  2836. <xsl:with-param name="suffix">_start</xsl:with-param>
  2837. <xsl:with-param name="breakAfterLabel">true</xsl:with-param>
  2838. </xsl:call-template>
  2839. </table>
  2840. </dp:section>
  2841. </dp:list>
  2842. </xsl:otherwise>
  2843. </xsl:choose>
  2844. </td>
  2845. </tr>
  2846. </table>
  2847. </lyt:section>
  2848. <lyt:section>
  2849. <xsl:if test="key('request-param','taskType') = 'approval'">
  2850. <dp:list title="IDS_TASK_ICON_LABEL" width="100%">
  2851. <dp:section>
  2852. <dp:hint wrap="wrap">
  2853. <xts:string id="IDS_TASK_ICON_DESC"/>
  2854. </dp:hint>
  2855. </dp:section>
  2856. <dp:section>
  2857. <table cellspacing="0" cellpadding="0" border="0">
  2858. <tr>
  2859. <!-- radio button for ES -->
  2860. <xsl:if test="key('request-param','agentStudio') = 'true'">
  2861. <td>
  2862. <input type="radio" id="m_ro_icon_radio_default" name="m_ro_icon_radio" value="default">
  2863. <xsl:if test="key('env-param','m_ro_icon_radio')='default'">
  2864. <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
  2865. </xsl:if>
  2866. </input>
  2867. </td>
  2868. </xsl:if>
  2869. <!-- combo box -->
  2870. <td nowrap="true" class="formText">
  2871. <label for="m_ro_icon_radio_default">
  2872. <xts:string id="IDS_TASK_ICON_DEFAULT"/>
  2873. </label>
  2874. </td>
  2875. </tr>
  2876. <xsl:if test="key('request-param','agentStudio') = 'true'">
  2877. <!-- agent item radio button -->
  2878. <tr>
  2879. <td>
  2880. <input type="radio" id="m_ro_icon_radio_item" name="m_ro_icon_radio" value="item">
  2881. <xsl:if test="key('env-param','m_ro_icon_radio')='item'">
  2882. <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
  2883. </xsl:if>
  2884. </input>
  2885. </td>
  2886. <td class="formText">
  2887. <label for="m_ro_icon_radio_item">
  2888. <xts:string id="IDS_TASK_LABEL_ITEM"/>
  2889. </label>
  2890. <img width="1" height="15" src="{$webcontent}/images/space.gif" alt=""/>
  2891. </td>
  2892. </tr>
  2893. <tr>
  2894. <td/>
  2895. <td>
  2896. <table cellpadding="0" cellspacing="0">
  2897. <tr>
  2898. <!-- agent item insert image -->
  2899. <td valign="top" nowrap="nowrap">
  2900. <table border="0" cellspacing="0" cellpadding="1" valign="top">
  2901. <tr valign="top">
  2902. <dp:columnButton>
  2903. <img align="middle" height="18" name="insert_subject" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('m_ro_icon_item');">
  2904. <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
  2905. <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
  2906. </img>
  2907. </dp:columnButton>
  2908. </tr>
  2909. </table>
  2910. </td>
  2911. <td nowrap="nowrap">
  2912. <img width="3" src="{$webcontent}/images/space.gif" alt="" title=""/>
  2913. </td>
  2914. <td nowrap="nowrap">
  2915. <!-- agent item text box -->
  2916. <input type="text" name="m_ro_icon_item" id="m_ro_icon_item" style="width:100px" onclick="javascript:setRadioButton('m_ro_icon_radio_item');" onfocus="javascript:setRadioButton('m_ro_icon_radio_item');">
  2917. <xsl:attribute name="value"><xsl:value-of select="key('env-param','m_ro_icon_item')"/></xsl:attribute>
  2918. </input>
  2919. </td>
  2920. </tr>
  2921. </table>
  2922. </td>
  2923. </tr>
  2924. </xsl:if>
  2925. </table>
  2926. </dp:section>
  2927. </dp:list>
  2928. <img height="5" width="1" src="{$webcontent}/images/space.gif" alt="" title=""/>
  2929. <dp:list title="IDS_TASK_OWNER_ACTION_LABEL" width="100%">
  2930. <dp:section>
  2931. <dp:hint wrap="wrap">
  2932. <xts:string id="IDS_TASK_OWNER_ACTION_HINT"/>
  2933. </dp:hint>
  2934. </dp:section>
  2935. <dp:section>
  2936. <xsl:call-template name="renderOption">
  2937. <xsl:with-param name="id">m_ro_owner_action</xsl:with-param>
  2938. <xsl:with-param name="label">
  2939. <xts:string id="IDS_TASK_OWNER_APPROVE_REJECT"/>
  2940. </xsl:with-param>
  2941. <xsl:with-param name="type">radio</xsl:with-param>
  2942. <xsl:with-param name="value">approve</xsl:with-param>
  2943. </xsl:call-template>
  2944. </dp:section>
  2945. <dp:section>
  2946. <span>
  2947. <!-- YUK YUK -->
  2948. <img height="1" width="25" src="{$webcontent}/images/space.gif" alt=""/>
  2949. <xts:string id="IDS_TASK_APPROVE_REJECT">
  2950. <xts:param name="approveValue">
  2951. <xsl:value-of select="key('env-param','m_ro_approveValue')"/>
  2952. </xts:param>
  2953. <xts:param name="rejectValue">
  2954. <xsl:value-of select="key('env-param','m_ro_rejectValue')"/>
  2955. </xts:param>
  2956. </xts:string>
  2957. <a href="#" onclick="updateApproveAgentRadio('approve');setFormTarget(); controller_doSubmit('setLabels', 'markup', 'stack-up'); unsetFormTarget();">
  2958. <xts:string id="IDS_TASK_LBL_CUSTOMIZE"/>
  2959. </a>
  2960. </span>
  2961. </dp:section>
  2962. <dp:section>
  2963. <xsl:call-template name="renderOption">
  2964. <xsl:with-param name="id">m_ro_owner_action</xsl:with-param>
  2965. <xsl:with-param name="label">
  2966. <xts:string id="IDS_TASK_OWNER_CHOOSE"/>
  2967. </xsl:with-param>
  2968. <xsl:with-param name="type">radio</xsl:with-param>
  2969. <xsl:with-param name="value">agent</xsl:with-param>
  2970. </xsl:call-template>
  2971. </dp:section>
  2972. <dp:section>
  2973. <span>
  2974. <table cellspacing="0" cellpadding="0" border="0">
  2975. <xsl:for-each select="/root/followingTaskList/futureTask">
  2976. <xsl:variable name="checkboxID">
  2977. <xsl:value-of select="concat('m_ro_agentTaskItem_', ./id)"/>
  2978. </xsl:variable>
  2979. <xsl:variable name="hiddenDisplayID">
  2980. <xsl:value-of select="concat('m_ro_agentTaskItem_display_', ./id)"/>
  2981. </xsl:variable>
  2982. <tr>
  2983. <td><img height="1" width="15" src="{$webcontent}/images/space.gif" alt=""/></td>
  2984. <!-- we need a checkbox to say if the task is to be used -->
  2985. <td>
  2986. <input name="{$checkboxID}" id="{$checkboxID}" type="checkbox" value="true" onclick="updateApproveAgentRadio('agent')">
  2987. <xsl:if test="key('env-param',$checkboxID)='true' ">
  2988. <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
  2989. </xsl:if>
  2990. </input>
  2991. <input name="{$hiddenDisplayID}" id="{$hiddenDisplayID}" type="hidden">
  2992. <xsl:attribute name="value">
  2993. <xsl:choose>
  2994. <xsl:when test="key('env-param',$hiddenDisplayID) and key('env-param',$hiddenDisplayID)!=''">
  2995. <xsl:value-of select="key('env-param',$hiddenDisplayID)"/>
  2996. </xsl:when>
  2997. <xsl:otherwise>
  2998. <xsl:value-of select="./display"/>
  2999. </xsl:otherwise>
  3000. </xsl:choose>
  3001. </xsl:attribute>
  3002. </input>
  3003. </td>
  3004. <!-- we need the name of the task -->
  3005. <td class="formText">
  3006. <xsl:choose>
  3007. <xsl:when test="key('env-param',$hiddenDisplayID) and key('env-param',$hiddenDisplayID)!=''">
  3008. <xsl:value-of select="key('env-param',$hiddenDisplayID)"/>
  3009. </xsl:when>
  3010. <xsl:otherwise>
  3011. <xsl:value-of select="./display"/>
  3012. </xsl:otherwise>
  3013. </xsl:choose>
  3014. </td>
  3015. </tr>
  3016. </xsl:for-each>
  3017. </table>
  3018. <!-- this is going to need tidying up but for now -->
  3019. <!-- create a hidden input to hold all the possible future tasks -->
  3020. <input type="hidden" id="possible_futureTasks" name="possible_futureTasks" value="{key('env-param','possible_futureTasks')}"/>
  3021. </span>
  3022. </dp:section>
  3023. <dp:section>
  3024. <span>
  3025. <!-- YUK YUK -->
  3026. <img height="1" width="25" src="{$webcontent}/images/space.gif" alt=""/>
  3027. <xts:string id="IDS_TASK_SUBMIT">
  3028. <xts:param name="submitValue">
  3029. <xsl:value-of select="key('env-param','m_ro_submitValue')"/>
  3030. </xts:param>
  3031. </xts:string>
  3032. <a href="#" onclick="updateApproveAgentRadio('agent');setFormTarget(); controller_doSubmit('setLabels', 'markup', 'stack-up'); unsetFormTarget();">
  3033. <xts:string id="IDS_TASK_LBL_CUSTOMIZE"/>
  3034. </a>
  3035. </span>
  3036. </dp:section>
  3037. </dp:list>
  3038. </xsl:if>
  3039. </lyt:section>
  3040. </lyt:layout>
  3041. <!-- footer -->
  3042. <xsl:choose>
  3043. <xsl:when test="key('request-param','displayButtons') != 'false'">
  3044. <dp:footer>
  3045. <xsl:choose>
  3046. <xsl:when test="key('request-param','inWizard') = 'true'">
  3047. <dlgctrl:wizardButtons validateFunction="validate"/>
  3048. </xsl:when>
  3049. <xsl:otherwise>
  3050. <dlgctrl:okCancelButtons validateFunction="validate"/>
  3051. </xsl:otherwise>
  3052. </xsl:choose>
  3053. </dp:footer>
  3054. </xsl:when>
  3055. <xsl:otherwise>
  3056. <dp:emptyFooter/>
  3057. </xsl:otherwise>
  3058. </xsl:choose>
  3059. <xsl:if test="key('env-param','duplicateEntryAdded') = 'true'">
  3060. <script language="javascript">
  3061. window.alert("<xts:string id="IDS_DUPLICATE_ENTRY" encode="javascript"/>");
  3062. </script>
  3063. </xsl:if>
  3064. <xsl:if test="not(key('env-param','visited_email_options')) and /root/selectedEntries/item/unknown='true'">
  3065. <script language="javascript">
  3066. alert("<xts:string id="IDS_OTHERRUN_EMAIL_WARN_UNKNOWN_RECIPIENT" encode="javascript"/>");
  3067. </script>
  3068. </xsl:if>
  3069. </xts:transform>
  3070. </markup>
  3071. <browserTitle>
  3072. <xsl:if test="key('business-rules','browserTitle') != ''">
  3073. <xts:transform name="XMLEncode">
  3074. <xsl:value-of select="key('business-rules','browserTitle')"/>
  3075. </xts:transform>
  3076. </xsl:if>
  3077. </browserTitle>
  3078. </xsl:element>
  3079. </xos:entityBody>
  3080. </xos:part>
  3081. </xts:append>
  3082. </xts:sequence>
  3083. </xsl:template>
  3084. <xsl:template name="renderOption">
  3085. <xsl:param name="id"/>
  3086. <xsl:param name="label"/>
  3087. <xsl:param name="indent" select="false()"/>
  3088. <xsl:param name="value" select="true()"/>
  3089. <xsl:param name="onclick"/>
  3090. <xsl:param name="type"/>
  3091. <xsl:param name="uncheckedValue">
  3092. <xsl:text>unchecked</xsl:text>
  3093. </xsl:param>
  3094. <xsl:param name="defaultChecked" select="false()"/>
  3095. <!-- generate the option name -->
  3096. <xsl:variable name="optionName">
  3097. <xsl:choose>
  3098. <!-- for checkboxes generate a tmp name to handle the submission of unchecked values -->
  3099. <xsl:when test="$type='' or $type='checkbox'">
  3100. <xsl:value-of select="concat('tmp_chkbox_',$id)"/>
  3101. </xsl:when>
  3102. <!-- default name -->
  3103. <xsl:otherwise>
  3104. <xsl:value-of select="$id"/>
  3105. </xsl:otherwise>
  3106. </xsl:choose>
  3107. </xsl:variable>
  3108. <!-- radio buttons have an id composed of the id and the value -->
  3109. <xsl:variable name="optionId">
  3110. <xsl:choose>
  3111. <xsl:when test="$type='radio'">
  3112. <xsl:value-of select="concat(concat($id,'_'),$value)"/>
  3113. </xsl:when>
  3114. <xsl:otherwise>
  3115. <xsl:value-of select="$optionName"/>
  3116. </xsl:otherwise>
  3117. </xsl:choose>
  3118. </xsl:variable>
  3119. <table cellspacing="0" cellpadding="0" border="0">
  3120. <tr>
  3121. <!-- indent -->
  3122. <xsl:if test="$indent='true'">
  3123. <td>
  3124. <img height="1" width="25" src="{$webcontent}/images/space.gif" alt="" title=""/>
  3125. </td>
  3126. </xsl:if>
  3127. <td nowrap="true" class="formText">
  3128. <input id="{$optionId}" name="{$optionName}" value="{$value}" tabindex="0">
  3129. <!-- checkbox or radio -->
  3130. <xsl:attribute name="type"><xsl:choose><xsl:when test="$type!=''"><xsl:value-of select="$type"/></xsl:when><xsl:otherwise><xsl:text>checkbox</xsl:text></xsl:otherwise></xsl:choose></xsl:attribute>
  3131. <!-- on click handler-->
  3132. <xsl:variable name="onClickHandler">
  3133. <xsl:text/>if (this.checked) { document.<xsl:value-of select="key('request-param','formName')"/>.<xsl:value-of select="$id"/>.value = '<xsl:value-of select="xtsext:javascriptencode(string($value))"/>'; } <xsl:text/>
  3134. <xsl:text/>else { document.<xsl:value-of select="key('request-param','formName')"/>.<xsl:value-of select="$id"/>.value = '<xsl:value-of select="xtsext:javascriptencode(string($uncheckedValue))"/>'; } <xsl:text/>
  3135. <xsl:if test="$onclick!=''">
  3136. <!-- replace this.id with the temp id -->
  3137. <xsl:text>;</xsl:text>
  3138. <xsl:call-template name="replace">
  3139. <xsl:with-param name="input" select="$onclick"/>
  3140. <xsl:with-param name="searchItem">
  3141. <xsl:text>this.id</xsl:text>
  3142. </xsl:with-param>
  3143. <xsl:with-param name="replacement">
  3144. <xsl:text>'</xsl:text>
  3145. <xsl:value-of select="$optionName"/>
  3146. <xsl:text>'</xsl:text>
  3147. </xsl:with-param>
  3148. </xsl:call-template>
  3149. </xsl:if>
  3150. </xsl:variable>
  3151. <!-- add the onlick attribute -->
  3152. <xsl:attribute name="onclick"><xsl:value-of select="$onClickHandler"/></xsl:attribute>
  3153. <!-- determine the value of the 'checked' attribute -->
  3154. <xsl:variable name="checkedAttrValue">
  3155. <xsl:choose>
  3156. <!-- env param is true so check it -->
  3157. <xsl:when test="string(key('env-param',$id))=string($value)">
  3158. <xsl:text>checked</xsl:text>
  3159. </xsl:when>
  3160. <!-- the checkbox has been unchecked -->
  3161. <xsl:when test="($type='' or $type='checkbox') and (key('env-param',$id)=$uncheckedValue)"/>
  3162. <!-- initialise state is checked only when isChecked is true -->
  3163. <xsl:when test="not(key('env-param',$id))">
  3164. <xsl:if test="$defaultChecked='true'">
  3165. <xsl:text>checked</xsl:text>
  3166. </xsl:if>
  3167. </xsl:when>
  3168. </xsl:choose>
  3169. </xsl:variable>
  3170. <!-- checked attribute -->
  3171. <xsl:if test="$checkedAttrValue!=''">
  3172. <xsl:attribute name="checked"><xsl:value-of select="$checkedAttrValue"/></xsl:attribute>
  3173. </xsl:if>
  3174. </input>
  3175. <!-- add the logic to preserve 'unchecked' checkbox value -->
  3176. <xsl:if test="$type='' or $type='checkbox'">
  3177. <input type="hidden" id="{$id}" name="{$id}">
  3178. <!-- checked attribute -->
  3179. <xsl:attribute name="value">
  3180. <xsl:choose>
  3181. <!-- env param is true so check it -->
  3182. <xsl:when test="key('env-param',$id)!=''">
  3183. <xsl:value-of select="key('env-param',$id)"/>
  3184. </xsl:when>
  3185. <!-- initialise state is checked only when defaultChecked is true -->
  3186. <xsl:otherwise>
  3187. <!-- have to decide whether or not to use the checked or unchecked value -->
  3188. <xsl:choose>
  3189. <xsl:when test="$defaultChecked='true'">
  3190. <!-- the default is the checked value so set it -->
  3191. <xsl:value-of select="$value"/>
  3192. </xsl:when>
  3193. <xsl:otherwise>
  3194. <xsl:value-of select="$uncheckedValue"/>
  3195. </xsl:otherwise>
  3196. </xsl:choose>
  3197. </xsl:otherwise>
  3198. </xsl:choose>
  3199. </xsl:attribute>
  3200. </input>
  3201. </xsl:if>
  3202. </td>
  3203. <!-- define the label -->
  3204. <td nowrap="true" class="formText">
  3205. <label for="{$optionId}">
  3206. <xsl:value-of select="$label"/>
  3207. </label>
  3208. </td>
  3209. </tr>
  3210. </table>
  3211. </xsl:template>
  3212. <xsl:template name="renderDeadline">
  3213. <xsl:param name="label"/>
  3214. <xsl:param name="suffix"/>
  3215. <xsl:param name="breakAfterLabel" select="false()"/>
  3216. <xsl:param name="onClick" select="''"/>
  3217. <xsl:variable name="labelId" select="concat('m_ro_readExpiry',$suffix)"/>
  3218. <xsl:choose>
  3219. <xsl:when test="$breakAfterLabel='true'">
  3220. <tr>
  3221. <!-- checkbox -->
  3222. <td nowrap="true" class="formText">
  3223. <input type="checkbox" name="{$labelId}" id="{$labelId}" value="true" onclick="expiryChecked(this);" tabindex="0">
  3224. <xsl:if test="key('env-param',$labelId)='true'">
  3225. <xsl:attribute name="checked">checked</xsl:attribute>
  3226. </xsl:if>
  3227. </input>
  3228. </td>
  3229. <!-- label -->
  3230. <td nowrap="true" class="formText">
  3231. <label for="{$labelId}">
  3232. <xsl:value-of select="$label"/>
  3233. </label>
  3234. </td>
  3235. </tr>
  3236. <tr>
  3237. <td>&#160;</td>
  3238. <xsl:call-template name="renderDeadlineTextBoxAndCombo">
  3239. <xsl:with-param name="suffix" select="$suffix"/>
  3240. <xsl:with-param name="checkBox" select="$labelId"/>
  3241. </xsl:call-template>
  3242. </tr>
  3243. </xsl:when>
  3244. <xsl:otherwise>
  3245. <tr>
  3246. <!-- checkbox -->
  3247. <td nowrap="true" class="formText" width="15px">
  3248. <input type="checkbox" name="{$labelId}" id="{$labelId}" value="true">
  3249. <xsl:if test="key('env-param',$labelId)='true'">
  3250. <xsl:attribute name="checked">checked</xsl:attribute>
  3251. </xsl:if>
  3252. </input>
  3253. </td>
  3254. <!-- label -->
  3255. <td nowrap="true" class="formText">
  3256. <label for="{$labelId}">
  3257. <xsl:value-of select="$label"/>
  3258. </label>
  3259. </td>
  3260. <xsl:call-template name="renderDeadlineTextBoxAndCombo">
  3261. <xsl:with-param name="suffix" select="$suffix"/>
  3262. <xsl:with-param name="checkBox" select="$labelId"/>
  3263. </xsl:call-template>
  3264. </tr>
  3265. </xsl:otherwise>
  3266. </xsl:choose>
  3267. </xsl:template>
  3268. <xsl:template name="renderDeadlineTextBoxAndCombo">
  3269. <xsl:param name="suffix"/>
  3270. <xsl:param name="checkBox"/>
  3271. <xsl:variable name="labelId" select="concat('m_ro_readExpiry',$suffix)"/>
  3272. <xsl:variable name="unitId" select="concat('m_ro_readExpireUnit',$suffix)"/>
  3273. <xsl:variable name="unitCountlId" select="concat('m_ro_readExpireUnitCount',$suffix)"/>
  3274. <script type="text/javascript">
  3275. // validate the due date. should only contain intergers
  3276. function validateType(InputId, value) {
  3277. if(value &amp;&amp; !isValidValue(value)) {
  3278. alert('<xsl:text/><xts:string id="IDS_TASK_DUE_DATE_VALIDATE_MESSAGE" encode="javascript"/><xsl:text/>');
  3279. document.getElementById(InputId.id).focus();
  3280. }
  3281. }
  3282. function isValidValue(value) {
  3283. return !(isNaN(value) || value &lt; 1 || (value % 1)!=0);
  3284. }
  3285. function doCheckBox(id,value) {
  3286. var checkBox = document.getElementById(id);
  3287. if (value &amp;&amp; isValidValue(value)) {
  3288. checkBox.checked = true;
  3289. } else {
  3290. checkBox.checked = false;
  3291. }
  3292. }
  3293. </script>
  3294. <td>
  3295. <table cellpadding="0" cellspacing="0">
  3296. <tr>
  3297. <td>
  3298. <!-- text box -->
  3299. <input type="text" id="{$unitCountlId}" size="5" name="{$unitCountlId}" onblur="validateType({$unitCountlId}, this.value);doCheckBox('{$checkBox}',this.value)">
  3300. <xsl:if test="key('env-param',$unitCountlId)">
  3301. <xsl:attribute name="value"><xsl:value-of select="key('env-param',$unitCountlId)"/></xsl:attribute>
  3302. </xsl:if>
  3303. </input>
  3304. </td>
  3305. <td>
  3306. <img height="1" width="3" src="{$webcontent}/images/space.gif" alt=""/>
  3307. </td>
  3308. <td nowrap="true" class="formText">
  3309. <label for="{$unitCountlId}">
  3310. <xsl:text><xts:string id="IDS_TASK_UNIT_DAYS"/></xsl:text>
  3311. </label>
  3312. <input type="hidden" id="{$unitId}" name="{$unitId}" value="D"/>
  3313. </td>
  3314. </tr>
  3315. </table>
  3316. </td>
  3317. </xsl:template>
  3318. <!-- general string replacement template -->
  3319. <xsl:template name="replace">
  3320. <xsl:param name="input" select="."/>
  3321. <xsl:param name="searchItem"/>
  3322. <xsl:param name="replacement"/>
  3323. <xsl:choose>
  3324. <xsl:when test="contains($input,$searchItem)">
  3325. <xsl:value-of select="substring-before($input,$searchItem)"/>
  3326. <xsl:value-of select="$replacement"/>
  3327. <xsl:call-template name="replace">
  3328. <xsl:with-param name="input" select="substring-after($input,$searchItem)"/>
  3329. <xsl:with-param name="searchItem" select="$searchItem"/>
  3330. <xsl:with-param name="replacement" select="$replacement"/>
  3331. </xsl:call-template>
  3332. </xsl:when>
  3333. <xsl:otherwise>
  3334. <xsl:value-of select="$input"/>
  3335. </xsl:otherwise>
  3336. </xsl:choose>
  3337. </xsl:template>
  3338. <xsl:template name="emailBody">
  3339. <xsl:param name="inputSize"/>
  3340. <xsl:param name="richEditMode"/>
  3341. <xsl:choose>
  3342. <xsl:when test="$richEditMode = 'true'">
  3343. <iframe id="email_body_iframe" src="../common/blank.html" frameborder="0" contentEditable="true" onblur="richEditControl_doEditBlur();" marginwidth="2" marginheight="2">
  3344. <!-- for rich edit body we're using the table border and not the textarea border -->
  3345. <xsl:attribute name="style">width:<xsl:value-of select="$inputSize - 6"/>px;height:95px;</xsl:attribute>
  3346. </iframe>
  3347. <input type="hidden" name="hidden_richEditBody" value="{key('env-param','hidden_richEditBody')}"/>
  3348. <input type="hidden" name="email_body" value="{key('env-param','email_body')}"/>
  3349. </xsl:when>
  3350. <xsl:otherwise>
  3351. <textarea rows="6" name="email_body" id="email_body">
  3352. <xsl:attribute name="style"><xsl:choose><!-- for agent studio we're using the table border and not the textarea border --><xsl:when test="key('request-param','agentStudio')='true'">
  3353. width:<xsl:value-of select="$inputSize - 6"/>px;
  3354. </xsl:when><xsl:otherwise>
  3355. width:<xsl:value-of select="$inputSize"/>px;
  3356. px;</xsl:otherwise></xsl:choose>
  3357. OVERFLOW:auto; PADDING: 2px;
  3358. <xsl:if test="key('request-param','agentStudio')='true'">BORDER-WIDTH: 0px;</xsl:if></xsl:attribute>
  3359. <xsl:value-of select="key('env-param','email_body')"/>
  3360. </textarea>
  3361. <input type="hidden" name="hidden_richEditBody" value=""/>
  3362. </xsl:otherwise>
  3363. </xsl:choose>
  3364. </xsl:template>
  3365. <xsl:template name="richEditControls">
  3366. <script type="text/javascript">
  3367. // Makes button look sunken when button is clicked
  3368. function richEditControl_buttonDown()
  3369. {
  3370. if (window.event.srcElement.className == 'toolbarImagePressed')
  3371. {
  3372. window.event.srcElement.className = "toolbarImageNormal";
  3373. }
  3374. else if (window.event.srcElement.className == 'toolbarImageNormal' || window.event.srcElement.className == 'toolbarImageOver')
  3375. {
  3376. window.event.srcElement.className = "toolbarImagePressed";
  3377. }
  3378. }
  3379. // Makes button look raised when button is released
  3380. function richEditControl_buttonOut(obj)
  3381. {
  3382. obj.className = "toolbarImageNormal";
  3383. }
  3384. function richEditControl_buttonOver(obj)
  3385. {
  3386. if (obj.className == 'toolbarImageNormal')
  3387. obj.className = 'toolbarImageOver';
  3388. }
  3389. function richEditControl_doBold()
  3390. {
  3391. email_body_iframe.focus();
  3392. email_body_iframe.document.execCommand('bold', false, null);
  3393. }
  3394. function richEditControl_doItalic()
  3395. {
  3396. email_body_iframe.focus();
  3397. email_body_iframe.document.execCommand('italic', false, null);
  3398. }
  3399. function richEditControl_doUnderline()
  3400. {
  3401. email_body_iframe.focus();
  3402. email_body_iframe.document.execCommand('underline', false, null);
  3403. }
  3404. function richEditControl_doLeft()
  3405. {
  3406. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  3407. <!-- make sure the other alignment buttons aren no longer selected -->
  3408. document.getElementById('action_align_center').className = "toolbarImageNormal";
  3409. document.getElementById('action_align_right').className = "toolbarImageNormal";
  3410. document.getElementById('action_justify').className = "toolbarImageNormal";
  3411. email_body_iframe.focus();
  3412. email_body_iframe.document.execCommand('justifyleft', false, null);
  3413. }
  3414. function richEditControl_doCenter()
  3415. {
  3416. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  3417. <!-- make sure the other alignment buttons aren no longer selected -->
  3418. document.getElementById('action_align_left').className = "toolbarImageNormal";
  3419. document.getElementById('action_align_right').className = "toolbarImageNormal";
  3420. document.getElementById('action_justify').className = "toolbarImageNormal";
  3421. email_body_iframe.focus();
  3422. email_body_iframe.document.execCommand('justifycenter', false, null);
  3423. }
  3424. function richEditControl_doRight()
  3425. {
  3426. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  3427. <!-- make sure the other alignment buttons aren no longer selected -->
  3428. document.getElementById('action_align_left').className = "toolbarImageNormal";
  3429. document.getElementById('action_align_center').className = "toolbarImageNormal";
  3430. document.getElementById('action_justify').className = "toolbarImageNormal";
  3431. email_body_iframe.focus();
  3432. email_body_iframe.document.execCommand('justifyright', false, null);
  3433. }
  3434. function richEditControl_doJustify()
  3435. {
  3436. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  3437. <!-- make sure the other alignment buttons aren no longer selected -->
  3438. document.getElementById('action_align_left').className = "toolbarImageNormal";
  3439. document.getElementById('action_align_center').className = "toolbarImageNormal";
  3440. document.getElementById('action_align_right').className = "toolbarImageNormal";
  3441. email_body_iframe.focus();
  3442. email_body_iframe.document.execCommand('JustifyFull', false, null);
  3443. }
  3444. function richEditControl_doOrdList()
  3445. {
  3446. email_body_iframe.focus();
  3447. email_body_iframe.document.execCommand('insertorderedlist', false, null);
  3448. }
  3449. function richEditControl_doBulList()
  3450. {
  3451. email_body_iframe.focus();
  3452. email_body_iframe.document.execCommand('insertunorderedlist', false, null);
  3453. }
  3454. function richEditControl_doIndent()
  3455. {
  3456. email_body_iframe.focus();
  3457. email_body_iframe.document.execCommand('Indent', false, null);
  3458. }
  3459. function richEditControl_doOutdent()
  3460. {
  3461. email_body_iframe.focus();
  3462. email_body_iframe.document.execCommand('Outdent', false, null);
  3463. }
  3464. function richEditControl_doForeCol(color)
  3465. {
  3466. toggledynamicDiv('fontColor');
  3467. email_body_iframe.focus();
  3468. email_body_iframe.document.execCommand('forecolor', false, color);
  3469. }
  3470. function richEditControl_doFont(obj)
  3471. {
  3472. email_body_iframe.focus();
  3473. email_body_iframe.document.execCommand('fontname', false, obj.value);
  3474. }
  3475. function richEditControl_doSize(obj)
  3476. {
  3477. email_body_iframe.focus();
  3478. email_body_iframe.document.execCommand('fontsize', false, obj.value);
  3479. }
  3480. function richEditControl_doTable()
  3481. {
  3482. var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
  3483. email_body_iframe.focus();
  3484. var rows = frm.richEditControl_tableRows.value;
  3485. var columns = frm.richEditControl_tableColumns.value;
  3486. var html = "&lt;table border=\&quot;1\&quot; cellpadding=\&quot;0\&quot; cellspacing=\&quot;0\&quot;&gt;";
  3487. for (var i = 0; i &lt; rows; ++i ) {
  3488. html += "&lt;tr&gt;";
  3489. for (var j = 0; j &lt; columns; ++j ) {
  3490. html += "&lt;td&gt;<xts:string id="IDS_EMAIL_INSERT_TEXT" encode="javascript"/>&lt;/td&gt;";
  3491. }
  3492. html += "&lt;/tr&gt;";
  3493. }
  3494. html += "&lt;/table&gt;";
  3495. var range = email_body_iframe.document.selection.createRange();
  3496. if (textRange.getBookmark())
  3497. {
  3498. range.moveToBookmark(textRange.getBookmark());
  3499. }
  3500. <!-- for some reason, when the cursor is at the end of a line, the moveToBookmark places the ending
  3501. point one character farther then it should be -->
  3502. if (range.compareEndPoints('EndToEnd',textRange) == 1)
  3503. {
  3504. range.moveEnd('character',-1);
  3505. }
  3506. range.pasteHTML(html);
  3507. textRange = null;
  3508. }
  3509. function richEditControl_doHorizontalRule()
  3510. {
  3511. email_body_iframe.focus();
  3512. var range = email_body_iframe.document.selection.createRange();
  3513. range.pasteHTML("&lt;hr&gt;");
  3514. }
  3515. function richEditControl_removeLinks()
  3516. {
  3517. <xsl:if test="not(key('system-param','allow-email-links')='true')">
  3518. // remove all links from email_body for security reasons
  3519. for (i=0; i &lt; email_body_iframe.document.links.length; i++) {
  3520. var tr = email_body_iframe.document.links[i].parentTextEdit.createTextRange();
  3521. tr.moveToElementText(email_body_iframe.document.links[i]);
  3522. tr.execCommand("Unlink",false);
  3523. tr.execCommand("Unselect",false);
  3524. i--;
  3525. }
  3526. </xsl:if>
  3527. // remove all images from email_body for security reasons
  3528. for (i=0; i &lt; email_body_iframe.document.images.length; i++) {
  3529. var tr = email_body_iframe.document.images[i].parentTextEdit.createTextRange();
  3530. tr.moveToElementText(email_body_iframe.document.images[i]);
  3531. tr.execCommand("Delete",false);
  3532. i--;
  3533. }
  3534. }
  3535. function richEditControl_convertToXHTML()
  3536. {
  3537. var element = email_body_iframe.document.body;
  3538. return richEditControl_doTree(element);
  3539. }
  3540. function richEditControl_doTree(element)
  3541. {
  3542. var node = "";
  3543. if (element.nodeType == 1) {
  3544. // add the start of the node
  3545. node = "&lt;" + element.tagName;
  3546. for (var i = 0; i &lt; element.attributes.length; ++i) {
  3547. if (element.attributes[i].nodeValue != null &amp;&amp;
  3548. element.attributes[i].nodeValue.length > 0 &amp;&amp;
  3549. element.attributes[i].nodeName != &quot;contentEditable&quot;) {
  3550. node += " " + element.attributes[i].nodeName + "=\&quot;" + htmlEncode(element.attributes[i].nodeValue) + "\&quot;";
  3551. }
  3552. }
  3553. if (element.childNodes != null &amp;&amp; element.childNodes.length > 0) {
  3554. node += ">";
  3555. for (var j = 0; j &lt; element.childNodes.length; ++j) {
  3556. node += richEditControl_doTree(element.childNodes[j]);
  3557. }
  3558. node += "&lt;/" + element.tagName + "&gt;";
  3559. } else {
  3560. node += "/&gt;";
  3561. }
  3562. } else if (element.nodeType == 3) {
  3563. <!-- Make sure we encode special HTML characters (&, ", <, >) -->
  3564. node = htmlEncode(element.data);
  3565. }
  3566. return node;
  3567. }
  3568. function richEditControl_doEditBlur()
  3569. {
  3570. richEditControl_removeLinks();
  3571. // copy the contents of the edit window into a form field
  3572. document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody.value = richEditControl_convertToXHTML();
  3573. }
  3574. // handles moving the bold, italic and underline spans
  3575. function moveRichEditSpans(moveBy)
  3576. {
  3577. document.getElementById('fix_bold').style.pixelTop += moveBy;
  3578. document.getElementById('fix_italic').style.pixelTop += moveBy;
  3579. document.getElementById('fix_underline').style.pixelTop += moveBy;
  3580. }
  3581. // function to initialize the script for the contents of the screen
  3582. function richEditControl_init()
  3583. {
  3584. var Editor = email_body_iframe.document;
  3585. Editor.designMode = "On";
  3586. // set up the body of the Iframe
  3587. <xsl:choose>
  3588. <xsl:when test="key('env-param','hidden_richEditBody') != ''">
  3589. email_body_iframe.document.write('<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','hidden_richEditBody')))"/>');
  3590. </xsl:when>
  3591. <xsl:when test="key('env-param','email_body') != ''">
  3592. <!-- encode textarea string's carriage returns -->
  3593. emailBodyString = replaceCarriageReturns(htmlEncode('<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','email_body')))"/>'),'&lt;br/&gt;');
  3594. email_body_iframe.document.write("&lt;BODY id=\&quot;editbody\&quot;&gt; style=\&quot;margin:0px\&quot;&gt;" + emailBodyString + "&lt;/BODY&gt;");
  3595. </xsl:when>
  3596. <xsl:otherwise>
  3597. email_body_iframe.document.write("&lt;BODY id=\&quot;editbody\&quot; style=\&quot;margin:0px\&quot;&gt;&lt;/BODY&gt;");
  3598. </xsl:otherwise>
  3599. </xsl:choose>
  3600. // set up the drag drop for the HTML edit body too
  3601. <xsl:if test="$agentStudio">
  3602. var dropZone = new DropZone("editbody","","",'true',&quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;);
  3603. droppy.registerDropZoneObject(dropZone);
  3604. //pass the group to a listener in case number of members dynamically changes
  3605. droppy.registerDropZoneGroup(new Array(dropZone), &quot;<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>&quot;);
  3606. </xsl:if>
  3607. <!-- nasty, but we have to reposition the blank images so they cover the padding and border around the
  3608. bold, italic and underline buttons -->
  3609. document.getElementById('fix_bold').style.pixelLeft = document.getElementById('fix_bold').offsetLeft - 2;
  3610. document.getElementById('fix_bold').style.pixelTop = document.getElementById('fix_bold').offsetTop - 2;
  3611. document.getElementById('fix_italic').style.pixelLeft = document.getElementById('fix_italic').offsetLeft - 2;
  3612. document.getElementById('fix_italic').style.pixelTop = document.getElementById('fix_italic').offsetTop - 2;
  3613. document.getElementById('fix_underline').style.pixelLeft = document.getElementById('fix_underline').offsetLeft - 2;
  3614. document.getElementById('fix_underline').style.pixelTop = document.getElementById('fix_underline').offsetTop - 2;
  3615. if (document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody)
  3616. {
  3617. // copy the contents of the edit window into a form field
  3618. document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody.value = richEditControl_convertToXHTML();
  3619. }
  3620. }
  3621. </script>
  3622. <!-- bold -->
  3623. <xsl:call-template name="richEditControl_button">
  3624. <xsl:with-param name="onclick">richEditControl_doBold();</xsl:with-param>
  3625. <xsl:with-param name="alt">
  3626. <xts:string id="IDS_EMAIL_OPTIONS_BOLD"/>
  3627. </xsl:with-param>
  3628. <xsl:with-param name="text">
  3629. <xts:string id="IDS_BOLD"/>
  3630. </xsl:with-param>
  3631. <xsl:with-param name="textClass" select="'toolbarTextBold'"/>
  3632. <xsl:with-param name="id">bold</xsl:with-param>
  3633. </xsl:call-template>
  3634. <!-- italic -->
  3635. <xsl:call-template name="richEditControl_button">
  3636. <xsl:with-param name="onclick">richEditControl_doItalic();</xsl:with-param>
  3637. <xsl:with-param name="alt">
  3638. <xts:string id="IDS_EMAIL_OPTIONS_ITALIC"/>
  3639. </xsl:with-param>
  3640. <xsl:with-param name="text">
  3641. <xts:string id="IDS_ITALIC"/>
  3642. </xsl:with-param>
  3643. <xsl:with-param name="textClass" select="'toolbarTextItalic'"/>
  3644. <xsl:with-param name="id">italic</xsl:with-param>
  3645. </xsl:call-template>
  3646. <!-- underline -->
  3647. <xsl:call-template name="richEditControl_button">
  3648. <xsl:with-param name="onclick">richEditControl_doUnderline();</xsl:with-param>
  3649. <xsl:with-param name="alt">
  3650. <xts:string id="IDS_EMAIL_OPTIONS_UNDERLINE"/>
  3651. </xsl:with-param>
  3652. <xsl:with-param name="text">
  3653. <xts:string id="IDS_UNDERLINE"/>
  3654. </xsl:with-param>
  3655. <xsl:with-param name="textClass" select="'toolbarTextUnderline'"/>
  3656. <xsl:with-param name="id">underline</xsl:with-param>
  3657. <xsl:with-param name="last">true</xsl:with-param>
  3658. </xsl:call-template>
  3659. <!-- spacer -->
  3660. <td>
  3661. <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
  3662. </td>
  3663. <!-- left align -->
  3664. <xsl:call-template name="richEditControl_button">
  3665. <xsl:with-param name="onclick">richEditControl_doLeft();</xsl:with-param>
  3666. <xsl:with-param name="alt">
  3667. <xts:string id="IDS_EMAIL_OPTIONS_ALIGN_LEFT"/>
  3668. </xsl:with-param>
  3669. <xsl:with-param name="icon">action_align_left.gif</xsl:with-param>
  3670. <xsl:with-param name="id">action_align_left</xsl:with-param>
  3671. </xsl:call-template>
  3672. <!-- center align -->
  3673. <xsl:call-template name="richEditControl_button">
  3674. <xsl:with-param name="onclick">richEditControl_doCenter();</xsl:with-param>
  3675. <xsl:with-param name="alt">
  3676. <xts:string id="IDS_EMAIL_OPTIONS_CENTER"/>
  3677. </xsl:with-param>
  3678. <xsl:with-param name="icon">action_align_center.gif</xsl:with-param>
  3679. <xsl:with-param name="id">action_align_center</xsl:with-param>
  3680. </xsl:call-template>
  3681. <!-- right align -->
  3682. <xsl:call-template name="richEditControl_button">
  3683. <xsl:with-param name="onclick">richEditControl_doRight();</xsl:with-param>
  3684. <xsl:with-param name="alt">
  3685. <xts:string id="IDS_EMAIL_OPTIONS_ALIGN_RIGHT"/>
  3686. </xsl:with-param>
  3687. <xsl:with-param name="icon">action_align_right.gif</xsl:with-param>
  3688. <xsl:with-param name="id">action_align_right</xsl:with-param>
  3689. </xsl:call-template>
  3690. <!-- justify -->
  3691. <xsl:call-template name="richEditControl_button">
  3692. <xsl:with-param name="onclick">richEditControl_doJustify();</xsl:with-param>
  3693. <xsl:with-param name="alt">
  3694. <xts:string id="IDS_EMAIL_OPTIONS_JUSTIFY"/>
  3695. </xsl:with-param>
  3696. <xsl:with-param name="icon">action_justify.gif</xsl:with-param>
  3697. <xsl:with-param name="id">action_justify</xsl:with-param>
  3698. <xsl:with-param name="last">true</xsl:with-param>
  3699. </xsl:call-template>
  3700. <!-- spacer -->
  3701. <td>
  3702. <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
  3703. </td>
  3704. <!-- ordered list -->
  3705. <xsl:call-template name="richEditControl_button">
  3706. <xsl:with-param name="onclick">richEditControl_doOrdList();</xsl:with-param>
  3707. <xsl:with-param name="alt">
  3708. <xts:string id="IDS_EMAIL_OPTIONS_NUMBERING"/>
  3709. </xsl:with-param>
  3710. <xsl:with-param name="icon">action_numbering.gif</xsl:with-param>
  3711. </xsl:call-template>
  3712. <!-- bullet list -->
  3713. <xsl:call-template name="richEditControl_button">
  3714. <xsl:with-param name="onclick">richEditControl_doBulList();</xsl:with-param>
  3715. <xsl:with-param name="alt">
  3716. <xts:string id="IDS_EMAIL_OPTIONS_BULLETS"/>
  3717. </xsl:with-param>
  3718. <xsl:with-param name="icon">action_bullets.gif</xsl:with-param>
  3719. </xsl:call-template>
  3720. <!-- Outdent -->
  3721. <xsl:call-template name="richEditControl_button">
  3722. <xsl:with-param name="onclick">richEditControl_doOutdent();</xsl:with-param>
  3723. <xsl:with-param name="alt">
  3724. <xts:string id="IDS_EMAIL_OPTIONS_DECREASE_INDENT"/>
  3725. </xsl:with-param>
  3726. <xsl:with-param name="icon">action_decrease_indent.gif</xsl:with-param>
  3727. </xsl:call-template>
  3728. <!-- Indent -->
  3729. <xsl:call-template name="richEditControl_button">
  3730. <xsl:with-param name="onclick">richEditControl_doIndent();</xsl:with-param>
  3731. <xsl:with-param name="alt">
  3732. <xts:string id="IDS_EMAIL_OPTIONS_INCREASE_INDENT"/>
  3733. </xsl:with-param>
  3734. <xsl:with-param name="icon">action_increase_indent.gif</xsl:with-param>
  3735. <xsl:with-param name="last">true</xsl:with-param>
  3736. </xsl:call-template>
  3737. <!-- spacer -->
  3738. <td>
  3739. <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
  3740. </td>
  3741. <!-- insert table -->
  3742. <xsl:call-template name="richEditControl_button">
  3743. <xsl:with-param name="onclick">initInsertTable();insertTablePopup.show();</xsl:with-param>
  3744. <xsl:with-param name="alt">
  3745. <xts:string id="IDS_EMAIL_OPTIONS_INSERT_TABLE"/>
  3746. </xsl:with-param>
  3747. <xsl:with-param name="icon">action_insert_table.gif</xsl:with-param>
  3748. </xsl:call-template>
  3749. <!-- Horizontal Rule -->
  3750. <xsl:call-template name="richEditControl_button">
  3751. <xsl:with-param name="onclick">richEditControl_doHorizontalRule();</xsl:with-param>
  3752. <xsl:with-param name="alt">
  3753. <xts:string id="IDS_EMAIL_OPTIONS_HORIZONAL_RULE"/>
  3754. </xsl:with-param>
  3755. <xsl:with-param name="icon">action_insert_line.gif</xsl:with-param>
  3756. <xsl:with-param name="last">true</xsl:with-param>
  3757. </xsl:call-template>
  3758. </xsl:template>
  3759. <!-- template to generate a button for the rich edit control -->
  3760. <xsl:template name="richEditControl_button">
  3761. <xsl:param name="onclick"/>
  3762. <xsl:param name="alt"/>
  3763. <xsl:param name="icon"/>
  3764. <xsl:param name="text"/>
  3765. <xsl:param name="id" select="''"/>
  3766. <xsl:param name="textClass"/>
  3767. <xsl:param name="last" select="'false'"/>
  3768. <td id="{$id}" class="toolbarImageNormal" alt="{$alt}" onmouseover="richEditControl_buttonOver(this);" onmouseout="richEditControl_buttonOut(this);" align="center" valign="bottom">
  3769. <xsl:choose>
  3770. <xsl:when test="$icon != ''">
  3771. <a href="javascript:{$onclick}">
  3772. <img border="0" style="width:16px;height:16px;" src="{$image_root}{$icon}" alt="{$alt}"/>
  3773. </a>
  3774. </xsl:when>
  3775. <xsl:when test="$text != ''">
  3776. <span id="fix_{$id}" style="position:absolute;display:block;width:16px;height:16px;">
  3777. <a href="javascript:{$onclick}">
  3778. <img border="0" height="21" width="21" src="{$webcontent}/images/space.gif" alt="{$alt}"/>
  3779. </a>
  3780. </span>
  3781. <div class="{$textClass}" style="width:16px;height:16px;">
  3782. <xsl:value-of select="$text"/>
  3783. </div>
  3784. </xsl:when>
  3785. </xsl:choose>
  3786. </td>
  3787. <!-- spacer -->
  3788. <xsl:if test="$last = 'false'">
  3789. <td>
  3790. <img height="1" width="3" src="{$webcontent}/images/space.gif" alt=""/>
  3791. </td>
  3792. </xsl:if>
  3793. </xsl:template>
  3794. </xsl:stylesheet>
  3795. </xts:block>
  3796. <!--
  3797. ===============================================================================================
  3798. debug - special debug block for nested requests
  3799. ===============================================================================================
  3800. -->
  3801. <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup processResponse returnResult" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
  3802. <!-- get the debug logic sheet -->
  3803. <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
  3804. <xsl:stylesheet version="1.0" xmlns:xos="http://developer.cognos.com/schemas/xts/output/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dbg="http://developer.cognos.com/schemas/xts/logicsheets/xslt/debug/" exclude-result-prefixes="dbg xos">
  3805. <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
  3806. <xsl:template match="/">
  3807. <xts:sequence>
  3808. <xsl:variable name="resultNode" select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='resultNode']"/>
  3809. <xts:append select="/root/output/xos:part/xos:entityBody/*[local-name()='{$resultNode}']">
  3810. <debugDump>
  3811. <xts:transform name="XMLEncode">
  3812. <dbg:dumpxml select="/root/*[local-name()!='header' and local-name()!='output' and local-name()!='system' and local-name()!='http' and local-name()!='session']">
  3813. <dbg:title>task_options.xts</dbg:title>
  3814. </dbg:dumpxml>
  3815. </xts:transform>
  3816. </debugDump>
  3817. </xts:append>
  3818. </xts:sequence>
  3819. </xsl:template>
  3820. </xsl:stylesheet>
  3821. </xts:block>
  3822. </xts:morphlet>