prmtGenDateTimeHTML.js 116 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| BI and PM: prmt
  5. *| (C) Copyright IBM Corp. 2002, 2014
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. ////////////////////////////////////////////////////////////////////
  13. // selectDate HTML generation functions
  14. ////////////////////////////////////////////////////////////////////
  15. // Function to create date prompt control
  16. // sPromptId: The id of the prompt control (String)
  17. // sFormName: Name of form control to submit selections to the server (String)
  18. // sParameterName: Name of control element to be submitted to report server (String)
  19. // sSubmitType: 'default' will submit as a standard form (String)
  20. // 'XML' will convert the submission to XML and submit
  21. // sPrmtDefaultDate: a date to start the control (String)
  22. // sDefaultValue: Default value for prompt control. If prompt control is a range, this represents the start value of the range. (String)
  23. // sStartOfWeek: First day of week: ['Monday'|'Tuesday'|'Wednesday'|'Thursday'|'Friday'|'Saturday'|'Sunday'] (String)
  24. // sCalendar: Calendar type: ['Gregorian'|'Imperial'] (String)
  25. // sSelectUI: UI of control: Textbox with calendar popup (editbox) or Inline calendar (calendar) ['editbox'|'calendar']
  26. // sSelectDateUI: Textbox with calendar popup (editbox) or Inline calendar (calendar) ['editbox'|'calendar']
  27. // sInputOrder: ['YMD'|'DMY'|...] (String)
  28. // sFirstDate: the minimum acceptable date (String)
  29. // sLastDate: the maximum acceptable date (String)
  30. // iDateTime: 0 = datetime e.g. yyyy-mm-dd 00:00:00.000, 1 = date e.g. yyyy-mm-dd [0|1] (Integer)
  31. // iInitialState: Range controls only. Controls whether to check radio buttons (Integer)
  32. // RANGE_NO_VALUE will select lowest to highest
  33. // RANGE_START_VALUE will select from a particular value to highest
  34. // RANGE_END_VALUE will select from lowest to a particular value
  35. // RANGE_BOUND_VALUE will select a range
  36. // RANGE_EQUAL_VALUE will select a single value
  37. // bRequired: If the control is a required field. (Boolean)
  38. // bSuppressDisabled: Suppress checkbox that allows user to disable control (required for dateTime controls) (Boolean)
  39. // bHideAdornments: Hide icons (e.g. star icon for required controls) (Boolean)
  40. // bSuppressExtraPromptNames: Force report server to handle multiple prompt controls as a single entity (Boolean)
  41. // e.g. treat datetime control as a single date time, as opposed to treating date and time independntly
  42. // bMultiSelect: If control can accomodate more than one value. (Boolean)
  43. // bRange: If control is a range. (Boolean)
  44. // sStyle: Style of prompt control (String)
  45. // sSelectDateEditBoxStyle: Style of date edit box (String)
  46. // sSelectDateYearsStyle: Style of years (String)
  47. // sSelectDateMonthsStyle: Style of months (String)
  48. // sSelectDateDaysOfWeekStyle: Style of days of the week (String)
  49. // sSelectDateDaysStyle: Style of days (String)
  50. // sEndRange: Optional. Only used for range controls. The end value of the range. (String)
  51. function genSelectDateHTML(sPromptId, sFormName, sParameterName, sSubmitType, sPrmtDefaultDate, sDefaultValue, sStartOfWeek, sCalendar, sSelectUI, sSelectDateUI, sInputOrder, sFirstDate, sLastDate, iDateTime, iInitialState, bRequired, bSuppressDisabled, bHideAdornments, bSuppressExtraPromptNames, bMultiSelect, bRange, sStyle, sSelectDateEditBoxStyle, sSelectDateYearsStyle, sSelectDateMonthsStyle, sSelectDateDaysOfWeekStyle, sSelectDateDaysStyle, sEndRange, sPopupLabel, sPopupZIndex)
  52. {
  53. var oProperties = sPromptId;
  54. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  55. {
  56. oProperties = {
  57. id: sPromptId,
  58. formName: sFormName,
  59. parameterName: sParameterName,
  60. submitType: sSubmitType,
  61. prmtDefaultDate: sPrmtDefaultDate,
  62. defaultValue: sDefaultValue,
  63. startOfWeek: sStartOfWeek,
  64. calendar: sCalendar,
  65. selectUI: sSelectUI,
  66. selectDateUI: sSelectDateUI,
  67. inputOrder: sInputOrder,
  68. firstDate: sFirstDate,
  69. lastDate: sLastDate,
  70. dateTime: iDateTime,
  71. initialState: iInitialState,
  72. required: bRequired,
  73. suppressDisabled: bSuppressDisabled,
  74. hideAdornments: bHideAdornments,
  75. suppressExtraPromptNames: bSuppressExtraPromptNames,
  76. multi: bMultiSelect,
  77. range: bRange,
  78. style: sStyle,
  79. selectDateEditBoxStyle: sSelectDateEditBoxStyle,
  80. selectDateYearsStyle: sSelectDateYearsStyle,
  81. selectDateMonthsStyle: sSelectDateMonthsStyle,
  82. selectDateDaysOfWeekStyle: sSelectDateDaysOfWeekStyle,
  83. selectDateDaysStyle: sSelectDateDaysStyle,
  84. endRange: sEndRange,
  85. popupLabel: sPopupLabel,
  86. popupZindex: sPopupZIndex
  87. };
  88. }
  89. oProperties.startRange = oProperties.defaultValue;
  90. if (oProperties.multi)
  91. {
  92. if (!oProperties.range) {
  93. genSelectDateMultipleHTML(oProperties);
  94. }
  95. else {
  96. genSelectDateRangeMultipleHTML(oProperties);
  97. }
  98. }
  99. else
  100. {
  101. if (oProperties.range) {
  102. genSelectDateRangeHTML(oProperties);
  103. }
  104. else {
  105. genSelectDateSingleHTML(oProperties);
  106. }
  107. }
  108. }
  109. function genSelectDateSingleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_PrmtDefaultDate, s_DefaultValue, s_StartOfWeek, s_Calendar, s_SelectUI, s_SelectDateUI, s_InputOrder, s_FirstDate, s_LastDate, i_DateTime, b_Required, b_SuppressDisabled, b_HideAdornments, b_SuppressExtraPromptNames, s_Style, s_SelectDateEditBoxStyle, s_SelectDateYearsStyle, s_SelectDateMonthsStyle, s_SelectDateDaysOfWeekStyle, s_SelectDateDaysStyle, sPopupLabel)
  110. {
  111. var oProperties = s_PromptId;
  112. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  113. {
  114. oProperties = {
  115. id: s_PromptId,
  116. formName: s_FormName,
  117. parameterName: s_ParameterName,
  118. submitType: s_SubmitType,
  119. prmtDefaultDate: s_PrmtDefaultDate,
  120. defaultValue: s_DefaultValue,
  121. startOfWeek: s_StartOfWeek,
  122. calendar: s_Calendar,
  123. selectUI: s_SelectUI,
  124. selectDateUI: s_SelectDateUI,
  125. inputOrder: s_InputOrder,
  126. firstDate: s_FirstDate,
  127. lastDate: s_LastDate,
  128. dateTime: i_DateTime,
  129. required: b_Required,
  130. suppressDisabled: b_SuppressDisabled,
  131. hideAdornments: b_HideAdornments,
  132. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  133. style: s_Style,
  134. selectDateEditBoxStyle: s_SelectDateEditBoxStyle,
  135. selectDateYearsStyle: s_SelectDateYearsStyle,
  136. selectDateMonthsStyle: s_SelectDateMonthsStyle,
  137. selectDateDaysOfWeekStyle: s_SelectDateDaysOfWeekStyle,
  138. selectDateDaysStyle: s_SelectDateDaysStyle
  139. };
  140. }
  141. var sPromptId = oProperties.id;
  142. if (!verifyPromptId(sPromptId)) {
  143. return;
  144. }
  145. //skin folder
  146. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  147. // string to append to onClick events of attributes in range prompt controls to focus
  148. // radio button when user clicks on calendar.
  149. var sRangeOnClick = K_PRMT_sEMPTY;
  150. if (sPromptId.search("range_from") != -1) {
  151. sRangeOnClick = sPromptId.substring(10) + ".fromGotFocus";
  152. }
  153. if (sPromptId.search("range_to") != -1) {
  154. sRangeOnClick = sPromptId.substring(8) + ".toGotFocus";
  155. }
  156. var sFormName = oProperties.formName;
  157. if (!sFormName) {
  158. sFormName = "forms[0]";
  159. }
  160. // determine the day of the week
  161. var iStartDay = 0;
  162. if (oProperties.startOfWeek == "Monday") {
  163. iStartDay = 1;
  164. }
  165. else if (oProperties.startOfWeek == "Tuesday") {
  166. iStartDay = 2;
  167. }
  168. else if (oProperties.startOfWeek == "Wednesday") {
  169. iStartDay = 3;
  170. }
  171. else if (oProperties.startOfWeek == "Thursday") {
  172. iStartDay = 4;
  173. }
  174. else if (oProperties.startOfWeek == "Friday") {
  175. iStartDay = 5;
  176. }
  177. else if (oProperties.startOfWeek == "Saturday") {
  178. iStartDay = 6;
  179. }
  180. var sParamName = "p_" + oProperties.parameterName;
  181. if (oProperties.suppressExtraPromptNames) {
  182. sParamName = sParamName.substring(1);
  183. }
  184. // check for emperor time
  185. var intType = 0;
  186. if (oProperties.calendar == "Imperial") {
  187. intType = 1;
  188. }
  189. var oErrorImg = "document." + sFormName + ".imgTest" + sPromptId;
  190. if (oProperties.hideAdornments) {
  191. oErrorImg = null;
  192. }
  193. var formElementName = sParamName;
  194. if (oProperties.submitType == K_PRMT_sXML) {
  195. formElementName = "_oDS_" + sPromptId;
  196. }
  197. // add a background-color for the background
  198. var sSelectDateCalendarStyle = "clsSelectDateCalendar";
  199. if (oProperties.selectUI == "editBox") {
  200. sSelectDateCalendarStyle = "clsSelectDateCalendarDialog";
  201. }
  202. var HTMLOut = K_PRMT_sEMPTY;
  203. if (oProperties.submitType == K_PRMT_sXML) {
  204. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  205. }
  206. HTMLOut +=
  207. "<input type='hidden' name='" + formElementName + "' id='" + formElementName + "' value='" + oProperties.prmtDefaultDate + "' >" +
  208. "<div class='clsFieldSet' style='"+cssParser(oProperties.style,gsCSS_DEFAULT_STYLE)+"'>" +
  209. "<table role='presentation' cellpadding='0' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  210. "<tr>";
  211. if (!oProperties.required && !oProperties.suppressDisabled && (oProperties.selectUI != "editBox" || !oProperties.selectUI || oProperties.selectDateUI != "editBox"))
  212. {
  213. HTMLOut +=
  214. "<td valign='top'>" +
  215. "<input type='checkbox' value='anyValue' name='chkAnyValue" + sPromptId + "' onclick='pickerControl" + sPromptId + ".toggleDisable(this.checked)' checked='checked'>" +
  216. "</td>";
  217. }
  218. else if (!oProperties.hideAdornments && oProperties.required)
  219. {
  220. HTMLOut +=
  221. "<td valign='top'>" +
  222. "<table role='presentation' cellpadding='0' cellspacing='0' border='0' width='10' height='20'>" +
  223. "<tr>" +
  224. "<td><img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='bottom' height='10' width='10' border='0'/></td>" +
  225. "</tr>" +
  226. "<tr>" +
  227. "<td valign='middle' align='right'><img id='imgTest" + sPromptId + "' name='imgTest" + sPromptId + "' class='clsErrorRequired' src='" + sSkin + "/prompting/images/error_timed_small_off.gif' align='bottom' height='10' width='10' border='0'/></td>" +
  228. "</tr>" +
  229. "</table>" +
  230. "</td>";
  231. }
  232. // Edit Box
  233. HTMLOut +=
  234. "<td valign='top' nowrap='nowrap' id='dateEditBox" + sPromptId + "'>";
  235. if (oProperties.selectUI == "editBox" || oProperties.selectDateUI == "editBox")
  236. {
  237. HTMLOut +=
  238. "<table role='presentation' cellpadding='0' cellspacing='0' border='0'>" +
  239. "<tr>" +
  240. "<td>" +
  241. "<input type='text' class='clsSelectDateEditBox pt' style=\"" + oProperties.selectDateEditBoxStyle + "\" name='txtDate" + sPromptId + "' id='txtDate" + sPromptId + "' onkeyup='pickerControl" + sPromptId + ".checkDate(this)' onkeypress='pickerControl" + sPromptId + ".keyPress(event);' value='' onfocus='pickerControl" + sPromptId + ".gotFocus()' onblur='pickerControl" + sPromptId + ".lostFocus()'>"+
  242. "</td><td>" +
  243. "<img role='button' tabindex='0' id='" + sPromptId + "imgPicker' name='" + sPromptId + "imgPicker' src='" + sSkin + "/prompting/images/icon_datepicker.gif' onKeydown=\"{if (event.keyCode == 9) {if (pickerControl" + sPromptId + ".m_oDatePickerDialog.isVisible()){if (event.shiftKey){pickerControl" + sPromptId + ".toggleDialogDatePicker(this,event); if (typeof range" + sRangeOnClick + " == 'function') {range" + sRangeOnClick + "();}} else {var focusEl = document.getElementById('" + sPromptId + "_btnYearDown');if (focusEl != null){focusEl.focus();PRMTUtils.F_StopEvent(event);}} }} else if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".toggleDialogDatePicker(this,event); event.cancelBubble=true;if (typeof range" + sRangeOnClick + " == 'function') {range" + sRangeOnClick + "();}}}\" onClick=\"pickerControl" + sPromptId + ".toggleDialogDatePicker(this,event); event.cancelBubble=true;if (typeof range" + sRangeOnClick + " == 'function') {range" + sRangeOnClick + "();}\" height='20' width='25' class='clsToolbarButton' onmouseover='buttonOver(this)' onmouseout='buttonOut(this)' onmousedown='buttonOver(this)' alt='" + PMT_DTP_DATECONTROLBUTTONPOPUP + "' title='" + PMT_DTP_DATECONTROLBUTTONPOPUP + "' align='top' style=\"padding:0px;height:20px;\"/>"+
  244. "</td>" +
  245. "</tr>" +
  246. "</table>";
  247. }
  248. var theLabel = "";
  249. if ((oProperties.popupLabel == null) || (oProperties.popupLabel == "")) {
  250. theLabel = PMT_DTP_DATECONTROLPOPUP;
  251. } else {
  252. theLabel = oProperties.popupLabel;
  253. }
  254. HTMLOut +=
  255. "<div name='dialogDatePicker' role='dialog' aria-label='" + theLabel +"' id='dialogDatePicker" + sPromptId + "' style='";
  256. // if popup calendar, default to display:none so it won't render to page
  257. if (oProperties.selectUI == "editBox" || oProperties.selectDateUI == "editBox") {
  258. HTMLOut += "display:none;";
  259. }
  260. HTMLOut +=
  261. "' onclick='event.cancelBubble=true;' onmousedown=\"if (typeof range" + sRangeOnClick + " == 'function') {range" + sRangeOnClick + "()}\">" +
  262. "<table role='presentation' border='0' cellpadding='0' cellspacing='0' class='" + sSelectDateCalendarStyle + "'>" +
  263. "<tr>" +
  264. "<td valign='top'>" +
  265. "<table role='presentation' class='clsSelectDateDialogTopTable' border='0' cellpadding='0' cellspacing='0' align='center' width='100%'>" +
  266. "<tr class='clsSelectDateYears' style=\"color: black" + oProperties.selectDateYearsStyle + "\">" +
  267. "<td role='presentation' width='15' class='clsToolbarButton' onmouseover='buttonOver(this)' onmouseout='buttonOut(this)' onmousedown='buttonOver(this)'>" +
  268. "<img tabindex='0' role='button' id='" + sPromptId +"_btnYearDown' alt='" + PMT_DTP_DATECONTROLBUTTONYEARDECREMENT + "' title='" + PMT_DTP_DATECONTROLBUTTONYEARDECREMENT + "' src='" + sSkin + "/prompting/images/icon_year_down.gif' onKeydown='if (event.keyCode == 9 && event.shiftKey){var focusEl=document.getElementById(\"" + sPromptId + "imgPicker\");if (focusEl != null){focusEl.focus(); PRMTUtils.F_StopEvent(event);}} else if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.yearDown();}' onclick='pickerControl" + sPromptId + ".m_oDatePickerDialog.yearDown()' ondblclick='pickerControl" + sPromptId + ".m_oDatePickerDialog.yearDown()' align='top'/>" +
  269. "</td>" +
  270. "<td width='100%' align='center'>" +
  271. "<input tabindex='0' class='clsSelectDateYearEditBox pcl' size='8' type='text' id='myYear" + sPromptId + "' onkeyup='pickerControl" + sPromptId + ".m_oDatePickerDialog.checkYear(this)' onkeypress='pickerControl" + sPromptId + ".m_oDatePickerDialog.keyPress(event.keyCode);pickerControl" + sPromptId + ".m_oDatePickerDialog.m_oParentControl.checkDate(pickerControl" + sPromptId + ".m_oDatePickerDialog.m_oParentControl.m_oEditBox);' onblur='pickerControl" + sPromptId + ".m_oDatePickerDialog.lostFocus()'>" +
  272. "</td>" +
  273. "<td role='presentation' width='15' align='right' class='clsToolbarButton' onmouseover='buttonOver(this)' onmouseout='buttonOut(this)' onmousedown='buttonOver(this)'>" +
  274. "<img tabindex='0' role='button' id='"+ sPromptId +"_btnYearUp' alt='" + PMT_DTP_DATECONTROLBUTTONYEARINCREMENT + "' title='" + PMT_DTP_DATECONTROLBUTTONYEARINCREMENT +"' src='" + sSkin + "/prompting/images/icon_year_up.gif' onKeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.yearUp();}' onclick='pickerControl" + sPromptId + ".m_oDatePickerDialog.yearUp()' ondblclick='pickerControl" + sPromptId + ".m_oDatePickerDialog.yearUp()' align='top'/>" +
  275. "</td>" +
  276. "</tr>" +
  277. "</table>" +
  278. "<table role='listbox' border='0' cellpadding='2' cellspacing='0' aria-label='" + PMT_DTP_DATECONTROLBUTTONPOPUP_MONTHS + "' width='100%' align='center'>" +
  279. "<tr>" +
  280. "<td tabindex='0' role='option' id='" + sPromptId + "m0' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(0);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(0);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>"+
  281. "<td tabindex='0' role='option' id='" + sPromptId + "m1' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(1);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(1);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  282. "<td tabindex='0' role='option' id='" + sPromptId + "m2' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(2);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(2);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  283. "<td tabindex='0' role='option' id='" + sPromptId + "m3' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(3);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(3);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  284. "<td tabindex='0' role='option' id='" + sPromptId + "m4' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(4);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(4);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  285. "<td tabindex='0' role='option' id='" + sPromptId + "m5' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(5);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(5);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  286. "</tr>" +
  287. "<tr>" +
  288. "<td tabindex='0' role='option' id='" + sPromptId + "m6' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(6);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(6);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  289. "<td tabindex='0' role='option' id='" + sPromptId + "m7' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(7);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(7);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  290. "<td tabindex='0' role='option' id='" + sPromptId + "m8' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(8);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(8);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  291. "<td tabindex='0' role='option' id='" + sPromptId + "m9' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(9);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(9);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  292. "<td tabindex='0' role='option' id='" + sPromptId + "m10' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(10);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(10);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  293. "<td tabindex='0' role='option' id='" + sPromptId + "m11' onkeydown='if ((event.keyCode == 13) || (event.keyCode == 32)) {pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(11);}' onmousedown='pickerControl" + sPromptId + ".m_oDatePickerDialog.newMonth(11);' nowrap='nowrap' class='clsSelectDateMonths pm' style=\"" + oProperties.selectDateMonthsStyle + "\">&nbsp;</td>" +
  294. "</tr>" +
  295. "</table>" +
  296. "<table role='listbox' border='0' cellspacing='0' width='100%' aria-label='" + PMT_DTP_DATECONTROLBUTTONPOPUP_DAYS + "' align='center'>" +
  297. "<tr>" +
  298. "<td id='" + sPromptId + "d0' class='clsSelectDateDaysOfWeek pw' style=\"" + oProperties.selectDateDaysOfWeekStyle + "\">&nbsp;</td>" +
  299. "<td id='" + sPromptId + "d1' class='clsSelectDateDaysOfWeek pw' style=\"" + oProperties.selectDateDaysOfWeekStyle + "\">&nbsp;</td>" +
  300. "<td id='" + sPromptId + "d2' class='clsSelectDateDaysOfWeek pw' style=\"" + oProperties.selectDateDaysOfWeekStyle + "\">&nbsp;</td>" +
  301. "<td id='" + sPromptId + "d3' class='clsSelectDateDaysOfWeek pw' style=\"" + oProperties.selectDateDaysOfWeekStyle + "\">&nbsp;</td>" +
  302. "<td id='" + sPromptId + "d4' class='clsSelectDateDaysOfWeek pw' style=\"" + oProperties.selectDateDaysOfWeekStyle + "\">&nbsp;</td>" +
  303. "<td id='" + sPromptId + "d5' class='clsSelectDateDaysOfWeek pw' style=\"" + oProperties.selectDateDaysOfWeekStyle + "\">&nbsp;</td>" +
  304. "<td id='" + sPromptId + "d6' class='clsSelectDateDaysOfWeek pw' style=\"" + oProperties.selectDateDaysOfWeekStyle + "\">&nbsp;</td>" +
  305. "</tr>" +
  306. "<tr>" +
  307. "<td tabindex='0' id='" + sPromptId + "r0c0' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  308. "<td tabindex='0' id='" + sPromptId + "r0c1' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  309. "<td tabindex='0' id='" + sPromptId + "r0c2' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  310. "<td tabindex='0' id='" + sPromptId + "r0c3' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  311. "<td tabindex='0' id='" + sPromptId + "r0c4' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  312. "<td tabindex='0' id='" + sPromptId + "r0c5' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  313. "<td tabindex='0' id='" + sPromptId + "r0c6' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  314. "</tr>" +
  315. "<tr>" +
  316. "<td tabindex='0' id='" + sPromptId + "r1c0' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  317. "<td tabindex='0' id='" + sPromptId + "r1c1' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  318. "<td tabindex='0' id='" + sPromptId + "r1c2' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  319. "<td role='option' tabindex='0' id='" + sPromptId + "r1c3' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  320. "<td tabindex='0' id='" + sPromptId + "r1c4' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  321. "<td tabindex='0' id='" + sPromptId + "r1c5' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  322. "<td tabindex='0' id='" + sPromptId + "r1c6' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  323. "</tr>" +
  324. "<tr>" +
  325. "<td tabindex='0' id='" + sPromptId + "r2c0' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  326. "<td tabindex='0' id='" + sPromptId + "r2c1' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  327. "<td tabindex='0' id='" + sPromptId + "r2c2' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  328. "<td tabindex='0' id='" + sPromptId + "r2c3' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  329. "<td tabindex='0' id='" + sPromptId + "r2c4' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  330. "<td tabindex='0' id='" + sPromptId + "r2c5' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  331. "<td tabindex='0' id='" + sPromptId + "r2c6' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  332. "</tr>" +
  333. "<tr>" +
  334. "<td tabindex='0' id='" + sPromptId + "r3c0' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  335. "<td tabindex='0' id='" + sPromptId + "r3c1' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  336. "<td tabindex='0' id='" + sPromptId + "r3c2' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  337. "<td tabindex='0' id='" + sPromptId + "r3c3' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  338. "<td tabindex='0' id='" + sPromptId + "r3c4' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  339. "<td tabindex='0' id='" + sPromptId + "r3c5' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  340. "<td tabindex='0' id='" + sPromptId + "r3c6' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  341. "</tr>" +
  342. "<tr>" +
  343. "<td tabindex='0' id='" + sPromptId + "r4c0' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  344. "<td tabindex='0' id='" + sPromptId + "r4c1' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  345. "<td tabindex='0' id='" + sPromptId + "r4c2' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  346. "<td tabindex='0' id='" + sPromptId + "r4c3' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  347. "<td tabindex='0' id='" + sPromptId + "r4c4' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  348. "<td tabindex='0' id='" + sPromptId + "r4c5' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  349. "<td tabindex='0' id='" + sPromptId + "r4c6' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  350. "</tr>" +
  351. "<tr>" +
  352. "<td tabindex='0' id='" + sPromptId + "r5c0' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  353. "<td tabindex='0' id='" + sPromptId + "r5c1' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  354. "<td tabindex='0' id='" + sPromptId + "r5c2' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  355. "<td tabindex='0' id='" + sPromptId + "r5c3' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  356. "<td tabindex='0' id='" + sPromptId + "r5c4' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  357. "<td tabindex='0' id='" + sPromptId + "r5c5' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  358. "<td tabindex='0' id='" + sPromptId + "r5c6' class='clsSelectDateDays pd' style=\"" + oProperties.selectDateDaysStyle + "\" >&nbsp;</td>" +
  359. "</tr>" +
  360. "</table>" +
  361. "</td>" +
  362. "</tr>" +
  363. "</table>" +
  364. "</div>" +
  365. "</td>" +
  366. "</tr>" +
  367. "</table>" +
  368. "</div>" +
  369. // ensure that calendar appears on top of select controls
  370. "<iframe role='presentation' id='pickerControl" + sPromptId + "iframe' style=\"position:absolute; display:none;height:0px;width:0px;\" src='" + sSkin + "/prompting/images/spacer.gif'></iframe>";
  371. renderPromptControlHTML("selectDate" + sPromptId, HTMLOut);
  372. var JSOut = K_PRMT_sEMPTY;
  373. if (oProperties.selectUI == "editBox" || oProperties.selectDateUI == "editBox")
  374. {
  375. JSOut = "this.pickerControl" + sPromptId + " = new CDatePicker(document.forms['" + sFormName + "'].elements['" + sParamName + "'], document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['txtDate" + sPromptId + "'], document.getElementById('dialogDatePicker" + sPromptId + "'), '" + sPromptId + "', '" + oProperties.defaultValue + "', 0, " + intType + ", '" + oProperties.inputOrder + "', " + iStartDay + ", " + oProperties.dateTime + ", '" + oProperties.firstDate + "', '" + oProperties.lastDate + "', " + oProperties.required + ", '" + oProperties.submitType + "', " + oErrorImg + ", '" + getCVId(oProperties) + "'," + oProperties.popupZindex + " );";
  376. }
  377. else
  378. {
  379. JSOut = "this.pickerControl" + sPromptId + " = new CDatePicker(document.forms['" + sFormName + "'].elements['" + sParamName + "'], document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.getElementById('dialogDatePicker" + sPromptId + "'), '" + sPromptId + "', '" + oProperties.defaultValue + "', 1, " + intType + ", '" + oProperties.inputOrder + "', " + iStartDay + ", " + oProperties.dateTime + ", '" + oProperties.firstDate + "', '" + oProperties.lastDate + "', " + oProperties.required + ", '" + oProperties.submitType + "', " + oErrorImg + ", '" + getCVId(oProperties) + "'," + oProperties.popupZindex + " );";
  380. }
  381. var sCVObj = getCVInstance(oProperties);
  382. JSOut += sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('pickerControl" + sPromptId + "');" +
  383. sCVObj + "datePickerObserverArray = " + sCVObj + "datePickerObserverArray.concat('pickerControl" + sPromptId + "');";
  384. executePromptControlJS(JSOut);
  385. }
  386. function genSelectDateMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_PrmtDefaultDate, s_DefaultValue, s_StartOfWeek, s_Calendar, s_SelectUI, s_SelectDateUI, s_InputOrder, s_FirstDate, s_LastDate, i_DateTime, b_Required, b_SuppressDisabled, b_HideAdornments, b_SuppressExtraPromptNames, s_Style, s_SelectDateEditBoxStyle, s_SelectDateYearsStyle, s_SelectDateMonthsStyle, s_SelectDateDaysOfWeekStyle, s_SelectDateDaysStyle)
  387. {
  388. var oProperties = s_PromptId;
  389. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  390. {
  391. oProperties = {
  392. id: s_PromptId,
  393. formName: s_FormName,
  394. parameterName: s_ParameterName,
  395. submitType: s_SubmitType,
  396. prmtDefaultDate: s_PrmtDefaultDate,
  397. defaultValue: s_DefaultValue,
  398. startOfWeek: s_StartOfWeek,
  399. calendar: s_Calendar,
  400. selectUI: s_SelectUI,
  401. selectDateUI: s_SelectDateUI,
  402. inputOrder: s_InputOrder,
  403. firstDate: s_FirstDate,
  404. lastDate: s_LastDate,
  405. dateTime: i_DateTime,
  406. required: b_Required,
  407. suppressDisabled: b_SuppressDisabled,
  408. hideAdornments: b_HideAdornments,
  409. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  410. style: s_Style,
  411. selectDateEditBoxStyle: s_SelectDateEditBoxStyle,
  412. selectDateYearsStyle: s_SelectDateYearsStyle,
  413. selectDateMonthsStyle: s_SelectDateMonthsStyle,
  414. selectDateDaysOfWeekStyle: s_SelectDateDaysOfWeekStyle,
  415. selectDateDaysStyle: s_SelectDateDaysStyle
  416. };
  417. }
  418. var sPromptId = oProperties.id;
  419. if (!verifyPromptId(sPromptId)) {
  420. return;
  421. }
  422. //skin folder
  423. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  424. var sFormName = oProperties.formName;
  425. if (!sFormName) {
  426. sFormName = "forms[0]";
  427. }
  428. var sParamName = "p_" + oProperties.parameterName;
  429. if (oProperties.suppressExtraPromptNames) {
  430. sParamName = sParamName.substring(1);
  431. }
  432. var formElementName = sParamName;
  433. if (oProperties.submitType == K_PRMT_sXML) {
  434. formElementName = "_oDM_" + sPromptId;
  435. }
  436. var HTMLOut = K_PRMT_sEMPTY;
  437. if (oProperties.submitType == K_PRMT_sXML) {
  438. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  439. }
  440. HTMLOut +=
  441. "<div class='clsFieldSet' style='"+cssParser(oProperties.style,gsCSS_DEFAULT_STYLE)+"'>" +
  442. "<table role='presentation' cellpadding='0' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style, "visibility")+"'>" +
  443. "<tr>" +
  444. "<td colspan='2'><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='1'/></td>" +
  445. "<td class='clsControlLabel pc'>";
  446. if (!oProperties.hideAdornments && oProperties.required) {
  447. HTMLOut +=
  448. "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  449. }
  450. HTMLOut +=
  451. PMT_UIM_CHOICES +
  452. "</td>" +
  453. "</tr>" +
  454. "<tr>" +
  455. // selectDateSingle prompt control
  456. "<td valign='top' id='selectDateSingle" + sPromptId + "'>&nbsp;</td>" +
  457. "<td valign='top' align='center' class='clsButtonLeftRightPadding'>" +
  458. "<table role='presentation' border='0' cellpadding='2' cellspacing='0'>" +
  459. "<tr>" +
  460. "<td id='getInsertButton" + sPromptId + "'>&nbsp;</td>" +
  461. "</tr>" +
  462. "<tr>" +
  463. "<td id='getRemoveButton" + sPromptId + "'>&nbsp;</td>" +
  464. "</tr>" +
  465. "<tr>" +
  466. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  467. "</tr>" +
  468. "</table>" +
  469. "</td>" +
  470. "<td valign='top'>" +
  471. "<table role='presentation' border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  472. "<tr>" +
  473. "<td><select name='" + formElementName + "' id='" + formElementName + "' style='"+cssParser(oProperties.style,"font,text,color,height")+"' class='clsChoicesListbox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleDatePicker" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleDatePicker" + sPromptId + ".catchDeleteKey(event.keyCode)'></select></td>" +
  474. "</tr>" +
  475. "<tr>" +
  476. "<td>" +
  477. "<div id='multipleFeedback" + sPromptId + "' class='clsFeedbackWidget'>" +
  478. "<img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/>" +
  479. "</div>" +
  480. "</td>" +
  481. "</tr>" +
  482. "<tr>" +
  483. "<td align='right'>" +
  484. "<a href='javascript:multipleDatePicker" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
  485. "&nbsp;" +
  486. "<a href='javascript:multipleDatePicker" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
  487. "</td>" +
  488. "</tr>" +
  489. "</table>" +
  490. "</td>" +
  491. "</tr>" +
  492. "</table>" +
  493. "</div>";
  494. renderPromptControlHTML("selectDate" + sPromptId, HTMLOut);
  495. var sCVObj = getCVInstance(oProperties);
  496. var JSOut = "genSelectDateSingleHTML(" + generatePromptProperties(oProperties, {
  497. id: "Single" + sPromptId,
  498. formName: sFormName,
  499. parameterName: "D_" + oProperties.parameterName,
  500. defaultValue: K_PRMT_sEMPTY,
  501. startOfWeek: K_PRMT_sEMPTY,
  502. calendar: K_PRMT_sEMPTY,
  503. inputOrder: K_PRMT_sEMPTY,
  504. firstDate: oProperties.firstDate,
  505. lastDate: oProperties.lastDate,
  506. required: false,
  507. suppressDisabled: true,
  508. style: cssParser(oProperties.style,"visibility"),
  509. suppressExtraPromptNames: true}) + ");" +
  510. "genInsertButtonHTML('" + sPromptId + "', 'multipleDatePicker" + sPromptId + ".insert()', 'insertButton" + sPromptId + "');" +
  511. "genRemoveButtonHTML('" + sPromptId + "', 'multipleDatePicker" + sPromptId + ".remove()', 'removeButton" + sPromptId + "');" +
  512. "this.multipleDatePicker" + sPromptId + " = new CMultipleDatePicker(pickerControlSingle" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['" + sParamName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  513. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleDatePicker" + sPromptId + "');" +
  514. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleDatePicker" + sPromptId + "');";
  515. executePromptControlJS(JSOut);
  516. }
  517. function genSelectDateRangeHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_PrmtDefaultDate, s_StartRange, s_EndRange, s_StartOfWeek, s_Calendar, s_SelectUI, s_SelectDateUI, s_InputOrder, s_FirstDate, s_LastDate, i_DateTime, i_InitialState, b_Required, b_SuppressDisabled, b_HideAdornments, b_SuppressExtraPromptNames, s_Style, s_SelectDateEditBoxStyle, s_SelectDateYearsStyle, s_SelectDateMonthsStyle, s_SelectDateDaysOfWeekStyle, s_SelectDateDaysStyle)
  518. {
  519. var oProperties = s_PromptId;
  520. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  521. {
  522. oProperties = {
  523. id: s_PromptId,
  524. formName: s_FormName,
  525. parameterName: s_ParameterName,
  526. submitType: s_SubmitType,
  527. prmtDefaultDate: s_PrmtDefaultDate,
  528. startRange: s_StartRange,
  529. endRange: s_EndRange,
  530. startOfWeek: s_StartOfWeek,
  531. calendar: s_Calendar,
  532. selectUI: s_SelectUI,
  533. selectDateUI: s_SelectDateUI,
  534. inputOrder: s_InputOrder,
  535. firstDate: s_FirstDate,
  536. lastDate: s_LastDate,
  537. dateTime: i_DateTime,
  538. initialState: i_InitialState,
  539. required: b_Required,
  540. suppressDisabled: b_SuppressDisabled,
  541. hideAdornments: b_HideAdornments,
  542. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  543. style: s_Style,
  544. selectDateEditBoxStyle: s_SelectDateEditBoxStyle,
  545. selectDateYearsStyle: s_SelectDateYearsStyle,
  546. selectDateMonthsStyle: s_SelectDateMonthsStyle,
  547. selectDateDaysOfWeekStyle: s_SelectDateDaysOfWeekStyle,
  548. selectDateDaysStyle: s_SelectDateDaysStyle
  549. };
  550. }
  551. var sPromptId = oProperties.id;
  552. if (!verifyPromptId(sPromptId)) {
  553. return;
  554. }
  555. //if there is a start and end date, but no default then use the start and end dates to bound the range.
  556. oProperties.startRange = ((typeof oProperties.firstDate != K_PRMT_sUNDEFINED) && oProperties.firstDate) && ((typeof oProperties.startRange == K_PRMT_sUNDEFINED) || !oProperties.startRange) ? oProperties.firstDate : oProperties.startRange;
  557. oProperties.endRange = ((typeof oProperties.lastDate != K_PRMT_sUNDEFINED) && oProperties.lastDate) && ((typeof oProperties.endRange == K_PRMT_sUNDEFINED) || !oProperties.endRange) ? oProperties.lastDate : oProperties.endRange;
  558. if(!oProperties.startRange) { oProperties.startRange = K_PRMT_sEMPTY;}
  559. if(!oProperties.endRange) { oProperties.endRange = K_PRMT_sEMPTY;}
  560. //skin folder
  561. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  562. var sFormName = oProperties.formName;
  563. if (!sFormName) {
  564. sFormName = "forms[0]";
  565. }
  566. var sParamName = "p_" + oProperties.parameterName;
  567. if (oProperties.suppressExtraPromptNames) {
  568. sParamName = sParamName.substring(1);
  569. }
  570. var HTMLOut = K_PRMT_sEMPTY;
  571. if (oProperties.submitType == K_PRMT_sXML) {
  572. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  573. }
  574. HTMLOut +=
  575. "<div class='clsFieldSet' style='"+cssParser(oProperties.style,gsCSS_DEFAULT_STYLE)+"'>" +
  576. "<table role='presentation' border='0' cellspacing='0' cellpadding='1' class='clsPromptComponent' style='"+cssParser(oProperties.style, "visibility")+"'>" +
  577. "<tr>" +
  578. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_FROM + "</td>" +
  579. "</tr>" +
  580. "<tr>" +
  581. "<td nowrap='nowrap'>&nbsp;</td>" +
  582. "<td nowrap='nowrap' onClick='range" + sPromptId + ".fromGotFocus();' onkeyup='range" + sPromptId + ".fromCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".fromKeyPress(event.keyCode);' style=\"valign-align:text-top\">";
  583. if (!oProperties.required)
  584. {
  585. HTMLOut +=
  586. "<table role='presentation' border='0' cellspacing='0' cellpadding='0'>" +
  587. "<tr>" +
  588. "<td style='vertical-align:top;'>" +
  589. "<input name='fromValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'/>" +
  590. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'>" +
  591. "</td>" +
  592. "<td>";
  593. }
  594. // SelectDateSingle prompt control for start range
  595. HTMLOut +=
  596. "<div id='selectDaterange_from" + sPromptId + "'>&nbsp;</div>";
  597. if (!oProperties.required)
  598. {
  599. HTMLOut +=
  600. "</td>" +
  601. "</tr>" +
  602. "</table>";
  603. }
  604. HTMLOut +=
  605. "</td>" +
  606. "</tr>";
  607. if (!oProperties.required)
  608. {
  609. HTMLOut +=
  610. "<tr>" +
  611. "<td nowrap='nowrap'>" +
  612. "<img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/>" +
  613. "</td>" +
  614. "<td class='clsReadOnlyText pe' onclick=\"document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  615. "<input value='lowest' name='fromValue" + sPromptId + "' type='radio' checked='true'>" +
  616. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_EARLIEST_DATE +
  617. "</td>" +
  618. "</tr>";
  619. }
  620. HTMLOut +=
  621. "<tr>" +
  622. "<td nowrap='nowrap' colspan='2'>&nbsp;</td>" +
  623. "</tr>" +
  624. "<tr>" +
  625. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_TO + "</td>" +
  626. "</tr>" +
  627. "<tr>" +
  628. "<td nowrap='nowrap'>&nbsp;</td>" +
  629. "<td nowrap='nowrap' onClick='range" + sPromptId + ".toGotFocus();' onkeyup='range" + sPromptId + ".toCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".toKeyPress(event.keyCode);'>";
  630. if (!oProperties.required)
  631. {
  632. HTMLOut +=
  633. "<table role='presentation' border='0' cellspacing='0' cellpadding='0'>" +
  634. "<tr>" +
  635. "<td style='vertical-align:top;'>" +
  636. "<input name='toValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'>" +
  637. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" +
  638. "</td>" +
  639. "<td>";
  640. }
  641. // SelectDateSingle prompt control for end range
  642. HTMLOut +=
  643. "<div id='selectDaterange_to" + sPromptId + "'>&nbsp;</div>";
  644. if (!oProperties.required)
  645. {
  646. HTMLOut +=
  647. "</td>" +
  648. "</tr>" +
  649. "</table>";
  650. }
  651. HTMLOut +=
  652. "</td>" +
  653. "</tr>";
  654. if (!oProperties.required)
  655. {
  656. HTMLOut +=
  657. "<tr>" +
  658. "<td nowrap='nowrap'>" +
  659. "<img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/>" +
  660. "</td>" +
  661. "<td class='clsReadOnlyText pe' onclick=\"document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  662. "<input value='highest' name='toValue" + sPromptId + "' type='radio' checked='true'>" +
  663. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_LATEST_DATE + "</td>" +
  664. "</tr>";
  665. }
  666. HTMLOut +=
  667. "</table>" +
  668. "</div>";
  669. renderPromptControlHTML("selectDate" + sPromptId, HTMLOut);
  670. // Range Control
  671. var JSOut = "genSelectDateSingleHTML(" + generatePromptProperties(oProperties, {
  672. id: "range_from" + sPromptId,
  673. formName: sFormName,
  674. parameterName: "range_from" + oProperties.parameterName,
  675. defaultValue: oProperties.startRange,
  676. startOfWeek: K_PRMT_sEMPTY,
  677. calendar: K_PRMT_sEMPTY,
  678. inputOrder: K_PRMT_sEMPTY,
  679. style: cssParser(oProperties.style, "visibility"),
  680. suppressDisabled: true,
  681. suppressExtraPromptNames: true}) + ");" +
  682. "genSelectDateSingleHTML(" + generatePromptProperties(oProperties, {
  683. id: "range_to" + sPromptId,
  684. formName: sFormName,
  685. parameterName: "range_to" + oProperties.parameterName,
  686. defaultValue: oProperties.endRange,
  687. startOfWeek: K_PRMT_sEMPTY,
  688. calendar: K_PRMT_sEMPTY,
  689. style: cssParser(oProperties.style, "visibility"),
  690. inputOrder: K_PRMT_sEMPTY,
  691. suppressDisabled: true,
  692. suppressExtraPromptNames: true}) + ");";
  693. if (oProperties.required) {
  694. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + sParamName + "'], null, pickerControlrange_from" + sPromptId + ", null, null, pickerControlrange_to" + sPromptId + ", null, 'date', true, '" + oProperties.submitType + "', null, '" + getCVId(oProperties) + "');";
  695. }
  696. else {
  697. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + sParamName + "'], document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][0], pickerControlrange_from" + sPromptId + ", null, document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][0], pickerControlrange_to" + sPromptId + ", null, 'date', false, '" + oProperties.submitType + "' , " + oProperties.initialState + ", '" + getCVId(oProperties) + "');";
  698. }
  699. var sCVObj = getCVInstance(oProperties);
  700. JSOut += sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('range" + sPromptId + "');" +
  701. sCVObj + "rangeObserverArray = " + sCVObj + "rangeObserverArray.concat('range" + sPromptId + "');";
  702. executePromptControlJS(JSOut);
  703. }
  704. function genSelectDateRangeMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_PrmtDefaultDate, s_StartRange, s_EndRange, s_StartOfWeek, s_Calendar, s_SelectUI, s_SelectDateUI, s_InputOrder, s_FirstDate, s_LastDate, i_DateTime, i_InitialState, b_Required, b_SuppressDisabled, b_HideAdornments, b_SuppressExtraPromptNames, s_Style, s_SelectDateEditBoxStyle, s_SelectDateYearsStyle, s_SelectDateMonthsStyle, s_SelectDateDaysOfWeekStyle, s_SelectDateDaysStyle)
  705. {
  706. var oProperties = s_PromptId;
  707. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  708. {
  709. oProperties = {
  710. id: s_PromptId,
  711. formName: s_FormName,
  712. parameterName: s_ParameterName,
  713. submitType: s_SubmitType,
  714. prmtDefaultDate: s_PrmtDefaultDate,
  715. startRange: s_StartRange,
  716. endRange: s_EndRange,
  717. startOfWeek: s_StartOfWeek,
  718. calendar: s_Calendar,
  719. selectUI: s_SelectUI,
  720. selectDateUI: s_SelectDateUI,
  721. inputOrder: s_InputOrder,
  722. firstDate: s_FirstDate,
  723. lastDate: s_LastDate,
  724. dateTime: i_DateTime,
  725. initialState: i_InitialState,
  726. required: b_Required,
  727. suppressDisabled: b_SuppressDisabled,
  728. hideAdornments: b_HideAdornments,
  729. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  730. style: s_Style,
  731. selectDateEditBoxStyle: s_SelectDateEditBoxStyle,
  732. selectDateYearsStyle: s_SelectDateYearsStyle,
  733. selectDateMonthsStyle: s_SelectDateMonthsStyle,
  734. selectDateDaysOfWeekStyle: s_SelectDateDaysOfWeekStyle,
  735. selectDateDaysStyle: s_SelectDateDaysStyle
  736. };
  737. }
  738. var sPromptId = oProperties.id;
  739. if (!verifyPromptId(sPromptId)) {
  740. return;
  741. }
  742. if(!oProperties.startRange) { oProperties.startRange = K_PRMT_sEMPTY;}
  743. if(!oProperties.endRange) { oProperties.endRange = K_PRMT_sEMPTY;}
  744. //skin folder
  745. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  746. var sFormName = oProperties.formName;
  747. if (!sFormName) {
  748. sFormName = "forms[0]";
  749. }
  750. var sParamName = "p_" + oProperties.parameterName;
  751. if (oProperties.suppressExtraPromptNames) {
  752. sParamName = sParamName.substring(1);
  753. }
  754. var formElementName = sParamName;
  755. if (oProperties.submitType == K_PRMT_sXML) {
  756. formElementName = "_oLstDRM_" + sPromptId;
  757. }
  758. var HTMLOut = K_PRMT_sEMPTY;
  759. if (oProperties.submitType == K_PRMT_sXML) {
  760. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  761. }
  762. HTMLOut +=
  763. "<div class='clsFieldSet' style='"+cssParser(oProperties.style,gsCSS_DEFAULT_STYLE)+"'>" +
  764. "<table role='presentation' cellpadding='0' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style, "visibility")+"'>" +
  765. "<tr>" +
  766. "<td valign='top' id='selectDateRange" + sPromptId + "'>&nbsp;</td>" +
  767. "<td valign='top' align='center' class='clsButtonLeftRightPadding'>" +
  768. "<table role='presentation' border='0' cellpadding='0' cellspacing='0'>" +
  769. "<tr>" +
  770. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='16'/></td>" +
  771. "</tr>" +
  772. "</table>" +
  773. "<table role='presentation' border='0' cellpadding='2' cellspacing='0'>" +
  774. "<tr>" +
  775. "<td id='getInsertButton" + sPromptId + "'>&nbsp;</td>" +
  776. "</tr>" +
  777. "<tr>" +
  778. "<td id='getRemoveButton" + sPromptId + "'>&nbsp;</td>" +
  779. "</tr>" +
  780. "<tr>" +
  781. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  782. "</tr>" +
  783. "</table>" +
  784. "</td>" +
  785. "<td valign='top'>" +
  786. "<table role='presentation' border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  787. "<tr>" +
  788. "<td class='clsControlLabel pc'>";
  789. if (oProperties.required)
  790. {
  791. HTMLOut +=
  792. "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  793. }
  794. HTMLOut +=
  795. PMT_UIM_CHOICES +
  796. "</td>" +
  797. "</tr>" +
  798. "<tr>" +
  799. "<td>" +
  800. "<select name='" + formElementName + "' style='"+cssParser(oProperties.style,"font,text,color,height")+"' class='clsChoicesListbox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleRange" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleRange" + sPromptId + ".catchDeleteKey(event.keyCode)'></select>" +
  801. "</td>" +
  802. "</tr>" +
  803. "<tr>" +
  804. "<td>" +
  805. "<div id='multipleRangeFeedback" + sPromptId + "' class='clsFeedbackWidget'><img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div>" +
  806. "</td>" +
  807. "</tr>" +
  808. "<tr>" +
  809. "<td align='right'>" +
  810. "<a href='javascript:multipleRange" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
  811. "&nbsp;" +
  812. "<a href='javascript:multipleRange" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
  813. "</td>" +
  814. "</tr>" +
  815. "</table>" +
  816. "</td>" +
  817. "</tr>" +
  818. "</table>" +
  819. "</div>";
  820. renderPromptControlHTML("selectDate" + sPromptId, HTMLOut);
  821. var sCVObj = getCVInstance(oProperties);
  822. var JSOut = "genSelectDateRangeHTML(" + generatePromptProperties(oProperties, {
  823. id: "Range" + sPromptId,
  824. formName: sFormName,
  825. parameterName: "r_" + oProperties.parameterName,
  826. style: cssParser(oProperties.style,"visibility"),
  827. suppressExtraPromptNames: true}) + ");" +
  828. "genInsertButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".insertChoiceList()', 'insertButton" + sPromptId + "');" +
  829. "genRemoveButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".removeChoiceList()', 'removeButton" + sPromptId + "');" +
  830. "this.multipleRange" + sPromptId + " = new CMultipleRange(rangeRange" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['" + sParamName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleRangeFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", '" + sPromptId + "', document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  831. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleRange" + sPromptId + "');" +
  832. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleRange" + sPromptId + "');" +
  833. "multipleRange" + sPromptId + ".initChoiceList();";
  834. executePromptControlJS(JSOut);
  835. }
  836. ////////////////////////////////////////////////////////////////////
  837. // selectTime HTML generation functions
  838. ////////////////////////////////////////////////////////////////////
  839. // Function to create a time prompt control
  840. // sPromptId: The id of the prompt control (String)
  841. // sFormName: Name of form control to submit selections to the server (String)
  842. // sParameterName: Name of control element to be submitted to report server (String)
  843. // sSubmitType: 'default' will submit as a standard form (String)
  844. // 'XML' will convert the submission to XML and submit
  845. // sDefaultValue: Default value for prompt control. If prompt control is a range, this represents the start value of the range. (String)
  846. // sSelectUI: UI of control: Textfields (editbox) or Inline clock (clock) ['editbox'|'clock'] (String)
  847. // sTimeZone: String representing the timezones (e.g. GMT). Default value is 'GMT'. (String)
  848. // sHourFormat: ('hh' = 01, 'h' = 1) (String)
  849. // sMinuteFormat: ('mm' = 01, 'm' = 1) (String)
  850. // sSecondFormat: ('ss' = 01, 's' = 1) (String)
  851. // iType: Controls type of clock (Integer)
  852. // 0 = 12 hour clock, right AM/PM,
  853. // 1 = 12 hour clock, left AM/PM
  854. // 2 = 24 hour clock, no AM/PM
  855. // iDisplay: Controls the display (Integer)
  856. // 0 = h:m:s:ms
  857. // 1 = h:m:s
  858. // 2 = h:m
  859. // iMode: 0 = static, 1 = live clock (Integer)
  860. // iInitialState: Range controls only. Controls whether to check radio buttons (Integer)
  861. // RANGE_NO_VALUE will select lowest to highest
  862. // RANGE_START_VALUE will select from a particular value to highest
  863. // RANGE_END_VALUE will select from lowest to a particular value
  864. // RANGE_BOUND_VALUE will select a range
  865. // RANGE_EQUAL_VALUE will select a single value
  866. // bRequired: If the control is a required field. (Boolean)
  867. // bSuppressDisabled: Suppress checkbox that allows user to disable control (required for dateTime controls) (Boolean)
  868. // bHideAdornments: Hide icons (e.g. star icon for required controls) (Boolean)
  869. // bSuppressExtraPromptNames: Force report server to handle multiple prompt controls as a single entity (Boolean)
  870. // e.g. treat datetime control as a single date time, as opposed to treating date and time independntly
  871. // bMulti: If control can accomodate more than one value. (Boolean)
  872. // bRange: If control is a range. (Boolean)
  873. // sEndTime: Optional. Only used for range controls. The end value of the range. (String)
  874. function genSelectTimeHTML(sPromptId, sFormName, sParameterName, sSubmitType, sDefaultValue, sSelectUI, sTimeZone, sHourFormat, sMinuteFormat, sSecondFormat, iType, iDisplay, iMode, iInitialState, bRequired, bSuppressDisabled, bHideAdornments, bSuppressExtraPromptNames, bMulti, bRange, sEndTime, sStyle)
  875. {
  876. var oProperties = sPromptId;
  877. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  878. {
  879. oProperties = {
  880. id: sPromptId,
  881. formName: sFormName,
  882. parameterName: sParameterName,
  883. submitType: sSubmitType,
  884. defaultValue: sDefaultValue,
  885. selectUI: sSelectUI,
  886. timeZone: sTimeZone,
  887. hourFormat: sHourFormat,
  888. minuteFormat: sMinuteFormat,
  889. secondFormat: sSecondFormat,
  890. type: iType,
  891. display: iDisplay,
  892. mode: iMode,
  893. initialState: iInitialState,
  894. required: bRequired,
  895. suppressDisabled: bSuppressDisabled,
  896. hideAdornments: bHideAdornments,
  897. suppressExtraPromptNames: bSuppressExtraPromptNames,
  898. multi: bMulti,
  899. range: bRange,
  900. style: sStyle,
  901. endTime: sEndTime
  902. };
  903. }
  904. oProperties.startTime = oProperties.defaultValue;
  905. if (oProperties.multi)
  906. {
  907. if (!oProperties.range) {
  908. genSelectTimeMultipleHTML(oProperties);
  909. }
  910. else {
  911. genSelectTimeRangeMultipleHTML(oProperties);
  912. }
  913. }
  914. else
  915. {
  916. if (oProperties.range) {
  917. genSelectTimeRangeHTML(oProperties);
  918. }
  919. else {
  920. genSelectTimeSingleHTML(oProperties);
  921. }
  922. }
  923. }
  924. function genSelectTimeSingleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultValue, s_SelectUI, s_TimeZone, s_HourFormat, s_MinuteFormat, s_SecondFormat, i_Type, i_Display, i_Mode, b_Required, b_SuppressDisabled, b_HideAdornments, b_SuppressExtraPromptNames)
  925. {
  926. var oProperties = s_PromptId;
  927. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  928. {
  929. oProperties = {
  930. id: s_PromptId,
  931. formName: s_FormName,
  932. parameterName: s_ParameterName,
  933. submitType: s_SubmitType,
  934. defaultValue: s_DefaultValue,
  935. selectUI: s_SelectUI,
  936. timeZone: s_TimeZone,
  937. hourFormat: s_HourFormat,
  938. minuteFormat: s_MinuteFormat,
  939. secondFormat: s_SecondFormat,
  940. type: i_Type,
  941. display: i_Display,
  942. mode: i_Mode,
  943. required: b_Required,
  944. suppressDisabled: b_SuppressDisabled,
  945. hideAdornments: b_HideAdornments,
  946. suppressExtraPromptNames: b_SuppressExtraPromptNames
  947. };
  948. }
  949. var sPromptId = oProperties.id;
  950. if (!verifyPromptId(sPromptId)) {
  951. return;
  952. }
  953. //skin folder
  954. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  955. var sFormName = oProperties.formName;
  956. if (!sFormName) {
  957. sFormName = "forms[0]";
  958. }
  959. var sParamName = "p_" + oProperties.parameterName;
  960. if (oProperties.suppressExtraPromptNames) {
  961. sParamName = sParamName.substring(1);
  962. }
  963. var formElementName = sParamName;
  964. if (oProperties.submitType == K_PRMT_sXML) {
  965. formElementName = "_oTS_" + sPromptId;
  966. }
  967. var oSubmitField = "document.forms['" + sFormName + "'].elements['" + sParamName + "']";
  968. var oFormField = "document.forms['" + sFormName + "'].elements['" + formElementName + "']";
  969. var oHours = "document.forms['" + sFormName + "'].elements['hours" + sPromptId + "']";
  970. var oMinutes = "document.forms['" + sFormName + "'].elements['minutes" + sPromptId + "']";
  971. var oSeconds = "document.forms['" + sFormName + "'].elements['seconds" + sPromptId + "']";
  972. var oMilliseconds = "document.forms['" + sFormName + "'].elements['milliseconds" + sPromptId + "']";
  973. var oAMPM = "document.forms['" + sFormName + "'].elements['AMPM" + sPromptId + "']";
  974. var oImgTest = "document.forms['" + sFormName + "'].elements['imgTest" + sPromptId + "']";
  975. if (oProperties.hideAdornments) {
  976. oImgTest = null;
  977. }
  978. var bInline = true;
  979. if (oProperties.selectUI == "clock") {
  980. bInline = true;
  981. }
  982. else if (oProperties.selectUI == "editBox") {
  983. bInline = false;
  984. }
  985. var clockObject = null;
  986. var clockBox = null;
  987. if (bInline)
  988. {
  989. clockObject = "clockDisplay" + sPromptId;
  990. clockBox = "document.getElementById('clock" + sPromptId + "')";
  991. }
  992. var timeZone = oProperties.timeZone;
  993. if (!timeZone) {
  994. timeZone = "GMT";
  995. }
  996. var hrFormat = oProperties.hourFormat;
  997. if (!hrFormat) {
  998. hrFormat = "hh";
  999. }
  1000. var minFormat = oProperties.minuteFormat;
  1001. if (!minFormat) {
  1002. minFormat = "mm";
  1003. }
  1004. var secFormat = oProperties.secondFormat;
  1005. if (!secFormat) {
  1006. secFormat = "ss";
  1007. }
  1008. var HTMLOut = K_PRMT_sEMPTY;
  1009. if (oProperties.submitType == K_PRMT_sXML) {
  1010. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  1011. }
  1012. HTMLOut +=
  1013. "<input type='hidden' name='" + formElementName + "' value='00:00:00.000'>" +
  1014. "<div class='clsFieldSet' style='"+cssParser(oProperties.style,gsCSS_DEFAULT_STYLE)+"'>" +
  1015. "<table role='presentation' border='0' cellspacing='0' cellpadding='0' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  1016. "<tr>";
  1017. if (!oProperties.required && !oProperties.suppressDisabled)
  1018. {
  1019. HTMLOut +=
  1020. "<td valign='top'>" +
  1021. "<input type='checkbox' value='anyValue' name='chkAnyValue" + sPromptId + "' onclick='timePicker" + sPromptId + ".toggleDisable(this.checked)' checked='checked'>" +
  1022. "</td>";
  1023. }
  1024. HTMLOut +=
  1025. "<td valign='top'>" +
  1026. "<table role='presentation' border='0' cellspacing='0' cellpadding='0' class='clsSelectTime' id='timeTable_" + sPromptId + "' ";
  1027. if ((oProperties.timeLabel != null) && (oProperties.timeLabel != "")){
  1028. HTMLOut += "role='group' aria-label='" + oProperties.timeLabel + "'";
  1029. } else {
  1030. HTMLOut += "role='presnetation' ";
  1031. }
  1032. HTMLOut += ">";
  1033. var bShowSecondHand = false;
  1034. if (bInline)
  1035. {
  1036. if (oProperties.display == 1 || oProperties.display === 0){
  1037. bShowSecondHand = true;
  1038. }
  1039. HTMLOut +=
  1040. "<tr class='clsClockPosition'>" +
  1041. "<td height='100%' colspan='3'><div class='clsClockBlock' align='center'><div id='clock" + sPromptId + "' class='clsClock'>&nbsp;</div></div></td>" +
  1042. "</tr>";
  1043. }
  1044. HTMLOut +=
  1045. "<tr>";
  1046. if (!oProperties.hideAdornments && oProperties.required)
  1047. {
  1048. HTMLOut +=
  1049. "<td valign='top'>" +
  1050. "<table role='presentation' cellpadding='0' cellspacing='0' border='0' width='10' height='20'>" +
  1051. "<tr>" +
  1052. "<td><img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='bottom' height='10' width='10' border='0'/></td>" +
  1053. "</tr>" +
  1054. "<tr>" +
  1055. "<td valign='middle' align='right'><img id='imgTest" + sPromptId + "' name='imgTest" + sPromptId + "' class='clsErrorRequired' src='" + sSkin + "/prompting/images/error_timed_small_off.gif' align='bottom' height='10' width='10' border='0'/></td>" +
  1056. "</tr>" +
  1057. "</table>" +
  1058. "</td>";
  1059. }
  1060. HTMLOut +=
  1061. "<td id='timeEditBox" + sPromptId + "' nowrap='nowrap'>" +
  1062. "<div ";
  1063. if (typeof oProperties.type != "number")
  1064. {
  1065. if (typeof g_24HourClock != K_PRMT_sUNDEFINED && g_24HourClock.toString().toLowerCase() == "true")
  1066. {
  1067. oProperties.type = 2;
  1068. }
  1069. else
  1070. {
  1071. if (typeof g_AMPMLocation != K_PRMT_sUNDEFINED && g_AMPMLocation == 'left')
  1072. {
  1073. oProperties.type = 1;
  1074. }
  1075. else
  1076. {
  1077. oProperties.type = 0;
  1078. }
  1079. }
  1080. }
  1081. if (oProperties.display === 0 && (oProperties.type === 0 || oProperties.type == 1)) {
  1082. HTMLOut += "class='clsSelectTimeEditBoxExtend pcl' id='editBox" + sPromptId + "'>";
  1083. }
  1084. else {
  1085. HTMLOut += "class='clsSelectTimeEditBox pcl' id='editBox" + sPromptId + "'>";
  1086. }
  1087. if (oProperties.type == 1) {
  1088. HTMLOut +=
  1089. "<span>" +
  1090. "<input name='AMPM" + sPromptId + "' class='clsSelectTimeControl' style='border:none;' onkeyup='timePicker" + sPromptId + ".keyPress(event,this);timePicker" + sPromptId + ".bCheckAMPM()' onblur='timePicker" + sPromptId + ".refreshTime()' onfocus='timePicker" + sPromptId + ".setCurrentFocus(this)' value='PM' size='2' maxlength='2'>" +
  1091. "</span>";
  1092. }
  1093. HTMLOut +=
  1094. "<span style=\"text-align: right\"><input name='hours" + sPromptId + "' style='border:none;' class='clsSelectTimeControl' onkeyup='timePicker" + sPromptId + ".keyPress(event,this);timePicker" + sPromptId + ".bCheckHour()' onblur='timePicker" + sPromptId + ".refreshTime()' onfocus='timePicker" + sPromptId + ".setCurrentFocus(this)' value='12' size='2' maxlength='2'></span>" +
  1095. "<span class='clsColon pcl'>:</span>" +
  1096. "<span class='pcl'><input name='minutes" + sPromptId + "' style='border:none;' class='clsSelectTimeControl' onkeyup='timePicker" + sPromptId + ".keyPress(event,this);timePicker" + sPromptId + ".bCheckMinute()' onblur='timePicker" + sPromptId + ".refreshTime()' onfocus='timePicker" + sPromptId + ".setCurrentFocus(this)' value='10' size='2' maxlength='2'></span>";
  1097. if (oProperties.display == 1 || oProperties.display === 0)
  1098. {
  1099. HTMLOut +=
  1100. "<span class='clsColon pcl'>:</span>" +
  1101. "<span><input name='seconds" + sPromptId + "' class='clsSelectTimeControl' style='border:none;' onkeyup='timePicker" + sPromptId + ".keyPress(event,this);timePicker" + sPromptId + ".bCheckSecond()' onblur='timePicker" + sPromptId + ".refreshTime()' onfocus='timePicker" + sPromptId + ".setCurrentFocus(this)' value='59' size='2' maxlength='2'></span>";
  1102. }
  1103. if (oProperties.display === 0)
  1104. {
  1105. HTMLOut +=
  1106. "<span class='clsColon pcl'>.</span>" +
  1107. "<span><input name='milliseconds" + sPromptId + "' class='clsSelectTimeControl' style='border:none;' onkeyup='timePicker" + sPromptId + ".keyPress(event,this);timePicker" + sPromptId + ".bCheckMillisecond()' onblur='timePicker" + sPromptId + ".refreshTime()' onfocus='timePicker" + sPromptId + ".setCurrentFocus(this)' value='000' size='3' maxlength='3'></span>";
  1108. }
  1109. if (oProperties.type === 0) {
  1110. HTMLOut +=
  1111. "<span><input name='AMPM" + sPromptId + "' class='clsSelectTimeControl' style='border:none;' onkeyup='timePicker" + sPromptId + ".keyPress(event,this);timePicker" + sPromptId + ".bCheckAMPM()' onblur='timePicker" + sPromptId + ".refreshTime()' onfocus='timePicker" + sPromptId + ".setCurrentFocus(this)' value='PM' size='3' maxlength='2'></span>";
  1112. }
  1113. HTMLOut +=
  1114. "</div>" +
  1115. "</td>" +
  1116. "<td>" +
  1117. "<table cellpadding='0' cellspacing='0' border='0' role='presentation' >" +
  1118. "<tr>" +
  1119. "<td width='15' align='right' role='button' class='clsToolbarButton' onmouseover='buttonOver(this)' onmouseout='buttonOut(this)' onmousedown='buttonOver(this)' onclick='timePicker" + sPromptId + ".timeUp()' ondblclick='timePicker" + sPromptId + ".timeUp()'><img id='btnTimeUp" + sPromptId + "' src='" + sSkin + "/prompting/images/icon_time_up.gif' border='0' align='top' width='15' height='7' alt='"+ PMT_DTP_TIME_BUTTON_INCREMENT +"' title='"+PMT_DTP_TIME_BUTTON_INCREMENT +"'/></td>" +
  1120. "</tr>" +
  1121. "<tr>" +
  1122. "<td width='15' align='right' role='button' class='clsToolbarButton' onmouseover='buttonOver(this)' onmouseout='buttonOut(this)' onmousedown='buttonOver(this)' onclick='timePicker" + sPromptId + ".timeDown()' ondblclick='timePicker" + sPromptId + ".timeDown()'><img id='btnTimeDown" + sPromptId + "' src='" + sSkin + "/prompting/images/icon_time_down.gif' border='0' align='top' width='15' height='7' alt='" + PMT_DTP_TIME_BUTTON_DECREMENT + "' title='" + PMT_DTP_TIME_BUTTON_DECREMENT + "'/></td>" +
  1123. "</tr>" +
  1124. "</table>" +
  1125. "</td>" +
  1126. "</tr>" +
  1127. "</table>" +
  1128. "</td>" +
  1129. "</tr>" +
  1130. "</table>" +
  1131. "</div>";
  1132. renderPromptControlHTML("selectTime" + sPromptId, HTMLOut);
  1133. var JSOut = K_PRMT_sEMPTY;
  1134. if (bInline)
  1135. {
  1136. JSOut += "this.clockDisplay" + sPromptId + " = new CClock(document.getElementById('clock" + sPromptId + "'), null, 'clockDisplay" + sPromptId + "', " + oProperties.mode + ", " + bShowSecondHand + ", '" + getCVId(oProperties) + "');";
  1137. }
  1138. var sCVObj = getCVInstance(oProperties);
  1139. JSOut += "this.timePicker" + sPromptId + " = new CTimePicker(" + oSubmitField + ", " + oFormField + ", " + oHours + ", " + oMinutes + ", " + oSeconds + ", " + oMilliseconds + ", " + oAMPM + ", " + oImgTest + ", " + clockBox + ", document.getElementById('editBox" + sPromptId + "'), 'timePicker" + sPromptId + "', " + oProperties.type + ", " + oProperties.display + ", " + bInline + ", '" + timeZone + "', '" + hrFormat + "', '" + minFormat + "', '" + secFormat + "', " + oProperties.mode + ", '" + clockObject + "', '" + oProperties.defaultValue + "', " + oProperties.required + ", '" + oProperties.submitType + "', '" + getCVId(oProperties) + "', '"+ sPromptId +"');" +
  1140. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('timePicker" + sPromptId + "');";
  1141. executePromptControlJS(JSOut);
  1142. }
  1143. function genSelectTimeMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultValue, s_SelectUI, s_TimeZone, s_HourFormat, s_MinuteFormat, s_SecondFormat, i_Type, i_Display, i_Mode, b_Required, b_SuppressDisabled, b_HideAdornments, b_SuppressExtraPromptNames, b_Inline, s_Style)
  1144. {
  1145. var oProperties = s_PromptId;
  1146. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  1147. {
  1148. oProperties = {
  1149. id: s_PromptId,
  1150. formName: s_FormName,
  1151. parameterName: s_ParameterName,
  1152. submitType: s_SubmitType,
  1153. defaultValue: s_DefaultValue,
  1154. selectUI: s_SelectUI,
  1155. timeZone: s_TimeZone,
  1156. hourFormat: s_HourFormat,
  1157. minuteFormat: s_MinuteFormat,
  1158. secondFormat: s_SecondFormat,
  1159. type: i_Type,
  1160. display: i_Display,
  1161. mode: i_Mode,
  1162. required: b_Required,
  1163. suppressDisabled: b_SuppressDisabled,
  1164. hideAdornments: b_HideAdornments,
  1165. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  1166. inline: b_Inline,
  1167. style: s_Style
  1168. };
  1169. }
  1170. var sPromptId = oProperties.id;
  1171. if (!verifyPromptId(sPromptId)) {
  1172. return;
  1173. }
  1174. //skin folder
  1175. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  1176. var sFormName = oProperties.formName;
  1177. if (!sFormName) {
  1178. sFormName = "forms[0]";
  1179. }
  1180. var sParamName = "p_" + oProperties.parameterName;
  1181. if (oProperties.suppressExtraPromptNames) {
  1182. sParamName = sParamName.substring(1);
  1183. }
  1184. var formElementName = sParamName;
  1185. if (oProperties.submitType == K_PRMT_sXML) {
  1186. formElementName = "_oLstTM_" + sPromptId;
  1187. }
  1188. var HTMLOut = K_PRMT_sEMPTY;
  1189. if (oProperties.submitType == K_PRMT_sXML) {
  1190. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  1191. }
  1192. HTMLOut +=
  1193. "<div class='clsFieldSet' style='"+cssParser(oProperties.style,gsCSS_DEFAULT_STYLE)+"'>" +
  1194. "<table cellpadding='0' role='presentation' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  1195. "<tr>" +
  1196. "<td colspan='2'><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='1'/></td>" +
  1197. "<td class='clsControlLabel pc'>";
  1198. if (!oProperties.hideAdornments && oProperties.required)
  1199. {
  1200. HTMLOut +=
  1201. "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  1202. }
  1203. HTMLOut +=
  1204. PMT_UIM_CHOICES +
  1205. "</td>" +
  1206. "</tr>" +
  1207. "<tr>" +
  1208. // selectTimeSingle control prompt
  1209. "<td valign='top' id='selectTimeSingle" + sPromptId + "'>&nbsp;</td>" +
  1210. "<td valign='top' class='clsButtonLeftRightPadding' style=\"padding-left:15px\">" +
  1211. "<table border='0' cellpadding='2' cellspacing='0'>" +
  1212. "<tr>" +
  1213. "<td id='getInsertButton" + sPromptId + "'>&nbsp;</td>" +
  1214. "</tr>" +
  1215. "<tr>" +
  1216. "<td id='getRemoveButton" + sPromptId + "'>&nbsp;</td>" +
  1217. "</tr>" +
  1218. "<tr>" +
  1219. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  1220. "</tr>" +
  1221. "</table>" +
  1222. "</td>" +
  1223. "<td valign='top'>" +
  1224. "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  1225. "<tr>" +
  1226. "<td>" +
  1227. "<select name='" + formElementName + "' style='"+cssParser(oProperties.style,"font,color,text,height")+"' class='clsChoicesListbox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleTimePicker" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleTimePicker" + sPromptId + ".catchDeleteKey(event.keyCode)'></select>" +
  1228. "</td>" +
  1229. "</tr>" +
  1230. "<tr>" +
  1231. "<td>" +
  1232. "<div id='multipleTextFeedback" + sPromptId + "' class='clsFeedbackWidget'>" +
  1233. "<img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/>" +
  1234. "</div>" +
  1235. "</td>" +
  1236. "</tr>" +
  1237. "<tr>" +
  1238. "<td align='right'>" +
  1239. "<a href='javascript:multipleTimePicker" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
  1240. "&nbsp;" +
  1241. "<a href='javascript:multipleTimePicker" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
  1242. "</td>" +
  1243. "</tr>" +
  1244. "</table>" +
  1245. "</td>" +
  1246. "</tr>" +
  1247. "</table>" +
  1248. "</div>";
  1249. renderPromptControlHTML("selectTime" + sPromptId, HTMLOut);
  1250. var sCVObj = getCVInstance(oProperties);
  1251. var JSOut = "genSelectTimeSingleHTML(" + generatePromptProperties(oProperties, {
  1252. id: "Single" + sPromptId,
  1253. formName: sFormName,
  1254. defaultValue: K_PRMT_sEMPTY,
  1255. required: false,
  1256. suppressDisabled: true,
  1257. style: cssParser(oProperties.style,"visibility"),
  1258. suppressExtraPromptNames: true})+ ");" +
  1259. "genInsertButtonHTML('" + sPromptId + "', 'multipleTimePicker" + sPromptId + ".insert()', 'insertButton" + sPromptId + "');" +
  1260. "genRemoveButtonHTML('" + sPromptId + "', 'multipleTimePicker" + sPromptId + ".remove()', 'removeButton" + sPromptId + "');" +
  1261. "this.multipleTimePicker" + sPromptId + " = new CMultipleTimePicker(timePickerSingle" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['" + sParamName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleTextFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  1262. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleTimePicker" + sPromptId + "');" +
  1263. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleTimePicker" + sPromptId + "');";
  1264. executePromptControlJS(JSOut);
  1265. }
  1266. function genSelectTimeRangeHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_StartTime, s_EndTime, s_SelectUI, s_TimeZone, s_HourFormat, s_MinuteFormat, s_SecondFormat, i_Type, i_Display, i_Mode, i_InitialState, b_Required, b_SuppressDisabled, b_HideAdornments, b_SuppressExtraPromptNames, s_Style)
  1267. {
  1268. var oProperties = s_PromptId;
  1269. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  1270. {
  1271. oProperties = {
  1272. id: s_PromptId,
  1273. formName: s_FormName,
  1274. parameterName: s_ParameterName,
  1275. submitType: s_SubmitType,
  1276. startTime: s_StartTime,
  1277. endTime: s_EndTime,
  1278. selectUI: s_SelectUI,
  1279. timeZone: s_TimeZone,
  1280. hourFormat: s_HourFormat,
  1281. minuteFormat: s_MinuteFormat,
  1282. secondFormat: s_SecondFormat,
  1283. type: i_Type,
  1284. display: i_Display,
  1285. mode: i_Mode,
  1286. initialState: i_InitialState,
  1287. required: b_Required,
  1288. suppressDisabled: b_SuppressDisabled,
  1289. hideAdornments: b_HideAdornments,
  1290. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  1291. style: s_Style
  1292. };
  1293. }
  1294. var sPromptId = oProperties.id;
  1295. if (!verifyPromptId(sPromptId)) {
  1296. return;
  1297. }
  1298. //skin folder
  1299. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  1300. var sFormName = oProperties.formName;
  1301. if (!sFormName) {
  1302. sFormName = "forms[0]";
  1303. }
  1304. var sParamName = "p_" + oProperties.parameterName;
  1305. if (oProperties.suppressExtraPromptNames) {
  1306. sParamName = sParamName.substring(1);
  1307. }
  1308. var HTMLOut = K_PRMT_sEMPTY;
  1309. if (oProperties.submitType == K_PRMT_sXML) {
  1310. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  1311. }
  1312. HTMLOut +=
  1313. "<div class='clsFieldSet' style='"+cssParser(oProperties.style,gsCSS_DEFAULT_STYLE)+"'>" +
  1314. "<table border='0' cellspacing='0' cellpadding='1' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  1315. "<tr>" +
  1316. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_FROM + "</td>" +
  1317. "</tr>" +
  1318. "<tr>" +
  1319. "<td nowrap='nowrap'>&nbsp;</td>" +
  1320. "<td nowrap='nowrap' onClick='range" + sPromptId + ".fromGotFocus();' onkeyup='range" + sPromptId + ".fromCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".fromKeyPress(event.keyCode);'>" +
  1321. "<table cellpadding='0' cellspacing='0'>" +
  1322. "<tr>";
  1323. if (!oProperties.required)
  1324. {
  1325. HTMLOut +=
  1326. "<td valign='top'>" +
  1327. "<input name='fromValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'>" +
  1328. "</td>" +
  1329. "<td>" +
  1330. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" +
  1331. "</td>";
  1332. }
  1333. // TimeSingle prompt control for start value of range
  1334. HTMLOut +=
  1335. "<td id='selectTimerange_from" + sPromptId + "'>&nbsp;</td>" +
  1336. "</tr>" +
  1337. "</table>" +
  1338. "</td>" +
  1339. "</tr>";
  1340. if (!oProperties.required)
  1341. {
  1342. HTMLOut +=
  1343. "<tr onclick=\"document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  1344. "<td nowrap='nowrap'>" +
  1345. "<img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/>" +
  1346. "</td>" +
  1347. "<td class='clsReadOnlyText'>" +
  1348. "<input value='lowest' name='fromValue" + sPromptId + "' type='radio' checked='true'>" +
  1349. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_EARLIEST_TIME +
  1350. "</td>" +
  1351. "</tr>";
  1352. }
  1353. HTMLOut +=
  1354. "<tr>" +
  1355. "<td nowrap='nowrap' colspan='2'>&nbsp;</td>" +
  1356. "</tr>" +
  1357. "<tr>" +
  1358. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_TO + "</td>" +
  1359. "</tr>" +
  1360. "<tr>" +
  1361. "<td nowrap='nowrap'>&nbsp;</td>" +
  1362. "<td nowrap='nowrap' onClick='range" + sPromptId + ".toGotFocus();' onkeyup='range" + sPromptId + ".toCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".toKeyPress(event.keyCode);'>" +
  1363. "<table cellpadding='0' cellspacing='0'>" +
  1364. "<tr>";
  1365. if (!oProperties.required)
  1366. {
  1367. HTMLOut +=
  1368. "<td valign='top'>" +
  1369. "<input name='toValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'>" +
  1370. "</td>" +
  1371. "<td>" +
  1372. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" +
  1373. "</td>";
  1374. }
  1375. // TimeSingle prompt control for end value of range
  1376. HTMLOut +=
  1377. "<td valign='top' id='selectTimerange_to" + sPromptId + "'></td>" +
  1378. "</tr>" +
  1379. "</table>" +
  1380. "</td>" +
  1381. "</tr>";
  1382. if (!oProperties.required)
  1383. {
  1384. HTMLOut +=
  1385. "<tr onclick=\"document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  1386. "<td nowrap='nowrap'>" +
  1387. "<img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/>" +
  1388. "</td>" +
  1389. "<td class='clsReadOnlyText'>" +
  1390. "<input value='highest' name='toValue" + sPromptId + "' type='radio' checked='true' onclick='range" + sPromptId + ".rangeNotify()'>" +
  1391. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_LATEST_TIME +
  1392. "</td>" +
  1393. "</tr>";
  1394. }
  1395. HTMLOut +=
  1396. "</table>" +
  1397. "</div>";
  1398. renderPromptControlHTML("selectTime" + sPromptId, HTMLOut);
  1399. var JSOut = "genSelectTimeSingleHTML(" + generatePromptProperties(oProperties, {
  1400. id: "range_from" + sPromptId,
  1401. formName: sFormName,
  1402. parameterName: "range_from" + oProperties.parameterName,
  1403. defaultValue: oProperties.startTime,
  1404. suppressDisabled: true,
  1405. style: cssParser(oProperties.style,"visibility"),
  1406. suppressExtraPromptNames: true}) + ");" +
  1407. "genSelectTimeSingleHTML(" + generatePromptProperties(oProperties, {
  1408. id: "range_to" + sPromptId,
  1409. formName: sFormName,
  1410. parameterName: "range_to" + oProperties.parameterName,
  1411. defaultValue: oProperties.endTime,
  1412. style: cssParser(oProperties.style,"visibility"),
  1413. suppressDisabled: true,
  1414. suppressExtraPromptNames: true}) + ");";
  1415. if (oProperties.required)
  1416. {
  1417. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + sParamName + "'], null, timePickerrange_from" + sPromptId + ", null, null, timePickerrange_to" + sPromptId + ", null, 'time', true, '" + oProperties.submitType + "', null, '" + getCVId(oProperties) + "');";
  1418. }
  1419. else
  1420. {
  1421. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + sParamName + "'], document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][0], timePickerrange_from" + sPromptId + ",null, document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][0], timePickerrange_to" + sPromptId + ", null, 'datetime', false, '" + oProperties.submitType + "', " + oProperties.initialState + ", '" + getCVId(oProperties) + "');";
  1422. }
  1423. var sCVObj = getCVInstance(oProperties);
  1424. JSOut += sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('range" + sPromptId + "');" +
  1425. sCVObj + "rangeObserverArray = " + sCVObj + "rangeObserverArray.concat('range" + sPromptId + "');";
  1426. executePromptControlJS(JSOut);
  1427. }
  1428. function genSelectTimeRangeMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_StartTime, s_EndTime, s_SelectUI, s_TimeZone, s_HourFormat, s_MinuteFormat, s_SecondFormat, i_Type, i_Display, i_Mode, i_InitialState, b_Required, b_SuppressDisabled, b_HideAdornments, b_SuppressExtraPromptNames, s_Style)
  1429. {
  1430. var oProperties = s_PromptId;
  1431. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  1432. {
  1433. oProperties = {
  1434. id: s_PromptId,
  1435. formName: s_FormName,
  1436. parameterName: s_ParameterName,
  1437. submitType: s_SubmitType,
  1438. startTime: s_StartTime,
  1439. endTime: s_EndTime,
  1440. selectUI: s_SelectUI,
  1441. timeZone: s_TimeZone,
  1442. hourFormat: s_HourFormat,
  1443. minuteFormat: s_MinuteFormat,
  1444. secondFormat: s_SecondFormat,
  1445. type: i_Type,
  1446. display: i_Display,
  1447. mode: i_Mode,
  1448. initialState: i_InitialState,
  1449. required: b_Required,
  1450. suppressDisabled: b_SuppressDisabled,
  1451. hideAdornments: b_HideAdornments,
  1452. suppressExtraPromptNames: b_SuppressExtraPromptNames,
  1453. style: s_Style
  1454. };
  1455. }
  1456. var sPromptId = oProperties.id;
  1457. if (!verifyPromptId(sPromptId)) {
  1458. return;
  1459. }
  1460. //skin folder
  1461. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  1462. var sFormName = oProperties.formName;
  1463. if (!sFormName) {
  1464. sFormName = "forms[0]";
  1465. }
  1466. var sParamName = "p_" + oProperties.parameterName;
  1467. if (oProperties.suppressExtraPromptNames) {
  1468. sParamName = sParamName.substring(1);
  1469. }
  1470. var formElementName = sParamName;
  1471. if (oProperties.submitType == K_PRMT_sXML) {
  1472. formElementName = "_oLstTRM_" + sPromptId;
  1473. }
  1474. var HTMLOut = K_PRMT_sEMPTY;
  1475. if (oProperties.submitType == K_PRMT_sXML) {
  1476. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  1477. }
  1478. HTMLOut +=
  1479. "<div class='clsFieldSet' style='"+cssParser(oProperties.style,gsCSS_DEFAULT_STYLE)+"'>" +
  1480. "<table cellpadding='0' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  1481. "<tr>" +
  1482. // selectTimeRange prompt control
  1483. "<td valign='top' id='selectTimer_" + sPromptId + "'>&nbsp;</td>" +
  1484. "<td valign='top' class='clsButtonLeftRightPadding'>" +
  1485. "<table border='0' cellpadding='0' cellspacing='0'>" +
  1486. "<tr>" +
  1487. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='16'/></td>" +
  1488. "</tr>" +
  1489. "</table>" +
  1490. "<table border='0' cellpadding='2' cellspacing='0'>" +
  1491. "<tr>" +
  1492. "<td id='getInsertButton" + sPromptId + "'>&nbsp;</td>" +
  1493. "</tr>" +
  1494. "<tr>" +
  1495. "<td id='getRemoveButton" + sPromptId + "'>&nbsp;</td>" +
  1496. "</tr>" +
  1497. "<tr>" +
  1498. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  1499. "</tr>" +
  1500. "</table>" +
  1501. "</td>" +
  1502. "<td valign='top'>" +
  1503. "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  1504. "<tr>" +
  1505. "<td class='clsControlLabel pc'>";
  1506. if (oProperties.required)
  1507. {
  1508. HTMLOut +=
  1509. "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  1510. }
  1511. HTMLOut +=
  1512. PMT_UIM_CHOICES +
  1513. "</td>" +
  1514. "</tr>" +
  1515. "<tr>" +
  1516. "<td>" +
  1517. "<select name='" + formElementName + "' style='"+cssParser(oProperties.style,"font,text,color,height")+"' class='clsChoicesListbox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleRange" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleRange" + sPromptId + ".catchDeleteKey(event.keyCode)'></select>" +
  1518. "</td>" +
  1519. "</tr>" +
  1520. "<tr>" +
  1521. "<td>" +
  1522. "<div id='multipleRangeFeedback" + sPromptId + "' class='clsFeedbackWidget'>" +
  1523. "<img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/>" +
  1524. "</div>" +
  1525. "</td>" +
  1526. "</tr>" +
  1527. "<tr>" +
  1528. "<td align='right'>" +
  1529. "<a href='javascript:multipleRange" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
  1530. "&nbsp;" +
  1531. "<a href='javascript:multipleRange" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
  1532. "</td>" +
  1533. "</tr>" +
  1534. "</table>" +
  1535. "</td>" +
  1536. "</tr>" +
  1537. "</table>" +
  1538. "</div>";
  1539. renderPromptControlHTML("selectTime" + sPromptId, HTMLOut);
  1540. var sCVObj = getCVInstance(oProperties);
  1541. var JSOut = "genSelectTimeRangeHTML(" + generatePromptProperties(oProperties, {
  1542. id: "r_" + sPromptId,
  1543. formName: sFormName,
  1544. parameterName: "r_" + oProperties.parameterName,
  1545. style: cssParser(oProperties.style,"visibility"),
  1546. suppressExtraPromptNames: true}) + ");" +
  1547. "genInsertButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".insertChoiceList()', 'insertButton" + sPromptId + "');" +
  1548. "genRemoveButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".removeChoiceList()', 'removeButton" + sPromptId + "');" +
  1549. "this.multipleRange" + sPromptId + " = new CMultipleRange(ranger_" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['" + sParamName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleRangeFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", '" + sPromptId + "', document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  1550. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleRange" + sPromptId + "');" +
  1551. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleRange" + sPromptId + "');" +
  1552. "multipleRange" + sPromptId + ".initChoiceList();";
  1553. executePromptControlJS(JSOut);
  1554. }
  1555. ////////////////////////////////////////////////////////////////////
  1556. // selectDateTime HTML generation functions
  1557. ////////////////////////////////////////////////////////////////////
  1558. // Function to create a dateTime prompt control
  1559. // sPromptId: The id of the prompt control (String)
  1560. // sFormName: Name of form control to submit selections to the server (String)
  1561. // sParameterName: Name of control element to be submitted to report server (String)
  1562. // sSubmitType: 'default' will submit as a standard form (String)
  1563. // 'XML' will convert the submission to XML and submit
  1564. // sDefaultDate: Default date for prompt control. If prompt control is a range, this represents the start value of the range. (String)
  1565. // sDefaultTime: Default time for prompt control. If prompt control is a range, this represents the start value of the range. (String)
  1566. // sStartOfWeek: First day of week: ['Monday'|'Tuesday'|'Wednesday'|'Thursday'|'Friday'|'Saturday'|'Sunday'] (String)
  1567. // sCalendar: Calendar type: ['Gregorian'|'Imperial'] (String)
  1568. // sSelectUI: UI of control (String)
  1569. // Textbox with calendar popup and text fields for times (editbox)
  1570. // Inline calendar and clock () ['editbox'|'']
  1571. // sInputOrder: ['YMD'|'DMY'|...] (String)
  1572. // sFirstDate: the minimum acceptable date (String)
  1573. // sLastDate: the maximum acceptable date (String)
  1574. // sTimeZone: String representing the timezones (e.g. GMT). Default value is 'GMT'. (String)
  1575. // sHourFormat: ('hh' = 01, 'h' = 1) (String)
  1576. // sMinuteFormat: ('mm' = 01, 'm' = 1) (String)
  1577. // sSecondFormat: ('ss' = 01, 's' = 1) (String)
  1578. // iDateTime: 0 = datetime e.g. yyyy-mm-dd 00:00:00.000, 1 = date e.g. yyyy-mm-dd [0|1] (Integer)
  1579. // iType: Controls type of clock (Integer)
  1580. // 0 = 12 hour clock, right AM/PM,
  1581. // 1 = 12 hour clock, left AM/PM
  1582. // 2 = 24 hour clock, no AM/PM
  1583. // iDisplay: Controls the display (Integer)
  1584. // 0 = h:m:s:ms
  1585. // 1 = h:m:s
  1586. // 2 = h:m
  1587. // iMode: 0 = static, 1 = live clock (Integer)
  1588. // iInitialState: Range controls only. Controls whether to check radio buttons (Integer)
  1589. // RANGE_NO_VALUE will select lowest to highest
  1590. // RANGE_START_VALUE will select from a particular value to highest
  1591. // RANGE_END_VALUE will select from lowest to a particular value
  1592. // RANGE_BOUND_VALUE will select a range
  1593. // RANGE_EQUAL_VALUE will select a single value
  1594. // bRequired: If the control is a required field. (Boolean)
  1595. // bHideAdornments: Hide icons (e.g. star icon for required controls) (Boolean)
  1596. // bSuppressDisabled: Suppress checkbox that allows user to disable control (required for dateTime controls) (Boolean)
  1597. // bXSDformat: Specify whether date times should be returned in XSD format (true, default) or SQL format (false) (Boolean)
  1598. // bMulti: If control can accomodate more than one value. (Boolean)
  1599. // bRange: If control is a range. (Boolean)
  1600. // sStyle: Style of prompt control (String)
  1601. // sSelectDateEditBoxStyle: Style of date edit box (String)
  1602. // sSelectDateYearsStyle: Style of years (String)
  1603. // sSelectDateMonthsStyle: Style of months (String)
  1604. // sSelectDateDaysOfWeekStyle: Style of days of the week (String)
  1605. // sSelectDateDaysStyle: Style of days (String)
  1606. // sEndDate: Optional. Only used for range controls. The end date of the range. (String)
  1607. // sEndTime: Optional. Only used for range controls. The end time of the range. (String)
  1608. function genSelectDateTimeHTML(sPromptId, sFormName, sParameterName, sSubmitType, sDefaultDate, sDefaultTime, sStartOfWeek, sCalendar, sSelectUI, sInputOrder, sFirstDate, sLastDate, sTimeZone, sHourFormat, sMinuteFormat, sSecondFormat, iDateTime, iType, iDisplay, iMode, iInitialState, bRequired, bHideAdornments, bSuppressDisabled, bXSDFormat, bMulti, bRange, sStyle, sSelectDateEditBoxStyle, sSelectDateYearsStyle, sSelectDateMonthsStyle, sSelectDateDaysOfWeekStyle, sSelectDateDaysStyle, sEndDate, sEndTime, bSuppressExtraPromptNames)
  1609. {
  1610. var oProperties = sPromptId;
  1611. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  1612. {
  1613. oProperties = {
  1614. id: sPromptId,
  1615. formName: sFormName,
  1616. parameterName: sParameterName,
  1617. submitType: sSubmitType,
  1618. defaultDate: sDefaultDate,
  1619. defaultTime: sDefaultTime,
  1620. startOfWeek: sStartOfWeek,
  1621. calendar: sCalendar,
  1622. selectUI: sSelectUI,
  1623. inputOrder: sInputOrder,
  1624. firstDate: sFirstDate,
  1625. lastDate: sLastDate,
  1626. timeZone: sTimeZone,
  1627. hourFormat: sHourFormat,
  1628. minuteFormat: sMinuteFormat,
  1629. secondFormat: sSecondFormat,
  1630. dateTime: iDateTime,
  1631. type: iType,
  1632. display: iDisplay,
  1633. mode: iMode,
  1634. initialState: iInitialState,
  1635. required: bRequired,
  1636. hideAdornments: bHideAdornments,
  1637. suppressDisabled: bSuppressDisabled,
  1638. xSDFormat: bXSDFormat,
  1639. multi: bMulti,
  1640. range: bRange,
  1641. style: sStyle,
  1642. selectDateEditBoxStyle: sSelectDateEditBoxStyle,
  1643. selectDateYearsStyle: sSelectDateYearsStyle,
  1644. selectDateMonthsStyle: sSelectDateMonthsStyle,
  1645. selectDateDaysOfWeekStyle: sSelectDateDaysOfWeekStyle,
  1646. selectDateDaysStyle: sSelectDateDaysStyle,
  1647. endDate: sEndDate,
  1648. endTime: sEndTime,
  1649. suppressExtraPromptNames: bSuppressExtraPromptNames
  1650. };
  1651. }
  1652. if (oProperties.multi)
  1653. {
  1654. if (!oProperties.range) {
  1655. genSelectDateTimeMultipleHTML(oProperties);
  1656. }
  1657. else {
  1658. genSelectDateTimeRangeMultipleHTML(oProperties);
  1659. }
  1660. }
  1661. else
  1662. {
  1663. if (oProperties.range) {
  1664. genSelectDateTimeRangeHTML(oProperties);
  1665. }
  1666. else {
  1667. genSelectDateTimeSingleHTML(oProperties);
  1668. }
  1669. }
  1670. }
  1671. function genSelectDateTimeSingleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultDate, s_DefaultTime, s_StartOfWeek, s_Calendar, s_SelectUI, s_InputOrder, s_FirstDate, s_LastDate, s_TimeZone, s_HourFormat, s_MinuteFormat, s_SecondFormat, i_DateTime, i_Type, i_Display, i_Mode, b_Required, b_HideAdornments, b_SuppressDisabled, b_XSDFormat, s_Style, s_SelectDateEditBoxStyle, s_SelectDateYearsStyle, s_SelectDateMonthsStyle, s_SelectDateDaysOfWeekStyle, s_SelectDateDaysStyle, b_SuppressExtraPromptNames)
  1672. {
  1673. var oProperties = s_PromptId;
  1674. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  1675. {
  1676. oProperties = {
  1677. id: s_PromptId,
  1678. formName: s_FormName,
  1679. parameterName: s_ParameterName,
  1680. submitType: s_SubmitType,
  1681. defaultDate: s_DefaultDate,
  1682. defaultTime: s_DefaultTime,
  1683. startOfWeek: s_StartOfWeek,
  1684. calendar: s_Calendar,
  1685. selectUI: s_SelectUI,
  1686. inputOrder: s_InputOrder,
  1687. firstDate: s_FirstDate,
  1688. lastDate: s_LastDate,
  1689. timeZone: s_TimeZone,
  1690. hourFormat: s_HourFormat,
  1691. minuteFormat: s_MinuteFormat,
  1692. secondFormat: s_SecondFormat,
  1693. dateTime: i_DateTime,
  1694. type: i_Type,
  1695. display: i_Display,
  1696. mode: i_Mode,
  1697. required: b_Required,
  1698. hideAdornments: b_HideAdornments,
  1699. suppressDisabled: b_SuppressDisabled,
  1700. xSDFormat: b_XSDFormat,
  1701. style: s_Style,
  1702. selectDateEditBoxStyle: s_SelectDateEditBoxStyle,
  1703. selectDateYearsStyle: s_SelectDateYearsStyle,
  1704. selectDateMonthsStyle: s_SelectDateMonthsStyle,
  1705. selectDateDaysOfWeekStyle: s_SelectDateDaysOfWeekStyle,
  1706. selectDateDaysStyle: s_SelectDateDaysStyle,
  1707. suppressExtraPromptNames: b_SuppressExtraPromptNames
  1708. };
  1709. }
  1710. var sPromptId = oProperties.id;
  1711. if (!verifyPromptId(sPromptId)) {
  1712. return;
  1713. }
  1714. //skin folder
  1715. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  1716. var sFormName = oProperties.formName;
  1717. if (!sFormName) {
  1718. sFormName = "forms[0]";
  1719. }
  1720. var sParamName = "p_" + oProperties.parameterName;
  1721. if (oProperties.suppressExtraPromptNames) {
  1722. sParamName = sParamName.substring(1);
  1723. }
  1724. if (oProperties.selectUI == "editBox") {
  1725. oProperties.selectDateUI = "editBox";
  1726. }
  1727. else {
  1728. oProperties.selectDateUI = "calendar";
  1729. }
  1730. var sSelectTimeUI = "clock";
  1731. if (oProperties.selectUI == "editBox") {
  1732. sSelectTimeUI = "editBox";
  1733. }
  1734. var oErrorImg = "document." + sFormName + ".imgTest" + sPromptId;
  1735. if (oProperties.hideAdornments) {
  1736. oErrorImg = null;
  1737. }
  1738. var formElementName = sParamName;
  1739. if (oProperties.submitType == K_PRMT_sXML) {
  1740. formElementName = "_oLstDTS_" + sPromptId;
  1741. }
  1742. var HTMLOut = genHiddenInputHTML(sFormName, jsEncodeStr(formElementName), K_PRMT_sEMPTY);
  1743. if (oProperties.submitType == K_PRMT_sXML) {
  1744. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  1745. }
  1746. HTMLOut +=
  1747. "<div class='clsFieldSet' style='"+cssParser(oProperties.style, gsCSS_DEFAULT_STYLE)+"'>" +
  1748. "<table cellpadding='0' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  1749. "<tr>";
  1750. if (!oProperties.required && !oProperties.suppressDisabled)
  1751. {
  1752. HTMLOut +=
  1753. "<td valign='top'>" +
  1754. "<input type='checkbox' value='anyValue' name='chkAnyValue" + sPromptId + "' onclick='selectDateTime" + sPromptId + ".toggleDisable(this.checked)' checked='checked'>" +
  1755. "</td>";
  1756. }
  1757. if (!oProperties.hideAdornments && oProperties.required)
  1758. {
  1759. HTMLOut +=
  1760. "<td valign='top'>" +
  1761. "<table cellpadding='0' cellspacing='0' border='0' height='20'>" +
  1762. "<tr>" +
  1763. "<td><img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='bottom' height='10' width='10' border='0'/></td>" +
  1764. "</tr>" +
  1765. "<tr>" +
  1766. "<td><img id='imgTest" + sPromptId + "' name='imgTest" + sPromptId + "' class='clsErrorRequired' src='" + sSkin + "/prompting/images/error_timed_small_off.gif' align='bottom' height='10' width='10' border='0'/></td>" +
  1767. "</tr>" +
  1768. "</table>" +
  1769. "</td>";
  1770. }
  1771. HTMLOut +=
  1772. "<td valign='top'>" +
  1773. "<table border='0' cellpadding='0' cellspacing='0' class='clsBoundingBox pdt'>";
  1774. if (oProperties.selectUI == "editBox")
  1775. {
  1776. HTMLOut +=
  1777. "<tr>" +
  1778. // Single Date and Single Time prompt controls
  1779. "<td valign='top'><img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/><div id='selectDate" + sPromptId + "'>&nbsp;</div></td>" +
  1780. "</tr>" +
  1781. "<tr>" +
  1782. "<td valign='top'><img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/><div id='selectTime" + sPromptId + "'>&nbsp;</div></td>" +
  1783. "</tr>";
  1784. }
  1785. else
  1786. {
  1787. HTMLOut +=
  1788. "<tr>" +
  1789. // Single Date and Single Time prompt controls
  1790. "<td valign='top'><img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/><div id='selectDate" + sPromptId + "'>&nbsp;</div></td>" +
  1791. "<td valign='top'><img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='5'/><div id='selectTime" + sPromptId + "' >&nbsp;</div></td>" +
  1792. "</tr>";
  1793. }
  1794. HTMLOut +=
  1795. "</table>" +
  1796. "</td>" +
  1797. "</tr>" +
  1798. "</table>" +
  1799. "</div>";
  1800. renderPromptControlHTML("selectDateTime" + sPromptId, HTMLOut);
  1801. var JSOut = K_PRMT_sEMPTY;
  1802. if (oProperties.selectUI == 'editBox')
  1803. {
  1804. JSOut = "genSelectDateSingleHTML(" + generatePromptProperties(oProperties, {
  1805. id: sPromptId,
  1806. formName: sFormName,
  1807. parameterName: "D_" + oProperties.parameterName,
  1808. prmtDefaultValue: '-1',
  1809. defaultValue: K_PRMT_sEMPTY,
  1810. selectDateUI: 'editBox',
  1811. style: cssParser(oProperties.style,"visibility"),
  1812. required: false,
  1813. suppressDisabled: true,
  1814. suppressExtraPromptNames: true}) + ");" +
  1815. "genSelectTimeSingleHTML(" + generatePromptProperties(oProperties, {
  1816. id: sPromptId,
  1817. formName: sFormName,
  1818. parameterName: "T_" + oProperties.parameterName,
  1819. defaultValue: oProperties.defaultTime,
  1820. required: false,
  1821. style: cssParser(oProperties.style,"visibility"),
  1822. suppressDisabled: true,
  1823. suppressExtraPromptNames: true}) + ");";
  1824. }
  1825. else
  1826. {
  1827. JSOut = "genSelectDateSingleHTML(" + generatePromptProperties(oProperties, {
  1828. id: sPromptId,
  1829. formName: sFormName,
  1830. parameterName: "D_" + oProperties.parameterName,
  1831. prmtDefaultValue: '-1',
  1832. defaultValue: K_PRMT_sEMPTY,
  1833. required: false,
  1834. suppressDisabled: true,
  1835. style: cssParser(oProperties.style,"visibility"),
  1836. suppressExtraPromptNames: true}) + ");" +
  1837. "genSelectTimeSingleHTML(" + generatePromptProperties(oProperties, {
  1838. id: sPromptId,
  1839. formName: sFormName,
  1840. parameterName: "T_" + oProperties.parameterName,
  1841. defaultValue: oProperties.defaultTime,
  1842. required: false,
  1843. suppressDisabled: true,
  1844. hideAdornments: true,
  1845. style: cssParser(oProperties.style,"visibility"),
  1846. suppressExtraPromptNames: true}) + ");";
  1847. }
  1848. var sCVObj = getCVInstance(oProperties);
  1849. JSOut += "this.selectDateTime" + sPromptId + " = new CDateTime(pickerControl" + sPromptId + ", timePicker" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + sParamName + "'], document.forms['" + sFormName + "'].elements['" + formElementName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', '" + oProperties.defaultDate + "', " + oProperties.xSDFormat + ", '" + getCVId(oProperties) + "');" +
  1850. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('selectDateTime" + sPromptId + "');";
  1851. executePromptControlJS(JSOut);
  1852. }
  1853. function genSelectDateTimeMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultDate, s_DefaultTime, s_StartOfWeek, s_Calendar, s_SelectUI, s_InputOrder, s_FirstDate, s_LastDate, s_TimeZone, s_HourFormat, s_MinuteFormat, s_SecondFormat, i_DateTime, i_Type, i_Display, i_Mode, b_Required, b_HideAdornments, b_SuppressDisabled, b_XSDFormat, s_Style, s_SelectDateEditBoxStyle, s_SelectDateYearsStyle, s_SelectDateMonthsStyle, s_SelectDateDaysOfWeekStyle, s_SelectDateDaysStyle, b_SuppressExtraPromptNames)
  1854. {
  1855. var oProperties = s_PromptId;
  1856. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  1857. {
  1858. oProperties = {
  1859. id: s_PromptId,
  1860. formName: s_FormName,
  1861. parameterName: s_ParameterName,
  1862. submitType: s_SubmitType,
  1863. defaultDate: s_DefaultDate,
  1864. defaultTime: s_DefaultTime,
  1865. startOfWeek: s_StartOfWeek,
  1866. calendar: s_Calendar,
  1867. selectUI: s_SelectUI,
  1868. inputOrder: s_InputOrder,
  1869. firstDate: s_FirstDate,
  1870. lastDate: s_LastDate,
  1871. timeZone: s_TimeZone,
  1872. hourFormat: s_HourFormat,
  1873. minuteFormat: s_MinuteFormat,
  1874. secondFormat: s_SecondFormat,
  1875. dateTime: i_DateTime,
  1876. type: i_Type,
  1877. display: i_Display,
  1878. mode: i_Mode,
  1879. required: b_Required,
  1880. hideAdornments: b_HideAdornments,
  1881. suppressDisabled: b_SuppressDisabled,
  1882. xSDFormat: b_XSDFormat,
  1883. style: s_Style,
  1884. selectDateEditBoxStyle: s_SelectDateEditBoxStyle,
  1885. selectDateYearsStyle: s_SelectDateYearsStyle,
  1886. selectDateMonthsStyle: s_SelectDateMonthsStyle,
  1887. selectDateDaysOfWeekStyle: s_SelectDateDaysOfWeekStyle,
  1888. selectDateDaysStyle: s_SelectDateDaysStyle,
  1889. suppressExtraPromptNames: b_SuppressExtraPromptNames
  1890. };
  1891. }
  1892. var sPromptId = oProperties.id;
  1893. if (!verifyPromptId(sPromptId)) {
  1894. return;
  1895. }
  1896. //skin folder
  1897. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  1898. var sFormName = oProperties.formName;
  1899. if (!sFormName) {
  1900. sFormName = "forms[0]";
  1901. }
  1902. var sParamName = "p_" + oProperties.parameterName;
  1903. if (oProperties.suppressExtraPromptNames) {
  1904. sParamName = sParamName.substring(1);
  1905. }
  1906. var formElementName = sParamName;
  1907. if (oProperties.submitType == K_PRMT_sXML) {
  1908. formElementName = "_oLstDTM_" + sPromptId;
  1909. }
  1910. var HTMLOut = K_PRMT_sEMPTY;
  1911. if (oProperties.submitType == K_PRMT_sXML) {
  1912. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  1913. }
  1914. HTMLOut +=
  1915. "<div class='clsFieldSet' style='"+cssParser(oProperties.style, gsCSS_DEFAULT_STYLE)+"'>" +
  1916. "<table cellpadding='0' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  1917. "<tr>" +
  1918. "<td colspan='2'><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='1'/></td>" +
  1919. "<td class='clsControlLabel pc'>";
  1920. if (!oProperties.hideAdornments && oProperties.required)
  1921. {
  1922. HTMLOut +=
  1923. "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  1924. }
  1925. HTMLOut +=
  1926. PMT_UIM_CHOICES +
  1927. "</td>" +
  1928. "</tr>" +
  1929. "<tr>" +
  1930. // SelectDateTimeSingle control prompt
  1931. "<td valign='top' id='selectDateTimeSingle" + sPromptId + "'>&nbsp;</td>" +
  1932. "<td valign='top' align='center' class='clsButtonLeftRightPadding'>" +
  1933. "<table border='0' cellpadding='2' cellspacing='0'>" +
  1934. "<tr>" +
  1935. "<td id='getInsertButton" + sPromptId + "'>&nbsp;</td>" +
  1936. "</tr>" +
  1937. "<tr>" +
  1938. "<td id='getRemoveButton" + sPromptId + "'>&nbsp;</td>" +
  1939. "</tr>" +
  1940. "<tr>" +
  1941. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  1942. "</tr>" +
  1943. "</table>" +
  1944. "</td>" +
  1945. "<td valign='top'>" +
  1946. "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  1947. "<tr>" +
  1948. "<td>" +
  1949. "<select name='" + formElementName + "' style='"+cssParser(oProperties.style,"font,text,color,height")+"' class='clsChoicesListbox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleDateTimePicker" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleDateTimePicker" + sPromptId + ".catchDeleteKey(event.keyCode)'></select>" +
  1950. "</td>" +
  1951. "</tr>" +
  1952. "<tr>" +
  1953. "<td><div id='multipleFeedback" + sPromptId + "' class='clsFeedbackWidget'><img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  1954. "</tr>" +
  1955. "<tr>" +
  1956. "<td align='right'>" +
  1957. "<a href='javascript:multipleDateTimePicker" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
  1958. "&nbsp;" +
  1959. "<a href='javascript:multipleDateTimePicker" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
  1960. "</td>" +
  1961. "</tr>" +
  1962. "</table>" +
  1963. "</td>" +
  1964. "</tr>" +
  1965. "</table>" +
  1966. "</div>";
  1967. renderPromptControlHTML("selectDateTime" + sPromptId, HTMLOut);
  1968. var sCVObj = getCVInstance(oProperties);
  1969. var JSOut = "genSelectDateTimeSingleHTML(" + generatePromptProperties(oProperties, {
  1970. id: "Single" + sPromptId,
  1971. formName: sFormName,
  1972. parameterName: "DT_" + oProperties.parameterName,
  1973. defaultDate: K_PRMT_sEMPTY,
  1974. defaultTime: K_PRMT_sEMPTY,
  1975. required: false,
  1976. suppressDisabled: true,
  1977. style:cssParser(oProperties.style,"visibility"),
  1978. hideAdornments: true,
  1979. suppressExtraPromptNames: true}) + ");" +
  1980. "genInsertButtonHTML('" + sPromptId + "', 'multipleDateTimePicker" + sPromptId + ".insert()', 'insertButton" + sPromptId + "');" +
  1981. "genRemoveButtonHTML('" + sPromptId + "', 'multipleDateTimePicker" + sPromptId + ".remove()', 'removeButton" + sPromptId + "');" +
  1982. "this.multipleDateTimePicker" + sPromptId + "= new CMultipleDateTimePicker(selectDateTimeSingle" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['" + sParamName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  1983. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleDateTimePicker" + sPromptId + "');" +
  1984. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleDateTimePicker" + sPromptId + "');";
  1985. executePromptControlJS(JSOut);
  1986. }
  1987. function genSelectDateTimeRangeHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultDate, s_DefaultTime, s_StartOfWeek, s_Calendar, s_SelectUI, s_InputOrder, s_FirstDate, s_LastDate, s_TimeZone, s_HourFormat, s_MinuteFormat, s_SecondFormat, i_DateTime, i_Type, i_Display, i_Mode, i_InitialState, b_Required, b_HideAdornments, b_SuppressDisabled, b_XSDFormat, s_Style, s_SelectDateEditBoxStyle, s_SelectDateYearsStyle, s_SelectDateMonthsStyle, s_SelectDateDaysOfWeekStyle, s_SelectDateDaysStyle, s_EndDate, s_EndTime, b_SuppressExtraPromptNames)
  1988. {
  1989. var oProperties = s_PromptId;
  1990. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  1991. {
  1992. oProperties = {
  1993. id: s_PromptId,
  1994. formName: s_FormName,
  1995. parameterName: s_ParameterName,
  1996. submitType: s_SubmitType,
  1997. defaultDate: s_DefaultDate,
  1998. defaultTime: s_DefaultTime,
  1999. startOfWeek: s_StartOfWeek,
  2000. calendar: s_Calendar,
  2001. selectUI: s_SelectUI,
  2002. inputOrder: s_InputOrder,
  2003. firstDate: s_FirstDate,
  2004. lastDate: s_LastDate,
  2005. timeZone: s_TimeZone,
  2006. hourFormat: s_HourFormat,
  2007. minuteFormat: s_MinuteFormat,
  2008. secondFormat: s_SecondFormat,
  2009. dateTime: i_DateTime,
  2010. type: i_Type,
  2011. display: i_Display,
  2012. mode: i_Mode,
  2013. initialState: i_InitialState,
  2014. required: b_Required,
  2015. hideAdornments: b_HideAdornments,
  2016. suppressDisabled: b_SuppressDisabled,
  2017. xSDFormat: b_XSDFormat,
  2018. style: s_Style,
  2019. selectDateEditBoxStyle: s_SelectDateEditBoxStyle,
  2020. selectDateYearsStyle: s_SelectDateYearsStyle,
  2021. selectDateMonthsStyle: s_SelectDateMonthsStyle,
  2022. selectDateDaysOfWeekStyle: s_SelectDateDaysOfWeekStyle,
  2023. selectDateDaysStyle: s_SelectDateDaysStyle,
  2024. endDate: s_EndDate,
  2025. endTime: s_EndTime,
  2026. suppressExtraPromptNames: b_SuppressExtraPromptNames
  2027. };
  2028. }
  2029. var sPromptId = oProperties.id;
  2030. if (!verifyPromptId(sPromptId)) {
  2031. return;
  2032. }
  2033. //skin folder
  2034. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  2035. var sFormName = oProperties.formName;
  2036. if (!sFormName) {
  2037. sFormName = "forms[0]";
  2038. }
  2039. var sParamName = "p_" + oProperties.parameterName;
  2040. if (oProperties.suppressExtraPromptNames) {
  2041. sParamName = sParamName.substring(1);
  2042. }
  2043. var HTMLOut = K_PRMT_sEMPTY;
  2044. if (oProperties.submitType == K_PRMT_sXML) {
  2045. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  2046. }
  2047. HTMLOut +=
  2048. "<div class='clsFieldSet' style='"+cssParser(oProperties.style, gsCSS_DEFAULT_STYLE)+"'>" +
  2049. "<table cellpadding='0' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  2050. "<tr>" +
  2051. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_FROM + "</td>" +
  2052. "</tr>" +
  2053. "<tr>" +
  2054. "<td nowrap='nowrap'>&nbsp;</td>" +
  2055. "<td class='clsControlLabel pc' nowrap='nowrap' onClick='range" + sPromptId + ".fromGotFocus();' onkeyup='range" + sPromptId + ".fromCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".fromKeyPress(event.keyCode);'>" +
  2056. "<table cellpadding='0' cellspacing='0'>" +
  2057. "<tr>";
  2058. if (!oProperties.required)
  2059. {
  2060. HTMLOut +=
  2061. "<td valign='top'><input name='fromValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'></td>";
  2062. }
  2063. // DateTimeSingle prompt control for start range value
  2064. HTMLOut +=
  2065. "<td id='selectDateTimerange_from" + sPromptId + "' style='width:400px;'>&nbsp;</td>" +
  2066. "</tr>" +
  2067. "</table>" +
  2068. "</td>" +
  2069. "</tr>";
  2070. if (!oProperties.required)
  2071. {
  2072. HTMLOut +=
  2073. "<tr>" +
  2074. "<td nowrap='nowrap'>" +
  2075. "<img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='10'/>" +
  2076. "</td>" +
  2077. "<td class='clsReadOnlyText' onclick=\"document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  2078. "<input value='lowest' name='fromValue" + sPromptId + "' type='radio' checked='true'>" +
  2079. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_EARLIEST_DATE +
  2080. "</td>" +
  2081. "</tr>";
  2082. }
  2083. HTMLOut +=
  2084. "<tr>" +
  2085. "<td nowrap='nowrap' colspan='2'>&nbsp;</td>" +
  2086. "</tr>" +
  2087. "<tr>" +
  2088. "<td class='clsControlLabel pc' colspan='2' nowrap='nowrap'>" + PMT_RNG_TO + "</td>" +
  2089. "</tr>" +
  2090. "<tr>" +
  2091. "<td nowrap='nowrap'>&nbsp;</td>" +
  2092. "<td nowrap='nowrap' onClick='range" + sPromptId + ".toGotFocus();' onkeyup='range" + sPromptId + ".toCheckRadioState(event.keyCode);' onkeypress='range" + sPromptId + ".toKeyPress(event.keyCode);'>" +
  2093. "<table cellpadding='0' cellspacing='0'>" +
  2094. "<tr>";
  2095. if (!oProperties.required)
  2096. {
  2097. HTMLOut +=
  2098. "<td valign='top'><input name='toValue" + sPromptId + "' type='radio' onclick='range" + sPromptId + ".rangeNotify()'></td>";
  2099. }
  2100. // DateTimeSingle prompt control for end range value
  2101. HTMLOut +=
  2102. "<td id='selectDateTimerange_to" + sPromptId + "'>&nbsp;</td>" +
  2103. "</tr>" +
  2104. "</table>" +
  2105. "</td>" +
  2106. "</tr>";
  2107. if (!oProperties.required)
  2108. {
  2109. HTMLOut +=
  2110. "<tr>" +
  2111. "<td nowrap='nowrap'>" +
  2112. "<img src='" + sSkin + "/prompting/images/spacer.gif' height='1' width='10'/>" +
  2113. "</td>" +
  2114. "<td class='clsReadOnlyText' onclick=\"document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][1].checked=true;range" + sPromptId + ".rangeNotify()\">" +
  2115. "<input value='highest' name='toValue" + sPromptId + "' type='radio' checked='true'>" +
  2116. "<img width='10' alt='' src='" + sSkin + "/prompting/images/spacer.gif'/>" + PMT_RNG_LATEST_DATE +
  2117. "</td>" +
  2118. "</tr>";
  2119. }
  2120. HTMLOut +=
  2121. "</table>" +
  2122. "</div>";
  2123. renderPromptControlHTML("selectDateTime" + sPromptId, HTMLOut);
  2124. var JSOut = "genSelectDateTimeSingleHTML(" + generatePromptProperties(oProperties, {
  2125. id: "range_from" + sPromptId,
  2126. formName: sFormName,
  2127. parameterName: "range_from" + oProperties.parameterName,
  2128. submitType: K_PRMT_sEMPTY,
  2129. suppressDisabled: true,
  2130. style: cssParser(oProperties.style,"visibility"),
  2131. suppressExtraPromptNames: true}) + ");" +
  2132. "genSelectDateTimeSingleHTML(" + generatePromptProperties(oProperties, {
  2133. id: "range_to" + sPromptId,
  2134. formName: sFormName,
  2135. parameterName: "range_to" + oProperties.parameterName,
  2136. submitType: K_PRMT_sEMPTY,
  2137. defaultDate: oProperties.endDate,
  2138. defaultTime: oProperties.endTime,
  2139. suppressDisabled: true,
  2140. style: cssParser(oProperties.style,"visibility"),
  2141. suppressExtraPromptNames: true}) + ");";
  2142. if (oProperties.required)
  2143. {
  2144. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + sParamName + "'], null, selectDateTimerange_from" + sPromptId + ", null, null, selectDateTimerange_to" + sPromptId + ", null, 'datetime', true, '" + oProperties.submitType + "', null, '" + getCVId(oProperties) + "');";
  2145. }
  2146. else
  2147. {
  2148. JSOut += "this.range" + sPromptId + " = new CRange(document.forms['" + sFormName + "'].elements['" + sParamName + "'], document.forms['" + sFormName + "'].elements['fromValue" + sPromptId + "'][0], selectDateTimerange_from" + sPromptId + ", null, document.forms['" + sFormName + "'].elements['toValue" + sPromptId + "'][0], selectDateTimerange_to" + sPromptId + ", null, 'datetime', false, '" + oProperties.submitType + "', " + oProperties.initialState + ", '" + getCVId(oProperties) + "');";
  2149. }
  2150. var sCVObj = getCVInstance(oProperties);
  2151. JSOut += sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('range" + sPromptId + "');" +
  2152. sCVObj + "rangeObserverArray = " + sCVObj + "rangeObserverArray.concat('range" + sPromptId + "');";
  2153. executePromptControlJS(JSOut);
  2154. }
  2155. function genSelectDateTimeRangeMultipleHTML(s_PromptId, s_FormName, s_ParameterName, s_SubmitType, s_DefaultDate, s_DefaultTime, s_StartOfWeek, s_Calendar, s_SelectUI, s_InputOrder, s_FirstDate, s_LastDate, s_TimeZone, s_HourFormat, s_MinuteFormat, s_SecondFormat, i_DateTime, i_Type, i_Display, i_Mode, i_InitialState, b_Required, b_HideAdornments, b_SuppressDisabled, b_XSDFormat, s_Style, s_SelectDateEditBoxStyle, s_SelectDateYearsStyle, s_SelectDateMonthsStyle, s_SelectDateDaysOfWeekStyle, s_SelectDateDaysStyle, s_EndDate, s_EndTime, b_SuppressExtraPromptNames)
  2156. {
  2157. var oProperties = s_PromptId;
  2158. if (arguments.length > 1 || typeof oProperties != K_PRMT_sOBJECT)
  2159. {
  2160. oProperties = {
  2161. id: s_PromptId,
  2162. formName: s_FormName,
  2163. parameterName: s_ParameterName,
  2164. submitType: s_SubmitType,
  2165. defaultDate: s_DefaultDate,
  2166. defaultTime: s_DefaultTime,
  2167. startOfWeek: s_StartOfWeek,
  2168. calendar: s_Calendar,
  2169. selectUI: s_SelectUI,
  2170. inputOrder: s_InputOrder,
  2171. firstDate: s_FirstDate,
  2172. lastDate: s_LastDate,
  2173. timeZone: s_TimeZone,
  2174. hourFormat: s_HourFormat,
  2175. minuteFormat: s_MinuteFormat,
  2176. secondFormat: s_SecondFormat,
  2177. dateTime: i_DateTime,
  2178. type: i_Type,
  2179. display: i_Display,
  2180. mode: i_Mode,
  2181. initialState: i_InitialState,
  2182. required: b_Required,
  2183. hideAdornments: b_HideAdornments,
  2184. suppressDisabled: b_SuppressDisabled,
  2185. xSDFormat: b_XSDFormat,
  2186. style: s_Style,
  2187. selectDateEditBoxStyle: s_SelectDateEditBoxStyle,
  2188. selectDateYearsStyle: s_SelectDateYearsStyle,
  2189. selectDateMonthsStyle: s_SelectDateMonthsStyle,
  2190. selectDateDaysOfWeekStyle: s_SelectDateDaysOfWeekStyle,
  2191. selectDateDaysStyle: s_SelectDateDaysStyle,
  2192. endDate: s_EndDate,
  2193. endTime: s_EndTime,
  2194. suppressExtraPromptNames: b_SuppressExtraPromptNames
  2195. };
  2196. }
  2197. var sPromptId = oProperties.id;
  2198. if (!verifyPromptId(sPromptId)) {
  2199. return;
  2200. }
  2201. //skin folder
  2202. var sSkin = (typeof getPromptSkin != K_PRMT_sUNDEFINED ? getPromptSkin() : K_PRMT_sDEFAULTSKIN);
  2203. var sFormName = oProperties.formName;
  2204. if (!sFormName) {
  2205. sFormName = "forms[0]";
  2206. }
  2207. var sParamName = "p_" + oProperties.parameterName;
  2208. if (oProperties.suppressExtraPromptNames) {
  2209. sParamName = sParamName.substring(1);
  2210. }
  2211. var formElementName = sParamName;
  2212. if (oProperties.submitType == K_PRMT_sXML) {
  2213. formElementName = "_oLstDTRM_" + sPromptId;
  2214. }
  2215. var HTMLOut = K_PRMT_sEMPTY;
  2216. if (oProperties.submitType == K_PRMT_sXML) {
  2217. HTMLOut += genHiddenInputHTML(sFormName, jsEncodeStr(sParamName), K_PRMT_sEMPTY);
  2218. }
  2219. HTMLOut +=
  2220. "<div class='clsFieldSet' style='"+cssParser(oProperties.style, gsCSS_DEFAULT_STYLE)+"'>" +
  2221. "<table cellpadding='0' cellspacing='0' border='0' class='clsPromptComponent' style='"+cssParser(oProperties.style,"visibility")+"'>" +
  2222. "<tr>" +
  2223. // SelectDateTimeRange control prompt
  2224. "<td valign='top' id='selectDateTimeRange" + sPromptId + "'>&nbsp;</td>" +
  2225. "<td valign='top' align='center' class='clsButtonLeftRightPadding'>" +
  2226. "<table border='0' cellpadding='0' cellspacing='0'>" +
  2227. "<tr>" +
  2228. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='1' height='16'/></td>" +
  2229. "</tr>" +
  2230. "</table>" +
  2231. "<table border='0' cellpadding='2' cellspacing='0'>" +
  2232. "<tr>" +
  2233. "<td id='getInsertButton" + sPromptId + "'>&nbsp;</td>" +
  2234. "</tr>" +
  2235. "<tr>" +
  2236. "<td id='getRemoveButton" + sPromptId + "'>&nbsp;</td>" +
  2237. "</tr>" +
  2238. "<tr>" +
  2239. "<td><img src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='90' height='1'/></td>" +
  2240. "</tr>" +
  2241. "</table>" +
  2242. "</td>" +
  2243. "<td valign='top'>" +
  2244. "<table border='0' cellspacing='0' cellpadding='0' width='100%'>" +
  2245. "<tr>" +
  2246. "<td class='clsControlLabel pc'>";
  2247. if (oProperties.required)
  2248. {
  2249. HTMLOut +=
  2250. "<img src='" + sSkin + "/prompting/images/icon_required.gif' class='clsErrorRequired' align='top' height='10' width='10' border='0'/>";
  2251. }
  2252. HTMLOut +=
  2253. PMT_UIM_CHOICES +
  2254. "</td>" +
  2255. "</tr>" +
  2256. "<tr>" +
  2257. "<td>" +
  2258. "<select name='" + formElementName + "' style='"+cssParser(oProperties.style,"font,text,color,height")+"' class='clsChoicesListbox pv' multiple='multiple' size='7' onmouseup=\"setTimeout('multipleRange" + sPromptId + ".checkInsertRemove()', 100);\" onkeyup='multipleRange" + sPromptId + ".catchDeleteKey(event.keyCode)'></select>" +
  2259. "</td>" +
  2260. "</tr>" +
  2261. "<tr>" +
  2262. "<td><div id='multipleRangeFeedback" + sPromptId + "' class='clsFeedbackWidget'><img name='sizer" + sPromptId + "' src='" + sSkin + "/prompting/images/spacer.gif' alt='' width='100%' height='3'/></div></td>" +
  2263. "</tr>" +
  2264. "<tr>" +
  2265. "<td align='right'>" +
  2266. "<a href='javascript:multipleRange" + sPromptId + ".selectAll()' class='clsLink pl'>" + PMT_UIM_SELECTALL + "</a>" +
  2267. "&nbsp;" +
  2268. "<a href='javascript:multipleRange" + sPromptId + ".deSelectAll()' class='clsLink pl'>" + PMT_UIM_DESELECTALL + "</a>" +
  2269. "</td>" +
  2270. "</tr>" +
  2271. "</table>" +
  2272. "</td>" +
  2273. "</tr>" +
  2274. "</table>" +
  2275. "</div>";
  2276. renderPromptControlHTML("selectDateTime" + sPromptId, HTMLOut);
  2277. var sCVObj = getCVInstance(oProperties);
  2278. var JSOut = "genSelectDateTimeRangeHTML(" + generatePromptProperties(oProperties, {
  2279. id: "Range" + sPromptId,
  2280. formName: sFormName,
  2281. parameterName: "r_" + oProperties.parameterName,
  2282. style: cssParser(oProperties.style,"visibility"),
  2283. suppressExtraPromptNames: true }) + ");" +
  2284. "genInsertButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".insertChoiceList()', 'insertButton" + sPromptId + "');" +
  2285. "genRemoveButtonHTML('" + sPromptId + "', 'multipleRange" + sPromptId + ".removeChoiceList()', 'removeButton" + sPromptId + "');" +
  2286. "this.multipleRange" + sPromptId + " = new CMultipleRange(rangeRange" + sPromptId + ", document.forms['" + sFormName + "'].elements['" + formElementName + "'], document.forms['" + sFormName + "'].elements['" + sParamName + "'], " + oProperties.required + ", '" + oProperties.submitType + "', document.getElementById('multipleRangeFeedback" + sPromptId + "'), document.sizer" + sPromptId + ", '" + sPromptId + "', document.getElementById('insertButton" + sPromptId + "'), document.getElementById('removeButton" + sPromptId + "'), '" + getCVId(oProperties) + "');" +
  2287. sCVObj + "preProcessControlArray = " + sCVObj + "preProcessControlArray.concat('multipleRange" + sPromptId + "');" +
  2288. sCVObj + "multipleObserverArray = " + sCVObj + "multipleObserverArray.concat('multipleRange" + sPromptId + "');" +
  2289. "multipleRange" + sPromptId + ".initChoiceList();";
  2290. executePromptControlJS(JSOut);
  2291. }