Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1587 lines
42 KiB

  1. <HTML XMLNS:helpcenter>
  2. <HEAD>
  3. <!--
  4. Copyright (c) 2000 Microsoft Corporation
  5. -->
  6. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=windows-1252">
  7. <META HTTP-EQUIV=PICS-Label CONTENT='(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l comment "RSACi North America Server" by "[email protected]" r (n 0 s 0 v 0 l 0))'>
  8. <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
  9. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  10. <LINK ID=Stylesheet_Ref0 href="hcp://system/css/shared.css" rel=STYLESHEET type=text/css>
  11. <LINK ID=Stylesheet_Ref1 href="hcp://system/css/Behaviors.css" rel=STYLESHEET type=text/css>
  12. <LINK ID=Stylesheet_Ref2 href="hcp://system/css/Layout.css" rel=STYLESHEET type=text/css>
  13. <TITLE>Share Windows Help</TITLE>
  14. <SCRIPT ID=Script1_noloc SRC="hcp://system/scripts/Common.js"></SCRIPT>
  15. <helpcenter:events id=idEvents />
  16. <STYLE>
  17. .cell-border
  18. {
  19. border: 1pt solid;
  20. }
  21. .cell-border-left
  22. {
  23. border-bottom: 1pt solid;
  24. }
  25. .cell-border-right
  26. {
  27. border-left : 1pt solid;
  28. border-bottom : 1pt solid;
  29. }
  30. </STYLE>
  31. </HEAD>
  32. <BODY id=noloc0 style="margin: 16px; margin-top: 11px" SCROLL=auto class="sys-rhp-bgcolor sys-color-body">
  33. <!-- ######################################## -->
  34. <DIV id=idMODE_change class="sys-font-body" style="display: none; margin-right:0px">
  35. <DIV id=locCHANGE1 class="sys-font-heading3 sys-rhp-color-title">
  36. <SPAN>Switch Help version</SPAN>
  37. </DIV>
  38. <BR>
  39. <DIV id=locCHANGE2 CLASS="sys-font-body">
  40. Select a version of Help from the list, and click <B>Switch</B>.
  41. </DIV>
  42. <BR>
  43. <TABLE cellspacing=0 cellpadding=0 width=100% class=sys-table-color-border style="border: 1pt solid; padding: 0.5em">
  44. <THEAD CLASS=sys-inlineform-bgcolor3>
  45. <TR>
  46. <TD CLASS="sys-font-body-bold sys-rhp-splash-color-title" id=locCHANGE3>
  47. Available Help:
  48. </TD>
  49. </TR>
  50. </THEAD>
  51. <TBODY id=idCHANGE_resultTable CLASS="sys-font-body">
  52. </TBODY>
  53. <TFOOT CLASS=sys-table-header-bgcolor1>
  54. <TR>
  55. <TD id=noloc1_1 ALIGN=right>
  56. <BUTTON tabIndex=20 id=idCHANGE_exec class="Context-Button sys-font-body" accesskey="w" onClick="CHANGE_onClick();" DISABLED>S<U>w</U>itch</BUTTON>
  57. </TD>
  58. </TR>
  59. </TFOOT>
  60. </TABLE>
  61. </DIV>
  62. <!-- ######################################## -->
  63. <DIV id=idMODE_server class="sys-font-body" style="display: none; margin-right:0px">
  64. <DIV id=locSERVER1 class="sys-font-heading3 sys-rhp-color-title">
  65. <SPAN>Install shared Help</SPAN>
  66. </DIV>
  67. <BR>
  68. <DIV id=locSERVER2 CLASS="sys-font-body">
  69. To find Help content on another Windows computer, enter the computer name, and then click <B>Find</B>.
  70. </DIV>
  71. <BR>
  72. <TABLE cellspacing=0 cellpadding=0 width=100%>
  73. <TR>
  74. <TD WIDTH=100%>
  75. <INPUT ALIGN=baseline tabIndex=1 id=idSERVER_share style="width:100%" onPropertyChange="SERVER_onChange_share();" onKeyUp="SERVER_onKey_share();" class="Context-Input sys-font-body">
  76. </TD>
  77. </TR>
  78. </TABLE>
  79. <DIV id=noloc2_1 style="text-align: right; margin-top: .5em">
  80. <BUTTON tabIndex=3 id=idSERVER_query class="Context-Button sys-font-body" accesskey="F" onClick="SERVER_onClick_query();" DISABLED><U>F</U>ind</BUTTON>
  81. </DIV>
  82. <BR>
  83. <DIV id=locSERVER3 style="height: 2em">Pick a version of Help from the list, and click <B>Install</B>. To start using the newly installed Help content, you can
  84. <ID id=locSERVER3a><A id=locSERVER3b class="sys-link-normal sys-font-body" href="hcp://system/panels/remotehelp.htm?mode=Change" title="Start using Help content you've installed from another computer running Windows XP or Windows Server 2003.">switch from one operating system's Help content to another</A>.</ID>
  85. </DIV><BR>
  86. <DIV id=locSERVER4 style="height: 2em">The following versions of Help are available on <SPAN id=idSERVER_serverSelected></SPAN>:</DIV> <!-- computername -->
  87. <TABLE cellspacing=0 cellpadding=0 width=100% class="sys-table-color-border cell-border" style="padding: 0.5em">
  88. <THEAD CLASS=sys-inlineform-bgcolor3>
  89. <TR>
  90. <TD CLASS="sys-font-body-bold sys-rhp-splash-color-title cell-border-left" id=locSERVER5 width="100%">Name</TD>
  91. <TD CLASS="sys-font-body-bold sys-rhp-splash-color-title cell-border-right" id=locSERVER6 nowrap>Status</TD>
  92. </TR>
  93. </THEAD>
  94. <TBODY id=idSERVER_resultTable CLASS="sys-font-body">
  95. </TBODY>
  96. <TFOOT CLASS="sys-table-header-bgcolor1 sys-font-body">
  97. <TR>
  98. <TD COLSPAN=2>
  99. <TABLE cellspacing=0 cellpadding=0 width=100%>
  100. <TR>
  101. <TD id=noloc2_2 WIDTH=100% style="font-size: 8pt">
  102. <SPAN CLASS='sys-toppane-header-color' id=idSERVER_status></SPAN>
  103. </TD>
  104. <TD id=noloc2_3 ALIGN=right>
  105. <DIV NOWRAP>
  106. <BUTTON tabIndex=20 id=idSERVER_abort class="Context-Button sys-font-body" accesskey="C" onClick="SERVER_onClick_abort();" style="display: none"><U>C</U>ancel</BUTTON>
  107. <SPAN id=noloc2_4 style="width: 15px"></SPAN>
  108. <BUTTON tabIndex=21 id=idSERVER_install class="Context-Button sys-font-body" accesskey="I" onClick="SERVER_onClick_install();" DISABLED><U>I</U>nstall</BUTTON>
  109. </DIV>
  110. </TD>
  111. </TR>
  112. </TABLE>
  113. </TR>
  114. </TFOOT>
  115. </TABLE>
  116. </DIV>
  117. <!-- ######################################## -->
  118. <DIV id=idMODE_disk class="sys-font-body" style="display: none; margin-right:0px">
  119. <DIV id=locDISK1 class="sys-font-heading3 sys-rhp-color-title">
  120. <SPAN>Install Help from disk</SPAN>
  121. </DIV>
  122. <BR>
  123. <DIV id=locDISK2 CLASS="sys-font-body">
  124. To find Help content on a CD or disk image, enter the location, and then click <B>Find</B>.
  125. </DIV>
  126. <BR>
  127. <TABLE cellspacing=0 cellpadding=0 width=100%>
  128. <TR>
  129. <TD WIDTH=100%>
  130. <INPUT tabIndex=1 id=idDISK_dir style="width:100%" onPropertyChange="DISK_onChange_dir();" onKeyUp="DISK_onKey_dir();" class="Context-Input sys-font-body">
  131. </TD>
  132. <TD id=noloc3_1 style="padding-left: .2em">
  133. <BUTTON tabIndex=2 id=idDISK_browse class="Context-Button sys-font-body" accesskey="B" onClick="DISK_onClick_browse();"><U>B</U>rowse...</BUTTON>
  134. </TD>
  135. </TR>
  136. </TABLE>
  137. <DIV id=noloc3_2 style="text-align: right; margin-top: .5em">
  138. <BUTTON tabIndex=3 id=idDISK_query class="Context-Button sys-font-body" accesskey="F" onClick="DISK_onClick_query();" DISABLED><U>F</U>ind</BUTTON>
  139. </DIV>
  140. <BR>
  141. <DIV id=locDISK3 style="height: 2em">Pick a version of Help from the list, and click <B>Install</B>. To start using the newly installed Help content, you can
  142. <ID id=locDISK3a><A id=locDISK3b class="sys-link-normal sys-font-body" href="hcp://system/panels/remotehelp.htm?mode=Change" title="Start using Help content you've installed from another computer running Windows XP or Windows Server 2003.">switch from one operating system's Help content to another</A>.</ID>
  143. </DIV><BR>
  144. <DIV id=locDISK4 style="height: 2em">The following versions of Help are available on <SPAN id=idDISK_dirSelected></SPAN>:</DIV>
  145. <TABLE cellspacing=0 cellpadding=0 width=100% class="sys-table-color-border cell-border" style="padding: 0.5em">
  146. <THEAD CLASS=sys-inlineform-bgcolor3>
  147. <TR>
  148. <TD CLASS="sys-font-body-bold sys-rhp-splash-color-title cell-border-left" id=locDISK5 width="100%">Name</TD>
  149. <TD CLASS="sys-font-body-bold sys-rhp-splash-color-title cell-border-right" id=locDISK6>Status</TD>
  150. </TR>
  151. </THEAD>
  152. <TBODY id=idDISK_resultTable CLASS="sys-font-body">
  153. </TBODY>
  154. <TFOOT CLASS="sys-table-header-bgcolor1 sys-font-body">
  155. <TR>
  156. <TD COLSPAN=2>
  157. <TABLE cellspacing=0 cellpadding=0 width=100%>
  158. <TR>
  159. <TD id=noloc3_3 WIDTH=100% style="font-size: 8pt">
  160. <SPAN CLASS='sys-toppane-header-color' id=idDISK_status></SPAN>
  161. </TD>
  162. <TD id=noloc3_4 ALIGN=right>
  163. <DIV NOWRAP>
  164. <BUTTON tabIndex=20 id=idDISK_abort class="Context-Button sys-font-body" accesskey="C" onClick="DISK_onClick_abort();" style="display: none"><U>C</U>ancel</BUTTON>
  165. <SPAN id=noloc3_5 style="width: 15px"></SPAN>
  166. <BUTTON tabIndex=21 id=idDISK_install class="Context-Button sys-font-body" accesskey="I" onClick="DISK_onClick_install();" DISABLED><U>I</U>nstall</BUTTON>
  167. </DIV>
  168. </TD>
  169. </TR>
  170. </TABLE>
  171. </TR>
  172. </TFOOT>
  173. </TABLE>
  174. </DIV>
  175. <!-- ######################################## -->
  176. <DIV id=idMODE_share class="sys-font-body" style="display: none; margin-right:0px">
  177. <DIV id=locSHARE1 class="sys-font-heading3 sys-rhp-color-title">
  178. <SPAN>Share Help</SPAN>
  179. </DIV>
  180. <BR>
  181. <DIV id=locSHARE2 CLASS="sys-font-body">
  182. You can share the Help content on your computer with other users on your network. To share Help, click <B>Shared</B> or <B>Not Shared</B> next to the appropriate Help content, and then click <B>Apply</B>.
  183. </DIV>
  184. <BR>
  185. <TABLE cellspacing=0 cellpadding=0 width=100% class="sys-table-color-border cell-border" style="padding: 0.5em">
  186. <THEAD CLASS=sys-inlineform-bgcolor3>
  187. <TR>
  188. <TD CLASS="sys-font-body-bold sys-rhp-splash-color-title cell-border-left" id=locSHARE3 COLSPAN=3>Currently installed Help</TD>
  189. </TR>
  190. </THEAD>
  191. <TBODY id=idSHARE_resultTable CLASS="sys-font-body">
  192. </TBODY>
  193. <TFOOT CLASS="sys-table-header-bgcolor1 sys-font-body">
  194. <TR>
  195. <TD id=noloc4_1 ALIGN=right COLSPAN=3>
  196. <DIV NOWRAP>
  197. <BUTTON tabIndex=31 id=idSHARE_submit class="Context-Button sys-font-body" accesskey="A" onClick="SHARE_onClick_submit();" DISABLED><U>A</U>pply</BUTTON>
  198. <SPAN id=noloc4_2 style="width: 15px"></SPAN>
  199. <BUTTON tabIndex=32 id=idSHARE_reset class="Context-Button sys-font-body" accesskey="C" onClick="SHARE_onClick_reset();" DISABLED><U>C</U>ancel</BUTTON>
  200. </DIV>
  201. </TD>
  202. </TR>
  203. </TFOOT>
  204. </TABLE>
  205. <BR>
  206. <DIV id=idSHARE_tsblock>
  207. <SELECT id=idSHARE_ts NAME="ts" TITLE="Select a Help" SIZE="1" onchange='SHARE_onChange_ts()' CLASS="sys-font-body"></SELECT>
  208. <LABEL id=locSHARE4 class="sys-font-body" FOR=idSHARE_ts> : default Help for users who connect to this computer remotely</LABEL>
  209. </DIV>
  210. </DIV>
  211. <!-- ######################################## -->
  212. <DIV id=idMODE_remove class="sys-font-body" style="display: none; margin-right:0px">
  213. <DIV id=locREMOVE1 class="sys-font-heading3 sys-rhp-color-title">
  214. <SPAN>Remove Help</SPAN>
  215. </DIV>
  216. <BR>
  217. <DIV id=locREMOVE2 CLASS="sys-font-body">
  218. To uninstall Help from your computer, pick a version of Help from the list, and click <B>Remove</B>. You cannot uninstall Help that is currently in use.
  219. </DIV>
  220. <BR>
  221. <TABLE cellspacing=0 cellpadding=0 width=100% class=sys-table-color-border style="border: 1pt solid; padding: 0.5em">
  222. <THEAD CLASS=sys-inlineform-bgcolor3>
  223. <TR>
  224. <TD CLASS="sys-font-body-bold sys-rhp-splash-color-title" id=locREMOVE3>
  225. The following Help can be uninstalled
  226. </TD>
  227. </TR>
  228. </THEAD>
  229. <TBODY id=idREMOVE_resultTable CLASS="sys-font-body">
  230. </TBODY>
  231. <TFOOT CLASS=sys-table-header-bgcolor1>
  232. <TR>
  233. <TD id=noloc5_1 ALIGN=right>
  234. <BUTTON tabIndex=20 id=idREMOVE_exec class="Context-Button sys-font-body" accesskey="R" onClick="REMOVE_onClick();" DISABLED><U>R</U>emove</BUTTON>
  235. </TD>
  236. </TR>
  237. </TFOOT>
  238. </TABLE>
  239. </DIV>
  240. <DIV id=idWARNING style="display: none">
  241. <DIV id=locWARNING1 CLASS="sys-font-body">
  242. <BR>
  243. <B>Note</B> Help for other operating systems contains references to some features that are not on your
  244. computer. Links to these features will not respond when clicked.
  245. </DIV>
  246. </DIV>
  247. </BODY>
  248. <SCRIPT DEFER>
  249. //
  250. // localizable variables/filenames
  251. //
  252. var L_NOTACTIVE_Message = "" ;
  253. var L_QUERYING_Message = "Collecting information..." ;
  254. var L_QUERIED_Message = "Ready to execute." ;
  255. var L_COPYINGDB_Message = "Copying the database..." ;
  256. var L_COPYINGFILES_Message = "Copying file: " ;
  257. var L_INSTALLING_Message = "Finalizing installation..." ;
  258. var L_INSTALLED_Message = "Installation complete." ;
  259. var L_UNINSTALLING_Message = "Finalizing uninstallation...";
  260. var L_UNINSTALLED_Message = "Uninstallation complete." ;
  261. var L_ABORTING_Message = "Cancelling..." ;
  262. var L_ABORTED_Message = "Cancelled." ;
  263. var L_FAILED_Message = "Operation failed: " ;
  264. var L_AlreadyInstalled_Text = "Already Installed";
  265. var L_Available_Text = "Available";
  266. var L_NotAvailable_Text = "Not Available";
  267. var L_Shared_Text = "Shared";
  268. var L_NotShared_Text = "Not Shared";
  269. var L_HelpContentDir_Text = "Look for Help content in:";
  270. var L_AbortInstall_Message = "Do you want to cancel the installation?";
  271. var L_DenyUninstall1_Message = "You are currently using ";
  272. var L_DenyUninstall2_Message = ". Please select another view before uninstalling.";
  273. var L_DenyUninstall3_Message = "This Help Version is in use, it cannot be uninstalled.";
  274. var L_NoExport_Message = "The specified server doesn't export any Help version.";
  275. var L_Error80004004_Message = "The operation has been cancelled.";
  276. var L_Error80004005_Message = "The operation has failed.";
  277. var L_Error800706BA_Message = "Windows cannot connect to the specified Help server. Either the server name was typed incorrectly, or the Help server is not connected to the network.";
  278. var L_Error80040154_Message = "Windows Help content has not been shared from this server.";
  279. var L_Error8007007B_Message = "You entered an incorrect path.";
  280. var L_Error80070043_Message = "You don't have enough permissions to access the network.";
  281. var L_Error80070005_Message = "You don't have enough permissions to access the resource.";
  282. var L_Error80070002_Message = "Windows could not find Help content in this location. Either the location name was typed incorrectly, or there is no Help content available.";
  283. var g_StatusLookup = [];
  284. g_StatusLookup[pchealth.SHT_NOTACTIVE ] = L_NOTACTIVE_Message;
  285. g_StatusLookup[pchealth.SHT_QUERYING ] = L_QUERYING_Message;
  286. g_StatusLookup[pchealth.SHT_QUERIED ] = L_QUERIED_Message;
  287. g_StatusLookup[pchealth.SHT_COPYING_DB ] = L_COPYINGDB_Message;
  288. g_StatusLookup[pchealth.SHT_INSTALLING ] = L_INSTALLING_Message;
  289. g_StatusLookup[pchealth.SHT_INSTALLED ] = L_INSTALLED_Message;
  290. g_StatusLookup[pchealth.SHT_UNINSTALLING] = L_UNINSTALLING_Message;
  291. g_StatusLookup[pchealth.SHT_UNINSTALLED ] = L_UNINSTALLED_Message;
  292. g_StatusLookup[pchealth.SHT_ABORTING ] = L_ABORTING_Message;
  293. g_StatusLookup[pchealth.SHT_ABORTED ] = L_ABORTED_Message;
  294. ////////////////////
  295. var REG_DEFAULTTERMINALSERVERSKU = "HKLM\\SOFTWARE\\Microsoft\\PCHealth\\HelpCtr\\DefaultTerminalServerSKU";
  296. var REG_DEFAULTTERMINALSERVERLANGUAGE = "HKLM\\SOFTWARE\\Microsoft\\PCHealth\\HelpCtr\\DefaultTerminalServerLanguage";
  297. var REG_PERSIST_DISK = "HKLM\\SOFTWARE\\Microsoft\\PCHealth\\HelpCtr\\UserSettings\\RemoteHelp_Disk";
  298. var REG_PERSIST_SERVER = "HKLM\\SOFTWARE\\Microsoft\\PCHealth\\HelpCtr\\UserSettings\\RemoteHelp_Server";
  299. ////////////////////////////////////////////////////////////////////////////////
  300. var g_db = pchealth.Database;
  301. var g_skuMachine = pchealth.UserSettings.MachineSKU;
  302. var g_skuUser = pchealth.UserSettings.CurrentSKU;
  303. var g_fTS = pchealth.UserSettings.IsTerminalServer;
  304. var g_collLocal = null;
  305. var g_collServer = null;
  306. var g_collDisk = null;
  307. var g_executing = false;
  308. var g_SelectedRow = null;
  309. var g_SelectedSKU = null;
  310. var g_SelectedSKU_TS = null;
  311. try
  312. {
  313. g_TS_DefaultSKU = pchealth.RegRead( REG_DEFAULTTERMINALSERVERSKU );
  314. g_TS_DefaultLanguage = pchealth.RegRead( REG_DEFAULTTERMINALSERVERLANGUAGE );
  315. }
  316. catch(e)
  317. {
  318. }
  319. if(!g_TS_DefaultSKU ) g_TS_DefaultSKU = "";
  320. if(!g_TS_DefaultLanguage) g_TS_DefaultLanguage = "";
  321. if(g_fTS == false)
  322. {
  323. idSHARE_tsblock.style.display = "none";
  324. }
  325. ////////////////////////////////////////////////////////////////////////////////
  326. function CancelEvent( event )
  327. {
  328. event.cancelBubble = true;
  329. event.returnValue = false;
  330. }
  331. function HideAll()
  332. {
  333. idMODE_change.style.display = "none";
  334. idMODE_server.style.display = "none";
  335. idMODE_disk .style.display = "none";
  336. idMODE_share .style.display = "none";
  337. idWARNING .style.display = "none";
  338. }
  339. function GetSKUDisplayName( sku )
  340. {
  341. var text = sku.DisplayName;
  342. if(g_skuMachine.Language != sku.Language) text += " / " + pchealth.TextHelpers.GetLCIDDisplayString( sku.Language );
  343. return text;
  344. }
  345. function SameSKU( a, b )
  346. {
  347. try
  348. {
  349. return (a.SKU == b.SKU && a.Language == b.Language);
  350. }
  351. catch(e)
  352. {
  353. }
  354. return false;
  355. }
  356. function GetErrorMessage( hr )
  357. {
  358. switch(hr)
  359. {
  360. case -2147467260/*0x80004004*/: return L_Error80004004_Message;
  361. case -2147467259/*0x80004005*/: return L_Error80004005_Message;
  362. case -2147023174/*0x800706BA*/: return L_Error800706BA_Message;
  363. case -2147024773/*0x8007007B*/: return L_Error8007007B_Message;
  364. case -2147024829/*0x80070043*/: return L_Error80070043_Message;
  365. case -2147024891/*0x80070005*/: return L_Error80070005_Message;
  366. case -2147024894/*0x80070002*/: return L_Error80070002_Message;
  367. case -2147221164/*0x80040154*/: return L_Error80040154_Message;
  368. }
  369. return pchealth.FormatError( hr );
  370. }
  371. function GetStatus( obj, status, hr, file )
  372. {
  373. if(status == pchealth.SHT_COPYING_FILES)
  374. {
  375. status = L_COPYINGFILES_Message + file;
  376. }
  377. else
  378. {
  379. status = g_StatusLookup[status];
  380. }
  381. if(!status) status = L_FAILED_Message + GetErrorMessage( hr );
  382. return status;
  383. }
  384. ////////////////////
  385. function onKeyPress_Click()
  386. {
  387. if(event.keyCode == 13 || event.keyCode == 32)
  388. {
  389. var obj = this;
  390. while(obj)
  391. {
  392. if(obj.onclick) { obj.onclick(); return; }
  393. obj = obj.parentElement;
  394. }
  395. }
  396. }
  397. function onClick_Select()
  398. {
  399. CancelEvent( event ); if(g_executing) return;
  400. if(this.state_Selectable == false) return;
  401. // Unselect the previous selection.
  402. if(g_SelectedRow) g_SelectedRow.className = "";
  403. // Save the newly selected element.
  404. g_SelectedRow = this;
  405. g_SelectedSKU = this.state_SKU;
  406. g_SelectedRow.className = "sys-inlineform-bgcolor2";
  407. switch(mode)
  408. {
  409. case "Change" : CHANGE_select(); break;
  410. case "AddServer" : SERVER_select(); break;
  411. case "AddDisk" : DISK_select(); break;
  412. case "SetSharing": SHARE_select(); break;
  413. case "Remove" : REMOVE_select(); break;
  414. }
  415. }
  416. function onDblClick_Select()
  417. {
  418. CancelEvent( event ); if(g_executing) return;
  419. if(this.state_Selectable == false) return;
  420. switch(mode)
  421. {
  422. case "Change" : CHANGE_onClick(); break;
  423. case "AddServer" : break;
  424. case "AddDisk" : break;
  425. case "SetSharing": break;
  426. case "Remove" : break;
  427. }
  428. }
  429. function CancelEventDirect()
  430. {
  431. CancelEvent( event );
  432. }
  433. function SetupRowEvents( oRow )
  434. {
  435. oRow.onclick = onClick_Select;
  436. oRow.ondblclick = onDblClick_Select;
  437. oRow.onselect = CancelEventDirect;
  438. oRow.onselectstart = CancelEventDirect;
  439. }
  440. function CreateRowForSKU( sku, table, fSelectable )
  441. {
  442. var oRow = table.insertRow();
  443. var oCell;
  444. var text;
  445. var status;
  446. var className;
  447. oRow.state_SKU = sku;
  448. oRow.state_Selectable = false;
  449. if(sku)
  450. {
  451. if(fSelectable) SetupRowEvents( oRow );
  452. if(sku.IsInstalled)
  453. {
  454. status = L_AlreadyInstalled_Text;
  455. className = "sys-color-body-alert";
  456. }
  457. else if(sku.CanInstall)
  458. {
  459. status = L_Available_Text;
  460. className = "";
  461. oRow.state_Selectable = true;
  462. }
  463. else
  464. {
  465. status = L_NotAvailable_Text;
  466. className = "sys-color-body-sec sys-inlineform-bgcolor1";
  467. }
  468. text = GetSKUDisplayName( sku );
  469. status = pchealth.TextHelpers.HTMLEscape( status );
  470. }
  471. else
  472. {
  473. text = " ";
  474. status = "&nbsp;";
  475. className = "sys-inlineform-bgcolor1";
  476. }
  477. oCell = oRow.insertCell();
  478. oCell.innerText = text;
  479. oCell.className = "cell-border-left";
  480. oCell.style.width = "100%";
  481. if(oRow.state_Selectable) oCell.tabIndex = 10;
  482. if(sku) oCell.onkeypress = onKeyPress_Click;
  483. oCell = oRow.insertCell();
  484. oCell.innerHTML = "<DIV NOWRAP>" + status + "</DIV>";
  485. oCell.className = "sys-table-color-border cell-border-right";
  486. oRow.className = className;
  487. }
  488. function CreateRowForSelect( sku, table )
  489. {
  490. var oRow = table.insertRow();
  491. var oCell = oRow.insertCell();
  492. var text;
  493. var className;
  494. SetupRowEvents( oRow );
  495. oRow.state_SKU = sku;
  496. oRow.state_Selectable = false;
  497. if(sku)
  498. {
  499. text = GetSKUDisplayName( sku );
  500. if(SameSKU( sku, g_skuUser ))
  501. {
  502. className = "sys-inlineform-bgcolor2";
  503. g_SelectedRow = oRow;
  504. g_SelectedSKU = sku;
  505. }
  506. else
  507. {
  508. className = "";
  509. }
  510. oRow.state_Selectable = true;
  511. }
  512. else
  513. {
  514. text = " ";
  515. className = "sys-inlineform-bgcolor1";
  516. }
  517. oCell.innerText = text;
  518. oCell.className = "cell-border-left";
  519. oCell.tabIndex = 10;
  520. oCell.onkeypress = onKeyPress_Click;
  521. oRow.className = className;
  522. }
  523. function CreateRowForShare( sku, table, options )
  524. {
  525. var oRow = table.insertRow();
  526. var oCell;
  527. var oOption;
  528. var text;
  529. var status1;
  530. var status2;
  531. var className;
  532. oRow.state_SKU = sku;
  533. oRow.state_Selectable = false;
  534. if(sku)
  535. {
  536. var id = sku.SKU + sku.Language;
  537. oRow.state_SKU = sku;
  538. oRow.state_Exported = sku.Exported;
  539. oRow.state_Selectable = true;
  540. status1 = "<INPUT type=radio tabIndex=10 name='" + id + "'" + ( sku.Exported ? " CHECKED" : "") + ">" + L_Shared_Text;
  541. status2 = "<INPUT type=radio tabIndex=10 name='" + id + "'" + (!sku.Exported ? " CHECKED" : "") + ">" + L_NotShared_Text;
  542. className = "";
  543. text = GetSKUDisplayName( sku );
  544. oOption = document.createElement("OPTION");
  545. options.add( oOption );
  546. oOption.innerText = text;
  547. oOption.value = id;
  548. if(sku.SKU == g_TS_DefaultSKU && sku.Language == g_TS_DefaultLanguage)
  549. {
  550. g_SelectedSKU_TS = sku;
  551. oOption.selected = true;
  552. }
  553. }
  554. else
  555. {
  556. text = " ";
  557. status1 = null;
  558. status2 = null;
  559. className = "sys-inlineform-bgcolor1";
  560. }
  561. oCell = oRow.insertCell();
  562. oCell.innerText = text;
  563. oCell.className = "cell-border-left";
  564. if(oRow.state_Selectable) oCell.tabIndex = 10;
  565. oCell = oRow.insertCell();
  566. oCell.className = "sys-table-color-border cell-border-right";
  567. oCell.style.width = "7em";
  568. if(status1)
  569. {
  570. oCell.innerHTML = status1;
  571. oCell.firstChild.payload = oRow;
  572. oCell.firstChild.payload_state = true;
  573. }
  574. else
  575. {
  576. oCell.innerText = " ";
  577. }
  578. oCell = oRow.insertCell();
  579. oCell.className = "sys-table-color-border cell-border-left";
  580. oCell.style.width = "8em";
  581. if(status2)
  582. {
  583. oCell.innerHTML = status2;
  584. oCell.firstChild.payload = oRow;
  585. oCell.firstChild.payload_state = false;
  586. }
  587. else
  588. {
  589. oCell.innerText = " ";
  590. }
  591. oRow.className = className;
  592. if(sku) oRow.onclick = SHARE_onClick_radio;
  593. }
  594. ////////////////////////////////////////////////////////////////////////////////
  595. function CHANGE_init()
  596. {
  597. HideAll(); idMODE_change.style.display = ""; idWARNING.style.display = "";
  598. CHANGE_display();
  599. }
  600. function CHANGE_display()
  601. {
  602. var count = 0;
  603. Common_ClearTable( idCHANGE_resultTable );
  604. idCHANGE_exec.disabled = true;
  605. g_collLocal = g_db.InstalledSKUs;
  606. for(var e = new Enumerator( g_collLocal ); !e.atEnd(); e.moveNext())
  607. {
  608. var sku = e.item();
  609. CreateRowForSelect( sku, idCHANGE_resultTable ); count++;
  610. }
  611. while(count < 4)
  612. {
  613. CreateRowForSelect( null, idCHANGE_resultTable ); count++;
  614. }
  615. }
  616. function CHANGE_select()
  617. {
  618. idCHANGE_exec.disabled = SameSKU( g_SelectedSKU, g_skuUser );
  619. }
  620. ////////////////////
  621. function CHANGE_onClick()
  622. {
  623. CancelEvent( event ); if(g_executing) return;
  624. if(idCHANGE_exec.disabled == false && g_SelectedSKU)
  625. {
  626. pchealth.UserSettings.Select( g_SelectedSKU.SKU, g_SelectedSKU.Language );
  627. pchealth.HelpSession.ChangeContext( "HomePage", "refresh" );
  628. }
  629. }
  630. ////////////////////////////////////////////////////////////////////////////////
  631. var g_SERVER_state;
  632. function SERVER_init()
  633. {
  634. HideAll(); idMODE_server.style.display = ""; idWARNING.style.display = "";
  635. SERVER_reset();
  636. }
  637. function SERVER_reset()
  638. {
  639. var value;
  640. try
  641. {
  642. value = pchealth.RegRead( REG_PERSIST_SERVER );
  643. }
  644. catch(e)
  645. {
  646. }
  647. if(!value) value = "";
  648. idSERVER_share.value = value;
  649. idSERVER_serverSelected.value = "";
  650. SERVER_display( true );
  651. SERVER_setstate( "idle" );
  652. }
  653. function SERVER_setstate( state )
  654. {
  655. var fINPUT = false;
  656. var fQUERY = false;
  657. var fABORT = false;
  658. var fACTION = false;
  659. g_executing = false;
  660. switch( g_SERVER_state = state )
  661. {
  662. case "idle":
  663. fINPUT = true;
  664. fQUERY = (idSERVER_share.value.length != 0);
  665. break;
  666. case "query":
  667. fABORT = true;
  668. g_collServer = null;
  669. SERVER_display( false );
  670. break;
  671. case "ready":
  672. fINPUT = true;
  673. fQUERY = true;
  674. SERVER_display( true );
  675. break;
  676. case "installing":
  677. fABORT = true;
  678. g_executing = true;
  679. break;
  680. }
  681. idSERVER_share.disabled = fINPUT ? false : true;
  682. idSERVER_query.disabled = fQUERY ? false : true;
  683. idSERVER_abort.style.display = fABORT ? "" : "none";
  684. idSERVER_install.disabled = fACTION ? false : true;
  685. }
  686. function SERVER_display( fSelectable )
  687. {
  688. var count = 0;
  689. g_SelectedRow = null;
  690. g_SelectedSKU = null;
  691. Common_ClearTable( idSERVER_resultTable );
  692. if(g_collServer)
  693. {
  694. for(var e = new Enumerator( g_collServer ); !e.atEnd(); e.moveNext())
  695. {
  696. CreateRowForSKU( e.item(), idSERVER_resultTable, fSelectable ); count++;
  697. }
  698. }
  699. while(count < 4)
  700. {
  701. CreateRowForSKU( null, idSERVER_resultTable, false ); count++;
  702. }
  703. }
  704. function SERVER_select()
  705. {
  706. if(g_SelectedRow)
  707. {
  708. idSERVER_install.disabled = false;
  709. }
  710. else
  711. {
  712. idSERVER_install.disabled = true;
  713. }
  714. }
  715. function SERVER_onChange_share()
  716. {
  717. if(event.propertyName == 'value')
  718. {
  719. var fDIS = (idSERVER_share.value.length == 0);
  720. idSERVER_query.disabled = fDIS;
  721. }
  722. }
  723. function SERVER_onKey_share()
  724. {
  725. var fDIS = (idSERVER_share.value.length == 0);
  726. idSERVER_query.disabled = fDIS;
  727. if(fDIS == false && event.keyCode == 13) SERVER_onClick_query();
  728. }
  729. function SERVER_onClick_query()
  730. {
  731. idSERVER_serverSelected.innerText = idSERVER_share.value;
  732. SERVER_selected_query();
  733. }
  734. function SERVER_selected_query()
  735. {
  736. SERVER_setstate( "query" )
  737. g_collServer = g_db.ConnectToServer( idSERVER_serverSelected.innerText, SERVER_notifyForServer );
  738. }
  739. function SERVER_onClick_install()
  740. {
  741. if(g_SelectedSKU)
  742. {
  743. SERVER_setstate( "installing" );
  744. idEvents.onBeforeContextSwitch = SERVER_askToAbort;
  745. idEvents.onBeforeNavigate = SERVER_askToAbort;
  746. idEvents.onShutdown = SERVER_askToAbort;
  747. g_SelectedSKU.onStatusChange = SERVER_notify;
  748. g_SelectedSKU.Install();
  749. }
  750. }
  751. function SERVER_onClick_abort()
  752. {
  753. if(g_db)
  754. {
  755. g_db.Abort();
  756. }
  757. if(g_SelectedSKU)
  758. {
  759. g_SelectedSKU.Abort();
  760. }
  761. }
  762. function SERVER_notifyForServer( obj, status, hr, file )
  763. {
  764. if(g_SERVER_state == "query")
  765. {
  766. if(status == pchealth.SHT_ABORTING) return;
  767. if(status == pchealth.SHT_ABORTED)
  768. {
  769. status = pchealth.SHT_QUERIED;
  770. }
  771. }
  772. idSERVER_status.innerText = GetStatus( obj, status, hr, file );
  773. if(status == pchealth.SHT_QUERYING)
  774. {
  775. SERVER_display( false );
  776. }
  777. if(status == pchealth.SHT_QUERIED)
  778. {
  779. if(g_collServer && g_collServer.Count == 0)
  780. {
  781. idSERVER_status.innerText = L_Error80040154_Message;
  782. SERVER_setstate( "idle" );
  783. }
  784. else
  785. {
  786. try
  787. {
  788. pchealth.RegWrite( REG_PERSIST_SERVER, idSERVER_share.value );
  789. }
  790. catch(e)
  791. {
  792. }
  793. SERVER_setstate( "ready" );
  794. }
  795. return;
  796. }
  797. if(status == pchealth.SHT_ABORTED ||
  798. status == pchealth.SHT_FAILED )
  799. {
  800. SERVER_setstate( "idle" );
  801. }
  802. }
  803. function SERVER_askToAbort()
  804. {
  805. var res = pchealth.MessageBox( L_AbortInstall_Message, "YESNO" );
  806. if(res == "NO")
  807. {
  808. CancelEvent( event );
  809. event.srcElement.data.Cancel = true;
  810. }
  811. else
  812. {
  813. idEvents.onBeforeContextSwitch = null;
  814. idEvents.onBeforeNavigate = null;
  815. idEvents.onShutdown = null;
  816. SERVER_onClick_abort();
  817. }
  818. }
  819. function SERVER_notify( obj, status, hr, file )
  820. {
  821. idSERVER_status.innerText = GetStatus( obj, status, hr, file );
  822. if(status == pchealth.SHT_INSTALLED ||
  823. status == pchealth.SHT_ABORTED ||
  824. status == pchealth.SHT_FAILED )
  825. {
  826. idEvents.onBeforeContextSwitch = null;
  827. idEvents.onBeforeNavigate = null;
  828. idEvents.onShutdown = null;
  829. if (status != pchealth.SHT_FAILED)
  830. SERVER_setstate( "ready" );
  831. else
  832. SERVER_selected_query();
  833. }
  834. }
  835. ////////////////////////////////////////////////////////////////////////////////
  836. var g_DISK_state;
  837. function DISK_init()
  838. {
  839. HideAll(); idMODE_disk.style.display = ""; idWARNING.style.display = "";
  840. DISK_reset();
  841. }
  842. function DISK_reset()
  843. {
  844. var value;
  845. try
  846. {
  847. value = pchealth.RegRead( REG_PERSIST_DISK );
  848. }
  849. catch(e)
  850. {
  851. }
  852. if(!value) value = "";
  853. idDISK_dir.value = value;
  854. idDISK_dirSelected.value = "";
  855. DISK_display( true );
  856. DISK_setstate( "idle" );
  857. }
  858. function DISK_setstate( state )
  859. {
  860. var fINPUT = false;
  861. var fQUERY = false;
  862. var fABORT = false;
  863. var fACTION = false;
  864. g_executing = false;
  865. switch( g_DISK_state = state )
  866. {
  867. case "idle":
  868. fINPUT = true;
  869. fQUERY = (idDISK_dir.value.length != 0);
  870. break;
  871. case "query":
  872. fABORT = true;
  873. g_collDisk = null;
  874. DISK_display( false );
  875. break;
  876. case "ready":
  877. fINPUT = true;
  878. fQUERY = true;
  879. DISK_display( true );
  880. break;
  881. case "installing":
  882. fABORT = true;
  883. g_executing = true;
  884. break;
  885. }
  886. idDISK_dir.disabled = fINPUT ? false : true;
  887. idDISK_browse.disabled = fINPUT ? false : true;
  888. idDISK_query.disabled = fQUERY ? false : true;
  889. idDISK_abort.style.display = fABORT ? "" : "none";
  890. idDISK_install.disabled = fACTION ? false : true;
  891. }
  892. function DISK_display( fSelectable )
  893. {
  894. var count = 0;
  895. g_SelectedRow = null;
  896. g_SelectedSKU = null;
  897. Common_ClearTable( idDISK_resultTable );
  898. if(g_collDisk)
  899. {
  900. var seen = [];
  901. for(var e = new Enumerator( g_collDisk ); !e.atEnd(); e.moveNext())
  902. {
  903. var sku = e.item();
  904. var id = sku.SKU + "_#_" + sku.Language;
  905. if(seen[id]) continue;
  906. seen[id] = true;
  907. CreateRowForSKU( sku, idDISK_resultTable, fSelectable ); count++;
  908. }
  909. }
  910. while(count < 4)
  911. {
  912. CreateRowForSKU( null, idDISK_resultTable, false ); count++;
  913. }
  914. }
  915. function DISK_select()
  916. {
  917. if(g_SelectedRow)
  918. {
  919. idDISK_install.disabled = false;
  920. }
  921. else
  922. {
  923. idDISK_install.disabled = true;
  924. }
  925. }
  926. function DISK_onChange_dir()
  927. {
  928. if(event.propertyName == 'value')
  929. {
  930. var fDIS = (idDISK_dir.value.length == 0);
  931. idDISK_query.disabled = fDIS;
  932. }
  933. }
  934. function DISK_onKey_dir()
  935. {
  936. var fDIS = (idDISK_dir.value.length == 0);
  937. idDISK_query.disabled = fDIS;
  938. if(fDIS == false && event.keyCode == 13) DISK_onClick_query();
  939. }
  940. function DISK_onClick_browse()
  941. {
  942. var res = pchealth.SelectFolder( L_HelpContentDir_Text, idDISK_dir.value );
  943. if(res && res.length > 0)
  944. {
  945. idDISK_dir.value = res;
  946. idDISK_dir.focus();
  947. idDISK_query.disabled = false;
  948. }
  949. }
  950. function DISK_onClick_query()
  951. {
  952. DISK_setstate( "query" )
  953. idDISK_dirSelected.innerText = idDISK_dir.value;
  954. g_collDisk = g_db.ConnectToDisk( idDISK_dir.value, DISK_notifyForDisk );
  955. }
  956. function DISK_onClick_install()
  957. {
  958. if(g_SelectedSKU)
  959. {
  960. DISK_setstate( "installing" );
  961. idEvents.onBeforeContextSwitch = DISK_askToAbort;
  962. idEvents.onBeforeNavigate = DISK_askToAbort;
  963. idEvents.onShutdown = DISK_askToAbort;
  964. g_SelectedSKU.onStatusChange = DISK_notify;
  965. g_SelectedSKU.Install();
  966. }
  967. }
  968. function DISK_onClick_abort()
  969. {
  970. if(g_db)
  971. {
  972. g_db.Abort();
  973. }
  974. if(g_SelectedSKU)
  975. {
  976. g_SelectedSKU.Abort();
  977. }
  978. }
  979. function DISK_notifyForDisk( obj, status, hr, file )
  980. {
  981. if(g_DISK_state == "query")
  982. {
  983. if(status == pchealth.SHT_ABORTING) return;
  984. if(status == pchealth.SHT_ABORTED)
  985. {
  986. status = pchealth.SHT_QUERIED;
  987. }
  988. }
  989. idDISK_status.innerText = GetStatus( obj, status, hr, file );
  990. if(status == pchealth.SHT_QUERYING)
  991. {
  992. DISK_display( false );
  993. }
  994. if(status == pchealth.SHT_QUERIED)
  995. {
  996. if(g_collDisk && g_collDisk.Count == 0)
  997. {
  998. idDISK_status.innerText = L_Error80070002_Message;
  999. DISK_setstate( "idle" );
  1000. }
  1001. else
  1002. {
  1003. try
  1004. {
  1005. pchealth.RegWrite( REG_PERSIST_DISK, idDISK_dir.value );
  1006. }
  1007. catch(e)
  1008. {
  1009. }
  1010. DISK_setstate( "ready" );
  1011. }
  1012. }
  1013. if(status == pchealth.SHT_ABORTED ||
  1014. status == pchealth.SHT_FAILED )
  1015. {
  1016. DISK_setstate( "idle" );
  1017. }
  1018. }
  1019. function DISK_askToAbort()
  1020. {
  1021. var res = pchealth.MessageBox( L_AbortInstall_Message, "YESNO" );
  1022. if(res == "NO")
  1023. {
  1024. CancelEvent( event );
  1025. event.srcElement.data.Cancel = true;
  1026. }
  1027. else
  1028. {
  1029. idEvents.onBeforeContextSwitch = null;
  1030. idEvents.onBeforeNavigate = null;
  1031. idEvents.onShutdown = null;
  1032. DISK_onClick_abort();
  1033. }
  1034. }
  1035. function DISK_notify( obj, status, hr, file )
  1036. {
  1037. idDISK_status.innerText = GetStatus( obj, status, hr, file );
  1038. if(status == pchealth.SHT_INSTALLED ||
  1039. status == pchealth.SHT_ABORTED ||
  1040. status == pchealth.SHT_FAILED )
  1041. {
  1042. idEvents.onBeforeContextSwitch = null;
  1043. idEvents.onBeforeNavigate = null;
  1044. idEvents.onShutdown = null;
  1045. DISK_setstate( "ready" );
  1046. }
  1047. }
  1048. ////////////////////////////////////////////////////////////////////////////////
  1049. function SHARE_init()
  1050. {
  1051. HideAll(); idMODE_share.style.display = "";
  1052. SHARE_onClick_reset();
  1053. }
  1054. function SHARE_onClick_submit()
  1055. {
  1056. for(var e = new Enumerator( idSHARE_resultTable.rows ); !e.atEnd(); e.moveNext())
  1057. {
  1058. var oRow = e.item();
  1059. var oSKU = oRow.state_SKU; if(!oSKU) continue;
  1060. if(oRow.state_Exported != oSKU.Exported)
  1061. {
  1062. oSKU.Exported = oRow.state_Exported;
  1063. }
  1064. }
  1065. if(g_SelectedSKU_TS)
  1066. {
  1067. try
  1068. {
  1069. pchealth.RegWrite( REG_DEFAULTTERMINALSERVERSKU , g_SelectedSKU_TS.SKU );
  1070. pchealth.RegWrite( REG_DEFAULTTERMINALSERVERLANGUAGE, g_SelectedSKU_TS.Language );
  1071. g_TS_DefaultSKU = g_SelectedSKU_TS.SKU;
  1072. g_TS_DefaultLanguage = g_SelectedSKU_TS.Language;
  1073. }
  1074. catch(e)
  1075. {
  1076. }
  1077. }
  1078. else
  1079. {
  1080. try
  1081. {
  1082. pchealth.RegDelete( REG_DEFAULTTERMINALSERVERSKU );
  1083. pchealth.RegDelete( REG_DEFAULTTERMINALSERVERLANGUAGE );
  1084. g_TS_DefaultSKU = "";
  1085. g_TS_DefaultLanguage = "";
  1086. }
  1087. catch(e)
  1088. {
  1089. }
  1090. }
  1091. SHARE_onClick_reset();
  1092. }
  1093. function SHARE_onClick_reset()
  1094. {
  1095. var count = 0;
  1096. var options = idSHARE_ts.options;
  1097. Common_ClearTable( idSHARE_resultTable );
  1098. idSHARE_submit.disabled = true;
  1099. idSHARE_reset .disabled = true;
  1100. g_SelectedRow = null;
  1101. g_SelectedSKU = null;
  1102. g_SelectedSKU_TS = null;
  1103. while(options.length) options.remove( 0 );
  1104. g_collLocal = g_db.InstalledSKUs;
  1105. for(var e = new Enumerator( g_collLocal ); !e.atEnd(); e.moveNext())
  1106. {
  1107. var sku = e.item();
  1108. CreateRowForShare( sku, idSHARE_resultTable, options ); count++;
  1109. }
  1110. while(count < 4)
  1111. {
  1112. CreateRowForShare( null, idSHARE_resultTable, options ); count++;
  1113. }
  1114. }
  1115. ////////////////////
  1116. function SHARE_CheckIfModified()
  1117. {
  1118. var fRes = true;
  1119. for(var e = new Enumerator( idSHARE_resultTable.rows ); !e.atEnd(); e.moveNext())
  1120. {
  1121. var oRow = e.item();
  1122. var oSKU = oRow.state_SKU; if(!oSKU) continue;
  1123. if(oRow.state_Exported != oSKU.Exported)
  1124. {
  1125. fRes = false;
  1126. break;
  1127. }
  1128. }
  1129. if(g_SelectedSKU_TS)
  1130. {
  1131. if(g_SelectedSKU_TS.SKU != g_TS_DefaultSKU || g_SelectedSKU_TS.Language != g_TS_DefaultLanguage)
  1132. {
  1133. fRes = false;
  1134. }
  1135. }
  1136. else
  1137. {
  1138. if(g_TS_DefaultSKU || g_TS_DefaultLanguage)
  1139. {
  1140. fRes = false;
  1141. }
  1142. }
  1143. idSHARE_submit.disabled = fRes;
  1144. idSHARE_reset .disabled = fRes;
  1145. }
  1146. function SHARE_onClick_radio()
  1147. {
  1148. var obj = event.srcElement;
  1149. if(obj.tagName == "INPUT" && obj.type == "radio")
  1150. {
  1151. this.state_Exported = obj.payload_state;
  1152. }
  1153. SHARE_CheckIfModified();
  1154. }
  1155. function SHARE_onChange_ts()
  1156. {
  1157. var value = idSHARE_ts.options(idSHARE_ts.selectedIndex).value;
  1158. g_SelectedSKU_TS = null;
  1159. for(var e = new Enumerator( idSHARE_resultTable.rows ); !e.atEnd(); e.moveNext())
  1160. {
  1161. var oRow = e.item();
  1162. var oSKU = oRow.state_SKU; if(!oSKU) continue;
  1163. var id = oSKU.SKU + oSKU.Language;
  1164. if(id == value)
  1165. {
  1166. g_SelectedSKU_TS = oSKU;
  1167. break;
  1168. }
  1169. }
  1170. SHARE_CheckIfModified();
  1171. }
  1172. ////////////////////////////////////////////////////////////////////////////////
  1173. function REMOVE_init()
  1174. {
  1175. HideAll(); idMODE_remove.style.display = "";
  1176. REMOVE_display();
  1177. }
  1178. function REMOVE_display()
  1179. {
  1180. var count = 0;
  1181. g_SelectedRow = null;
  1182. g_SelectedSKU = null;
  1183. Common_ClearTable( idREMOVE_resultTable );
  1184. g_collLocal = g_db.InstalledSKUs;
  1185. for(var e = new Enumerator( g_collLocal ); !e.atEnd(); e.moveNext())
  1186. {
  1187. var sku = e.item(); if(sku.CanUninstall == false) continue;
  1188. CreateRowForSelect( sku, idREMOVE_resultTable ); count++;
  1189. }
  1190. while(count < 4)
  1191. {
  1192. CreateRowForSelect( null, idREMOVE_resultTable ); count++;
  1193. }
  1194. REMOVE_select();
  1195. }
  1196. function REMOVE_select()
  1197. {
  1198. if(g_SelectedRow)
  1199. {
  1200. idREMOVE_exec.disabled = g_SelectedSKU.IsMachineHelp;
  1201. }
  1202. else
  1203. {
  1204. idREMOVE_exec.disabled = true;
  1205. }
  1206. }
  1207. function REMOVE_onClick()
  1208. {
  1209. if(g_SelectedSKU)
  1210. {
  1211. if(SameSKU( g_SelectedSKU, g_skuUser ))
  1212. {
  1213. pchealth.MessageBox( L_DenyUninstall1_Message + GetSKUDisplayName( g_skuUser ) + L_DenyUninstall2_Message, "OK" );
  1214. return;
  1215. }
  1216. if(g_SelectedSKU.CanUninstall == false)
  1217. {
  1218. pchealth.MessageBox( L_DenyUninstall3_Message, "OK" );
  1219. return;
  1220. }
  1221. idREMOVE_exec.disabled = true;
  1222. g_executing = true;
  1223. g_SelectedSKU.onStatusChange = REMOVE_notify;
  1224. g_SelectedSKU.Uninstall();
  1225. g_SelectedRow = null;
  1226. g_SelectedSKU = null;
  1227. }
  1228. }
  1229. function REMOVE_notify( obj, status, hr, file )
  1230. {
  1231. if(status == pchealth.SHT_UNINSTALLED)
  1232. {
  1233. try
  1234. {
  1235. if(obj.SKU == g_TS_DefaultSKU && obj.Language == g_TS_DefaultLanguage)
  1236. {
  1237. pchealth.RegDelete( REG_DEFAULTTERMINALSERVERSKU );
  1238. pchealth.RegDelete( REG_DEFAULTTERMINALSERVERLANGUAGE );
  1239. g_TS_DefaultSKU = "";
  1240. g_TS_DefaultLanguage = "";
  1241. }
  1242. }
  1243. catch(e)
  1244. {
  1245. }
  1246. }
  1247. if(status == pchealth.SHT_UNINSTALLED ||
  1248. status == pchealth.SHT_ABORTED ||
  1249. status == pchealth.SHT_FAILED )
  1250. {
  1251. REMOVE_display();
  1252. g_executing = false;
  1253. }
  1254. }
  1255. ////////////////////////////////////////////////////////////////////////////////
  1256. var obj = pchealth.TextHelpers.ParseURL( window.location.href );
  1257. var mode = obj.GetQueryParameter( "mode" );
  1258. if(g_db.HasWritePermissions == false) mode = "Change"
  1259. switch(mode)
  1260. {
  1261. default : mode = "Change";
  1262. case "Change" : CHANGE_init(); break;
  1263. case "AddServer" : SERVER_init(); break;
  1264. case "AddDisk" : DISK_init(); break;
  1265. case "SetSharing": SHARE_init(); break;
  1266. case "Remove" : REMOVE_init(); break;
  1267. }
  1268. </SCRIPT>
  1269. </HTML>