1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ASV
- (C) Copyright IBM Corp. 2005, 2014
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- =================================================================================================================================
- email_options.xts
- view email_interface.xml for information on the API.
- =================================================================================================================================
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.xml, messages/subscribe.xml">
- <!--
- ===============================================================================================
- processRequestParams - Default any params that weren't passed in. Also this is where we would
- do validation (when time permits).
- ===============================================================================================
- -->
- <xts:block id="processRequestParams" processor="XSLT" type="exec" nodeList="/root/*[local-name()='requestParams']">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/*[local-name()='requestParams']">
- <xts:transform src="portal/controls/gen_default_parameters.xslt" processor="XSLT">
- <root>
- <xts:transform name="XML">
- <xts:param name="systemId">subscribe/taskOptions/task_interface.xml</xts:param>
- </xts:transform>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- </root>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- returnResult - We're done with the email options morphlet, so return the appropriate response
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <xsl:key name="session-param" match="/root/session/param" use="@name"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root">
- <processedUsers>
- <xsl:choose>
- <xsl:when test="key('request-param','requestState') = 'genDefault'">
- <param name="to">
- <param name="to">
- <xsl:value-of select="key('session-param','e_hp')"/>
- </param>
- </param>
- </xsl:when>
- <xsl:otherwise>
- <xts:transform src="subscribe/taskOptions/transforms/process_email_address.xslt" processor="XSLT">
- <root>
- <xsl:copy-of select="/root/env"/>
- <xsl:if test="key('env-param','addedRecipients') != ''">
- <xsl:choose>
- <!-- if the 'to', 'cc' fields have changed then rebuild the addedRecipients list -->
- <xsl:when test="key('env-param','recipientsChanged')='true'">
- <xts:transform src="subscribe/taskOptions/transforms/move_recipients.xslt" processor="XSLT">
- <root>
- <addedRecipients>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
- </xts:transform>
- </addedRecipients>
- <toField>
- <xsl:value-of select="key('env-param','email_to')"/>
- </toField>
- <ccField>
- <xsl:value-of select="key('env-param','email_cc')"/>
- </ccField>
- <bccField>
- <xsl:value-of select="key('env-param','email_bcc')"/>
- </bccField>
- </root>
- </xts:transform>
- </xsl:when>
- <xsl:otherwise>
- <addedRecipients>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
- </xts:transform>
- </addedRecipients>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </root>
- </xts:transform>
- </xsl:otherwise>
- </xsl:choose>
- </processedUsers>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- returnResult - We're done with the email options morphlet, so return the appropriate response
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <xsl:key name="session-param" match="/root/session/param" use="@name"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output">
- <!-- build a part -->
- <xts:transform name="Null" option="part" mimeType="text/xml">
- <xsl:element name="{key('request-param','resultNode')}" namespace="">
- <xsl:choose>
- <xsl:when test="key('request-param','requestState') = 'canceled'">
- <canceled/>
- </xsl:when>
- <!-- generate default delivery options -->
- <xsl:when test="key('request-param','requestState') = 'genDefault'">
- <taskOptions>
- <xsl:call-template name="buildTaskOptions"/>
- </taskOptions>
- <!-- return the task name -->
- <xsl:if test="key('request-param','agentStudio') = 'true' or key('request-param','subscription') = 'true'">
- <xsl:call-template name="buildAgentVars"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <taskOptions>
- <xsl:call-template name="buildTaskOptions"/>
- </taskOptions>
- <!-- return the task name -->
- <xsl:if test="key('request-param','agentStudio') = 'true' or key('request-param','subscription') = 'true'">
- <xsl:call-template name="buildAgentVars"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xts:transform>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="buildTaskOptions">
- <xsl:choose>
- <xsl:when test="key('request-param','taskType')='approval'">
- <xsl:choose>
- <!-- generate default delivery options -->
- <xsl:when test="key('request-param','requestState') = 'genDefault'">
- <xts:transform src="subscribe/taskOptions/transforms/buildApproval.xslt" processor="XSLT">
- <root>
- <!-- copy the already created processed users -->
- <xsl:copy-of select="/root/processedUsers/*"/>
- <xsl:choose>
- <xsl:when test="key('request-param','hideLinkToReport')='false'">
- <param name="m_ro_taskAsURL">true</param>
- </xsl:when>
- <xsl:otherwise>
- <param name="m_ro_taskAsURL">false</param>
- </xsl:otherwise>
- </xsl:choose>
- <param name="m_ro_priority">3</param>
- <param name="email_subject">
- <xsl:choose>
- <!-- use the supplied subject when we're given one - else we just make it up -->
- <xsl:when test="key('request-param','defaultSubject')">
- <xsl:value-of select="key('request-param','defaultSubject')"/>
- </xsl:when>
- <!-- only time we'd be defaulting the delivery options and we have a step class if for reports -->
- <!-- Don't pretty print the following section since it'll add spaces in the default subject -->
- <xsl:when test="key('env-param','step-class') != ''">
- <xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/>
- <xsl:value-of select="concat(' ',key('env-param','step_default_name'))"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_class')='jobDefinition' or key('env-param','m_new_class')='jobDefinition'">
- <xts:string id="IDS_EMAIL_OPTIONS_JOB_PREFIX"/>
- <xsl:choose>
- <xsl:when test="key('env-param','m_p_defaultName')">
- <xsl:value-of select="concat(' ',key('env-param','m_p_defaultName'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(' ',key('env-param','m_name'))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/>
- <xsl:choose>
- <xsl:when test="key('env-param','ui.name')">
- <xsl:value-of select="concat(' ',key('env-param','ui.name'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(' ',key('env-param','m_name'))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- <!-- we also need all the information about each recipient -->
- </root>
- </xts:transform>
- </xsl:when>
- <xsl:otherwise>
- <xts:transform src="subscribe/taskOptions/transforms/buildApproval.xslt" processor="XSLT">
- <root>
- <!-- copy the already created processed users -->
- <xsl:copy-of select="/root/processedUsers/*"/>
- <!-- links and attachments -->
- <xsl:if test="key('env-param','links') != ''">
- <links>
- <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </links>
- </xsl:if>
- <!-- attachments -->
- <xsl:if test="key('env-param','attachments') != ''">
- <attachments>
- <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </attachments>
- </xsl:if>
- <!-- futureTasks -->
- <xsl:if test="/root/env/param[starts-with(@name,'m_ro_agentTaskItem_')]">
- <futureTasks>
- <xts:transform src="subscribe/taskOptions/transforms/update_futureTasks.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','possible_futureTasks'))),true())"/>
- </xts:transform>
- <futureTasks>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'m_ro_agentTaskItem_')]"/>
- </futureTasks>
- </root>
- </xts:transform>
- </futureTasks>
- </xsl:if>
- <!-- richEditBody - validate HTML for allowed tags only-->
- <!-- only perform this transform when we are in Rich Edit Mode -->
- <xsl:if test="key('env-param','hidden_richEditBody') != '' and key('env-param','richEditMode')='true'">
- <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE">
- <xsl:choose>
- <xsl:when test="key('system-param','allow-email-links')='true'">
- <xts:param name="noNamespaceSchemaLocation">subscribe/taskOptions/schemas/richEditBodyPartial.xsd</xts:param>
- </xsl:when>
- <xsl:otherwise>
- <xts:param name="noNamespaceSchemaLocation">subscribe/taskOptions/schemas/richEditBodyFull.xsd</xts:param>
- </xsl:otherwise>
- </xsl:choose>
- <!-- use the normalizeEmailBody transform to change all element names to uppercase and all atrributes to lowercase -->
- <xts:transform src="subscribe/taskOptions/transforms/normalizeEmailBody.xslt" processor="XSLT">
- <xsl:value-of select="/root/env/param[@name='hidden_richEditBody']" disable-output-escaping="yes"/>
- </xts:transform>
- </xts:transform>
- </xsl:if>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- <!-- we also need all the information about each recipient -->
- </root>
- </xts:transform>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- this is a notification task -->
- <xsl:choose>
- <!-- generate default delivery options -->
- <xsl:when test="key('request-param','requestState') = 'genDefault'">
- <xts:transform src="subscribe/taskOptions/transforms/buildNotification.xslt" processor="XSLT">
- <root>
- <!-- copy the already created processed users -->
- <xsl:copy-of select="/root/processedUsers/*"/>
- <xsl:choose>
- <xsl:when test="key('request-param','hideLinkToReport')='false'">
- <param name="m_ro_taskAsURL">true</param>
- </xsl:when>
- <xsl:otherwise>
- <param name="m_ro_taskAsURL">false</param>
- </xsl:otherwise>
- </xsl:choose>
- <param name="m_ro_priority">3</param>
- <param name="email_subject">
- <xsl:choose>
- <!-- use the supplied subject when we're given one - else we just make it up -->
- <xsl:when test="key('request-param','defaultSubject')">
- <xsl:value-of select="key('request-param','defaultSubject')"/>
- </xsl:when>
- <!-- only time we'd be defaulting the delivery options and we have a step class if for reports -->
- <!-- Don't pretty print the following section since it'll add spaces in the default subject -->
- <xsl:when test="key('env-param','step-class') != ''">
- <xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/>
- <xsl:value-of select="concat(' ',key('env-param','step_default_name'))"/>
- </xsl:when>
- <xsl:when test="key('env-param','m_class')='jobDefinition' or key('env-param','m_new_class')='jobDefinition'">
- <xts:string id="IDS_EMAIL_OPTIONS_JOB_PREFIX"/>
- <xsl:choose>
- <xsl:when test="key('env-param','m_p_defaultName')">
- <xsl:value-of select="concat(' ',key('env-param','m_p_defaultName'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(' ',key('env-param','m_name'))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_REPORT_PREFIX"/>
- <xsl:choose>
- <xsl:when test="key('env-param','ui.name')">
- <xsl:value-of select="concat(' ',key('env-param','ui.name'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(' ',key('env-param','m_name'))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </param>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- </root>
- </xts:transform>
- </xsl:when>
- <xsl:otherwise>
- <xts:transform src="subscribe/taskOptions/transforms/buildNotification.xslt" processor="XSLT">
- <root>
- <!-- copy the already created processed users -->
- <xsl:copy-of select="/root/processedUsers/*"/>
- <!-- links and attachments -->
- <xsl:if test="key('env-param','links') != ''">
- <links>
- <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </links>
- </xsl:if>
- <!-- attachments -->
- <xsl:if test="key('env-param','attachments') != ''">
- <attachments>
- <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </attachments>
- </xsl:if>
- <!-- richEditBody - validate HTML for allowed tags only-->
- <!-- only perform this transform when we are in Rich Edit Mode -->
- <xsl:if test="key('env-param','hidden_richEditBody') != '' and key('env-param','richEditMode')='true'">
- <xts:transform xmlns:xts="http://developer.cognos.com/schemas/xts/" name="VALIDATE">
- <xsl:choose>
- <xsl:when test="key('system-param','allow-email-links')='true'">
- <xts:param name="noNamespaceSchemaLocation">subscribe/taskOptions/schemas/richEditBodyPartial.xsd</xts:param>
- </xsl:when>
- <xsl:otherwise>
- <xts:param name="noNamespaceSchemaLocation">subscribe/taskOptions/schemas/richEditBodyFull.xsd</xts:param>
- </xsl:otherwise>
- </xsl:choose>
- <!-- use the normalizeEmailBody transform to change all element names to uppercase and all atrributes to lowercase -->
- <xts:transform src="subscribe/taskOptions/transforms/normalizeEmailBody.xslt" processor="XSLT">
- <xsl:value-of select="/root/env/param[@name='hidden_richEditBody']" disable-output-escaping="yes"/>
- </xts:transform>
- </xts:transform>
- </xsl:if>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- <!-- we also need all the information about each recipient -->
- </root>
- </xts:transform>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="buildAgentVars">
- <!-- taskName isn't shown in the UI anymore (trakker bug 478414). Agent studio wants the email subject
- returned as the taskName -->
- <xsl:variable name="quote">"</xsl:variable>
- <xsl:variable name="apos">'</xsl:variable>
- <xsl:variable name="task_name">
- <xsl:choose>
- <xsl:when test="key('env-param','email_subject') and key('env-param','email_subject')!=''">
- <xsl:value-of select="key('env-param','email_subject')"/>
- </xsl:when>
- <xsl:when test="key('request-param','defaultSubject') and key('request-param','defaultSubject')!=''">
- <xsl:value-of select="key('request-param','defaultSubject')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('request-param','taskName')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <taskName>
- <xsl:choose>
- <xsl:when test="contains($task_name,$quote) and contains($task_name,$apos)">
- <xsl:value-of select="translate($task_name,$quote,$apos)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$task_name"/>
- </xsl:otherwise>
- </xsl:choose>
- </taskName>
- <hasAttachment>
- <xsl:choose>
- <xsl:when test="key('env-param','attachments') != '' or key('env-param','links') != ''">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </hasAttachment>
- <!-- 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 -->
- <xsl:if test="key('request-param','subscription') = 'true'">
- <subscription>true</subscription>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- callMorphlet - Calls the appropriate morphlet using the passed in params which will return
- markup to be displayed or the expected results
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <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">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:template match="/">
- <xsl:variable name="taskType"><xsl:value-of select="key('request-param','taskType')"/></xsl:variable>
- <xsl:variable name="addEntriesUI">
- <xsl:choose>
- <xsl:when test="$taskType = 'notification'">recipients</xsl:when>
- <xsl:when test="$taskType = 'approval'">humanTask</xsl:when>
- <xsl:otherwise>recipients</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xts:sequence>
- <xsl:choose>
- <xsl:when test="starts-with(key('request-param','requestState'),'addEntries')">
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
- <dlgctrl:stackName>add_entries</dlgctrl:stackName>
- <req-params:param name="defaultTarget">
- <xsl:value-of select="key('request-param','defaultTarget')"/>
- </req-params:param>
- <req-params:param name="titlePostfix">
- <xsl:value-of select="key('request-param','titlePostfix')"/>
- </req-params:param>
- <req-params:param name="defaultSearchPath">/directory</req-params:param>
- <req-params:param name="showUsers">true</req-params:param>
- <req-params:param name="addEntriesUI"><xsl:value-of select="$addEntriesUI"/></req-params:param>
- <req-params:param name="withBCC">false</req-params:param>
- <req-params:param name="returnProperties">
- <req-params:property name="userName"/>
- </req-params:param>
- <req-params:param name="isPopup">
- <xsl:value-of select="key('request-param','addEntriesPopUp')"/>
- </req-params:param>
- <req-params:param name="agentStudio">
- <xsl:value-of select="key('request-param','agentStudio')"/>
- </req-params:param>
- </dlgctrl:XTS2Request>
- </xsl:when>
- <xsl:when test="starts-with(key('request-param','requestState'),'addRoles')">
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
- <dlgctrl:stackName>add_entries</dlgctrl:stackName>
- <req-params:param name="defaultTarget">
- <xsl:value-of select="key('request-param','defaultTarget')"/>
- </req-params:param>
- <req-params:param name="titlePostfix">
- <xsl:value-of select="key('request-param','titlePostfix')"/>
- </req-params:param>
- <req-params:param name="defaultSearchPath">/directory</req-params:param>
- <req-params:param name="showUsers">true</req-params:param>
- <req-params:param name="addEntriesUI">
- <xsl:value-of select="'privileges'"/>
- </req-params:param>
- <req-params:param name="returnProperties">
- <req-params:property name="userName"/>
- </req-params:param>
- <req-params:param name="isPopup">
- <xsl:value-of select="key('request-param','addEntriesPopUp')"/>
- </req-params:param>
- <req-params:param name="agentStudio">
- <xsl:value-of select="key('request-param','agentStudio')"/>
- </req-params:param>
- </dlgctrl:XTS2Request>
- </xsl:when>
- <xsl:when test="starts-with(key('request-param','requestState'),'addLinks')">
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/portal/addEntries/add_entries.xts</dlgctrl:target>
- <dlgctrl:stackName>add_entries</dlgctrl:stackName>
- <req-params:param name="defaultTarget">
- <xsl:value-of select="key('request-param','defaultTarget')"/>
- </req-params:param>
- <req-params:param name="titlePostfix">
- <xsl:value-of select="key('request-param','titlePostfix')"/>
- </req-params:param>
- <req-params:param name="defaultSearchPath">/content</req-params:param>
- <req-params:param name="addEntriesUI">
- <xsl:value-of select="'links'"/>
- </req-params:param>
- <req-params:param name="returnProperties">
- <req-params:property name="userName"/>
- </req-params:param>
- <req-params:param name="isPopup">
- <xsl:value-of select="key('request-param','addEntriesPopUp')"/>
- </req-params:param>
- <req-params:param name="allowRootBrowsing">
- <xsl:value-of select="'true'"/>
- </req-params:param>
- <req-params:param name="agentStudio">
- <xsl:value-of select="key('request-param','agentStudio')"/>
- </req-params:param>
- </dlgctrl:XTS2Request>
- </xsl:when>
- <xsl:when test="starts-with(key('request-param','requestState'),'setLabels')">
- <dlgctrl:XTS2Request>
- <dlgctrl:target>/subscribe/setLabels/setLabels.xts</dlgctrl:target>
- <dlgctrl:stackName>set_labels</dlgctrl:stackName>
- <req-params:param name="defaultTarget">
- <xsl:value-of select="key('request-param','defaultTarget')"/>
- </req-params:param>
- <req-params:param name="titlePostfix">
- <xsl:value-of select="key('request-param','titlePostfix')"/>
- </req-params:param>
- <req-params:param name="approveText">
- <xsl:value-of select="key('env-param','m_ro_approveValue')"/>
- </req-params:param>
- <req-params:param name="rejectText">
- <xsl:value-of select="key('env-param','m_ro_rejectValue')"/>
- </req-params:param>
- <req-params:param name="submitText">
- <xsl:value-of select="key('env-param','m_ro_submitValue')"/>
- </req-params:param>
- <req-params:param name="futureTasks">
- <futureTasks>
- <xsl:if test="key('env-param','possible_futureTasks')">
- <xts:transform src="subscribe/taskOptions/transforms/update_futureTasks.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','possible_futureTasks'))),true())"/>
- </xts:transform>
- <futureTasks>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'m_ro_agentTaskItem_')]"/>
- </futureTasks>
- <allTasks>true</allTasks>
- </root>
- </xts:transform>
- </xsl:if>
- </futureTasks>
- </req-params:param>
- <req-params:param name="owner_action">
- <xsl:value-of select="key('env-param','m_ro_owner_action')"/>
- </req-params:param>
- <req-params:param name="isPopup">
- <xsl:value-of select="string(true())"/>
- </req-params:param>
- </dlgctrl:XTS2Request>
- </xsl:when>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- processReponse - Process the response from the callMorphlet block and either displays
- the markup or processes the results - but only from the add entries links
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <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">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <dlgctrl:processXTS2Response>
- <dlgctrl:stackName>add_entries</dlgctrl:stackName>
- <!-- if we got markup back, then simply send it back to the calling morphlet.
- email options should never have to take care of displaying the add entries markup -->
- <dlgctrl:mode match="markup"/>
- <!-- got back selected entries -->
- <dlgctrl:mode match="selectedEntries">
- <xsl:if test="/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'] != ''">
- <xts:append select="/root">
- <selectedEntries>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries'])), true())"/>
- </xts:transform>
- </selectedEntries>
- </xts:append>
- </xsl:if>
- </dlgctrl:mode>
- </dlgctrl:processXTS2Response>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- processReponse2 - Process the response from the callMorphlet block and either displays
- the markup or processes the results - but only from setlables
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <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">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <dlgctrl:processXTS2Response>
- <dlgctrl:stackName>set_labels</dlgctrl:stackName>
- <!-- if we got markup back, then simply send it back to the calling morphlet.
- email options should never have to take care of displaying the add entries markup -->
- <dlgctrl:mode match="markup"/>
- <!-- got back selected entries -->
- <dlgctrl:mode match="setLabels">
- <dlgctrl:morphletResponse/>
- </dlgctrl:mode>
- </dlgctrl:processXTS2Response>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- businessRules - Take care off any business logic to simplify the UI generation
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <xsl:key name="env-param" match="/root/env/param" use="@name"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <!-- if it's the first time we hit this page -->
- <xsl:if test="not(/root/env/param[@name='email_body']) and not(/root/env/param[@name='hidden_richEditBody'])">
- <xts:append select="/root">
- <defaultOptions>
- <!-- transform the options blob passed in into env params -->
- <xsl:if test="key('request-param','taskOptions') != ''">
- <xts:transform src="subscribe/taskOptions/transforms/parse_options.xslt" processor="XSLT">
- <root>
- <xts:transform src="subscribe/transforms/getChildren.xslt" processor="XSLT">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('request-param','taskOptions'))), true())"/>
- </xts:transform>
- </xts:transform>
- <xsl:copy-of select="/root/*[local-name()='requestParams']"/>
- </root>
- </xts:transform>
- </xsl:if>
- <!-- also have to keep the list of possible future tasks -->
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="possible_futureTasks">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <followingTaskList>
- <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='followingTaskList']/*"/>
- </followingTaskList>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </defaultOptions>
- </xts:append>
- <!-- append all the params to env -->
- <xts:append select="/root/env">
- <xts:queryNode select="/root/defaultOptions/*[local-name() = 'param']"/>
- </xts:append>
- <!-- copy the contents of the followingTaskLists to the root -->
- <xts:append select="/root">
- <followingTaskList>
- <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='followingTaskList']/*"/>
- </followingTaskList>
- </xts:append>
- <!-- set the default values for the labels -->
- <xts:append select="/root/env">
- <param name="m_ro_approveValue">
- <xsl:text><xts:string id="IDS_TASK_LABEL_APPROVE"/></xsl:text>
- </param>
- <param name="m_ro_rejectValue">
- <xsl:text><xts:string id="IDS_TASK_LABEL_REJECT"/></xsl:text>
- </param>
- <param name="m_ro_submitValue">
- <xsl:text><xts:string id="IDS_TASK_LABEL_SUBMIT"/></xsl:text>
- </param>
- </xts:append>
- </xsl:if>
- <!-- decode the following task list into the root -->
- <xsl:if test="key('env-param','possible_futureTasks')">
- <xts:append select="/root">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap', string(key('env-param','possible_futureTasks'))),true())"/>
- </xts:transform>
- </xts:append>
- </xsl:if>
- <!-- handle the reply from selecting recipients for to/cc -->
- <xsl:if test="key('env-param','recipientsChanged')='true' and key('env-param','addedRecipients')!='' ">
- <!-- create the new added recipients list -->
- <xts:append select="/root">
- <xts:transform src="subscribe/taskOptions/transforms/move_recipients.xslt" processor="XSLT">
- <root>
- <addedRecipients>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','addedRecipients'))), true())"/>
- </xts:transform>
- </addedRecipients>
- <toField>
- <xsl:value-of select="key('env-param','email_to')"/>
- </toField>
- <ccField>
- <xsl:value-of select="key('env-param','email_cc')"/>
- </ccField>
- <bccField>
- <xsl:value-of select="key('env-param','email_bcc')"/>
- </bccField>
- </root>
- </xts:transform>
- </xts:append>
- <!-- delete the old list -->
- <xts:delete select="/root/env/param[starts-with(@name,'tmp_chkbox')]"/>
- <xts:delete select="/root/env/param[@name='addedRecipients']"/>
- <!-- web64 encode the new list -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="addedRecipients">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/addedRecipients/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:if>
- <!-- if we're in Event studio, then deal with the links and attachments -->
- <xsl:if test="key('request-param','agentStudio') = 'true'">
- <!-- links -->
- <xsl:choose>
- <!-- if the user delete any links -->
- <xsl:when test="key('env-param','links') != '' and /root/env/param[starts-with(@name,'deleted_link_')]='true'">
- <xts:append select="/root">
- <links>
- <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_link_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </links>
- </xts:append>
- <!-- delete the old list -->
- <xts:delete select="/root/env/param[@name='links']"/>
- <!-- web64 encode the new list -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="links">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/links/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <!-- unpack the list of links and attachments -->
- <xsl:when test="key('env-param','links') != ''">
- <xts:append>
- <links>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','links'))), true())"/>
- </xts:transform>
- </links>
- </xts:append>
- </xsl:when>
- </xsl:choose>
- <!-- attachments -->
- <xsl:choose>
- <!-- if the user delete any links -->
- <xsl:when test="key('env-param','attachments') != '' and /root/env/param[starts-with(@name,'deleted_attachment_')]='true'">
- <xts:append select="/root">
- <attachments>
- <xts:transform src="subscribe/taskOptions/transforms/delete_links_attachments.xslt" processor="XSLT">
- <root>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
- </xts:transform>
- <deleted>
- <xsl:copy-of select="/root/env/param[starts-with(@name,'deleted_attachment_') and .='true']"/>
- </deleted>
- </root>
- </xts:transform>
- </attachments>
- </xts:append>
- <!-- delete the old list -->
- <xts:delete select="/root/env/param[@name='attachments']"/>
- <!-- web64 encode the new list -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="attachments">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/attachments/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <!-- unpack the list of links and attachments -->
- <xsl:when test="key('env-param','attachments') != ''">
- <xts:append>
- <attachments>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('env-param','attachments'))), true())"/>
- </xts:transform>
- </attachments>
- </xts:append>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xts:append select="/root">
- <businessRules>
- <!-- choose the image -->
- <image>
- <xsl:choose>
- <xsl:when test="key('request-param','taskType') = 'notification' or key('request-param','taskType') = 'approval'">
- <xsl:value-of select="$webRoot"/>/<xsl:value-of select="key('request-param','taskImage')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$image_root"/>icon_email_24.gif</xsl:otherwise>
- </xsl:choose>
- </image>
- <!-- browser title -->
- <browserTitle>
- <xsl:text/>
- <xsl:choose>
- <xsl:when test="key('request-param','titlePostfix') != ''">
- <xts:string id="IDS_COMBINE_TITLE">
- <xts:param name="prefix">
- <xsl:value-of select="key('request-param','titlePrefix')"/>
- </xts:param>
- <xts:param name="postfix">
- <xsl:value-of select="key('request-param','titlePostfix')"/>
- </xts:param>
- </xts:string>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="key('request-param','titlePrefix')"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text/>
- </browserTitle>
- <!-- description -->
- <description>
- <xsl:choose>
- <xsl:when test="key('request-param','agentStudio') = 'true'">
- <xsl:choose>
- <xsl:when test="key('request-param','taskType') = 'approval' ">
- <xsl:text/>
- <xts:string id="IDS_TASK_OPTIONS_AGENT_STUDIO_APPROVE_INTRO"/>
- <xsl:text/>
- </xsl:when>
- <xsl:when test="key('request-param','taskType') = 'notification' ">
- <xsl:text/>
- <xts:string id="IDS_TASK_OPTIONS_AGENT_STUDIO_NOTIFICATION_INTRO"/>
- <xsl:text/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="key('request-param','burst') = 'true'">
- <xsl:text/>
- <xts:string id="IDS_TASK_OPTIONS_BURST_INTRO"/>
- <xsl:text/>
- </xsl:when>
- <xsl:when test="key('request-param','subscription') = 'true'">
- <xsl:text/>
- <xts:string id="IDS_TASK_OPTIONS_SUBSCRIPTION_INTRO"/>
- <xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/>
- <xts:string id="IDS_TASK_OPTIONS_INTRODUCTION"/>
- <xsl:text/>
- </xsl:otherwise>
- </xsl:choose>
- </description>
- <!-- should we show the email as attachment checkbox -->
- <allowEmailAsAttachment>
- <xsl:variable name="s" select="concat(' ', key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment/@show, ' ')"/>
- <xsl:choose>
- <xsl:when test="key('request-param', 'agentStudio')='true' and not(key('request-param','hideEmailAsAttachment'))">false</xsl:when>
- <xsl:when test="key('request-param','hideEmailAsAttachment') = 'true'">false</xsl:when>
- <xsl:when test="
- not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)
- or
- (
- key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment
- and
- (
- (contains($s, 'Administrators') and $hasAdminCapability) or
- (contains($s, 'QSUsers') and $hasFullQSCapability) or
- (contains($s, 'RSUsers') and $hasFullRSCapability) or
- (contains($s, 'Consumers') and $is-named='1') or
- (contains($s, 'Anonymous') and $is-named='0') or
- (key('system-param', 'ui_groups')/group[contains($s, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])
- )
- )">
- <xsl:value-of select="'true'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'false'"/>
- </xsl:otherwise>
- </xsl:choose>
- </allowEmailAsAttachment>
- <allowLinkToReport>
- <xsl:choose>
- <xsl:when test="key('request-param','agentStudio')='true' and not(key('request-param','hideLinkToReport'))">false</xsl:when>
- <xsl:when test="key('request-param','hideLinkToReport')='false'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </allowLinkToReport>
- <allowAttachMenu>
- <xsl:choose>
- <xsl:when test="key('request-param','hideAttachMenu')='false'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </allowAttachMenu>
- <allowAddLinksAction>
- <xsl:choose>
- <xsl:when test="key('request-param','hideAddLinks')='false'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </allowAddLinksAction>
- </businessRules>
- </xts:append>
- <!-- handle updating the labels -->
- <xsl:if test="/root/morphletResponse/setLabels">
- <xsl:for-each select="/root/morphletResponse/setLabels/param">
- <xts:replace select="/root/env/param[@name='{@name}']">
- <xsl:copy-of select="."/>
- </xts:replace>
- </xsl:for-each>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- businessRules - Take care off any business logic to simplify the UI generation
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
- <xsl:key name="default-options" match="/root/*[local-name()='defaultOptions']/*" use="local-name()"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:key name="session-param" match="/root/session/param" use="@name"/>
- <pf:variables/>
- <xsl:template match="/">
- <xts:sequence>
- <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')">
- <!--we can set the default stakeholder to be the curent user -->
- <xts:append select="/root/defaultOptions">
- <cc>
- <searchPath><xsl:value-of select="key('session-param','e_hp')"/></searchPath>
- </cc>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
-
- <!--
- ===============================================================================================
- queryCMForOptionsInfo - If the options blob passed had recipients which referenced CM, then
- we must query for those recipients. Also if the options blob had attachments or links then
- query CM for the information need to display the UI
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/buslogic.xslt"/>
- <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">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <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="."/>
- <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="."/>
- <xsl:key name="default-options" match="/root/*[local-name()='defaultOptions']/*" use="local-name()"/>
- <xsl:variable name="passport">
- <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- </xsl:variable>
- <xsl:template match="/">
- <!-- recipients -->
- <xts:sequence>
- <xsl:if test="key('default-options','to') or key('default-options','cc') or key('default-options','bcc')">
- <xts:append select="/root">
- <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',.))]"/>
- <selectedEntries>
- <!-- Make sure we add 'unknown' items in our list for every nil queryReply we got back from CM -->
- <xts:transform src="subscribe/taskOptions/transforms/add-unknown-entries.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <root>
- <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
- the same transforms to update the email fields and the recipients blob -->
- <xts:transform src="subscribe/taskOptions/transforms/gen-standard-list.xslt" processor="XSLT">
- <root>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <xsl:for-each select="$unique-search-paths">
- <!-- only query CM for valid search paths -->
- <xsl:if test=". != '' and not(starts-with(.,'['))">
- <cm:query>
- <cm:search>
- <xsl:value-of select="."/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="userName"/>
- <cm:property name="iconURI"/>
- <cm:property name="objectClass"/>
- </cm:properties>
- </cm:query>
- </xsl:if>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <defaultOptions>
- <xsl:copy-of select="/root/defaultOptions/*[local-name()='to' or local-name()='cc' or local-name()='bcc']"/>
- </defaultOptions>
- <action>recipients</action>
- </root>
- </xts:transform>
- <defaultOptions>
- <xsl:copy-of select="/root/defaultOptions/*[local-name()='to' or local-name()='cc' or local-name()='bcc']"/>
- </defaultOptions>
- </root>
- </xts:transform>
- </selectedEntries>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- <!-- links -->
- <xts:sequence>
- <xsl:if test="key('default-options','link') and /root/*[local-name()='defaultOptions']/*[local-name()='link']/*[local-name()='item']/*[local-name()='searchPath'] != ''">
- <xts:append select="/root">
- <links>
- <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
- the same transforms to update the email fields and the recipients blob -->
- <xts:transform src="subscribe/taskOptions/transforms/gen-standard-list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <root>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <xsl:for-each select="/root/*[local-name()='defaultOptions']/*[local-name()='link']/*[local-name()='item']/*[local-name()='searchPath' and .!='']">
- <cm:query>
- <cm:search>
- <xsl:value-of select="."/>
- <xsl:value-of select="/root/system/param[@name='visible']"/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="iconURI"/>
- <cm:property name="storeID"/>
- </cm:properties>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <action>links</action>
- </root>
- </xts:transform>
- </links>
- </xts:append>
- <!-- web64 encode the list of links -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="links">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/links/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- <!-- attachments -->
- <xts:sequence>
- <xsl:if test="key('default-options','attachments') or key('default-options','eventOutput')">
- <xts:append select="/root">
- <attachments>
- <!-- transform the CM result into the same structure that the add entries returns. This will allow us to use
- the same transforms to update the email fields and the recipients blob -->
- <xts:transform src="subscribe/taskOptions/transforms/gen-standard-list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <root>
- <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-'))] != ''">
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <cm:query xmlns:cm="http://developer.cognos.com/schemas/xts-cm/1/">
- <cm:requests>
- <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-'))]">
- <cm:query>
- <cm:search>
- <xsl:value-of select="."/>
- <xsl:value-of select="/root/system/param[@name='visible']"/>
- </cm:search>
- <cm:properties>
- <cm:property name="defaultName"/>
- <cm:property name="searchPath"/>
- <cm:property name="iconURI"/>
- </cm:properties>
- </cm:query>
- </xsl:for-each>
- </cm:requests>
- </cm:query>
- </xts:transform>
- </send:request>
- </xts:transform>
- </xsl:if>
- <action>attachments</action>
- <defaultOptions>
- <xsl:copy-of select="/root/defaultOptions/*[local-name()='attachments']"/>
- <eventOutput>
- <xsl:copy-of select="/root/defaultOptions/*[local-name()='eventOutput']"/>
- </eventOutput>
- </defaultOptions>
- <attachParam>
- <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*"/>
- </attachParam>
- </root>
- </xts:transform>
- </attachments>
- </xts:append>
- <!-- web64 encode the list of links -->
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="attachments">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/attachments/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- updateAddedLists
- ===============================================================================================
- -->
- <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">
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <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">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <pf:serialize-xml/>
- <!-- Session variables -->
- <xsl:variable name="passport">
- <xsl:value-of select="/root/credential/param[@name='CAM']/*[local-name() ='CAM']/*[local-name() = 'CAMPassport']/*[local-name() = 'id']"/>
- </xsl:variable>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:choose>
- <!-- adding attachments -->
- <xsl:when test="/root/env/param[@name='addAttachment'] != ''">
- <xts:delete select="/root/attachments"/>
- <xts:append select="/root">
- <attachments>
- <xts:transform src="subscribe/taskOptions/transforms/update_entries_list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <root>
- <createWeb64Param>false</createWeb64Param>
- <action>addingAttachments</action>
- <attachmentToAdd>
- <xsl:copy-of select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*[string(position())=string(/root/env/param[@name='addAttachment'])]/*"/>
- <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'])">
- <locale/>
- </xsl:if>
- <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'])">
- <format/>
- </xsl:if>
- <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']">
- <eventOutput>true</eventOutput>
- </xsl:if>
- </attachmentToAdd>
- <xsl:if test="/root/env/param[@name='attachments'] != ''">
- <previouslyAdded>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='attachments'])), true())"/>
- </xts:transform>
- </previouslyAdded>
- </xsl:if>
- </root>
- </xts:transform>
- </attachments>
- </xts:append>
- <!-- web64 the list of links and attachments -->
- <xts:delete select="/root/env/param[@name='attachments']"/>
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="attachments">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/attachments/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <!-- added links -->
- <xsl:when test="/root/env/param[@name='addingLinks']='true'">
- <xts:delete select="/root/links"/>
- <xts:append select="/root">
- <links>
- <xts:transform src="subscribe/taskOptions/transforms/update_entries_list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portal.xml</xts:param>
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <root>
- <createWeb64Param>false</createWeb64Param>
- <selectedEntries>
- <xts:queryNode select="/root/selectedEntries/*"/>
- </selectedEntries>
- <action>addingLinks</action>
- <xsl:if test="/root/env/param[@name='links'] != ''">
- <previouslyAdded>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='links'])), true())"/>
- </xts:transform>
- </previouslyAdded>
- </xsl:if>
- </root>
- </xts:transform>
- </links>
- </xts:append>
- <!-- web64 the list of links and attachments -->
- <xts:delete select="/root/env/param[@name='links']"/>
- <xts:append select="/root/env">
- <xts:transform src="portal/controls/create_web64_param.xslt" processor="XSLT">
- <param name="links">
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <markup>
- <xts:transform name="XMLEncode">
- <xts:queryNode select="/root/links/*"/>
- </xts:transform>
- </markup>
- </param>
- </xts:transform>
- </xts:append>
- </xsl:when>
- <!-- added recipients -->
- <xsl:otherwise>
- <xsl:variable name="env" select="/root/env"/>
- <xts:delete select="/root/env/param[@name='email_to' or @name='email_cc' or @name='email_bcc' or @name='addedRecipients']"/>
- <xts:append select="/root/env">
- <xts:transform src="subscribe/taskOptions/transforms/update_email_recipients.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <root>
- <xsl:copy-of select="$env"/>
- <selectedEntries>
- <xts:queryNode select="/root/selectedEntries/*"/>
- </selectedEntries>
- <xsl:if test="/root/env/param[@name='addedRecipients'] != ''">
- <previouslyAdded>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addedRecipients'])), true())"/>
- </xts:transform>
- </previouslyAdded>
- </xsl:if>
- </root>
- </xts:transform>
- <xts:transform src="subscribe/taskOptions/transforms/update_entries_list.xslt" processor="XSLT">
- <xts:param name="messageBase">/messages/portalRL.xml</xts:param>
- <xts:param name="logicsheet">logicsheets/portal.xsl</xts:param>
- <root>
- <passport>
- <xsl:value-of select="$passport"/>
- </passport>
- <paramName>addedRecipients</paramName>
- <selectedEntries>
- <xts:queryNode select="/root/selectedEntries/*"/>
- </selectedEntries>
- <xsl:if test="/root/env/param[@name='addedRecipients'] != ''">
- <previouslyAdded>
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(/root/env/param[@name='addedRecipients'])), true())"/>
- </xts:transform>
- </previouslyAdded>
- </xsl:if>
- <action>addingRecipients</action>
- </root>
- </xts:transform>
- </xts:append>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- genMarkup -
- ===============================================================================================
- -->
- <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">
- <!-- logicsheets -->
- <!-- portal specific information -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
- <!-- Dialog specific logicsheets -->
- <xts:logicsheet path="subscribe/taskOptions/logicsheets/ui-templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/controller-templates.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/layout.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/dialog/presentation.xsl"/>
- <!-- Generic logicsheets -->
- <xts:logicsheet path="logicsheets/presentation/controls/framework.xsl"/>
- <xts:logicsheet path="logicsheets/presentation/controls/presentation.xsl"/>
- <xts:logicsheet path="logicsheets/validation.xslt"/>
- <xts:logicsheet path="logicsheets/formlogic.xslt"/>
- <xts:logicsheet path="logicsheets/presentation/touch_up.xslt"/>
- <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">
- <xsl:output method="xml" encoding="utf-8" indent="no"/>
- <xsl:key name="business-rules" match="/root/businessRules/*" use="local-name()"/>
- <xsl:key name="request-param" match="/root/*[local-name()='requestParams']/*[local-name()='param']" use="@name"/>
- <xsl:key name="system-param" match="/root/system/param" use="@name"/>
- <pf:variables/>
- <pf:gen-icon/>
- <xsl:variable name="agentStudio" select="key('request-param','agentStudio') = 'true'"/>
- <xsl:variable name="inWizard" select="key('request-param','inWizard') = 'true'"/>
- <xsl:variable name="subscription" select="key('request-param','subscription') = 'true'"/>
- <xsl:variable name="taskType" select="key('request-param','taskType')"/>
- <xsl:variable name="richEditMode">
- <xsl:choose>
- <xsl:when test="$browser = 'ie' and not(key('env-param','richEditMode'))">true</xsl:when>
- <xsl:when test="$browser = 'ie'">
- <xsl:value-of select="key('env-param','richEditMode')"/>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:template match="/">
- <xts:sequence>
- <xts:append select="/root/output">
- <xos:part>
- <xos:entityHeader>
- <xos:param name="Content-Type">text/xml; charset=utf-8</xos:param>
- </xos:entityHeader>
- <xos:entityBody>
- <xsl:element name="{key('request-param','resultNode')}" namespace="">
- <markup>
- <xts:transform name="XMLEncode">
- <!-- adds standard hidden inputs and javascript -->
- <dlgctrl:markupHelper/>
- <input type="hidden" name="addedRecipients" value="{key('env-param','addedRecipients')}"/>
- <input type="hidden" name="links" value="{key('env-param','links')}"/>
- <input type="hidden" name="attachments" value="{key('env-param','attachments')}"/>
- <input type="hidden" name="recipientsChanged" value="false"/>
- <input type="hidden" name="addingLinks" value="false"/>
- <input type="hidden" name="addAttachment" value=""/>
- <input type="hidden" name="richEditMode" value="{$richEditMode}"/>
- <input type="hidden" name="visited_email_options" value="true"/>
- <!-- hidden variables to define what labels we're setting -->
- <input type="hidden" name="m_ro_approveValue" value="{key('env-param','m_ro_approveValue')}"/>
- <input type="hidden" name="m_ro_rejectValue" value="{key('env-param','m_ro_rejectValue')}"/>
- <input type="hidden" name="m_ro_submitValue" value="{key('env-param','m_ro_submitValue')}"/>
- <!-- hidden variable for the type of task - notification or approve -->
- <input type="hidden" name="taskType" value="{$taskType}"/>
- <xsl:if test="key('request-param', 'usePowerPlay8Options') = 'true'">
- <input type="hidden" name="usePowerPlay8Options" value="true"/>
- </xsl:if>
- <pf:help context="HID_DISTRIBUTION"/>
- <xsl:choose>
- <xsl:when test="key('request-param','headerStyle')='page'">
- <eut:header close="false" border="false" help="false">
- <dp:image>
- <img alt="" border="0" src="{key('business-rules','image')}"/>
- </dp:image>
- <dp:title>
- <xsl:value-of select="key('business-rules','browserTitle')"/>
- </dp:title>
- <dp:description>
- <xsl:value-of select="key('business-rules','description')"/>
- </dp:description>
- </eut:header>
- </xsl:when>
- <xsl:otherwise>
- <dp:header>
- <dp:title>
- <xsl:value-of select="key('business-rules','browserTitle')"/>
- </dp:title>
- <dp:description>
- <xsl:value-of select="key('business-rules','description')"/>
- </dp:description>
- <dp:close>
- <a href="#" onclick="controller_changeState('canceled'); controller_submitForm('cancel');">
- <dp:closeMarker/>
- </a>
- </dp:close>
- </dp:header>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$agentStudio">
- <script type="text/javascript" src="{$webRoot}/ags/dragDropHandler.js"/>
- <script type="text/javascript" src="{$webRoot}/ags/layout.js"/>
- </xsl:if>
- <xsl:if test="key('request-param','taskType') = 'notification'">
- <script language="javascript">
- function requestAcknowledgedChecked(checkbox) {
- var target = 'm_ro_readExpiry_start';
- var cb = document.getElementById(target);
-
- if(!checkbox.checked){
- //alert("uncheck ack" + checkbox.id);
- cb.checked = false;
- }
- }
- function expiryChecked(checkbox){
- var target = 'm_ro_readReceipt';
- var cb = document.getElementById(target);
- var cb_tmp = document.getElementById('tmp_chkbox_' + target);
- if(checkbox.checked){
- cb.checked = 'true';
- cb_tmp.checked = true;
- }
- }
- </script>
- </xsl:if>
- <xsl:if test="key('request-param','taskType') = 'approval'">
- <script language="javascript">
- var cb_prefix='tmp_chkbox_';
- var cb_statechange_parent=cb_prefix+'m_ro_sub_notifyOnStateChange';
- var cb_statechange_children=cb_prefix+'m_ro_sub_notifyOnStateChange_';
-
- /*
- * Get all child state change checkboxes
- */
- function getSubscriptionCheckboxes(node) {
- var subscriptionCheckboxes = new Array();
- var checkboxes = new Object();
-
- var checkboxes = node.getElementsByTagName('INPUT');
- var count=0;
- for (var i=0;i<checkboxes.length;i++) {
- if (checkboxes[i].type =='checkbox' && checkboxes[i].id.match("^"+cb_statechange_children)==cb_statechange_children ) {
- subscriptionCheckboxes[count]=checkboxes[i];
- count++;
- }
- }
- return subscriptionCheckboxes;
- }
- /*
- * Update the radio buttons for approve/agent tasks - when link or checkbox is changed
- */
- function updateApproveAgentRadio(value) {
- document.getElementById('m_ro_owner_action_' + value).checked='true'
- }
-
- /*
- * Update the state change checkboxes
- */
- <!--function setSubscriptions() {
- for (eventx in subscriptionObj.events) {
- checkboxes = getSubscriptionCheckboxes(document);
- for (var i=0;i<checkboxes.length;i++) {
- var cb = checkboxes[i];
- cb.checked=subscriptionObj.events[cb.value];
- }
- }
- }-->
-
- /*
- * If we have at least one child state change checkbox checked then select the parent otherwise deselected
- */
- function initialiseCheckboxes() {
- var containerId = 'taskOptionsTableId';
- var containerNode = document.getElementById(containerId);
- var parentCb = document.getElementById(cb_statechange_parent);
- if (parentCb && containerNode) {
- parentCb.checked= isStateChangeSelected(containerNode);
- }
- }
-
- /*
- * A checkbox has been selected. This function is attache to the checkbox onclick handler
- */
- function checkboxSelected(id,containerId) {
- //we have clicked the parent checkbox so select/deselect all state change options
- var node = document.getElementById(containerId);
- if (id==cb_statechange_parent) {
- var cb = document.getElementById(id);
- processCheckBoxes(node,cb.checked);
- }
- //we have selected a state change option so select the parent checkbox too
- else {
- var parentCb = document.getElementById(cb_statechange_parent);
- parentCb.checked= isStateChangeSelected(node);
- }
- }
-
-
-
- /*
- * Loop through the state change checkboxes selecting/deselecting each one
- */
- function processCheckBoxes(node,subscribe) {
- for (var i=0; i < node.childNodes.length; i++){
- var childNode = node.childNodes[i];
- if (childNode.nodeName=='INPUT' && childNode.type=='checkbox' && node.id != cb_statechange_parent && childNode.id.indexOf(cb_statechange_children)==0) {
- if (childNode.checked != subscribe) {
- childNode.checked=subscribe;
- fireClickEvent(childNode.id);
- }
- }
- processCheckBoxes(childNode,subscribe);
- }
- }
-
- /*
- *Loop through the state change options. If at least one is selected then return true
- */
- function isStateChangeSelected(node) {
- var found = true;
- var checkboxes = node.getElementsByTagName('INPUT');
- for (var i=0;i < checkboxes.length;i++) {
- if (checkboxes[i].type =='checkbox' && checkboxes[i].id.indexOf(cb_statechange_children) != -1 && checkboxes[i].id != cb_statechange_parent) {
- found = checkboxes[i].checked;
- //found a selected state change option so break
- if (found) {
- break;
- }
- }
- }
- return found;
- }
-
- function fireClickEvent(elementId) {
- var element = document.getElementById(elementId);
- //IE
- if (element.fireEvent) {
- var e = document.createEventObject();
- element.fireEvent('onclick', e);
- }
- //Firefox
- else {
- var e = document.createEvent('MouseEvents');
- e.initEvent('click', true, true);
- element.dispatchEvent(e);
- }
- }
- </script>
- </xsl:if>
- <script language="javascript">
- <xsl:choose>
- <xsl:when test="$agentStudio">
- var textRange;
-
- function init()
- {
- <xsl:variable name="tab" select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>
- droppy.registerDropZone("email_to","","",'true',"<xsl:value-of select="$tab"/>",true);
- droppy.registerDropZone("email_cc","","",'true',"<xsl:value-of select="$tab"/>",true);
- droppy.registerDropZone("email_subject","","",'true',"<xsl:value-of select="$tab"/>",false);
- droppy.registerDropZone("m_ro_priority_item","","",'true',"<xsl:value-of select="$tab"/>",true);
- <xsl:if test="key('request-param','taskType') = 'approval' ">
- droppy.registerDropZone("m_ro_icon_item","","",'true',"<xsl:value-of select="$tab"/>",true);
- </xsl:if>
-
- if (document.<xsl:value-of select="key('request-param','formName')"/>.richEditMode.value == 'true')
- {
- richEditControl_init();
- }
- else
- {
- var dropZone = new DropZone("email_body","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>");
-
- droppy.registerDropZoneObject(dropZone);
-
- //pass the dropzone as a group to let the listener process swaps to the html body
- droppy.registerDropZoneGroup(new Array(dropZone), "<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>");
- }
-
- //set the default for the priority radio button
- <xsl:if test="not(key('env-param','m_ro_priority_radio'))">
- document.getElementById('m_ro_priority_radio_default').checked="true";
- </xsl:if>
-
- //set the default label radio button(only for approval tasks)
- <xsl:if test="key('request-param','taskType')='approval'">
- <xsl:if test="not(key('env-param','m_ro_owner_action'))">
- document.getElementById('m_ro_owner_action_approve').checked="true";
- </xsl:if>
-
- <xsl:if test="not(key('env-param','m_ro_icon_radio'))">
- document.getElementById('m_ro_icon_radio_default').checked="true";
- </xsl:if>
-
- //set the parent state change checkbox
- initialiseCheckboxes();
- </xsl:if>
- }
-
- function deleteLinksAndAttachments()
- {
- var foundSelectedItems = false;
- <xsl:variable name="linksCount" select="count(/root/*[local-name()='links']/*[local-name()='item'])+1"/>
-
- frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- for (var i=1; i<<xsl:value-of select="$linksCount"/>; i++)
- {
- tableName = 'linkTable_' + i;
-
- table = document.getElementById(tableName);
- if (table && table.className == 'emailItem_active')
- {
- table.className = 'hidden';
- hiddenInputName = 'deleted_link_' + i;
- document.getElementById(hiddenInputName).value = 'true';
- foundSelectedItems = true;
- }
- }
-
- <xsl:variable name="attachmentCount" select="count(/root/*[local-name()='attachments']/*[local-name()='item'])+1"/>
- for (var i=1; i<<xsl:value-of select="$attachmentCount"/>; i++)
- {
- tableName = 'attachTable_' + i;
-
- table = document.getElementById(tableName);
- if (table && table.className == 'emailItem_active')
- {
- table.className = 'hidden';
- hiddenInputName = 'deleted_attachment_' + i;
- document.getElementById(hiddenInputName).value = 'true';
- foundSelectedItems = true;
- }
-
- }
-
- return foundSelectedItems;
- }
-
- function mouseOverLinkAttach(item)
- {
- if (item.className == 'emailItem')
- {
- item.className = 'emailItem_hover';
- }
- }
-
- function mouseOutLinkAttach(item)
- {
- if (item.className == 'emailItem_hover')
- {
- item.className = 'emailItem';
- }
- }
-
- function mouseDownLinkAttach(item)
- {
- if (item.className == 'emailItem_active')
- {
- item.className = 'emailItem';
- }
- else if (item.className == 'emailItem' || item.className == 'emailItem_hover')
- {
- item.className = 'emailItem_active';
- }
- }
-
- function attach(position)
- {
- if (document.<xsl:value-of select="key('request-param','formName')"/>.addAttachment)
- document.<xsl:value-of select="key('request-param','formName')"/>.addAttachment.value = position;
-
- controller_submitForm('default');
- }
- </xsl:when>
- <xsl:otherwise>
- function init()
- {
- //set the read receipt checkbox if a deadline has been set
- <xsl:if test="key('env-param','m_ro_readExpiry_start')='true'">
- var expiryStart = document.getElementById('m_ro_readExpiry_start');
- if (expiryStart) {
- expiryChecked(expiryStart);
- }
- </xsl:if>
-
- if (document.<xsl:value-of select="key('request-param','formName')"/>.richEditMode.value == 'true')
- richEditControl_init();
-
- if (document.<xsl:value-of select="key('request-param','formName')"/>.controller_state)
- {
- document.<xsl:value-of select="key('request-param','formName')"/>.controller_state.value = '<xsl:value-of select="xtsext:javascriptencode(key('env-param','controller_state'))"/>';
- }
- }
- </xsl:otherwise>
- </xsl:choose>
-
- function setRadioButton(radioId) {
- var radio = document.getElementById(radioId);
-
- if (radio) {
- radio.checked="true";
- }
- }
-
- function setInputValue(elementId,inputValue) {
- var element = document.getElementById(elementId);
-
- if (element) {
- element.value=inputValue;
- }
- }
-
- function changedEmailRecipients()
- {
- <!-- update the changed flag so we know that we should regenerate the added entries blob -->
- document.<xsl:value-of select="key('request-param','formName')"/>.recipientsChanged.value = 'true';
- }
-
- function handleKeydown(e) {
- var evt = (window.event) ? event:e;
- var charCode = ((evt.keyCode) ? evt.keyCode : evt.which);
- if (charCode == 8 || // backspace
- charCode == 9 || // tab
- charCode == 16 || //shift key??
- charCode == 37 || // let arrow
- charCode == 39 || // right arrow
- charCode == 46 ) // delete
- {
- return true;
- } else {
- if (typeof evt.cancelBubble != 'undefined')
- {
- evt.cancelBubble = true;
- }
- if (typeof evt.stopPropagation != 'undefined')
- {
- evt.stopPropagation();
- }
- return false;
- }
- }
- function validate()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
- <xsl:if test="key('request-param','burst')!='true'">
- if ( frm.email_to.value == '' && frm.email_cc.value == '')
- {
- alert("<xts:string id="IDS_EMAIL_OPTIONS_NO_RECIPIENTS" encode="javascript"/>");
- return false;
- }
- </xsl:if>
- leavingDialog();
- return true;
- }
- <!-- makes sure all the hidden inputs are properlly set before leavingt the
- email options dialog -->
- function leavingDialog()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- <!-- we need to get the plain text body since the memopart needs both the html and plain text body -->
- if (frm.richEditMode && frm.richEditMode.value == 'true')
- {
- frm.email_body.value = email_body_iframe.document.body.innerText;
- if (frm.hidden_richEditBody)
- {
- // copy the contents of the edit window into a form field
- frm.hidden_richEditBody.value = richEditControl_convertToXHTML();
- }
- }
- <!-- we're in plain text mode, so make sure the hidden HTML input gets updated -->
- else
- {
- if (frm.hidden_richEditBody)
- {
- frm.hidden_richEditBody.value = replaceCarriageReturns(htmlEncode(frm.email_body.value),'<br/>');
- }
- }
- }
-
- function setFormTarget()
- {
- <xsl:choose>
- <xsl:when test="key('request-param','addEntriesPopUp')='true' and key('request-param','addEntriesPopUpTarget')!=''">
- document.<xsl:value-of select="key('request-param','formName')"/>.target = '<xsl:value-of select="key('request-param','addEntriesPopUpTarget')"/>';
- </xsl:when>
- <xsl:when test="key('request-param','addEntriesPopUp')='true'">
- document.<xsl:value-of select="key('request-param','formName')"/>.target = 'addEntriesFrame';
- </xsl:when>
- </xsl:choose>
- }
-
- function unsetFormTarget()
- {
- <xsl:if test="key('request-param','addEntriesPopUp')='true'">
- document.<xsl:value-of select="key('request-param','formName')"/>.target = '';
- </xsl:if>
- }
-
- <!-- convert less than and greater than to text references -->
- function htmlEncode(string)
- {
- var returnString = string.replace(/&/g, "&amp;");
- returnString = returnString.replace(/"/g, "&quot;");
- returnString = returnString.replace(/</g, "&lt;");
- returnString = returnString.replace(/>/g, "&gt;");
- return returnString;
- }
-
- <!-- used to replace linefeeds to </br> for the html version of the body -->
- function replaceCarriageReturns(string, replaceWith)
- {
- <!-- encode textarea string's carriage returns -->
- string = escape(string);
-
- <!--loop through string, replacing carriage return encoding with HTML break tag-->
- for(i=0; i<string.length; i++)
- {
- if(string.indexOf("%0D%0A") > -1)
- {
- <!-- Windows encodes returns as \r\n hex-->
- string=string.replace("%0D%0A",replaceWith);
- }
- else if(string.indexOf("%0A") > -1)
- {
- <!-- Unix encodes returns as \n hex-->
- string=string.replace("%0A",replaceWith);
- }
- else if(string.indexOf("%0D") > -1)
- {
- <!-- Macintosh encodes returns as \r hex -->
- string=string.replace("%0D",replaceWith);
- }
- }
-
- string=unescape(string) <!-- unescape all other encoded characters -->
-
- return string;
- }
-
-
- function changeModes()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
- if (frm.richEditMode.value == 'true')
- {
- frm.email_body.value = email_body_iframe.document.body.innerText;
- frm.richEditMode.value = 'false';
- }
- else
- {
- frm.richEditMode.value = 'true';
- }
-
- controller_submitForm('default');
- }
-
- function initInsertTable()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
- frm.richEditControl_tableColumns.value = '2';
- frm.richEditControl_tableRows.value = '2';
-
- email_body_iframe.focus();
- textRange = email_body_iframe.document.selection.createRange();
- }
-
- function insertTableIntoBody()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- <xsl:variable name="maxColumns">
- <xsl:choose>
- <xsl:when test="/root/system/param[@name='max-table-columns']!=''">
- <xsl:value-of select="/root/system/param[@name='max-table-columns']"/>
- </xsl:when>
- <xsl:otherwise>20</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="maxRows">
- <xsl:choose>
- <xsl:when test="/root/system/param[@name='max-table-rows']!=''">
- <xsl:value-of select="/root/system/param[@name='max-table-rows']"/>
- </xsl:when>
- <xsl:otherwise>100</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- make sure the number of rows and columns are valid integers
- and do not exceed the maximum. Default for maximum is 20 columns and 100 rows, but
- can be changed via system.xml -->
- if (!validate_positiveIntegerProp(frm.richEditControl_tableColumns, <xsl:value-of select="$maxColumns"/>))
- {
- var errorMsg = "<xts:string id="IDS_EMAIL_OPTIONS_MIN_MAX_COLUMNS" encode="javascript">
- <xts:param name="max">" + (<xsl:value-of select="$maxColumns"/>) + "</xts:param>
- </xts:string>";
- window.alert(errorMsg);
- frm.richEditControl_tableColumns.focus();
- return;
- }
- if (!validate_positiveIntegerProp(frm.richEditControl_tableRows, <xsl:value-of select="$maxRows"/>))
- {
- var errorMsg = "<xts:string id="IDS_EMAIL_OPTIONS_MIN_MAX_ROWS" encode="javascript">
- <xts:param name="max">" + (<xsl:value-of select="$maxRows"/>) + "</xts:param>
- </xts:string>";
- window.alert(errorMsg);
- frm.richEditControl_tableRows.focus();
- return;
- }
- insertTablePopup.hide();
- richEditControl_doTable();
- }
-
- <!-- required when user enters bad data and clicks off dialog leaving it hidden but active.
- we don't want to reset a good entry back to defaults (bug 555470.1) -->
- function validateHideTable()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- if (!validate_positiveIntegerProp(frm.richEditControl_tableColumns, <xsl:value-of select="$maxColumns"/>))
- {
- return;
- }
- if (!validate_positiveIntegerProp(frm.richEditControl_tableRows, <xsl:value-of select="$maxRows"/>))
- {
- return;
- }
- return true;
- }
-
- function cancelCreateTable()
- {
- frm = document.<xsl:value-of select="key('request-param','formName')"/>;
- <!-- need to reset the columns and rows or we might get a CAF error (bug 477423) -->
- frm.richEditControl_tableColumns.value = '2';
- frm.richEditControl_tableRows.value = '2';
- }
-
- <!-- Make sure the number of columns or rows is a positive integer (1,2,...) -->
- function validate_positiveIntegerProp(e, max)
- {
- if (e.value > max || e.value < 1 || isNaN(e.value) || parseInt(e.value, 10) != e.value)
- {
- return false;
- }
- e.value = parseInt(e.value, 10);
- return true;
- }
- </script>
- <!-- add a hidden iframe if we must show the added recipients in a popup -->
- <xsl:if test="key('request-param','addEntriesPopUp')='true'">
- <script language="javascript">
- function show_div(div)
- {
- modalDiv = document.getElementById(div);
- modalDiv.style.display = "block";
- modalDiv.style.height = "100%";
- modalDiv.style.width = "100%";
- modalDiv.style.left = 0;
- modalDiv.style.top = 0;
- }
-
- function show_iFrame(iframe)
- {
- iFrameAddEntries = document.getElementById(iframe);
- iFrameAddEntries.style.display = "block";
- iFrameAddEntries.style.height = "70%";
- iFrameAddEntries.style.width = "85%";
- iFrameAddEntries.style.border = "1px solid";
-
- if ((document.body.clientWidth - iFrameAddEntries.scrollWidth) < 0)
- {
- iFrameAddEntries.style.left = 0;
- }
- else
- {
- iFrameAddEntries.style.left = ((document.body.clientWidth - iFrameAddEntries.scrollWidth) / 2) + document.body.scrollLeft;
- }
- }
- </script>
- <div id="makeModalDiv" style="z-index:49; display:none; position: absolute;">
- <table width="100%" height="100%">
- <tr>
- <td/>
- </tr>
- </table>
- </div>
- <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;"/>
- </xsl:if>
- <!-- generate table popup -->
- <xsl:if test="$richEditMode = 'true'">
- <!-- Set the search options dialog wrap it in a div so it doesn't expand the td we're in -->
- <div>
- <cp:genericDialog id="insertTablePopup" interactive="true" align="left" width="300" positionVertical="true" positionHorizontal="true" closeOnClick="cancelCreateTable();">
- <cp:param name="title">
- <xts:string id="IDS_EMAIL_OPTIONS_INSERT_TABLE_TITLE"/>
- </cp:param>
- <cp:param name="body">
- <lyt:layout style="1">
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:label>
- <xts:string id="IDS_EMAIL_OPTIONS_NUMBER_OF_COLUMNS"/>
- </dp:label>
- </dp:section>
- <dp:section>
- <!-- column default is always 2 -->
- <input type="text" name="richEditControl_tableColumns" value="2" size="2"/>
- </dp:section>
- </dp:list>
- </lyt:section>
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:label>
- <xts:string id="IDS_EMAIL_OPTIONS_NUMBER_OF_ROWS"/>
- </dp:label>
- </dp:section>
- <dp:section>
- <!-- rows default is always 2 -->
- <input type="text" name="richEditControl_tableRows" value="2" size="2"/>
- </dp:section>
- <dp:section>
- <img height="15" width="5" src="{$webcontent}/images/space.gif" alt=""/>
- </dp:section>
- </dp:list>
- </lyt:section>
- </lyt:layout>
- </cp:param>
- <cp:param name="footer">
- <dp:simpleFooter>
- <df:button df:id="IDS_OK" df:style="href" df:href="javascript:insertTableIntoBody();"/>
- <df:button df:id="IDS_CANCEL" df:style="href" df:href="javascript:cancelCreateTable();javascript:insertTablePopup.hide();"/>
- </dp:simpleFooter>
- </cp:param>
- </cp:genericDialog>
- </div>
- </xsl:if>
- <lyt:layout style="2">
- <lyt:section>
- <xsl:variable name="inputSize">
- <xsl:choose>
- <xsl:when test="$agentStudio">50</xsl:when>
- <xsl:otherwise>55</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="key('request-param','burst')!='true'">
- <!-- need to put the email to, cc and links in one table
- to get the links to right align properly -->
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <!-- email to -->
- <dp:list>
- <dp:section>
- <dp:label>
- <label for="email_to">
- <xsl:choose>
- <xsl:when test="key('request-param','taskType')='approval'">
- <xts:string id="IDS_EMAIL_OPTIONS_ASSIGN_TO"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_TO"/>
- </xsl:otherwise>
- </xsl:choose>
- </label>
- </dp:label>
- </dp:section>
- </dp:list>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <xsl:if test="$agentStudio">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_to" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_to');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </xsl:if>
- <td nowrap="nowrap">
- <input name="email_to" id="email_to" size="{$inputSize}" oncontextmenu="return false;" onkeydown="return handleKeydown(event);" onchange="changedEmailRecipients();">
- <!-- make the input hidden if part of a subscription -->
- <xsl:attribute name="type"><xsl:text>text</xsl:text></xsl:attribute>
- <xsl:attribute name="value"><xsl:value-of select="key('env-param','email_to')"/></xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
- <!-- do not show the CC section if part of a subscription -->
- <!-- email cc -->
- <dp:list>
- <dp:section>
- <dp:label>
- <label for="email_cc">
- <xsl:choose>
- <xsl:when test="key('request-param','taskType')='approval'">
- <xts:string id="IDS_EMAIL_OPTIONS_STAKEHOLDERS"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_CC"/>
- </xsl:otherwise>
- </xsl:choose>
- </label>
- </dp:label>
- </dp:section>
- </dp:list>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <xsl:if test="$agentStudio">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_cc" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_cc');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </xsl:if>
- <td nowrap="nowrap">
- <input type="text" name="email_cc" id="email_cc" size="{$inputSize}" oncontextmenu="return false;" onkeydown="return handleKeydown(event);" onchange="changedEmailRecipients();">
- <xsl:attribute name="value"><xsl:value-of select="key('env-param','email_cc')"/></xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
- <table border="0" cellspacing="0" cellpadding="1" width="100%">
- <tr align="right" class="formLink">
- <td nowrap="nowrap" align="right">
- <!-- select recipients -->
- <dp:link align="right">
- <a href="#" onclick="setFormTarget(); controller_doSubmit('addEntries', 'navigate', 'stack-up'); unsetFormTarget();">
- <xts:string id="IDS_EMAIL_OPTIONS_SELECT_RECIPIENTS"/>
- </a>
- </dp:link>
-   
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </xsl:if>
- </lyt:section>
- <!-- task name -->
- <lyt:section>
- <xsl:if test="$agentStudio">
- <xsl:value-of select="key('request-param','suppressionDetails')" disable-output-escaping="yes"/>
- </xsl:if>
- </lyt:section>
- </lyt:layout>
- <lyt:layout style="1">
- <lyt:section>
- <xsl:variable name="controlsWidth">
- <xsl:choose>
- <xsl:when test="$agentStudio">650</xsl:when>
- <xsl:otherwise>680</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- subject -->
- <dp:list>
- <dp:section>
- <dp:label>
- <label for="email_subject">
- <xts:string id="IDS_EMAIL_OPTIONS_SUBJECT"/>
- </label>
- </dp:label>
- </dp:section>
- </dp:list>
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <xsl:if test="$agentStudio">
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_subject" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_subject');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </xsl:if>
- <td nowrap="nowrap">
- <input type="text" name="email_subject" id="email_subject" style="width:{$controlsWidth}px">
- <xsl:attribute name="value"><xsl:value-of select="key('env-param','email_subject')"/></xsl:attribute>
- </input>
- </td>
- </tr>
- <tr>
- <td nowrap="nowrap">
- <img height="5" width="1" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- </table>
- <!-- body -->
- <table border="0" cellspacing="0" cellpadding="0">
- <!-- in agent studio we have to take into account the add selected items button -->
- <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>
- <tr>
- <td style="white-space:nowrap;" class="formLabel" valign="bottom">
- <label for="email_body">
- <xts:string id="IDS_EMAIL_OPTIONS_BODY"/>
- </label>
- </td>
- <xsl:if test="$browser = 'ie'">
- <xsl:choose>
- <xsl:when test="$richEditMode = 'true'">
- <td width="100%" align="right" class="formLink" nowrap="nowrap" valign="bottom">
- <a href="#" onclick="javascript:changeModes();">
- <xts:string id="IDS_EMAIL_OPTIONS_PLAIN_TEXT"/>
- </a>
- </td>
- <td valign="bottom" nowrap="nowrap">
- <img height="5" width="3" src="{$webcontent}/images/space.gif" alt=""/>
- <img src="{$skin_images}prompt_option_to_right.gif"/>
- <img height="5" width="10" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </xsl:when>
- <xsl:otherwise>
- <td width="100%" align="right" valign="bottom">
- <img src="{$skin_images}prompt_option_to_left.gif"/>
- <img height="5" width="3" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- <td class="formLink" nowrap="nowrap" valign="bottom">
- <a href="#" onclick="javascript:changeModes();">
- <xts:string id="IDS_EMAIL_OPTIONS_HTML_TEXT"/>
- </a>
- </td>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$richEditMode = 'true'">
- <xsl:call-template name="richEditControls"/>
- </xsl:if>
- </xsl:if>
- </tr>
- <tr>
- <td>
- <img height="3" width="1" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- </table>
- <table border="0" cellspacing="0" cellpadding="1">
- <xsl:choose>
- <xsl:when test="$agentStudio">
- <tr>
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_body">
- <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>
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- <td nowrap="nowrap">
- <table cellspacing="0" cellpadding="0" border="0" width="{$controlsWidth}">
- <tr>
- <!-- body -->
- <td class="emailBodyTableRow">
- <xsl:call-template name="emailBody">
- <xsl:with-param name="inputSize">
- <xsl:value-of select="$controlsWidth"/>
- </xsl:with-param>
- <xsl:with-param name="richEditMode" select="$richEditMode"/>
- </xsl:call-template>
- </td>
- </tr>
- <xsl:if test="/root/*[local-name()='links']/*[local-name()='item']">
- <tr>
- <!-- links -->
- <td class="emailLinksAttachmentTableRow" width="100%">
- <xsl:for-each select="/root/*[local-name()='links']/*[local-name()='item']">
- <input type="hidden" name="deleted_link_{position()}" value=""/>
- <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)">
- <tr>
- <td valign="middle" align="center">
- <xsl:call-template name="gen-icon">
- <xsl:with-param name="showAction" select="false()"/>
- <xsl:with-param name="class" select="*[local-name()='objectClass']"/>
- </xsl:call-template>
- </td>
- <td valign="middle" align="center" class="formText" nowrap="nowrap">
- <xsl:value-of select="*[local-name()='displayName']"/>
- </td>
- </tr>
- </table>
- </xsl:for-each>
- </td>
- </tr>
- </xsl:if>
- <xsl:if test="/root/*[local-name()='attachments']/*[local-name()='item']">
- <tr>
- <!-- attachments -->
- <td class="emailLinksAttachmentTableRow" width="100%">
- <xsl:for-each select="/root/*[local-name()='attachments']/*[local-name()='item']">
- <input type="hidden" name="deleted_attachment_{position()}" value=""/>
- <xsl:variable name="format">
- <xsl:choose>
- <xsl:when test="not(normalize-space(*[local-name()='format']))">
- <xsl:value-of select="/root/user/param[@name='format']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="*[local-name()='format']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="locale">
- <xsl:choose>
- <xsl:when test="not(normalize-space(*[local-name()='locale']))">
- <xsl:value-of select="/root/user/param[@name='contentLocale']"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="*[local-name()='locale']"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <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']}">
- <tr>
- <td align="center">
- <img>
- <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>
- </img>
- </td>
- </tr>
- <tr>
- <td nowrap="nowrap" align="center" class="formText">
- <xsl:value-of select="*[local-name()='attachmentName']"/>
- </td>
- </tr>
- <tr>
- <td nowrap="nowrap" align="center" class="formText">
- <xsl:choose>
- <xsl:when test="$format !='' and $locale!=''">
- <xts:string id="IDS_EMAIL_OPTIONS_FORMAT_LOCALE">
- <xts:param name="format">
- <xsl:value-of select="$format"/>
- </xts:param>
- <xts:param name="locale">
- <xsl:value-of select="$locale"/>
- </xts:param>
- </xts:string>
- </xsl:when>
- <xsl:otherwise> </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </table>
- </xsl:for-each>
- </td>
- </tr>
- </xsl:if>
- <!-- attachment and link links -->
- <tr>
- <td>
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class="formLink" width="100%" align="right">
- <xsl:if test="key('business-rules','allowAttachMenu')='true'">
- <!-- code from agent studio for the flyout -->
- <table border="0" cellpadding="0" cellspacing="0" style="cursor:hand">
- <tr>
- <td id="attachmentDropdown" height="0px" valign="bottom"/>
- <td class="formLink">
- <a href="#" onkeypress="if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
- <xts:string id="IDS_ADDENTRIES_ATTACHMENT_COLUMN"/>
- </a>
- </td>
- <td onkeypress="if(event.keyCode==9)return true;removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);" onmouseup="removeAttachmentMenuListener();showMenu(event);attachmentMenu_cancelBub(event);">
- <img border="0" title="" src="{$skin_shared_images}dropdown_arrow.gif"/>
- </td>
- </tr>
- </table>
- <script language="Javascript">
- var menuItemStyle = new CUIStyle('menuItem_normal', 'menuItem_hover', '', '', 'task_active');
- var menuStyle = new CUIStyle('menuContainer', '', '', '', '');
- var attachmentMenu = new CMenu('attachmentDropdown1',menuStyle);
- attachmentMenu.setHTMLContainer(document.getElementById('attachmentDropdown'));
- <xsl:for-each select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='attach']/*">
- <xsl:variable name="menuName">
- <xsl:choose>
- <xsl:when test="local-name()='eventOutput'">
- <xts:string id="IDS_EMAIL_OPTIONS_ATTACH_EVENT_OUTPUT"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_ATTACH_REPORT">
- <xts:param name="obj">
- <xsl:value-of select="*[local-name()='defaultName']"/>
- </xts:param>
- </xts:string>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- new CMenuItem(attachmentMenu, "<xsl:value-of select="xtsext:javascriptencode(string($menuName))"/>","<xsl:value-of select="xtsext:javascriptencode(concat('task', position()))"/>","attach('<xsl:value-of select="position()"/>')", '', menuItemStyle, "<xsl:value-of select="xtsext:javascriptencode(string($menuName))"/>");
- </xsl:for-each>
- //The call to this is done in the onmouseup event only.
- //We cannot put in the function below. Because the function
- //below can be called by the observer.
- function removeAttachmentMenuListener() {
- document.body.getWndObserver().removeListener(attachmentMenu);
- }
-
- function showMenu(event) {
- if (attachmentMenu && attachmentMenu.isVisible()) {
- attachmentMenu.remove();
- if (document.body.getWndObserver && parent.document.body.getWndObserver) {
- document.body.getWndObserver().removeWhenDone(attachmentMenu);
- }
- } else {
- //Must always be first to be able to delete the marked observer, before it shows it.
- if (document.body.getWndObserver && parent.document.body.getWndObserver) {
- //Notify parent that mouseup occured.
- parent.document.body.getWndObserver().notify(attachmentMenu,"mouseup");
- document.body.getWndObserver().addListener(attachmentMenu, showMenu, "mouseup");
- }
- attachmentMenu.draw();
- attachmentMenu.show();
- }
- }
- function attachmentMenu_cancelBub(evt)
- {
- //get the event in a cross-browser fashion
- evt = (evt) ? evt : ((event) ? event : null);
-
- //prevent the click from proceeding to other nodes
- if (typeof evt.cancelBubble != 'undefined')
- {
- evt.cancelBubble = true;
- }
-
- if (typeof evt.stopPropagation != 'undefined')
- {
- evt.stopPropagation();
- }
- }
- </script>
- </xsl:if>
- </td>
- <td class="formLink" nowrap="nowrap">
- <xsl:if test="key('business-rules','allowAddLinksAction')='true'">
-   
- <a href="#" onclick="setFormTarget(); document.{key('request-param','formName')}.addingLinks.value='true'; controller_doSubmit('addLinks', 'navigate', 'stack-up'); unsetFormTarget();">
- <xts:string id="IDS_EMAIL_OPTIONS_SELECT_LINKS"/>
- </a>
- </xsl:if>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </xsl:when>
- <xsl:otherwise>
- <tr>
- <td>
- <xsl:if test="$richEditMode = 'true'">
- <xsl:attribute name="class">emailBodyTableRow</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="emailBody">
- <xsl:with-param name="inputSize" select="$controlsWidth"/>
- <xsl:with-param name="richEditMode" select="$richEditMode"/>
- </xsl:call-template>
- </td>
- </tr>
- </xsl:otherwise>
- </xsl:choose>
- <tr>
- <td nowrap="nowrap">
- <img height="5" width="1" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- </table>
- </lyt:section>
- </lyt:layout>
- <lyt:layout style="2">
- <lyt:section>
- <xsl:if test="key('request-param','taskType') = 'approval'">
- <dp:list title="IDS_TASK_OPTIONS_DUEDATES_LABEL" width="100%">
- <dp:section>
- <dp:hint wrap="wrap">
- <xts:string id="IDS_TASK_OPTIONS_DUEDATES_DESC"/>
- </dp:hint>
- </dp:section>
- <dp:section>
- <table border="0" cellspacing="0" callpadding="0">
- <xsl:call-template name="renderDeadline">
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_OPTIONS_STARTWITHIN_LABEL"/>
- </xsl:with-param>
- <xsl:with-param name="suffix">_start</xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="renderDeadline">
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_OPTIONS_DUEWITHIN_LABEL"/>
- </xsl:with-param>
- <xsl:with-param name="suffix">_due</xsl:with-param>
- </xsl:call-template>
- </table>
- </dp:section>
- <dp:section>
- </dp:section>
- </dp:list>
- </xsl:if>
- <!-- the link to report -->
- <table>
- <xsl:if test="key('request-param','subscription')='true'">
- <tr>
- <td>
- <dp:choice>
- <dp:section1>
- <input type="checkbox" name="m_ro_taskAsURL" id="m_ro_taskAsURL" value="true">
- <xsl:if test="key('env-param','m_ro_taskAsURL')='true'">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </input>
- </dp:section1>
- <dp:section2>
- <label for="m_ro_taskAsURL">
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_LINK"/>
- </label>
- </dp:section2>
- </dp:choice>
- </td>
- </tr>
- </xsl:if>
- </table>
- <!-- the priority -->
- <dp:list>
- <dp:section>
- <dp:label>
- <xts:string id="IDS_TASK_PRIORITY_LABEL"/>
- </dp:label>
- </dp:section>
- <dp:section>
- <table cellspacing="0" cellpadding="0" border="0">
- <tr>
- <!-- radio button for ES -->
- <xsl:if test="key('request-param','agentStudio') = 'true'">
- <td>
- <input type="radio" id="m_ro_priority_radio_default" name="m_ro_priority_radio" value="priority">
- <xsl:if test="key('env-param','m_ro_priority_radio')='priority'">
- <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
- </xsl:if>
- </input>
- </td>
- </xsl:if>
- <!-- combo box -->
- <td>
- <select onclick="javascript:setRadioButton('m_ro_priority_radio_default');" type="text" id="m_ro_priority" name="m_ro_priority">
- <xsl:if test="key('request-param','agentStudio') = 'true' ">
- <xsl:attribute name="style"><xsl:text>width:100%</xsl:text></xsl:attribute>
- </xsl:if>
- <option name="high" id="high" value="1">
- <xsl:if test="key('env-param','m_ro_priority')='1' ">
- <xsl:attribute name="selected"><xsl:text>selected</xsl:text></xsl:attribute>
- </xsl:if>
- <xsl:text>
- <xts:string id="IDS_TASK_PRIORITY_HIGH"/>
- </xsl:text>
- </option>
- <option name="normal" id="normal" value="3">
- <xsl:if test="key('env-param','m_ro_priority')='3' or not(key('env-param','m_ro_priority'))">
- <xsl:attribute name="selected"><xsl:text>selected</xsl:text></xsl:attribute>
- </xsl:if>
- <xsl:text>
- <xts:string id="IDS_TASK_PRIORITY_NORMAL"/>
- </xsl:text>
- </option>
- <option name="low" id="low" value="5">
- <xsl:if test="key('env-param','m_ro_priority')='5' ">
- <xsl:attribute name="selected"><xsl:text>selected</xsl:text></xsl:attribute>
- </xsl:if>
- <xsl:text>
- <xts:string id="IDS_TASK_PRIORITY_LOW"/>
- </xsl:text>
- </option>
- </select>
- </td>
- </tr>
- <xsl:if test="key('request-param','agentStudio') = 'true'">
- <!-- agent item radio button -->
- <tr>
- <td>
- <input type="radio" id="m_ro_priority_radio_item" name="m_ro_priority_radio" value="item">
- <xsl:if test="key('env-param','m_ro_priority_radio')='item'">
- <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
- </xsl:if>
- </input>
- </td>
- <td class="formText">
- <label for="m_ro_priority_radio_item">
- <xts:string id="IDS_TASK_LABEL_ITEM"/>
- </label>
- <img width="1" height="15" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- <tr>
- <td/>
- <td>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <!-- agent item insert image -->
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_subject" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('m_ro_priority_item');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt="" title=""/>
- </td>
- <td nowrap="nowrap">
- <!-- agent item text box -->
- <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');">
- <xsl:attribute name="value"><xsl:value-of select="key('env-param','m_ro_priority_item')"/></xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </xsl:if>
- </table>
- </dp:section>
- </dp:list>
- <table id="taskOptionsTableId" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td>
- <xsl:choose>
- <xsl:when test="key('request-param','taskType') = 'approval'">
- <dp:list title="IDS_TASK_OPTIONS_LABEL" noSpace="true">
- <!-- notify recipients upon creation -->
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyOnCreation</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_ON_CREATION"/>
- </xsl:with-param>
- <xsl:with-param name="defaultChecked" select="true()"/>
- </xsl:call-template>
- </dp:section>
- <!-- notify if not started by start by date-->
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyNotStarted</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_NOT_STARTED"/>
- </xsl:with-param>
- <xsl:with-param name="defaultChecked" select="true()"/>
- </xsl:call-template>
- </dp:section>
- <!-- notify if not completed by due date-->
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyNotCompleted</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_NOT_COMPLETED"/>
- </xsl:with-param>
- <xsl:with-param name="defaultChecked" select="true()"/>
- </xsl:call-template>
- </dp:section>
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyOnStateChange</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_ON_STATECHANGE"/>
- </xsl:with-param>
- <xsl:with-param name="defaultChecked" select="true()"/>
- <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
- </xsl:call-template>
- </dp:section>
- <!-- send notification on state change -->
- </dp:list>
- <table cellspacing="0" cellpadding="0">
- <tr>
- <td>
- <dp:list>
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_started</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_STARTED"/>
- </xsl:with-param>
- <xsl:with-param name="indent">true</xsl:with-param>
- <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_owner</xsl:with-param>
- <xsl:with-param name="indent">true</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_OWNER_CHANGED"/>
- </xsl:with-param>
- <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
- </xsl:call-template>
- </dp:section>
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_comment</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_COMMENT"/>
- </xsl:with-param>
- <xsl:with-param name="indent">true</xsl:with-param>
- <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
- </xsl:call-template>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_completed</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_COMPLETED"/>
- </xsl:with-param>
- <xsl:with-param name="indent">true</xsl:with-param>
- <xsl:with-param name="defaultChecked" select="true()"/>
- <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
- </xsl:call-template>
- </dp:section>
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyOnStateChange_cancelled</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_NOTIFY_STATECHANGE_CANCELLED"/>
- </xsl:with-param>
- <xsl:with-param name="indent">true</xsl:with-param>
- <xsl:with-param name="defaultChecked" select="true()"/>
- <xsl:with-param name="onclick">checkboxSelected(this.id,'taskOptionsTableId');</xsl:with-param>
- </xsl:call-template>
- </dp:section>
- </dp:list>
- </td>
- </tr>
- </table>
- </xsl:when>
- <xsl:otherwise>
- <!-- the task options -->
- <dp:list title="IDS_TASK_OPTIONS_LABEL" padding="0">
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_sub_notifyOnCreation</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_CREATION_EMAIL_NOTIFICATION"/>
- </xsl:with-param>
- </xsl:call-template>
- </dp:section>
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_readReceipt</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_READ_RECIEPT"/>
- </xsl:with-param>
- <xsl:with-param name="onclick">requestAcknowledgedChecked(this);</xsl:with-param>
- </xsl:call-template>
- </dp:section>
-
- <dp:section>
- <table border="0" cellspacing="0" callpadding="0">
- <xsl:call-template name="renderDeadline">
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_READ_EXPIREY"/>
- </xsl:with-param>
- <xsl:with-param name="suffix">_start</xsl:with-param>
- <xsl:with-param name="breakAfterLabel">true</xsl:with-param>
-
- </xsl:call-template>
- </table>
- </dp:section>
- </dp:list>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </table>
- </lyt:section>
- <lyt:section>
- <xsl:if test="key('request-param','taskType') = 'approval'">
- <dp:list title="IDS_TASK_ICON_LABEL" width="100%">
- <dp:section>
- <dp:hint wrap="wrap">
- <xts:string id="IDS_TASK_ICON_DESC"/>
- </dp:hint>
- </dp:section>
- <dp:section>
- <table cellspacing="0" cellpadding="0" border="0">
- <tr>
- <!-- radio button for ES -->
- <xsl:if test="key('request-param','agentStudio') = 'true'">
- <td>
- <input type="radio" id="m_ro_icon_radio_default" name="m_ro_icon_radio" value="default">
- <xsl:if test="key('env-param','m_ro_icon_radio')='default'">
- <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
- </xsl:if>
- </input>
- </td>
- </xsl:if>
- <!-- combo box -->
- <td nowrap="true" class="formText">
- <label for="m_ro_icon_radio_default">
- <xts:string id="IDS_TASK_ICON_DEFAULT"/>
- </label>
- </td>
- </tr>
- <xsl:if test="key('request-param','agentStudio') = 'true'">
- <!-- agent item radio button -->
- <tr>
- <td>
- <input type="radio" id="m_ro_icon_radio_item" name="m_ro_icon_radio" value="item">
- <xsl:if test="key('env-param','m_ro_icon_radio')='item'">
- <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
- </xsl:if>
- </input>
- </td>
- <td class="formText">
- <label for="m_ro_icon_radio_item">
- <xts:string id="IDS_TASK_LABEL_ITEM"/>
- </label>
- <img width="1" height="15" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </tr>
- <tr>
- <td/>
- <td>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <!-- agent item insert image -->
- <td valign="top" nowrap="nowrap">
- <table border="0" cellspacing="0" cellpadding="1" valign="top">
- <tr valign="top">
- <dp:columnButton>
- <img align="middle" height="18" name="insert_subject" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('m_ro_icon_item');">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>insert.gif</xsl:attribute>
- <xsl:attribute name="alt"><xts:string id="IDS_EMAIL_OPTIONS_INSERT_ALT"/></xsl:attribute>
- </img>
- </dp:columnButton>
- </tr>
- </table>
- </td>
- <td nowrap="nowrap">
- <img width="3" src="{$webcontent}/images/space.gif" alt="" title=""/>
- </td>
- <td nowrap="nowrap">
- <!-- agent item text box -->
- <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');">
- <xsl:attribute name="value"><xsl:value-of select="key('env-param','m_ro_icon_item')"/></xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </xsl:if>
- </table>
- </dp:section>
- </dp:list>
- <img height="5" width="1" src="{$webcontent}/images/space.gif" alt="" title=""/>
- <dp:list title="IDS_TASK_OWNER_ACTION_LABEL" width="100%">
- <dp:section>
- <dp:hint wrap="wrap">
- <xts:string id="IDS_TASK_OWNER_ACTION_HINT"/>
- </dp:hint>
- </dp:section>
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_owner_action</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_OWNER_APPROVE_REJECT"/>
- </xsl:with-param>
- <xsl:with-param name="type">radio</xsl:with-param>
- <xsl:with-param name="value">approve</xsl:with-param>
- </xsl:call-template>
- </dp:section>
- <dp:section>
- <span>
- <!-- YUK YUK -->
- <img height="1" width="25" src="{$webcontent}/images/space.gif" alt=""/>
- <xts:string id="IDS_TASK_APPROVE_REJECT">
- <xts:param name="approveValue">
- <xsl:value-of select="key('env-param','m_ro_approveValue')"/>
- </xts:param>
- <xts:param name="rejectValue">
- <xsl:value-of select="key('env-param','m_ro_rejectValue')"/>
- </xts:param>
- </xts:string>
- <a href="#" onclick="updateApproveAgentRadio('approve');setFormTarget(); controller_doSubmit('setLabels', 'markup', 'stack-up'); unsetFormTarget();">
- <xts:string id="IDS_TASK_LBL_CUSTOMIZE"/>
- </a>
- </span>
- </dp:section>
- <dp:section>
- <xsl:call-template name="renderOption">
- <xsl:with-param name="id">m_ro_owner_action</xsl:with-param>
- <xsl:with-param name="label">
- <xts:string id="IDS_TASK_OWNER_CHOOSE"/>
- </xsl:with-param>
- <xsl:with-param name="type">radio</xsl:with-param>
- <xsl:with-param name="value">agent</xsl:with-param>
- </xsl:call-template>
- </dp:section>
- <dp:section>
- <span>
- <table cellspacing="0" cellpadding="0" border="0">
- <xsl:for-each select="/root/followingTaskList/futureTask">
- <xsl:variable name="checkboxID">
- <xsl:value-of select="concat('m_ro_agentTaskItem_', ./id)"/>
- </xsl:variable>
- <xsl:variable name="hiddenDisplayID">
- <xsl:value-of select="concat('m_ro_agentTaskItem_display_', ./id)"/>
- </xsl:variable>
- <tr>
- <td><img height="1" width="15" src="{$webcontent}/images/space.gif" alt=""/></td>
- <!-- we need a checkbox to say if the task is to be used -->
- <td>
- <input name="{$checkboxID}" id="{$checkboxID}" type="checkbox" value="true" onclick="updateApproveAgentRadio('agent')">
- <xsl:if test="key('env-param',$checkboxID)='true' ">
- <xsl:attribute name="checked"><xsl:text>checked</xsl:text></xsl:attribute>
- </xsl:if>
- </input>
- <input name="{$hiddenDisplayID}" id="{$hiddenDisplayID}" type="hidden">
- <xsl:attribute name="value">
- <xsl:choose>
- <xsl:when test="key('env-param',$hiddenDisplayID) and key('env-param',$hiddenDisplayID)!=''">
- <xsl:value-of select="key('env-param',$hiddenDisplayID)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./display"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </input>
- </td>
- <!-- we need the name of the task -->
- <td class="formText">
- <xsl:choose>
- <xsl:when test="key('env-param',$hiddenDisplayID) and key('env-param',$hiddenDisplayID)!=''">
- <xsl:value-of select="key('env-param',$hiddenDisplayID)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./display"/>
- </xsl:otherwise>
- </xsl:choose>
- </td>
- </tr>
- </xsl:for-each>
- </table>
- <!-- this is going to need tidying up but for now -->
- <!-- create a hidden input to hold all the possible future tasks -->
- <input type="hidden" id="possible_futureTasks" name="possible_futureTasks" value="{key('env-param','possible_futureTasks')}"/>
- </span>
- </dp:section>
- <dp:section>
- <span>
- <!-- YUK YUK -->
- <img height="1" width="25" src="{$webcontent}/images/space.gif" alt=""/>
- <xts:string id="IDS_TASK_SUBMIT">
- <xts:param name="submitValue">
- <xsl:value-of select="key('env-param','m_ro_submitValue')"/>
- </xts:param>
- </xts:string>
- <a href="#" onclick="updateApproveAgentRadio('agent');setFormTarget(); controller_doSubmit('setLabels', 'markup', 'stack-up'); unsetFormTarget();">
- <xts:string id="IDS_TASK_LBL_CUSTOMIZE"/>
- </a>
- </span>
- </dp:section>
- </dp:list>
- </xsl:if>
- </lyt:section>
- </lyt:layout>
- <!-- footer -->
- <xsl:choose>
- <xsl:when test="key('request-param','displayButtons') != 'false'">
- <dp:footer>
- <xsl:choose>
- <xsl:when test="key('request-param','inWizard') = 'true'">
- <dlgctrl:wizardButtons validateFunction="validate"/>
- </xsl:when>
- <xsl:otherwise>
- <dlgctrl:okCancelButtons validateFunction="validate"/>
- </xsl:otherwise>
- </xsl:choose>
- </dp:footer>
- </xsl:when>
- <xsl:otherwise>
- <dp:emptyFooter/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="key('env-param','duplicateEntryAdded') = 'true'">
- <script language="javascript">
- window.alert("<xts:string id="IDS_DUPLICATE_ENTRY" encode="javascript"/>");
- </script>
- </xsl:if>
- <xsl:if test="not(key('env-param','visited_email_options')) and /root/selectedEntries/item/unknown='true'">
- <script language="javascript">
- alert("<xts:string id="IDS_OTHERRUN_EMAIL_WARN_UNKNOWN_RECIPIENT" encode="javascript"/>");
- </script>
- </xsl:if>
- </xts:transform>
- </markup>
- <browserTitle>
- <xsl:if test="key('business-rules','browserTitle') != ''">
- <xts:transform name="XMLEncode">
- <xsl:value-of select="key('business-rules','browserTitle')"/>
- </xts:transform>
- </xsl:if>
- </browserTitle>
- </xsl:element>
- </xos:entityBody>
- </xos:part>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- <xsl:template name="renderOption">
- <xsl:param name="id"/>
- <xsl:param name="label"/>
- <xsl:param name="indent" select="false()"/>
- <xsl:param name="value" select="true()"/>
- <xsl:param name="onclick"/>
- <xsl:param name="type"/>
- <xsl:param name="uncheckedValue">
- <xsl:text>unchecked</xsl:text>
- </xsl:param>
- <xsl:param name="defaultChecked" select="false()"/>
- <!-- generate the option name -->
- <xsl:variable name="optionName">
- <xsl:choose>
- <!-- for checkboxes generate a tmp name to handle the submission of unchecked values -->
- <xsl:when test="$type='' or $type='checkbox'">
- <xsl:value-of select="concat('tmp_chkbox_',$id)"/>
- </xsl:when>
- <!-- default name -->
- <xsl:otherwise>
- <xsl:value-of select="$id"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- radio buttons have an id composed of the id and the value -->
- <xsl:variable name="optionId">
- <xsl:choose>
- <xsl:when test="$type='radio'">
- <xsl:value-of select="concat(concat($id,'_'),$value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$optionName"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <table cellspacing="0" cellpadding="0" border="0">
- <tr>
- <!-- indent -->
- <xsl:if test="$indent='true'">
- <td>
- <img height="1" width="25" src="{$webcontent}/images/space.gif" alt="" title=""/>
- </td>
- </xsl:if>
- <td nowrap="true" class="formText">
- <input id="{$optionId}" name="{$optionName}" value="{$value}" tabindex="0">
- <!-- checkbox or radio -->
- <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>
- <!-- on click handler-->
- <xsl:variable name="onClickHandler">
- <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/>
- <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/>
- <xsl:if test="$onclick!=''">
- <!-- replace this.id with the temp id -->
- <xsl:text>;</xsl:text>
- <xsl:call-template name="replace">
- <xsl:with-param name="input" select="$onclick"/>
- <xsl:with-param name="searchItem">
- <xsl:text>this.id</xsl:text>
- </xsl:with-param>
- <xsl:with-param name="replacement">
- <xsl:text>'</xsl:text>
- <xsl:value-of select="$optionName"/>
- <xsl:text>'</xsl:text>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- </xsl:variable>
- <!-- add the onlick attribute -->
- <xsl:attribute name="onclick"><xsl:value-of select="$onClickHandler"/></xsl:attribute>
- <!-- determine the value of the 'checked' attribute -->
- <xsl:variable name="checkedAttrValue">
- <xsl:choose>
- <!-- env param is true so check it -->
- <xsl:when test="string(key('env-param',$id))=string($value)">
- <xsl:text>checked</xsl:text>
- </xsl:when>
- <!-- the checkbox has been unchecked -->
- <xsl:when test="($type='' or $type='checkbox') and (key('env-param',$id)=$uncheckedValue)"/>
- <!-- initialise state is checked only when isChecked is true -->
- <xsl:when test="not(key('env-param',$id))">
- <xsl:if test="$defaultChecked='true'">
- <xsl:text>checked</xsl:text>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <!-- checked attribute -->
- <xsl:if test="$checkedAttrValue!=''">
- <xsl:attribute name="checked"><xsl:value-of select="$checkedAttrValue"/></xsl:attribute>
- </xsl:if>
- </input>
- <!-- add the logic to preserve 'unchecked' checkbox value -->
- <xsl:if test="$type='' or $type='checkbox'">
- <input type="hidden" id="{$id}" name="{$id}">
- <!-- checked attribute -->
- <xsl:attribute name="value">
- <xsl:choose>
- <!-- env param is true so check it -->
- <xsl:when test="key('env-param',$id)!=''">
- <xsl:value-of select="key('env-param',$id)"/>
- </xsl:when>
- <!-- initialise state is checked only when defaultChecked is true -->
- <xsl:otherwise>
- <!-- have to decide whether or not to use the checked or unchecked value -->
- <xsl:choose>
- <xsl:when test="$defaultChecked='true'">
- <!-- the default is the checked value so set it -->
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$uncheckedValue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </input>
- </xsl:if>
- </td>
- <!-- define the label -->
- <td nowrap="true" class="formText">
- <label for="{$optionId}">
- <xsl:value-of select="$label"/>
- </label>
- </td>
- </tr>
- </table>
- </xsl:template>
- <xsl:template name="renderDeadline">
- <xsl:param name="label"/>
- <xsl:param name="suffix"/>
- <xsl:param name="breakAfterLabel" select="false()"/>
- <xsl:param name="onClick" select="''"/>
- <xsl:variable name="labelId" select="concat('m_ro_readExpiry',$suffix)"/>
- <xsl:choose>
- <xsl:when test="$breakAfterLabel='true'">
- <tr>
- <!-- checkbox -->
- <td nowrap="true" class="formText">
- <input type="checkbox" name="{$labelId}" id="{$labelId}" value="true" onclick="expiryChecked(this);" tabindex="0">
- <xsl:if test="key('env-param',$labelId)='true'">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </input>
- </td>
- <!-- label -->
- <td nowrap="true" class="formText">
- <label for="{$labelId}">
- <xsl:value-of select="$label"/>
- </label>
- </td>
- </tr>
- <tr>
- <td> </td>
- <xsl:call-template name="renderDeadlineTextBoxAndCombo">
- <xsl:with-param name="suffix" select="$suffix"/>
- <xsl:with-param name="checkBox" select="$labelId"/>
- </xsl:call-template>
- </tr>
- </xsl:when>
- <xsl:otherwise>
- <tr>
- <!-- checkbox -->
- <td nowrap="true" class="formText" width="15px">
- <input type="checkbox" name="{$labelId}" id="{$labelId}" value="true">
- <xsl:if test="key('env-param',$labelId)='true'">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </input>
- </td>
- <!-- label -->
- <td nowrap="true" class="formText">
- <label for="{$labelId}">
- <xsl:value-of select="$label"/>
- </label>
- </td>
- <xsl:call-template name="renderDeadlineTextBoxAndCombo">
- <xsl:with-param name="suffix" select="$suffix"/>
- <xsl:with-param name="checkBox" select="$labelId"/>
- </xsl:call-template>
- </tr>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="renderDeadlineTextBoxAndCombo">
- <xsl:param name="suffix"/>
- <xsl:param name="checkBox"/>
-
- <xsl:variable name="labelId" select="concat('m_ro_readExpiry',$suffix)"/>
- <xsl:variable name="unitId" select="concat('m_ro_readExpireUnit',$suffix)"/>
- <xsl:variable name="unitCountlId" select="concat('m_ro_readExpireUnitCount',$suffix)"/>
- <script type="text/javascript">
- // validate the due date. should only contain intergers
- function validateType(InputId, value) {
- if(value && !isValidValue(value)) {
- alert('<xsl:text/><xts:string id="IDS_TASK_DUE_DATE_VALIDATE_MESSAGE" encode="javascript"/><xsl:text/>');
- document.getElementById(InputId.id).focus();
- }
- }
- function isValidValue(value) {
- return !(isNaN(value) || value < 1 || (value % 1)!=0);
- }
- function doCheckBox(id,value) {
- var checkBox = document.getElementById(id);
- if (value && isValidValue(value)) {
- checkBox.checked = true;
- } else {
- checkBox.checked = false;
- }
- }
- </script>
- <td>
- <table cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <!-- text box -->
- <input type="text" id="{$unitCountlId}" size="5" name="{$unitCountlId}" onblur="validateType({$unitCountlId}, this.value);doCheckBox('{$checkBox}',this.value)">
- <xsl:if test="key('env-param',$unitCountlId)">
- <xsl:attribute name="value"><xsl:value-of select="key('env-param',$unitCountlId)"/></xsl:attribute>
- </xsl:if>
- </input>
- </td>
- <td>
- <img height="1" width="3" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- <td nowrap="true" class="formText">
- <label for="{$unitCountlId}">
- <xsl:text><xts:string id="IDS_TASK_UNIT_DAYS"/></xsl:text>
- </label>
- <input type="hidden" id="{$unitId}" name="{$unitId}" value="D"/>
- </td>
- </tr>
- </table>
- </td>
- </xsl:template>
- <!-- general string replacement template -->
- <xsl:template name="replace">
- <xsl:param name="input" select="."/>
- <xsl:param name="searchItem"/>
- <xsl:param name="replacement"/>
- <xsl:choose>
- <xsl:when test="contains($input,$searchItem)">
- <xsl:value-of select="substring-before($input,$searchItem)"/>
- <xsl:value-of select="$replacement"/>
- <xsl:call-template name="replace">
- <xsl:with-param name="input" select="substring-after($input,$searchItem)"/>
- <xsl:with-param name="searchItem" select="$searchItem"/>
- <xsl:with-param name="replacement" select="$replacement"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$input"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="emailBody">
- <xsl:param name="inputSize"/>
- <xsl:param name="richEditMode"/>
- <xsl:choose>
- <xsl:when test="$richEditMode = 'true'">
- <iframe id="email_body_iframe" src="../common/blank.html" frameborder="0" contentEditable="true" onblur="richEditControl_doEditBlur();" marginwidth="2" marginheight="2">
- <!-- for rich edit body we're using the table border and not the textarea border -->
- <xsl:attribute name="style">width:<xsl:value-of select="$inputSize - 6"/>px;height:95px;</xsl:attribute>
- </iframe>
- <input type="hidden" name="hidden_richEditBody" value="{key('env-param','hidden_richEditBody')}"/>
- <input type="hidden" name="email_body" value="{key('env-param','email_body')}"/>
- </xsl:when>
- <xsl:otherwise>
- <textarea rows="6" name="email_body" id="email_body">
- <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'">
- width:<xsl:value-of select="$inputSize - 6"/>px;
- </xsl:when><xsl:otherwise>
- width:<xsl:value-of select="$inputSize"/>px;
- px;</xsl:otherwise></xsl:choose>
- OVERFLOW:auto; PADDING: 2px;
- <xsl:if test="key('request-param','agentStudio')='true'">BORDER-WIDTH: 0px;</xsl:if></xsl:attribute>
- <xsl:value-of select="key('env-param','email_body')"/>
- </textarea>
- <input type="hidden" name="hidden_richEditBody" value=""/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="richEditControls">
- <script type="text/javascript">
- // Makes button look sunken when button is clicked
- function richEditControl_buttonDown()
- {
- if (window.event.srcElement.className == 'toolbarImagePressed')
- {
- window.event.srcElement.className = "toolbarImageNormal";
- }
- else if (window.event.srcElement.className == 'toolbarImageNormal' || window.event.srcElement.className == 'toolbarImageOver')
- {
- window.event.srcElement.className = "toolbarImagePressed";
- }
-
- }
- // Makes button look raised when button is released
- function richEditControl_buttonOut(obj)
- {
- obj.className = "toolbarImageNormal";
- }
-
- function richEditControl_buttonOver(obj)
- {
- if (obj.className == 'toolbarImageNormal')
- obj.className = 'toolbarImageOver';
- }
-
-
- function richEditControl_doBold()
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('bold', false, null);
- }
-
- function richEditControl_doItalic()
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('italic', false, null);
- }
-
- function richEditControl_doUnderline()
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('underline', false, null);
- }
-
- function richEditControl_doLeft()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- <!-- make sure the other alignment buttons aren no longer selected -->
- document.getElementById('action_align_center').className = "toolbarImageNormal";
- document.getElementById('action_align_right').className = "toolbarImageNormal";
- document.getElementById('action_justify').className = "toolbarImageNormal";
-
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('justifyleft', false, null);
- }
-
- function richEditControl_doCenter()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- <!-- make sure the other alignment buttons aren no longer selected -->
- document.getElementById('action_align_left').className = "toolbarImageNormal";
- document.getElementById('action_align_right').className = "toolbarImageNormal";
- document.getElementById('action_justify').className = "toolbarImageNormal";
-
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('justifycenter', false, null);
- }
-
- function richEditControl_doRight()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- <!-- make sure the other alignment buttons aren no longer selected -->
- document.getElementById('action_align_left').className = "toolbarImageNormal";
- document.getElementById('action_align_center').className = "toolbarImageNormal";
- document.getElementById('action_justify').className = "toolbarImageNormal";
-
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('justifyright', false, null);
- }
-
- function richEditControl_doJustify()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- <!-- make sure the other alignment buttons aren no longer selected -->
- document.getElementById('action_align_left').className = "toolbarImageNormal";
- document.getElementById('action_align_center').className = "toolbarImageNormal";
- document.getElementById('action_align_right').className = "toolbarImageNormal";
-
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('JustifyFull', false, null);
- }
-
- function richEditControl_doOrdList()
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('insertorderedlist', false, null);
- }
-
- function richEditControl_doBulList()
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('insertunorderedlist', false, null);
- }
-
- function richEditControl_doIndent()
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('Indent', false, null);
- }
-
- function richEditControl_doOutdent()
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('Outdent', false, null);
- }
-
- function richEditControl_doForeCol(color)
- {
- toggledynamicDiv('fontColor');
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('forecolor', false, color);
- }
-
- function richEditControl_doFont(obj)
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('fontname', false, obj.value);
- }
-
- function richEditControl_doSize(obj)
- {
- email_body_iframe.focus();
- email_body_iframe.document.execCommand('fontsize', false, obj.value);
- }
-
- function richEditControl_doTable()
- {
- var frm = document.<xsl:value-of select="key('request-param','formName')"/>;
-
- email_body_iframe.focus();
- var rows = frm.richEditControl_tableRows.value;
- var columns = frm.richEditControl_tableColumns.value;
- var html = "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\">";
- for (var i = 0; i < rows; ++i ) {
- html += "<tr>";
- for (var j = 0; j < columns; ++j ) {
- html += "<td><xts:string id="IDS_EMAIL_INSERT_TEXT" encode="javascript"/></td>";
- }
- html += "</tr>";
- }
- html += "</table>";
- var range = email_body_iframe.document.selection.createRange();
-
- if (textRange.getBookmark())
- {
- range.moveToBookmark(textRange.getBookmark());
- }
-
- <!-- for some reason, when the cursor is at the end of a line, the moveToBookmark places the ending
- point one character farther then it should be -->
- if (range.compareEndPoints('EndToEnd',textRange) == 1)
- {
- range.moveEnd('character',-1);
- }
-
- range.pasteHTML(html);
- textRange = null;
- }
-
- function richEditControl_doHorizontalRule()
- {
- email_body_iframe.focus();
- var range = email_body_iframe.document.selection.createRange();
- range.pasteHTML("<hr>");
- }
-
- function richEditControl_removeLinks()
- {
- <xsl:if test="not(key('system-param','allow-email-links')='true')">
- // remove all links from email_body for security reasons
- for (i=0; i < email_body_iframe.document.links.length; i++) {
- var tr = email_body_iframe.document.links[i].parentTextEdit.createTextRange();
- tr.moveToElementText(email_body_iframe.document.links[i]);
- tr.execCommand("Unlink",false);
- tr.execCommand("Unselect",false);
- i--;
- }
- </xsl:if>
- // remove all images from email_body for security reasons
- for (i=0; i < email_body_iframe.document.images.length; i++) {
- var tr = email_body_iframe.document.images[i].parentTextEdit.createTextRange();
- tr.moveToElementText(email_body_iframe.document.images[i]);
- tr.execCommand("Delete",false);
- i--;
- }
- }
-
- function richEditControl_convertToXHTML()
- {
- var element = email_body_iframe.document.body;
- return richEditControl_doTree(element);
- }
-
- function richEditControl_doTree(element)
- {
- var node = "";
- if (element.nodeType == 1) {
- // add the start of the node
- node = "<" + element.tagName;
- for (var i = 0; i < element.attributes.length; ++i) {
- if (element.attributes[i].nodeValue != null &&
- element.attributes[i].nodeValue.length > 0 &&
- element.attributes[i].nodeName != "contentEditable") {
- node += " " + element.attributes[i].nodeName + "=\"" + htmlEncode(element.attributes[i].nodeValue) + "\"";
- }
- }
- if (element.childNodes != null && element.childNodes.length > 0) {
- node += ">";
- for (var j = 0; j < element.childNodes.length; ++j) {
- node += richEditControl_doTree(element.childNodes[j]);
- }
- node += "</" + element.tagName + ">";
- } else {
- node += "/>";
- }
- } else if (element.nodeType == 3) {
- <!-- Make sure we encode special HTML characters (&, ", <, >) -->
- node = htmlEncode(element.data);
- }
- return node;
- }
-
- function richEditControl_doEditBlur()
- {
- richEditControl_removeLinks();
- // copy the contents of the edit window into a form field
- document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody.value = richEditControl_convertToXHTML();
- }
-
- // handles moving the bold, italic and underline spans
- function moveRichEditSpans(moveBy)
- {
- document.getElementById('fix_bold').style.pixelTop += moveBy;
- document.getElementById('fix_italic').style.pixelTop += moveBy;
- document.getElementById('fix_underline').style.pixelTop += moveBy;
- }
-
- // function to initialize the script for the contents of the screen
- function richEditControl_init()
- {
- var Editor = email_body_iframe.document;
- Editor.designMode = "On";
-
- // set up the body of the Iframe
- <xsl:choose>
- <xsl:when test="key('env-param','hidden_richEditBody') != ''">
- email_body_iframe.document.write('<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','hidden_richEditBody')))"/>');
- </xsl:when>
- <xsl:when test="key('env-param','email_body') != ''">
- <!-- encode textarea string's carriage returns -->
- emailBodyString = replaceCarriageReturns(htmlEncode('<xsl:value-of select="xtsext:javascriptencode(string(key('env-param','email_body')))"/>'),'<br/>');
- email_body_iframe.document.write("<BODY id=\"editbody\"> style=\"margin:0px\">" + emailBodyString + "</BODY>");
- </xsl:when>
- <xsl:otherwise>
- email_body_iframe.document.write("<BODY id=\"editbody\" style=\"margin:0px\"></BODY>");
- </xsl:otherwise>
- </xsl:choose>
-
- // set up the drag drop for the HTML edit body too
- <xsl:if test="$agentStudio">
- var dropZone = new DropZone("editbody","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>");
-
- droppy.registerDropZoneObject(dropZone);
-
- //pass the group to a listener in case number of members dynamically changes
- droppy.registerDropZoneGroup(new Array(dropZone), "<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>");
- </xsl:if>
- <!-- nasty, but we have to reposition the blank images so they cover the padding and border around the
- bold, italic and underline buttons -->
- document.getElementById('fix_bold').style.pixelLeft = document.getElementById('fix_bold').offsetLeft - 2;
- document.getElementById('fix_bold').style.pixelTop = document.getElementById('fix_bold').offsetTop - 2;
- document.getElementById('fix_italic').style.pixelLeft = document.getElementById('fix_italic').offsetLeft - 2;
- document.getElementById('fix_italic').style.pixelTop = document.getElementById('fix_italic').offsetTop - 2;
- document.getElementById('fix_underline').style.pixelLeft = document.getElementById('fix_underline').offsetLeft - 2;
- document.getElementById('fix_underline').style.pixelTop = document.getElementById('fix_underline').offsetTop - 2;
-
- if (document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody)
- {
- // copy the contents of the edit window into a form field
- document.<xsl:value-of select="key('request-param','formName')"/>.hidden_richEditBody.value = richEditControl_convertToXHTML();
- }
- }
- </script>
- <!-- bold -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doBold();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_BOLD"/>
- </xsl:with-param>
- <xsl:with-param name="text">
- <xts:string id="IDS_BOLD"/>
- </xsl:with-param>
- <xsl:with-param name="textClass" select="'toolbarTextBold'"/>
- <xsl:with-param name="id">bold</xsl:with-param>
- </xsl:call-template>
- <!-- italic -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doItalic();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_ITALIC"/>
- </xsl:with-param>
- <xsl:with-param name="text">
- <xts:string id="IDS_ITALIC"/>
- </xsl:with-param>
- <xsl:with-param name="textClass" select="'toolbarTextItalic'"/>
- <xsl:with-param name="id">italic</xsl:with-param>
- </xsl:call-template>
- <!-- underline -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doUnderline();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_UNDERLINE"/>
- </xsl:with-param>
- <xsl:with-param name="text">
- <xts:string id="IDS_UNDERLINE"/>
- </xsl:with-param>
- <xsl:with-param name="textClass" select="'toolbarTextUnderline'"/>
- <xsl:with-param name="id">underline</xsl:with-param>
- <xsl:with-param name="last">true</xsl:with-param>
- </xsl:call-template>
- <!-- spacer -->
- <td>
- <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- <!-- left align -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doLeft();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_ALIGN_LEFT"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_align_left.gif</xsl:with-param>
- <xsl:with-param name="id">action_align_left</xsl:with-param>
- </xsl:call-template>
- <!-- center align -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doCenter();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_CENTER"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_align_center.gif</xsl:with-param>
- <xsl:with-param name="id">action_align_center</xsl:with-param>
- </xsl:call-template>
- <!-- right align -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doRight();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_ALIGN_RIGHT"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_align_right.gif</xsl:with-param>
- <xsl:with-param name="id">action_align_right</xsl:with-param>
- </xsl:call-template>
- <!-- justify -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doJustify();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_JUSTIFY"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_justify.gif</xsl:with-param>
- <xsl:with-param name="id">action_justify</xsl:with-param>
- <xsl:with-param name="last">true</xsl:with-param>
- </xsl:call-template>
- <!-- spacer -->
- <td>
- <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- <!-- ordered list -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doOrdList();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_NUMBERING"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_numbering.gif</xsl:with-param>
- </xsl:call-template>
- <!-- bullet list -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doBulList();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_BULLETS"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_bullets.gif</xsl:with-param>
- </xsl:call-template>
- <!-- Outdent -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doOutdent();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_DECREASE_INDENT"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_decrease_indent.gif</xsl:with-param>
- </xsl:call-template>
- <!-- Indent -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doIndent();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_INCREASE_INDENT"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_increase_indent.gif</xsl:with-param>
- <xsl:with-param name="last">true</xsl:with-param>
- </xsl:call-template>
- <!-- spacer -->
- <td>
- <img height="1" width="10" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- <!-- insert table -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">initInsertTable();insertTablePopup.show();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_INSERT_TABLE"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_insert_table.gif</xsl:with-param>
- </xsl:call-template>
- <!-- Horizontal Rule -->
- <xsl:call-template name="richEditControl_button">
- <xsl:with-param name="onclick">richEditControl_doHorizontalRule();</xsl:with-param>
- <xsl:with-param name="alt">
- <xts:string id="IDS_EMAIL_OPTIONS_HORIZONAL_RULE"/>
- </xsl:with-param>
- <xsl:with-param name="icon">action_insert_line.gif</xsl:with-param>
- <xsl:with-param name="last">true</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- template to generate a button for the rich edit control -->
- <xsl:template name="richEditControl_button">
- <xsl:param name="onclick"/>
- <xsl:param name="alt"/>
- <xsl:param name="icon"/>
- <xsl:param name="text"/>
- <xsl:param name="id" select="''"/>
- <xsl:param name="textClass"/>
- <xsl:param name="last" select="'false'"/>
- <td id="{$id}" class="toolbarImageNormal" alt="{$alt}" onmouseover="richEditControl_buttonOver(this);" onmouseout="richEditControl_buttonOut(this);" align="center" valign="bottom">
- <xsl:choose>
- <xsl:when test="$icon != ''">
- <a href="javascript:{$onclick}">
- <img border="0" style="width:16px;height:16px;" src="{$image_root}{$icon}" alt="{$alt}"/>
- </a>
- </xsl:when>
- <xsl:when test="$text != ''">
- <span id="fix_{$id}" style="position:absolute;display:block;width:16px;height:16px;">
- <a href="javascript:{$onclick}">
- <img border="0" height="21" width="21" src="{$webcontent}/images/space.gif" alt="{$alt}"/>
- </a>
- </span>
- <div class="{$textClass}" style="width:16px;height:16px;">
- <xsl:value-of select="$text"/>
- </div>
- </xsl:when>
- </xsl:choose>
- </td>
- <!-- spacer -->
- <xsl:if test="$last = 'false'">
- <td>
- <img height="1" width="3" src="{$webcontent}/images/space.gif" alt=""/>
- </td>
- </xsl:if>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- debug - special debug block for nested requests
- ===============================================================================================
- -->
- <xts:block id="debug" type="exec" processor="XSLT" mimeType="text/html" dependency="genMarkup processResponse returnResult" condition=".[/root/session/param[@name='debug']='1']" mandatory="false">
- <!-- get the debug logic sheet -->
- <xts:logicsheet path="logicsheets/debuglogic.xslt"/>
- <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">
- <xsl:output method="html" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:variable name="resultNode" select="/root/*[local-name()='requestParams']/*[local-name()='param' and @name='resultNode']"/>
- <xts:append select="/root/output/xos:part/xos:entityBody/*[local-name()='{$resultNode}']">
- <debugDump>
- <xts:transform name="XMLEncode">
- <dbg:dumpxml select="/root/*[local-name()!='header' and local-name()!='output' and local-name()!='system' and local-name()!='http' and local-name()!='session']">
- <dbg:title>task_options.xts</dbg:title>
- </dbg:dumpxml>
- </xts:transform>
- </debugDump>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|