Web Interface For Lite Argus Control modules
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.

648 lines
18 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var um_user_list_store = new Ext.data.JsonStore({
  3. root: 'users',
  4. totalProperty: 'totalCount',
  5. idProperty: 'id',
  6. remoteSort: true,
  7. fields: [{
  8. name: 'id',
  9. type: 'int'
  10. },{
  11. name: 'status',
  12. type: 'string'
  13. },{
  14. name: 'login',
  15. type: 'string'
  16. },{
  17. name: 'created',
  18. type: 'string'
  19. },{
  20. name: 'last',
  21. type: 'string'
  22. },{
  23. name: 'access',
  24. type: 'int'
  25. },{
  26. name: 'lang',
  27. type: 'int'
  28. },{
  29. name: 'site',
  30. type: 'int'
  31. }],
  32. proxy : new Ext.data.HttpProxy({
  33. method: 'POST',
  34. prettyUrls: false,
  35. url: '/lib/controller/listUsers.php',
  36. headers: {
  37. UID: <?=$UserID;?>,
  38. SID: '<?=$Session;?>'
  39. }
  40. })
  41. });
  42. var um_selected_user_id = 0;
  43. var um_user_locked = false;
  44. var um_add_user_window = null;
  45. var um_edit_user_window = null;
  46. function um_user_access_renderer( val ){
  47. if( val == 0 ){
  48. return '<?=$Labels->GetLabel("_GUEST_");?>';
  49. } else {
  50. if( val < 6 ){
  51. return '<?=$Labels->GetLabel("_REGULAR_");?>';
  52. } else {
  53. if( val == 10 ){
  54. return '<?=$Labels->GetLabel("_FOUNDER_");?>';
  55. } else {
  56. return '<?=$Labels->GetLabel("_ADMIN_");?>';
  57. };
  58. };
  59. };
  60. };
  61. function um_user_status_renderer( val ){
  62. switch( val ){
  63. case 'D': return '<img alt="Disabled" src="/style/icons/icons/status_busy.png">';
  64. case 'A': return '<img alt="Active" src="/style/icons/icons/status_online.png">';
  65. };
  66. return '<img alt="Blocked" src="/style/icons/icons/status_offline.png">';
  67. };
  68. var um_user_list_col_model_opt = {
  69. columns: [
  70. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  71. {header: "<?=$Labels->GetLabel("_STATUS_");?>", width: 80, sortable: false, renderer: um_user_status_renderer, fixed: true, menuDisabled: true, align: 'center', css: 'vertical-align: middle;', dataIndex: 'status' },
  72. {header: "<?=$Labels->GetLabel("_LOGIN_");?>", width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'login' },
  73. {header: "<?=$Labels->GetLabel("_CREATED_");?>", width: 150, sortable: false, renderer: unix_ts_renderer, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'created' },
  74. {header: "<?=$Labels->GetLabel("_LAST_ACCESS_");?>", width: 150, sortable: false, renderer: unix_ts_renderer, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'last' },
  75. {header: "<?=$Labels->GetLabel("_TYPE_");?>", width: 100, sortable: false, renderer: um_user_access_renderer, dataIndex: 'access' },
  76. {header: "<?=$Labels->GetLabel("_INFO_");?>", width: 200, sortable: false, dataindex: 'data' }
  77. ],
  78. defaults: {
  79. sortable: true,
  80. menuDisabled: true,
  81. width: 100
  82. },
  83. listeners: {
  84. hiddenchange: function(cm, colIndex, hidden) {
  85. //saveConfig(colIndex, hidden);
  86. }
  87. }
  88. };
  89. var um_user_list_sel_model_opt = {
  90. singleSelect: true,
  91. listeners: {
  92. rowselect: function( sm, row, rec ) {
  93. um_selected_user_id = rec.data.id;
  94. if ( rec.data.status == 'A' ){
  95. Ext.getCmp('um_lock_user_btn').setText('<?=$Labels->GetLabel("_LOCK_USER_");?>');
  96. um_user_locked = false;
  97. } else {
  98. Ext.getCmp('um_lock_user_btn').setText('<?=$Labels->GetLabel("_UNLOCK_USER_");?>');
  99. um_user_locked = true;
  100. };
  101. if( um_selected_user_id == 1 || rec.data.access == 10 ){
  102. Ext.getCmp('um_del_user_btn').disable();
  103. Ext.getCmp('um_lock_user_btn').disable();
  104. } else {
  105. Ext.getCmp('um_del_user_btn').enable();
  106. Ext.getCmp('um_lock_user_btn').enable();
  107. };
  108. if( um_selected_user_id == 1 ){
  109. Ext.getCmp('um_edit_user_btn').disable();
  110. } else {
  111. Ext.getCmp('um_edit_user_btn').enable();
  112. };
  113. }
  114. }
  115. };
  116. function addNewUser(){
  117. if( um_add_user_window == null ){
  118. um_add_user_window = new Ext.Window({
  119. modal: true,
  120. title: '<?=$Labels->GetLabel("_EDIT_USER_CRACCES_");?>',
  121. width: 400,
  122. height: 250,
  123. layout: 'fit',
  124. closeAction: 'hide',
  125. listeners:{
  126. beforehide : function(){
  127. //Ext.getCmp('connectstarterbutton').toggle( false, false );
  128. }
  129. },
  130. items:[{
  131. layout: 'table',
  132. border: false,
  133. defaults: {
  134. // applied to each contained panel
  135. bodyStyle:'padding-top:10px;padding-left:20px;padding-right:20px;padding-bottom:10px;'
  136. },
  137. layoutConfig: {
  138. // The total column count must be specified here
  139. columns: 2
  140. },
  141. items: [{
  142. border: false,
  143. html: 'User Login:'
  144. },{
  145. xtype: 'textfield',
  146. id: 'um_ua_login',
  147. width: 200
  148. },{
  149. border: false,
  150. html: 'New Password:'
  151. },{
  152. xtype: 'textfield',
  153. id: 'um_ua_pwd1',
  154. inputType: 'password',
  155. width: 200
  156. },{
  157. border: false,
  158. html: 'Repeate Password:'
  159. },{
  160. xtype: 'textfield',
  161. id: 'um_ua_pwd2',
  162. inputType: 'password',
  163. width: 200
  164. },{
  165. border: false,
  166. html: 'Access Level:'
  167. },{
  168. xtype: 'combo',
  169. id: 'um_ua_access',
  170. editable: false,
  171. typeAhead: true,
  172. triggerAction: 'all',
  173. width: 200,
  174. lazyRender:true,
  175. mode: 'local',
  176. value: 2,
  177. store: new Ext.data.ArrayStore({
  178. id: 0,
  179. fields: ['acc_lvl', 'displayText' ],
  180. data: [[2,'Minimal Access'],[4,'Operator'],[6,'Admin']]
  181. }),
  182. valueField: 'acc_lvl',
  183. displayField: 'displayText'
  184. }]
  185. }],
  186. bbar: [ '->',{
  187. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  188. handler: function(){
  189. um_add_user_window.hide();
  190. }
  191. },{
  192. text: '<?=$Labels->GetLabel("_SAVE_");?>',
  193. handler: function(){
  194. var lo = Ext.getCmp('um_ua_login').getValue();
  195. var pwd = Ext.getCmp('um_ua_pwd1').getValue();
  196. var rwd = Ext.getCmp('um_ua_pwd2').getValue();
  197. var acc = Ext.getCmp('um_ua_access').getValue();
  198. var sbt = true;
  199. if( acc > my_access ){
  200. sbt = false;
  201. Ext.Msg.show({
  202. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  203. msg: 'You Can not add more privileged user!',
  204. buttons: Ext.Msg.OK,
  205. icon: Ext.MessageBox.ERROR //QUESTION
  206. });
  207. };
  208. if( sbt && pwd!=''){
  209. if( pwd != rwd ){
  210. sbt = false;
  211. Ext.Msg.show({
  212. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  213. msg: 'Passwords don\'t match!',
  214. buttons: Ext.Msg.OK,
  215. icon: Ext.MessageBox.ERROR //QUESTION
  216. });
  217. };
  218. } else {
  219. sbt = false;
  220. Ext.Msg.show({
  221. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  222. msg: 'You Can not Add User Without Password!',
  223. buttons: Ext.Msg.OK,
  224. icon: Ext.MessageBox.ERROR //QUESTION
  225. });
  226. };
  227. if( sbt && lo == '' ){
  228. sbt = false;
  229. Ext.Msg.show({
  230. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  231. msg: 'You Can not Add User Without Login!',
  232. buttons: Ext.Msg.OK,
  233. icon: Ext.MessageBox.ERROR //QUESTION
  234. });
  235. };
  236. if( sbt ){
  237. Ext.Ajax.request({
  238. url: '/lib/controller/updateUser.php',
  239. params: {
  240. OP: 0,
  241. UID: <?=$UserID;?>,
  242. SID: '<?=$Session;?>',
  243. NLO: lo,
  244. PW1: pwd,
  245. PW2: rwd,
  246. ACC: acc
  247. },
  248. success: function( response, opts ){
  249. // If the response is JSON, you have to decode it
  250. var data = Ext.decode(response.responseText);
  251. if( data.success == true ) {
  252. Ext.Msg.show({
  253. title:'<?=$Labels->GetLabel("_INFO_MSG_");?>',
  254. msg: '<?=$Labels->GetLabel("_SETTING_SAVE_OK_");?>',
  255. buttons: Ext.Msg.OK,//YESNOCANCEL,
  256. fn: function(){
  257. um_user_list_store.reload();
  258. um_add_user_window.hide();
  259. },
  260. //animEl: 'elId',
  261. icon: Ext.MessageBox.INFO //QUESTION
  262. });
  263. } else {
  264. Ext.Msg.show({
  265. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  266. msg: data['error'],
  267. buttons: Ext.Msg.OK,//YESNOCANCEL,
  268. fn: function(){
  269. um_add_user_window.hide();
  270. },
  271. //animEl: 'elId',
  272. icon: Ext.MessageBox.ERROR //QUESTION
  273. });
  274. };
  275. },
  276. failure: failureAJAXFunction
  277. });
  278. };
  279. }
  280. }]
  281. });
  282. };
  283. um_add_user_window.show();
  284. Ext.getCmp('um_ua_login').setValue( '' );
  285. Ext.getCmp('um_ua_pwd1').setValue( '' );
  286. Ext.getCmp('um_ua_pwd2').setValue( '' );
  287. Ext.getCmp('um_ua_access').setValue( 2 );
  288. };
  289. function doUserOperation( op ){
  290. if( um_selected_user_id < 1 ) return;
  291. Ext.Ajax.request({
  292. url: '/lib/controller/updateUser.php',
  293. params: {
  294. OP: op,
  295. UID: <?=$UserID;?>,
  296. SID: '<?=$Session;?>',
  297. SUID: um_selected_user_id
  298. },
  299. success: function( response, opts ){
  300. // If the response is JSON, you have to decode it
  301. var data = Ext.decode(response.responseText);
  302. if( data.success == true ) {
  303. Ext.Msg.show({
  304. title:'<?=$Labels->GetLabel("_INFO_MSG_");?>',
  305. msg: '<?=$Labels->GetLabel("_SETTING_SAVE_OK_");?>',
  306. buttons: Ext.Msg.OK,//YESNOCANCEL,
  307. fn: function(){
  308. um_user_list_store.reload();
  309. },
  310. //animEl: 'elId',
  311. icon: Ext.MessageBox.INFO //QUESTION
  312. });
  313. } else {
  314. Ext.Msg.show({
  315. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  316. msg: data.msg,
  317. buttons: Ext.Msg.OK,//YESNOCANCEL,
  318. //animEl: 'elId',
  319. icon: Ext.MessageBox.ERROR //QUESTION
  320. });
  321. };
  322. },
  323. failure: failureAJAXFunction
  324. });
  325. };
  326. function editSelectedUser(){
  327. if( um_edit_user_window == null ){
  328. um_edit_user_window = new Ext.Window({
  329. modal: true,
  330. title: '<?=$Labels->GetLabel("_EDIT_USER_CRACCES_");?>',
  331. width: 400,
  332. height: 250,
  333. layout: 'fit',
  334. closeAction: 'hide',
  335. listeners:{
  336. beforehide : function(){
  337. //Ext.getCmp('connectstarterbutton').toggle( false, false );
  338. }
  339. },
  340. items:[{
  341. layout: 'table',
  342. border: false,
  343. defaults: {
  344. // applied to each contained panel
  345. bodyStyle:'padding-top:10px;padding-left:20px;padding-right:20px;padding-bottom:10px;'
  346. },
  347. layoutConfig: {
  348. // The total column count must be specified here
  349. columns: 2
  350. },
  351. items: [{
  352. border: false,
  353. html: 'User Login:'
  354. },{
  355. xtype: 'textfield',
  356. id: 'um_ue_login',
  357. width: 200
  358. },{
  359. border: false,
  360. html: 'New Password:'
  361. },{
  362. xtype: 'textfield',
  363. id: 'um_ue_pwd1',
  364. inputType: 'password',
  365. width: 200
  366. },{
  367. border: false,
  368. html: 'Repeate Password:'
  369. },{
  370. xtype: 'textfield',
  371. id: 'um_ue_pwd2',
  372. inputType: 'password',
  373. width: 200
  374. },{
  375. border: false,
  376. html: 'Access Level:'
  377. },{
  378. xtype: 'combo',
  379. id: 'um_ue_access',
  380. editable: false,
  381. typeAhead: true,
  382. triggerAction: 'all',
  383. width: 200,
  384. lazyRender:true,
  385. mode: 'local',
  386. value: 2,
  387. store: new Ext.data.ArrayStore({
  388. id: 0,
  389. fields: ['acc_lvl', 'displayText' ],
  390. data: [[2,'Minimal Access'],[4,'Operator'],[6,'Admin'],[10,'Factory Defined']]
  391. }),
  392. valueField: 'acc_lvl',
  393. displayField: 'displayText'
  394. }]
  395. }],
  396. bbar: [ '->',{
  397. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  398. handler: function(){
  399. um_edit_user_window.hide();
  400. }
  401. },{
  402. text: '<?=$Labels->GetLabel("_SAVE_");?>',
  403. handler: function(){
  404. var aid = um_user_list_store.find( 'id', um_selected_user_id );
  405. var r = um_user_list_store.getAt( aid );
  406. var lo = Ext.getCmp('um_ue_login').getValue();
  407. var pwd = Ext.getCmp('um_ue_pwd1').getValue();
  408. var rwd = Ext.getCmp('um_ue_pwd2').getValue();
  409. var acc = Ext.getCmp('um_ue_access').getValue();
  410. var olo = r.data.login;
  411. var oacc = r.data.access;
  412. var sbt = true;
  413. if( oacc > my_access ){
  414. sbt = false;
  415. Ext.Msg.show({
  416. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  417. msg: 'You Can not change settings of more privileged user!',
  418. buttons: Ext.Msg.OK,
  419. icon: Ext.MessageBox.ERROR
  420. });
  421. };
  422. if( sbt && oacc != acc ){
  423. if( acc > my_access ){
  424. sbt = false;
  425. Ext.Msg.show({
  426. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  427. msg: 'You Can not change access level to more privileged user then you are!',
  428. buttons: Ext.Msg.OK,
  429. icon: Ext.MessageBox.ERROR
  430. });
  431. } else {
  432. if( acc == 10 ){
  433. sbt = false;
  434. Ext.Msg.show({
  435. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  436. msg: 'You Can not change access level to Factory Defined Master!',
  437. buttons: Ext.Msg.OK,
  438. icon: Ext.MessageBox.ERROR
  439. });
  440. };
  441. };
  442. };
  443. if( sbt && pwd!=''){
  444. if( pwd != rwd ){
  445. sbt = false;
  446. Ext.Msg.show({
  447. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  448. msg: 'Passwords does not match!',
  449. buttons: Ext.Msg.OK,
  450. icon: Ext.MessageBox.ERROR
  451. });
  452. };
  453. };
  454. if( sbt && olo != lo ){
  455. sbt = false;
  456. Ext.Msg.show({
  457. title:'<?=$Labels->GetLabel("_QERY_MSG_");?>',
  458. msg: 'Are you sure to change Login User Name?',
  459. buttons: Ext.Msg.YESNOCANCEL,
  460. fn: function( a ){
  461. if( a == 'yes' ){
  462. Ext.Ajax.request({
  463. url: '/lib/controller/updateUser.php',
  464. params: {
  465. OP: 1,
  466. SUID: um_selected_user_id,
  467. UID: <?=$UserID;?>,
  468. SID: '<?=$Session;?>',
  469. NLO: lo,
  470. OLO: olo,
  471. PW1: pwd,
  472. PW2: rwd,
  473. ACC: acc
  474. },
  475. success: function( response, opts ){
  476. var data = Ext.decode(response.responseText);
  477. if( data.success == true ) {
  478. Ext.Msg.show({
  479. title:'<?=$Labels->GetLabel("_INFO_MSG_");?>',
  480. msg: '<?=$Labels->GetLabel("_SETTING_SAVE_OK_");?>',
  481. buttons: Ext.Msg.OK,//YESNOCANCEL,
  482. fn: function(){
  483. um_user_list_store.reload();
  484. um_edit_user_window.hide();
  485. },
  486. //animEl: 'elId',
  487. icon: Ext.MessageBox.INFO //QUESTION
  488. });
  489. } else {
  490. Ext.Msg.show({
  491. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  492. msg: data['error'],
  493. buttons: Ext.Msg.OK,//YESNOCANCEL,
  494. fn: function(){
  495. um_edit_user_window.hide();
  496. },
  497. //animEl: 'elId',
  498. icon: Ext.MessageBox.ERROR //QUESTION
  499. });
  500. };
  501. },
  502. failure: failureAJAXFunction
  503. });
  504. };
  505. },
  506. icon: Ext.MessageBox.QUESTION
  507. });
  508. };
  509. if( sbt ){
  510. Ext.Ajax.request({
  511. url: '/lib/controller/updateUser.php',
  512. params: {
  513. OP: 1,
  514. SUID: um_selected_user_id,
  515. UID: <?=$UserID;?>,
  516. SID: '<?=$Session;?>',
  517. NLO: lo,
  518. OLO: olo,
  519. PW1: pwd,
  520. PW2: rwd,
  521. ACC: acc
  522. },
  523. success: function( response, opts ){
  524. // If the response is JSON, you have to decode it
  525. var data = Ext.decode(response.responseText);
  526. if( data.success == true ) {
  527. Ext.Msg.show({
  528. title:'<?=$Labels->GetLabel("_INFO_MSG_");?>',
  529. msg: '<?=$Labels->GetLabel("_SETTING_SAVE_OK_");?>',
  530. buttons: Ext.Msg.OK,//YESNOCANCEL,
  531. fn: function(){
  532. //SettingsLidar3D.hide();
  533. um_user_list_store.reload();
  534. um_edit_user_window.hide();
  535. },
  536. //animEl: 'elId',
  537. icon: Ext.MessageBox.INFO //QUESTION
  538. });
  539. } else {
  540. Ext.Msg.show({
  541. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  542. msg: data['error'],
  543. buttons: Ext.Msg.OK,//YESNOCANCEL,
  544. fn: function(){
  545. um_edit_user_window.hide();
  546. },
  547. //animEl: 'elId',
  548. icon: Ext.MessageBox.ERROR //QUESTION
  549. });
  550. };
  551. },
  552. failure: failureAJAXFunction
  553. });
  554. };
  555. }
  556. }]
  557. });
  558. };
  559. um_edit_user_window.show();
  560. var aid = um_user_list_store.find( 'id', um_selected_user_id );
  561. var r = um_user_list_store.getAt( aid );
  562. Ext.getCmp('um_ue_login').setValue( r.data.login );
  563. Ext.getCmp('um_ue_access').setValue( r.data.access );
  564. if( r.data.access == 10 ){
  565. Ext.getCmp('um_ue_access').disable();
  566. } else {
  567. Ext.getCmp('um_ue_access').enable();
  568. };
  569. };
  570. function loadUserEditor(){
  571. if( tlInterval!= null ){
  572. window.clearInterval( tlInterval );
  573. tlInterval = null;
  574. timelineObj = null;
  575. };
  576. var tPanel = Ext.getCmp('main_content');
  577. tPanel.removeAll( true );
  578. Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_USERS_MNGMT_");?>' );
  579. tPanel.add({
  580. columnWidth: 1.0,
  581. frame: false,
  582. border: false,
  583. items: [{
  584. xtype: 'panel',
  585. layout: 'fit',
  586. layoutConfig: {
  587. align : 'stretch',
  588. pack : 'start'
  589. },
  590. height: PanelH-5,
  591. flex: 1,
  592. frame: false,
  593. border: false,
  594. items:{
  595. frame: false,
  596. height: PanelH-5,
  597. xtype: 'grid',
  598. ds: um_user_list_store,
  599. cm: new Ext.grid.ColumnModel( um_user_list_col_model_opt ),
  600. sm: new Ext.grid.RowSelectionModel( um_user_list_sel_model_opt )
  601. },
  602. tbar: [{
  603. xtype: 'button',
  604. id: 'um_add_user_btn',
  605. text: '<?=$Labels->GetLabel("_ADD_USER_");?>',
  606. handler: addNewUser
  607. },{
  608. xtype: 'button',
  609. id: 'um_edit_user_btn',
  610. text: '<?=$Labels->GetLabel("_EDIT_USER_");?>',
  611. disabled: true,
  612. handler: editSelectedUser
  613. },{
  614. xtype: 'button',
  615. id: 'um_lock_user_btn',
  616. text: '<?=$Labels->GetLabel("_LOCK_USER_");?>',
  617. disabled: true,
  618. handler: function(){
  619. if( um_user_locked ){
  620. doUserOperation( 3 );
  621. } else {
  622. doUserOperation( 2 );
  623. };
  624. }
  625. },{
  626. xtype: 'button',
  627. id: 'um_del_user_btn',
  628. text: '<?=$Labels->GetLabel("_DEL_USER_");?>',
  629. disabled: true,
  630. handler: function(){
  631. doUserOperation( 4 );
  632. }
  633. }]
  634. }]
  635. });
  636. tPanel.doLayout();
  637. um_selected_user_id = 0;
  638. um_user_list_store.reload();
  639. };