w_oa_workremindadmin.srw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. $PBExportHeader$w_oa_workremindadmin.srw
  2. forward
  3. global type w_oa_workremindadmin from window
  4. end type
  5. type cb_5 from uo_imflatbutton within w_oa_workremindadmin
  6. end type
  7. type cb_exit from uo_imflatbutton within w_oa_workremindadmin
  8. end type
  9. type cbx_2 from checkbox within w_oa_workremindadmin
  10. end type
  11. type cbx_1 from checkbox within w_oa_workremindadmin
  12. end type
  13. type dw_list from datawindow within w_oa_workremindadmin
  14. end type
  15. type tv_1 from datawindow within w_oa_workremindadmin
  16. end type
  17. type dw_userlist from datawindow within w_oa_workremindadmin
  18. end type
  19. type cb_4 from uo_imflatbutton within w_oa_workremindadmin
  20. end type
  21. type cb_3 from uo_imflatbutton within w_oa_workremindadmin
  22. end type
  23. type cb_2 from uo_imflatbutton within w_oa_workremindadmin
  24. end type
  25. type cb_1 from uo_imflatbutton within w_oa_workremindadmin
  26. end type
  27. type ln_bar2 from line within w_oa_workremindadmin
  28. end type
  29. type ln_bar from line within w_oa_workremindadmin
  30. end type
  31. type r_bar from rectangle within w_oa_workremindadmin
  32. end type
  33. end forward
  34. global type w_oa_workremindadmin from window
  35. integer width = 3611
  36. integer height = 2380
  37. boolean titlebar = true
  38. string title = "工作提醒管理订阅"
  39. boolean controlmenu = true
  40. boolean minbox = true
  41. windowtype windowtype = popup!
  42. long backcolor = 67108864
  43. string icon = "AppIcon!"
  44. boolean center = true
  45. cb_5 cb_5
  46. cb_exit cb_exit
  47. cbx_2 cbx_2
  48. cbx_1 cbx_1
  49. dw_list dw_list
  50. tv_1 tv_1
  51. dw_userlist dw_userlist
  52. cb_4 cb_4
  53. cb_3 cb_3
  54. cb_2 cb_2
  55. cb_1 cb_1
  56. ln_bar2 ln_bar2
  57. ln_bar ln_bar
  58. r_bar r_bar
  59. end type
  60. global w_oa_workremindadmin w_oa_workremindadmin
  61. type variables
  62. boolean ib_edit=false
  63. string is_curmod=''
  64. uo_oa_workremind u_wrm
  65. long il_curid=-1
  66. string is_curSelectUser=''
  67. s_wrm_right user_remindRight[]
  68. s_wrm_right copyRight[]
  69. string is_canSee=''
  70. end variables
  71. forward prototypes
  72. public subroutine wf_refresh ()
  73. end prototypes
  74. public subroutine wf_refresh ();if ib_edit then
  75. //编辑状态
  76. dw_list.setTabOrder("selected",10)
  77. cbx_1.enabled=true
  78. cbx_2.enabled=true
  79. cb_1.enabled=true
  80. cb_2.text="放弃"
  81. // cb_3.enabled=true
  82. cb_4.enabled=true
  83. cbx_1.checked=false
  84. cbx_2.checked=false
  85. cb_2.normalpicname = 'undo.bmp'
  86. else
  87. //非编辑状态
  88. dw_list.setTabOrder("selected",0)
  89. cbx_1.enabled=false
  90. cbx_2.enabled=false
  91. cb_1.enabled=false
  92. cb_2.text="修改"
  93. // cb_3.enabled=false
  94. cb_4.enabled=false
  95. cb_2.normalpicname = 'open.bmp'
  96. end if
  97. cb_1.of_init_draw()
  98. cb_2.of_init_draw()
  99. cb_1.of_paint()
  100. cb_2.of_paint()
  101. cb_1.TriggerEvent('ue_textchange')
  102. cb_2.TriggerEvent('ue_textchange')
  103. end subroutine
  104. event open;dw_userlist.setTrans(sqlca)
  105. tv_1.setTrans(sqlca)
  106. dw_list.setTrans(sqlca)
  107. long ll_wrmid,cnt_wrm,cnt
  108. u_wrm=create uo_oa_workremind
  109. string ls_right
  110. //取提醒定义表的提醒id列
  111. declare cr cursor for
  112. select wrmid
  113. from oa_workreminddef;
  114. open cr;
  115. fetch cr into :ll_wrmid;
  116. do while sqlca.sqlcode=0
  117. cnt_wrm++
  118. user_remindRight[cnt_wrm].wrmid=ll_wrmid
  119. user_remindRight[cnt_wrm].selected=0
  120. fetch cr into :ll_wrmid;
  121. loop
  122. close cr;
  123. if ls_right<>'' and cnt_wrm<>0 then
  124. for cnt=1 to cnt_wrm
  125. string ls_curWrmid
  126. ls_curWrmid=string(user_remindRight[cnt].wrmid)
  127. if pos(ls_right,ls_curWrmid)<>0 then
  128. user_remindRight[cnt].selected=1
  129. end if
  130. next
  131. end if
  132. dw_userlist.retrieve()
  133. tv_1.retrieve()
  134. end event
  135. on w_oa_workremindadmin.create
  136. this.cb_5=create cb_5
  137. this.cb_exit=create cb_exit
  138. this.cbx_2=create cbx_2
  139. this.cbx_1=create cbx_1
  140. this.dw_list=create dw_list
  141. this.tv_1=create tv_1
  142. this.dw_userlist=create dw_userlist
  143. this.cb_4=create cb_4
  144. this.cb_3=create cb_3
  145. this.cb_2=create cb_2
  146. this.cb_1=create cb_1
  147. this.ln_bar2=create ln_bar2
  148. this.ln_bar=create ln_bar
  149. this.r_bar=create r_bar
  150. this.Control[]={this.cb_5,&
  151. this.cb_exit,&
  152. this.cbx_2,&
  153. this.cbx_1,&
  154. this.dw_list,&
  155. this.tv_1,&
  156. this.dw_userlist,&
  157. this.cb_4,&
  158. this.cb_3,&
  159. this.cb_2,&
  160. this.cb_1,&
  161. this.ln_bar2,&
  162. this.ln_bar,&
  163. this.r_bar}
  164. end on
  165. on w_oa_workremindadmin.destroy
  166. destroy(this.cb_5)
  167. destroy(this.cb_exit)
  168. destroy(this.cbx_2)
  169. destroy(this.cbx_1)
  170. destroy(this.dw_list)
  171. destroy(this.tv_1)
  172. destroy(this.dw_userlist)
  173. destroy(this.cb_4)
  174. destroy(this.cb_3)
  175. destroy(this.cb_2)
  176. destroy(this.cb_1)
  177. destroy(this.ln_bar2)
  178. destroy(this.ln_bar)
  179. destroy(this.r_bar)
  180. end on
  181. event resize;ln_bar.endx = this.width
  182. ln_bar2.endx = this.width
  183. r_bar.Width = ln_bar2.EndX
  184. //long width1,height1
  185. //width1 = width - 118
  186. //height1 =height - 380
  187. //
  188. //dw_userlist.height=height1
  189. //tv_1.height=height1
  190. //tv_1.x=dw_userlist.x+dw_userlist.width+10
  191. //tv_1.y=dw_userlist.y
  192. //
  193. //dw_list.width=width1 - tv_1.x - tv_1.width - 2
  194. //dw_list.height=height1
  195. //dw_list.x=tv_1.x+tv_1.width+10
  196. //dw_list.y=tv_1.y
  197. tv_1.x = dw_userlist.x + dw_userlist.width + 10
  198. dw_list.x = tv_1.x + tv_1.width + 10
  199. dw_list.width = this.width - dw_list.x - 40
  200. dw_userlist.height = this.height - dw_userlist.y - 140
  201. tv_1.height = dw_userlist.height
  202. dw_list.height = dw_userlist.height
  203. end event
  204. type cb_5 from uo_imflatbutton within w_oa_workremindadmin
  205. integer x = 37
  206. integer width = 169
  207. integer height = 172
  208. integer taborder = 30
  209. string text = "刷新"
  210. string normalpicname = "refresh.bmp"
  211. integer picsize = 16
  212. toolbaralignment pic_align = alignattop!
  213. boolean border = false
  214. end type
  215. event clicked;call super::clicked;dw_list.retrieve(is_curMOD)
  216. f_oa_workremind_setRight(user_remindRight,dw_list)
  217. end event
  218. type cb_exit from uo_imflatbutton within w_oa_workremindadmin
  219. integer x = 887
  220. integer width = 165
  221. integer height = 172
  222. integer taborder = 20
  223. string text = "退出"
  224. boolean cancel = true
  225. string normalpicname = "exit.bmp"
  226. integer picsize = 16
  227. toolbaralignment pic_align = alignattop!
  228. boolean border = false
  229. end type
  230. event clicked;call super::clicked;close(parent)
  231. end event
  232. type cbx_2 from checkbox within w_oa_workremindadmin
  233. integer x = 1527
  234. integer y = 68
  235. integer width = 238
  236. integer height = 60
  237. integer textsize = -9
  238. integer weight = 400
  239. fontcharset fontcharset = gb2312charset!
  240. fontpitch fontpitch = variable!
  241. string facename = "宋体"
  242. long textcolor = 33554432
  243. long backcolor = 67108864
  244. boolean enabled = false
  245. string text = "反选"
  246. end type
  247. event clicked;cbx_2.checked=false
  248. cbx_1.checked=false
  249. long cnt
  250. for cnt=1 to dw_list.rowcount()
  251. if dw_list.object.selected[cnt]=1 then
  252. dw_list.object.selected[cnt]=0
  253. else
  254. dw_list.object.selected[cnt]=1
  255. end if
  256. next
  257. end event
  258. event constructor;this.BackColor=14215660
  259. end event
  260. type cbx_1 from checkbox within w_oa_workremindadmin
  261. integer x = 1266
  262. integer y = 48
  263. integer width = 224
  264. integer height = 92
  265. integer textsize = -9
  266. integer weight = 400
  267. fontcharset fontcharset = gb2312charset!
  268. fontpitch fontpitch = variable!
  269. string facename = "宋体"
  270. long textcolor = 33554432
  271. long backcolor = 67108864
  272. boolean enabled = false
  273. string text = "全选"
  274. end type
  275. event clicked;long cnt,curState
  276. if cbx_1.checked then
  277. curstate=1
  278. else
  279. curState=0
  280. end if
  281. for cnt=1 to dw_list.rowcount()
  282. dw_list.object.selected[cnt]=curState
  283. next
  284. end event
  285. event constructor;this.BackColor=14215660
  286. end event
  287. type dw_list from datawindow within w_oa_workremindadmin
  288. integer x = 1669
  289. integer y = 192
  290. integer width = 1911
  291. integer height = 1344
  292. integer taborder = 40
  293. string title = "none"
  294. string dataobject = "dw_oa_remainddef"
  295. boolean vscrollbar = true
  296. boolean livescroll = true
  297. borderstyle borderstyle = stylelowered!
  298. end type
  299. event rowfocuschanged;IF currentrow > 0 THEN
  300. THIS.SelectRow(0, FALSE)
  301. THIS.SetRow(currentrow)
  302. THIS.SelectRow(currentrow, TRUE)
  303. Long ll_curid
  304. ll_curid = Long(dw_list.Object.WrmID[currentrow])
  305. il_curid = ll_curid
  306. END IF
  307. end event
  308. event clicked;
  309. if row > 0 then
  310. this.selectrow(0, false)
  311. this.setrow(row)
  312. this.selectrow(row, true)
  313. end if
  314. end event
  315. type tv_1 from datawindow within w_oa_workremindadmin
  316. integer x = 699
  317. integer y = 192
  318. integer width = 955
  319. integer height = 1344
  320. integer taborder = 30
  321. string title = "none"
  322. string dataobject = "dw_oa_remind_modlist"
  323. boolean livescroll = true
  324. borderstyle borderstyle = stylelowered!
  325. end type
  326. event rowfocuschanged;if ib_edit then
  327. IF MessageBox(publ_operator,'是否要确定放弃保存资料', Exclamation!, YesNo!, 2) = 2 THEN
  328. RETURN
  329. END IF
  330. end if
  331. if currentrow > 0 then
  332. this.selectrow(0, false)
  333. this.setrow(currentrow)
  334. this.selectrow(currentrow, true)
  335. end if
  336. ib_edit=false
  337. wf_refresh()
  338. is_curMOD=tv_1.object.ModuleName[currentrow]
  339. //dw_list.retrieve(is_curMOD)
  340. //f_oa_workremind_setRight(user_remindRight,dw_list)
  341. cb_5.triggerevent(clicked!)
  342. end event
  343. event rowfocuschanging;IF ib_edit THEN return 1
  344. end event
  345. event clicked;
  346. if row > 0 then
  347. this.selectrow(0, false)
  348. this.setrow(row)
  349. this.selectrow(row, true)
  350. end if
  351. end event
  352. type dw_userlist from datawindow within w_oa_workremindadmin
  353. integer y = 188
  354. integer width = 699
  355. integer height = 1336
  356. integer taborder = 20
  357. string title = "none"
  358. string dataobject = "dw_oa_remind_userlist"
  359. boolean livescroll = true
  360. borderstyle borderstyle = stylelowered!
  361. end type
  362. event rowfocuschanged;IF ib_edit THEN
  363. IF MessageBox(publ_operator,'是否要确定放弃保存资料', Exclamation!, YesNo!, 2) = 2 THEN
  364. RETURN
  365. END IF
  366. END IF
  367. if currentrow > 0 then
  368. this.selectrow(0, false)
  369. this.setrow(currentrow)
  370. this.selectrow(currentrow, true)
  371. end if
  372. String ls_right,arg_msg
  373. Long cnt
  374. ib_edit = FALSE
  375. wf_refresh()
  376. is_curSelectUser = dw_userlist.Object.UserID[currentrow]
  377. //u_wrm.uf_get_userworkremind(ref ls_right,is_curSelectUser,ref arg_msg)
  378. u_wrm.uf_get_cansee(is_curSelectUser,REF is_cansee,REF arg_msg)
  379. FOR cnt = 1 TO UpperBound(user_remindRight)
  380. IF Pos(is_cansee,String(user_remindRight[cnt].wrmid)) <> 0 THEN
  381. user_remindRight[cnt].Selected = 1
  382. ELSE
  383. user_remindRight[cnt].Selected = 0
  384. END IF
  385. NEXT
  386. //dw_list.Retrieve(is_curmod)
  387. //f_oa_workremind_setright(user_remindRight,dw_list)
  388. cb_5.triggerevent(clicked!)
  389. end event
  390. event clicked;
  391. if row > 0 then
  392. this.selectrow(0, false)
  393. this.setrow(row)
  394. this.selectrow(row, true)
  395. end if
  396. end event
  397. event rowfocuschanging;IF ib_edit THEN return 1
  398. end event
  399. type cb_4 from uo_imflatbutton within w_oa_workremindadmin
  400. integer x = 718
  401. integer width = 169
  402. integer height = 172
  403. integer taborder = 10
  404. boolean enabled = false
  405. string text = "粘贴"
  406. string normalpicname = "PASTE.BMP"
  407. integer picsize = 16
  408. toolbaralignment pic_align = alignattop!
  409. boolean border = false
  410. end type
  411. event clicked;call super::clicked;long cnt
  412. string ls_right='',arg_msg
  413. for cnt=1 to UpperBound(copyRight)
  414. user_remindRight[cnt]=copyRight[cnt]
  415. if copyRight[cnt].selected=1 then
  416. ls_right+=string(copyRight[cnt].wrmid)+","
  417. end if
  418. next
  419. if not u_wrm.uf_add_userworkremind(ls_right,is_curSelectUser,arg_msg)then
  420. messagebox('',arg_msg)
  421. return
  422. end if
  423. ib_edit=false
  424. wf_refresh()
  425. f_oa_workremind_setright(user_remindRight,dw_list)
  426. end event
  427. type cb_3 from uo_imflatbutton within w_oa_workremindadmin
  428. integer x = 549
  429. integer width = 169
  430. integer height = 172
  431. integer taborder = 10
  432. string text = "复制"
  433. string normalpicname = "COPY.BMP"
  434. integer picsize = 16
  435. toolbaralignment pic_align = alignattop!
  436. boolean border = false
  437. end type
  438. event clicked;call super::clicked;long cnt
  439. if ib_edit then
  440. IF MessageBox(publ_operator,'当前处于编辑状态,更改将不被复制!~n是否放弃复制?', Exclamation!, YesNo!, 2) = 1 THEN
  441. RETURN
  442. END IF
  443. end if
  444. for cnt=1 to UpperBound(user_remindRight)
  445. copyRight[cnt]=user_remindRight[cnt]
  446. next
  447. end event
  448. type cb_2 from uo_imflatbutton within w_oa_workremindadmin
  449. integer x = 379
  450. integer width = 169
  451. integer height = 172
  452. integer taborder = 10
  453. string text = "修改&E"
  454. string normalpicname = "Open.bmp"
  455. integer picsize = 16
  456. toolbaralignment pic_align = alignattop!
  457. boolean border = false
  458. end type
  459. event clicked;call super::clicked;
  460. if ib_edit then
  461. IF MessageBox(publ_operator,'是否要确定放弃保存资料', Exclamation!, YesNo!, 2) = 2 THEN
  462. RETURN
  463. END IF
  464. end if
  465. ib_edit=not ib_edit
  466. wf_refresh()
  467. end event
  468. type cb_1 from uo_imflatbutton within w_oa_workremindadmin
  469. integer x = 210
  470. integer width = 169
  471. integer height = 172
  472. integer taborder = 10
  473. boolean enabled = false
  474. string text = "保存"
  475. string normalpicname = "save.bmp"
  476. integer picsize = 16
  477. toolbaralignment pic_align = alignattop!
  478. boolean border = false
  479. end type
  480. event clicked;call super::clicked;long cnt
  481. string new_right[]={'',''},arg_msg
  482. //复制一份订阅表
  483. for cnt=1 to dw_list.rowcount()
  484. if dw_list.object.selected[cnt]=1 then
  485. new_right[1]+=string(dw_list.object.wrmid[cnt])+","
  486. end if
  487. new_right[2]+=string(dw_list.object.wrmid[cnt])+","
  488. next
  489. f_oa_workremind_saveright(new_right,ref user_remindRight)
  490. string new_right1=''
  491. for cnt=1 to UpperBound(user_remindRight)
  492. if user_remindRight[cnt].selected=1 then
  493. new_right1+= string(user_remindRight[cnt].wrmid)+","
  494. end if
  495. next
  496. ib_edit=false
  497. wf_refresh()
  498. //dw_list.retrieve(is_curmod,'')
  499. //f_oa_workremind_setRight(user_remindRight,dw_list)
  500. cb_5.triggerevent(clicked!)
  501. if not u_wrm.uf_add_canseeStr(new_right1,is_curSelectUser,ref arg_msg) then
  502. messagebox('',arg_msg)
  503. end if
  504. end event
  505. type ln_bar2 from line within w_oa_workremindadmin
  506. long linecolor = 16777215
  507. integer linethickness = 4
  508. integer beginy = 180
  509. integer endx = 3323
  510. integer endy = 188
  511. end type
  512. type ln_bar from line within w_oa_workremindadmin
  513. long linecolor = 268435456
  514. integer linethickness = 4
  515. integer beginy = 180
  516. integer endx = 3323
  517. integer endy = 180
  518. end type
  519. type r_bar from rectangle within w_oa_workremindadmin
  520. long linecolor = 16777215
  521. long fillcolor = 1073741824
  522. integer x = 1778
  523. integer width = 73
  524. integer height = 172
  525. end type
  526. event constructor;this.fillcolor = 14215660
  527. this.linecolor = 14215660
  528. this.x = -1
  529. this.y = -1
  530. this.height = ln_bar2.beginy - 5
  531. this.width=ln_bar2.endx
  532. end event