123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- Licensed Materials - Property of IBM
- IBM Cognos Products: ps
- (C) Copyright IBM Corp. 2005, 2017
- US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- -->
- <!--
- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- -->
- <!--
- =================================================================================================================================
- email_options_legacy.xts
- view email_interface.xml for information on the API.
- this legacy email_option file is for those components who are not compitable with Dojo solution (e.g. rich text editor) yet.
- =================================================================================================================================
- -->
- <xts:morphlet xmlns:xts="http://developer.cognos.com/schemas/xts/" messageBase="messages/portal.xml, messages/portalRL.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">portal/emailOptions/email_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="returnResult" type="exec" processor="XSLT" dependency="processResponse processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'genDefault' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'next' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'back' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'finished' or /root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'canceled']" mandatory="false">
- <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'">
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="portal/emailOptions/transforms/delivery_items.xslt" processor="XSLT">
- <root>
- <xsl:if test="key('session-param','e_hp')!='' and key('session-param','e_hp')!='CAMID("::Anonymous")'">
- <xts:transform src="portal/emailOptions/transforms/generateEmailTo.xslt" processor="XSLT">
- <root>
- <e_hp><xsl:value-of select="key('session-param','e_hp')"/></e_hp>
- <xts:transform src="transforms/CM/post-process.xslt" processor="XSLT">
- <send:request provider="cm">
- <xts:transform src="transforms/CM/pre-process.xslt" processor="XSLT">
- <query xmlns="http://developer.cognos.com/schemas/xts-cm/1/">
- <search>
- <xsl:value-of select="'~'"/>
- </search>
- <properties>
- <cm:property name="email"/>
- <cm:property name="notificationEMail"/>
- <cm:property name="iconURI"/>
- </properties>
- </query>
- </xts:transform>
- </send:request>
- </xts:transform>
- <xsl:if test="key('request-param','subscription')='true'">
- <!-- add another node to say to use the notification email address -->
- <subscription/>
- </xsl:if>
- </root>
- </xts:transform>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="key('request-param','defaultEmailAsAttachment')='true' and key('request-param','hideEmailAsAttachment')='false' and not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment)"><param name="m_ro_emailAsAttachment">true</param></xsl:when>
- <xsl:otherwise><param name="m_ro_emailAsAttachment">false</param></xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="key('request-param','defaultEmailAsAttachment')='true'"><param name="m_ro_emailAsURL">false</param></xsl:when>
- <xsl:when test="key('request-param','hideLinkToReport')='false'"><param name="m_ro_emailAsURL">true</param></xsl:when>
- <xsl:otherwise><param name="m_ro_emailAsURL">false</param></xsl:otherwise>
- </xsl:choose>
- <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>
- </root>
- </xts:transform>
- <!-- 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>
- <xts:transform src="transforms/portal/options/buildOptions.xslt" processor="XSLT">
- <root>
- <xts:transform src="portal/emailOptions/transforms/delivery_items.xslt" processor="XSLT">
- <root>
- <xts:transform src="portal/emailOptions/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' or 'bcc' fields have changed then rebuild the addedRecipients list -->
- <xsl:when test="key('env-param','recipientsChanged')='true'">
- <xts:transform src="portal/emailOptions/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>
- <!-- links and attachments -->
- <xsl:if test="key('env-param','links') != ''">
- <links>
- <xts:transform src="portal/emailOptions/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="portal/emailOptions/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">portal/emailOptions/schemas/richEditBodyPartial.xsd</xts:param>
- </xsl:when>
- <xsl:otherwise>
- <xts:param name="noNamespaceSchemaLocation">portal/emailOptions/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="portal/emailOptions/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']"/>
- </root>
- </xts:transform>
- </root>
- </xts:transform>
-
- <!-- 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="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>
- </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') ]" 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:template match="/">
- <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="'recipients'"/></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="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: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
- ===============================================================================================
- -->
- <xts:block id="processResponse" processor="XSLT" dependency="callMorphlet processRequestParams" type="exec" condition=".[ starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addEntries') or starts-with(/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'],'addLinks')]" mandatory="false">
- <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>
-
- <!--
- ===============================================================================================
- businessRules - Take care off any business logic to simplify the UI generation
- ===============================================================================================
- -->
- <xts:block id="businessRules" type="exec" processor="XSLT" dependency="processResponse processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='canceled']]" mandatory="false">
- <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','options') != ''">
- <xts:transform src="portal/emailOptions/transforms/parse_options.xslt" processor="XSLT">
- <xts:transform name="XMLDecode">
- <xsl:value-of select="xtsext:web64decode(xtsext:cafaction('sign_unwrap',string(key('request-param','options'))), true())"/>
- </xts:transform>
- </xts:transform>
- </xsl:if>
- </defaultOptions>
- </xts:append>
-
- <!-- append all the params to env -->
- <xts:append select="/root/env">
- <xts:queryNode select="/root/defaultOptions/*[local-name() = 'param']"/>
- </xts:append>
- </xsl:if>
-
- <!-- if the 'to', 'cc', or 'bcc' fields have changed, then we must update the blob -->
- <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="portal/emailOptions/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[@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="portal/emailOptions/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="portal/emailOptions/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>
- <!-- 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' and key('request-param','burst') != 'true'" >
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_AGENT_STUDIO_INTRO"/><xsl:text/>
- </xsl:when>
- <xsl:when test="key('request-param','agentStudio') = 'true' and key('request-param','burst') = 'true'" >
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_AGENT_STUDIO_INTRO_BURST"/><xsl:text/>
- </xsl:when>
- <xsl:when test="key('request-param','burst') = 'true'">
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_BURST_INTRO"/><xsl:text/>
- </xsl:when>
- <xsl:when test="key('request-param','subscription') = 'true'">
- <xsl:text/><xts:string id="IDS_EMAIL_OPTIONS_SUBSCRIPTION_INTRO"/><xsl:text/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text/><xts:string id="IDS_EMAIL_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:variable name="checkShowParam" select="concat(' ', key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment/@show, ' ')"/>
- <xsl:choose>
- <xsl:when test="key('request-param','hideAttachMenu')='false' and (not(key('system-param', 'ui_hide')/CC_RUN_OPTIONS_email_attachment) or
- (contains($checkShowParam, 'Administrators') and $hasAdminCapability)) or
- (contains($checkShowParam, 'QSUsers') and $hasFullQSCapability) or
- (contains($checkShowParam, 'RSUsers') and $hasFullRSCapability) or
- (key('system-param', 'ui_groups')/group[contains($checkShowParam, concat(' ', @id, ' ')) and contains( key('session-param', 'uig'), concat(' ', @id, ' '))])">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>
- </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="businessRules" condition=".[/root/*[local-name()='defaultOptions']/*[local-name()='attachments'] or /root/*[local-name()='defaultOptions']/*[local-name()='link'] or /root/*[local-name()='defaultOptions']/*[local-name()='to'] or /root/*[local-name()='defaultOptions']/*[local-name()='cc'] or /root/*[local-name()='defaultOptions']/*[local-name()='bcc']]" mandatory="false">
- <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="portal/emailOptions/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="portal/emailOptions/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">
- <xsl:if test=". != ''">
- <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: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="portal/emailOptions/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: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="portal/emailOptions/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>
- <!--
- ================================================================================
- decode the agent items
- ===============================================================================================
- -->
- <xts:block id="decode_agent_definition" processor="XSLT" type="exec" nodelist="env" dependency="processResponse processRequestParams queryCMForOptionsInfo" condition=".[/root/*[local-name()='selectedEntries'] or /root/env/param[@name='addAttachment']!='']" mandatory="false">
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xtsext="xalan://com.cognos.xts.ext.XTSExt" xmlns:xts="http://developer.cognos.com/schemas/xts/" exclude-result-prefixes="xts xtsext">
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
- <xsl:template match="/">
- <xts:sequence>
- <xsl:if test="/root/env/param[@name = 'agent_definition_blob']">
- <xts:append select="/root">
- <xsl:value-of select="xtsext:web64decode( xtsext:cafaction('sign_unwrap_settemplatename_decodeagentdefinition_settemplateid_seqagenttasks001',string( /root/env/param[@name = 'agent_definition_blob'])), true() )" disable-output-escaping="yes"/>
- </xts:append>
- </xsl:if>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- <!--
- ===============================================================================================
- updateAddedLists
- ===============================================================================================
- -->
- <xts:block id="updateAddedLists" type="exec" processor="XSLT" dependency="decode_agent_definition" condition=".[/root/*[local-name()='selectedEntries'] or /root/env/param[@name='addAttachment']!='']" mandatory="false">
- <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="portal/emailOptions/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>
- <defaultFormat><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name']='outputFormat']/*[local-name()='value']"/></defaultFormat>
- <defaultLocale><xsl:value-of select="/root/agent_definition/agentOptions/*[local-name()='options']/*[local-name()='value']/*[local-name()='item' and ./*[local-name()='name']='outputLocale']/*[local-name()='value']"/></defaultLocale>
- </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="portal/emailOptions/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="portal/emailOptions/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="portal/emailOptions/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>
-
- <!-- if the user just added recipients to the bcc, then make sure the bcc field will be visible -->
- <xsl:if test="/root/*[local-name()='selectedEntries']/*/*[local-name()='type'] = 'bcc'">
- <xts:append select="/root">
- <showBccField>true</showBccField>
- </xts:append>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xts:sequence>
- </xsl:template>
-
- </xsl:stylesheet>
- </xts:block>
-
-
- <!--
- ===============================================================================================
- genMarkup -
- ===============================================================================================
- -->
- <xts:block id="genMarkup" type="exec" processor="XSLT" dependency="updateAddedLists queryCMForOptionsInfo businessRules processRequestParams" condition=".[/root/*[local-name()='requestParams']/*[local-name()='param' and @name='requestState'] = 'markup' or /root/*[local-name()='morphletResponse']/*[local-name()='selectedEntries' or local-name()='canceled']]" mandatory="false">
- <!-- logicsheets -->
- <!-- portal specific information -->
- <xts:logicsheet path="logicsheets/portal.xsl"/>
-
- <!-- Dialog specific logicsheets -->
- <xts:logicsheet path="portal/emailOptions/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/presentation/touch_up.xslt"/>
- <xsl:stylesheet version="1.0"
- 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">
- <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="hideInsertButton" select="key('request-param','hideInsertButton') = 'true'"/>
-
- <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:variable name="bccVisible">
- <xsl:choose>
- <xsl:when test="/root/showBccField = 'true'">true</xsl:when>
- <xsl:when test="key('env-param','bccVisible')!=''"><xsl:value-of select="key('env-param','bccVisible')"/></xsl:when>
- <xsl:when test="key('env-param','email_bcc')!=''">true</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="bccVisible" value="{$bccVisible}"/>
- <input type="hidden" name="visited_email_options" value="true"/>
- <xsl:if test="key('request-param', 'usePowerPlay8Options') = 'true'">
- <input type="hidden" name="usePowerPlay8Options" value="true"/>
- </xsl:if>
- <xsl:if test="key('request-param','burst') = 'true'">
- <input type="hidden" name="m_ro_burst" 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">
- <xsl:attribute name="src"><xsl:value-of select="$image_root"/>icon_email_24.gif</xsl:attribute>
- </img>
- </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"/>
- <script type="text/javascript" src="{$webRoot}/ags/AccessibilityHandler.js"/>
- </xsl:if>
- <script language="javascript">
- <xsl:choose>
- <xsl:when test="$agentStudio">
- var textRange;
-
- function init()
- {
- droppy.registerDropZone("email_to","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>",true);
- droppy.registerDropZone("email_cc","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>",true);
- droppy.registerDropZone("email_bcc","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>",true);
- droppy.registerDropZone("email_subject","","",'true',"<xsl:value-of select="xtsext:javascriptencode(key('request-param','tabSelectedID'))"/>",false);
- 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'))"/>");
- }
- }
-
- 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()
- {
- 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'))"/>';
- }
-
-
- if (document.getElementById("email_to"))
- {
- document.getElementById("email_to").focus();
- }
- }
- </xsl:otherwise>
- </xsl:choose>
- 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 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 == '' && frm.email_bcc.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>
- return;
- }
-
- function unsetFormTarget()
- {
- <xsl:if test="key('request-param','addEntriesPopUp')='true'">
- document.<xsl:value-of select="key('request-param','formName')"/>.target = '';
- </xsl:if>
- return;
- }
- <!-- 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;
- }
- <!--
- - handles showing/hidding the bcc text field
- - we have spans behind the bold, italic and underline since we use letters
- instead of icons for localization. Make sure we move the span when we're showing/hidding
- the bcc field
- -->
- function swapBccVisible()
- {
- if (document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value == 'false')
- {
- <!-- change the link text -->
- document.getElementById('showHideAnchor').innerHTML = '<xts:string id="IDS_EMAIL_HIDE_BCC" encode="javascript"/>';
-
- showDynamicDiv('emailBccDiv');
- document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value = 'true';
-
- <xsl:if test="$richEditMode = 'true'">
- moveRichEditSpans(document.getElementById('bccEmailFieldTable').clientHeight);
- </xsl:if>
- }
- else
- {
- <!-- change the link text -->
- document.getElementById('showHideAnchor').innerHTML = '<xts:string id="IDS_EMAIL_SHOW_BCC" encode="javascript"/>';
-
- hideDynamicDiv('emailBccDiv');
-
- document.<xsl:value-of select="key('request-param','formName')"/>.bccVisible.value = 'false';
-
- <xsl:if test="$richEditMode = 'true'">
- moveRichEditSpans(document.getElementById('bccEmailFieldTable').clientHeight * -1);
- </xsl:if>
- }
- }
- </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;"></iframe>
- </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><label for="richEditControl_tableColumns"><xts:string id="IDS_EMAIL_OPTIONS_NUMBER_OF_COLUMNS"/></label></dp:label>
- </dp:section>
- <dp:section>
- <!-- column default is always 2 -->
- <input type="text" id="richEditControl_tableColumns" name="richEditControl_tableColumns" value="2" size="2"/>
- </dp:section>
- </dp:list>
- </lyt:section>
- <lyt:section>
- <dp:list>
- <dp:section>
- <dp:label><label for="richEditControl_tableRows"><xts:string id="IDS_EMAIL_OPTIONS_NUMBER_OF_ROWS"/></label></dp:label>
- </dp:section>
- <dp:section>
- <!-- rows default is always 2 -->
- <input type="text" id="richEditControl_tableRows" 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, bcc 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"><xts:string id="IDS_EMAIL_OPTIONS_TO"/></label></dp:label>
- </dp:section>
- </dp:list>
-
- <!--display the "To" value as readonly text when part of a subscription -->
- <xsl:if test="$subscription">
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td nowrap="nowrap">
- <dp:list>
- <dp:section>
- <xsl:value-of select="key('env-param','email_to')"/>
- </dp:section>
- </dp:list>
- </td>
- </tr>
- </table>
- </xsl:if>
-
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <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=""></img>
- </td>
- </xsl:if>
-
- <td nowrap="nowrap">
- <input name="email_to" id="email_to" size="{$inputSize}" onchange="changedEmailRecipients();">
- <!-- make the input hidden if part of a subscription -->
- <xsl:attribute name="type">
- <xsl:choose>
- <xsl:when test="$subscription">
- <xsl:text>hidden</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>text</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </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 or BCC section if part of a subscription -->
- <xsl:if test="not($subscription)">
- <!-- email cc -->
- <dp:list>
- <dp:section>
- <dp:label><label for="email_cc"><xts:string id="IDS_EMAIL_OPTIONS_CC"/></label></dp:label>
- </dp:section>
- </dp:list>
-
- <table border="0" cellspacing="0" cellpadding="1">
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <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=""></img>
- </td>
- </xsl:if>
-
- <td nowrap="nowrap">
- <input type="text" name="email_cc" id="email_cc" size="{$inputSize}" onchange="changedEmailRecipients();">
- <xsl:attribute name="value">
- <xsl:value-of select="key('env-param','email_cc')"/>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
- <!-- email bcc -->
- <cf:dynamicDiv name="emailBccDiv" runTimeVisibleCheck="$bccVisible = 'true'">
- <!-- need to put all this in one table since we need the height of table for
- calculations when hiding/showing the bcc field -->
- <table id="bccEmailFieldTable" border="0" cellspacing="0" cellpadding="1">
- <tr>
- <td>
- <xsl:if test="$agentStudio">
- <xsl:attribute name="colspan">3</xsl:attribute>
- </xsl:if>
- <dp:list>
- <dp:section>
- <dp:label><label for="email_bcc"><xts:string id="IDS_EMAIL_OPTIONS_BCC"/></label></dp:label>
- </dp:section>
- </dp:list>
- </td>
- </tr>
- <tr>
- <xsl:if test="$agentStudio and not($hideInsertButton)">
- <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_bcc" onclick="javascript:parent.dropFrame=window.name;parent.insertStartMC('email_bcc');">
- <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=""></img>
- </td>
- </xsl:if>
-
- <td nowrap="nowrap">
- <input type="text" name="email_bcc" id="email_bcc" size="{$inputSize}" onchange="changedEmailRecipients();">
- <xsl:attribute name="value">
- <xsl:value-of select="key('env-param','email_bcc')"/>
- </xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
- </cf:dynamicDiv>
- <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>
-   
- <!-- show/hide Bcc -->
- <dp:link align="right">
- <a id="showHideAnchor" href="#" onclick="swapBccVisible()">
- <xsl:choose>
- <xsl:when test="$bccVisible='true'"><xts:string id="IDS_EMAIL_HIDE_BCC"/></xsl:when>
- <xsl:otherwise><xts:string id="IDS_EMAIL_SHOW_BCC"/></xsl:otherwise>
- </xsl:choose>
- </a>
- </dp:link>
- </td>
- </tr>
- </table>
- </xsl:if>
- </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 and not($hideInsertButton)">
- <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=""></img>
- </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" alt=""/>
- <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" alt=""/>
- <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>
- <xsl:if test="not($hideInsertButton)">
- <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=""></img>
- </td>
- </xsl:if>
- <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>
- <xsl:if test="(key('business-rules','allowLinkToReport')='true') or (key('business-rules','allowEmailAsAttachment')='true' or key('env-param','m_ro_emailAsAttachment')='true')">
- <lyt:layout style="1">
- <lyt:section>
- <dp:choice>
- <xsl:if test="key('business-rules','allowLinkToReport')='true'">
- <dp:section1>
- <input type="checkbox" name="m_ro_emailAsURL" id="m_ro_emailAsURL" value="true">
- <xsl:if test="key('env-param','m_ro_emailAsURL')='true'">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </input>
- </dp:section1>
- <dp:section2>
- <label for="m_ro_emailAsURL">
- <xsl:choose>
- <xsl:when test="key('request-param','objectClass')='jobDefinition'">
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_LINKS"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_LINK"/>
- </xsl:otherwise>
- </xsl:choose>
- </label>
- </dp:section2>
- </xsl:if>
- <xsl:if test="key('business-rules','allowEmailAsAttachment')='true' or key('env-param','m_ro_emailAsAttachment')='true'">
- <dp:section1>
- <input type="checkbox" name="m_ro_emailAsAttachment" id="m_ro_emailAsAttachment" value="true">
- <xsl:if test="key('env-param','m_ro_emailAsAttachment')='true'">
- <xsl:attribute name="checked">checked</xsl:attribute>
- </xsl:if>
- </input>
- </dp:section1>
- <dp:section2>
- <label for="m_ro_emailAsAttachment">
- <xsl:choose>
- <xsl:when test="key('request-param','objectClass')='jobDefinition'">
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_OUTPUTS"/>
- </xsl:when>
- <xsl:otherwise>
- <xts:string id="IDS_EMAIL_OPTIONS_INCLUDE_OUTPUT"/>
- </xsl:otherwise>
- </xsl:choose>
- </label>
- </dp:section2>
- </xsl:if>
- </dp:choice>
- </lyt:section>
- </lyt:layout>
- </xsl:if>
- <!-- 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="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\">" + emailBodyString + "</BODY>");
- </xsl:when>
- <xsl:otherwise>
- email_body_iframe.document.write("<BODY id=\"editbody\"></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" omit-xml-declaration="yes"/>
- <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/*[local-name() = 'part']/*[local-name() = '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>email_options.xts</dbg:title>
- </dbg:dumpxml>
- </xts:transform>
- </debugDump>
- </xts:append>
- </xts:sequence>
- </xsl:template>
- </xsl:stylesheet>
- </xts:block>
- </xts:morphlet>
|