w_oa_workreminduser.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. $PBExportHeader$w_oa_workreminduser.srw
  2. forward
  3. global type w_oa_workreminduser from window
  4. end type
  5. type cb_5 from uo_imflatbutton within w_oa_workreminduser
  6. end type
  7. type cb_2 from uo_imflatbutton within w_oa_workreminduser
  8. end type
  9. type cb_exit from uo_imflatbutton within w_oa_workreminduser
  10. end type
  11. type dw_list from datawindow within w_oa_workreminduser
  12. end type
  13. type tv_1 from datawindow within w_oa_workreminduser
  14. end type
  15. type cbx_2 from checkbox within w_oa_workreminduser
  16. end type
  17. type cbx_1 from checkbox within w_oa_workreminduser
  18. end type
  19. type cb_1 from uo_imflatbutton within w_oa_workreminduser
  20. end type
  21. type r_bar from rectangle within w_oa_workreminduser
  22. end type
  23. type ln_bar2 from line within w_oa_workreminduser
  24. end type
  25. type ln_bar from line within w_oa_workreminduser
  26. end type
  27. end forward
  28. global type w_oa_workreminduser from window
  29. integer width = 3611
  30. integer height = 2380
  31. boolean titlebar = true
  32. string title = "工作提醒用户订阅"
  33. boolean controlmenu = true
  34. boolean minbox = true
  35. windowtype windowtype = popup!
  36. long backcolor = 67108864
  37. string icon = "AppIcon!"
  38. boolean center = true
  39. cb_5 cb_5
  40. cb_2 cb_2
  41. cb_exit cb_exit
  42. dw_list dw_list
  43. tv_1 tv_1
  44. cbx_2 cbx_2
  45. cbx_1 cbx_1
  46. cb_1 cb_1
  47. r_bar r_bar
  48. ln_bar2 ln_bar2
  49. ln_bar ln_bar
  50. end type
  51. global w_oa_workreminduser w_oa_workreminduser
  52. type variables
  53. string is_curmod=''
  54. long il_curid=-1
  55. uo_oa_workremind u_wrm
  56. s_wrm_right user_remindRight[]
  57. boolean ib_edit=false
  58. string is_cansee
  59. end variables
  60. forward prototypes
  61. public subroutine wf_refresh ()
  62. end prototypes
  63. public subroutine wf_refresh ();if ib_edit then
  64. dw_list.setTabOrder("selected",10)
  65. cbx_1.enabled=true
  66. cbx_2.enabled=true
  67. cb_1.enabled=true
  68. cb_2.text="放弃"
  69. cbx_1.checked=false
  70. cbx_2.checked=false
  71. cb_2.normalpicname = 'undo.bmp'
  72. else
  73. dw_list.setTabOrder("selected",0)
  74. cbx_1.enabled=false
  75. cbx_2.enabled=false
  76. cb_1.enabled=false
  77. cb_2.text="修改"
  78. cb_2.normalpicname = 'open.bmp'
  79. end if
  80. cb_1.of_init_draw()
  81. cb_2.of_init_draw()
  82. cb_1.of_paint()
  83. cb_2.of_paint()
  84. cb_1.TriggerEvent('ue_textchange')
  85. cb_2.TriggerEvent('ue_textchange')
  86. end subroutine
  87. on w_oa_workreminduser.create
  88. this.cb_5=create cb_5
  89. this.cb_2=create cb_2
  90. this.cb_exit=create cb_exit
  91. this.dw_list=create dw_list
  92. this.tv_1=create tv_1
  93. this.cbx_2=create cbx_2
  94. this.cbx_1=create cbx_1
  95. this.cb_1=create cb_1
  96. this.r_bar=create r_bar
  97. this.ln_bar2=create ln_bar2
  98. this.ln_bar=create ln_bar
  99. this.Control[]={this.cb_5,&
  100. this.cb_2,&
  101. this.cb_exit,&
  102. this.dw_list,&
  103. this.tv_1,&
  104. this.cbx_2,&
  105. this.cbx_1,&
  106. this.cb_1,&
  107. this.r_bar,&
  108. this.ln_bar2,&
  109. this.ln_bar}
  110. end on
  111. on w_oa_workreminduser.destroy
  112. destroy(this.cb_5)
  113. destroy(this.cb_2)
  114. destroy(this.cb_exit)
  115. destroy(this.dw_list)
  116. destroy(this.tv_1)
  117. destroy(this.cbx_2)
  118. destroy(this.cbx_1)
  119. destroy(this.cb_1)
  120. destroy(this.r_bar)
  121. destroy(this.ln_bar2)
  122. destroy(this.ln_bar)
  123. end on
  124. event resize;ln_bar.EndX = THIS.Width
  125. ln_bar2.EndX = THIS.Width
  126. r_bar.Width = ln_bar2.EndX
  127. //long width1,height1
  128. //width1 = width - 118
  129. //height1 =height - 400
  130. //tv_1.height=height1
  131. //
  132. //dw_list.width=width1 - tv_1.x - tv_1.width - 2
  133. //dw_list.height=height1
  134. //dw_list.x=tv_1.x+tv_1.width+10
  135. //dw_list.y=tv_1.y
  136. dw_list.X = tv_1.X + tv_1.Width + 10
  137. dw_list.Width = THIS.Width - dw_list.X - 40
  138. tv_1.Height = THIS.Height - tv_1.Y - 140
  139. dw_list.Height = tv_1.Height
  140. end event
  141. event open;String ls_userid = publ_operator
  142. String ls_right,arg_msg
  143. Long ll_wrmid
  144. Long cnt_wrm = 0,cnt
  145. dw_list.SetTabOrder("selected",0)
  146. tv_1.SetTrans(sqlca)
  147. dw_list.SetTrans(sqlca)
  148. u_wrm = CREATE uo_oa_workremind
  149. //获取用户订阅列表
  150. IF NOT u_wrm.uf_get_userworkremind(REF ls_right,publ_userid,REF arg_msg) THEN
  151. MessageBox('',arg_msg)
  152. RETURN
  153. END IF
  154. //得到用户可视订阅列
  155. IF NOT u_wrm.uf_get_Cansee(publ_userid,REF is_cansee,REF arg_msg) THEN
  156. MessageBox('',arg_msg)
  157. RETURN
  158. END IF
  159. String list[]
  160. f_oa_workremind_splitstr(is_cansee,",",REF list)
  161. //取提醒定义表的提醒id列
  162. //declare cr cursor for
  163. //select wrmid
  164. //from oa_workreminddef
  165. //where wrmid in (:is_cansee);
  166. //open cr;
  167. //fetch cr into :ll_wrmid;
  168. FOR cnt = 1 TO UpperBound(list)
  169. cnt_wrm++
  170. user_remindRight[cnt_wrm].wrmid = Long(list[cnt])
  171. user_remindRight[cnt_wrm].Selected = 0
  172. // fetch cr into :ll_wrmid;
  173. NEXT
  174. //close cr;
  175. IF ls_right <> '' AND cnt_wrm <> 0 THEN
  176. FOR cnt = 1 TO cnt_wrm
  177. String ls_curWrmid
  178. ls_curWrmid = String(user_remindRight[cnt].wrmid)
  179. IF Pos(ls_right,ls_curWrmid) <> 0 THEN
  180. user_remindRight[cnt].Selected = 1
  181. END IF
  182. NEXT
  183. END IF
  184. IF is_cansee <> "" THEN
  185. tv_1.Retrieve(is_cansee)
  186. // dw_list.retrieve( is_curmod , is_cansee )
  187. //f_oa_workremind_retrieve_list(ref dw_list,is_cansee,is_curmod)
  188. // f_oa_workremind_setRight(user_remindRight,dw_list)
  189. END IF
  190. end event
  191. type cb_5 from uo_imflatbutton within w_oa_workreminduser
  192. integer x = 37
  193. integer width = 169
  194. integer height = 172
  195. integer taborder = 10
  196. string text = "刷新"
  197. string normalpicname = "refresh.bmp"
  198. integer picsize = 16
  199. toolbaralignment pic_align = alignattop!
  200. boolean border = false
  201. end type
  202. event clicked;call super::clicked;
  203. f_oa_workremind_retrieve_list(REF dw_list,is_cansee,is_curMOD)
  204. f_oa_workremind_setRight(user_remindRight,dw_list)
  205. end event
  206. type cb_2 from uo_imflatbutton within w_oa_workreminduser
  207. integer x = 379
  208. integer width = 192
  209. integer height = 172
  210. integer taborder = 10
  211. boolean bringtotop = true
  212. string text = "修改&E"
  213. string normalpicname = "open.bmp"
  214. integer picsize = 16
  215. toolbaralignment pic_align = alignattop!
  216. boolean border = false
  217. end type
  218. event clicked;call super::clicked;
  219. if ib_edit then
  220. IF MessageBox(publ_operator,'是否要确定放弃保存资料', Exclamation!, YesNo!, 2) = 2 THEN
  221. RETURN
  222. END IF
  223. end if
  224. ib_edit=not ib_edit
  225. wf_refresh()
  226. end event
  227. type cb_exit from uo_imflatbutton within w_oa_workreminduser
  228. integer x = 571
  229. integer width = 165
  230. integer height = 172
  231. integer taborder = 20
  232. string text = "退出"
  233. boolean cancel = true
  234. string normalpicname = "exit.bmp"
  235. integer picsize = 16
  236. toolbaralignment pic_align = alignattop!
  237. boolean border = false
  238. end type
  239. event clicked;call super::clicked;close(parent)
  240. end event
  241. type dw_list from datawindow within w_oa_workreminduser
  242. integer x = 1330
  243. integer y = 184
  244. integer width = 2258
  245. integer height = 1344
  246. integer taborder = 30
  247. string title = "工作提醒用户订阅"
  248. string dataobject = "dw_oa_remainddef"
  249. boolean vscrollbar = true
  250. boolean livescroll = true
  251. borderstyle borderstyle = stylelowered!
  252. end type
  253. event rowfocuschanged;IF currentrow > 0 THEN
  254. THIS.SelectRow(0, FALSE)
  255. THIS.SetRow(currentrow)
  256. THIS.SelectRow(currentrow, TRUE)
  257. Long ll_curid
  258. ll_curid = Long(dw_list.Object.WrmID[currentrow])
  259. il_curid = ll_curid
  260. END IF
  261. end event
  262. event clicked;
  263. if row > 0 then
  264. this.selectrow(0, false)
  265. this.setrow(row)
  266. this.selectrow(row, true)
  267. end if
  268. end event
  269. type tv_1 from datawindow within w_oa_workreminduser
  270. integer y = 184
  271. integer width = 1326
  272. integer height = 1348
  273. integer taborder = 20
  274. string title = "none"
  275. string dataobject = "dw_oa_remind_modlist"
  276. boolean livescroll = true
  277. borderstyle borderstyle = stylelowered!
  278. end type
  279. event rowfocuschanged;IF ib_edit THEN
  280. IF MessageBox(publ_operator,'是否要确定放弃保存资料', Exclamation!, YesNo!, 2) = 2 THEN
  281. RETURN
  282. END IF
  283. END IF
  284. if currentrow > 0 then
  285. this.selectrow(0, false)
  286. this.setrow(currentrow)
  287. this.selectrow(currentrow, true)
  288. end if
  289. ib_edit = FALSE
  290. wf_refresh()
  291. is_curMOD = tv_1.Object.ModuleName[currentrow]
  292. //dw_list.retrieve(is_curMOD,is_cansee)
  293. //f_oa_workremind_retrieve_list(REF dw_list,is_cansee,is_curMOD)
  294. //f_oa_workremind_setRight(user_remindRight,dw_list)
  295. cb_5.triggerevent(clicked!)
  296. end event
  297. event clicked;
  298. if row > 0 then
  299. this.selectrow(0, false)
  300. this.setrow(row)
  301. this.selectrow(row, true)
  302. end if
  303. end event
  304. event rowfocuschanging;IF ib_edit THEN return 1
  305. end event
  306. type cbx_2 from checkbox within w_oa_workreminduser
  307. integer x = 1074
  308. integer y = 72
  309. integer width = 238
  310. integer height = 60
  311. integer textsize = -9
  312. integer weight = 400
  313. fontcharset fontcharset = gb2312charset!
  314. fontpitch fontpitch = variable!
  315. string facename = "宋体"
  316. long textcolor = 33554432
  317. long backcolor = 134217739
  318. boolean enabled = false
  319. string text = "反选"
  320. end type
  321. event clicked;cbx_2.checked=false
  322. cbx_1.checked=false
  323. long cnt
  324. for cnt=1 to dw_list.rowcount()
  325. if dw_list.object.selected[cnt]=1 then
  326. dw_list.object.selected[cnt]=0
  327. else
  328. dw_list.object.selected[cnt]=1
  329. end if
  330. next
  331. end event
  332. event constructor;this.BackColor=14215660
  333. end event
  334. type cbx_1 from checkbox within w_oa_workreminduser
  335. integer x = 814
  336. integer y = 72
  337. integer width = 224
  338. integer height = 60
  339. integer textsize = -9
  340. integer weight = 400
  341. fontcharset fontcharset = gb2312charset!
  342. fontpitch fontpitch = variable!
  343. string facename = "宋体"
  344. long textcolor = 33554432
  345. long backcolor = 134217739
  346. boolean enabled = false
  347. string text = "全选"
  348. end type
  349. event clicked;long cnt,curState
  350. if cbx_1.checked then
  351. curstate=1
  352. else
  353. curState=0
  354. end if
  355. for cnt=1 to dw_list.rowcount()
  356. dw_list.object.selected[cnt]=curState
  357. next
  358. end event
  359. event constructor;this.BackColor=14215660
  360. end event
  361. type cb_1 from uo_imflatbutton within w_oa_workreminduser
  362. integer x = 206
  363. integer width = 174
  364. integer height = 172
  365. integer taborder = 10
  366. boolean enabled = false
  367. string text = "保存"
  368. string normalpicname = "SAVE.BMP"
  369. integer picsize = 16
  370. toolbaralignment pic_align = alignattop!
  371. boolean border = false
  372. end type
  373. event clicked;call super::clicked;long cnt
  374. string new_right[]={'',''},arg_msg
  375. //复制一份订阅表
  376. for cnt=1 to dw_list.rowcount()
  377. if dw_list.object.selected[cnt]=1 then
  378. new_right[1]+=string(dw_list.object.wrmid[cnt])+","
  379. end if
  380. new_right[2]+=string(dw_list.object.wrmid[cnt])+","
  381. next
  382. f_oa_workremind_saveright(new_right,ref user_remindRight)
  383. string new_right1=''
  384. for cnt=1 to UpperBound(user_remindRight)
  385. if user_remindRight[cnt].selected=1 then
  386. new_right1+= string(user_remindRight[cnt].wrmid)+","
  387. end if
  388. next
  389. ib_edit=false
  390. wf_refresh()
  391. //dw_list.retrieve(is_curmod)
  392. //f_oa_workremind_retrieve_list(ref dw_list,is_cansee,is_curmod)
  393. //f_oa_workremind_setRight(user_remindRight,ref dw_list)
  394. cb_5.triggerevent(clicked!)
  395. if not u_wrm.uf_add_userworkremind(new_right1,publ_userid,arg_msg) then
  396. messagebox('',arg_msg)
  397. end if
  398. end event
  399. type r_bar from rectangle within w_oa_workreminduser
  400. long linecolor = 16777215
  401. long fillcolor = 1073741824
  402. integer x = 1330
  403. integer y = 8
  404. integer width = 73
  405. integer height = 172
  406. end type
  407. event constructor;this.fillcolor = 14215660
  408. this.linecolor = 14215660
  409. this.x = -1
  410. this.y = -1
  411. this.height = ln_bar2.beginy - 5
  412. this.width=ln_bar2.endx
  413. end event
  414. type ln_bar2 from line within w_oa_workreminduser
  415. long linecolor = 16777215
  416. integer linethickness = 4
  417. integer beginy = 180
  418. integer endx = 3323
  419. integer endy = 180
  420. end type
  421. type ln_bar from line within w_oa_workreminduser
  422. long linecolor = 268435456
  423. integer linethickness = 4
  424. integer beginy = 176
  425. integer endx = 3323
  426. integer endy = 176
  427. end type