视图问题:我想让视图根据用户登录的身份显示不同的内容,有没有办法?如何写视图的Select?

happydeer
博客专家认证
2002-11-18 09:41:52
比如职员登录,只显示他自己的文档;如果是部门经理,则显示他部门所有成员的文档;如果是财务总监,则显示所有财务处批复出去的文档;如果是总经理,则显示所有文档。

我觉得好复杂,视图的Select条件好难写。或者notes的视图就不支持这样复杂的选择?高手给点建议吧!
...全文
104 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
bingew 2002-11-18
  • 打赏
  • 举报
回复
楼上说的对,我也是这样处理的
small_idiot 2002-11-18
  • 打赏
  • 举报
回复
B/S方式可以用带读作者域选择条件的共享视图。
C/S方式可以用带读作者域选择条件的私有视图。
davidnim 2002-11-18
  • 打赏
  • 举报
回复
用分类视图,然后在表单通过嵌入单个分类视图来实现。
如果你不用分类视图,系统会出现异常。因为,当某个符合视图条件的人员,如职员进入系统,那么系统将正常显示正确的视图出来。但,如果这时有部门经理进入系统,那么系统显示的还是职员的视图。(系统读取服务器的Cache)
liugp 2002-11-18
  • 打赏
  • 举报
回复
是B/S下吗?在嵌入视图属性里选单个视图,公式为Remote_User
davidnim 2002-11-18
  • 打赏
  • 举报
回复
不是的。
视图的第一列属性的“排序”标签中类型,选为“分类”。也就是说,在视图第一列中应该为人员类型,其值则为员工、部门经理、总经理等。视图将按不同分类进行显示。
如果你是新手,请你多查DESIGNER的帮助数据库。
happydeer 2002-11-18
  • 打赏
  • 举报
回复
to davidnim():

您所说的分类视图,是指将视图的选择条件拆分成简单的条件
分别给他们建立视图吗?
我觉得分类也比较麻烦!
比如说某个职员的视图,可以选择文档创建者是这个用户的文档;
比如部门经理,可以选择所有在该部门的文档。
.......
这些分类视图都摆在那里!但是, 我不想让普通职员看到部门
经理能看到的东西!!
happydeer 2002-11-18
  • 打赏
  • 举报
回复

谢谢各位高手!!!
我是想在c/s下实现这样的功能!

small_idiot(开心) :
你是指在表单中放Reader字段吗?

我是新手。如果当前登录的用户不在某个文档的readers列表中,这个文档
就不会在视图中显示了吗?

还有,主文档加了reader字段,那么它的答复文档要不要加呢?
kingwgh 2002-11-18
  • 打赏
  • 举报
回复
以上方法在B/S中总会有问题,
如果要在B/S中实现这个功能的话,
最好的是运行代理生成待办箱。

在代理中先取得当前用户,然后根据这个用户将所有属于该用户要办理的文件以html的形式在RTF域中显示出来。
这样好像一点差错都没有。
以下是我做的发文待办箱:
在表单(form1)中创建一个RTF域:htmlbody
在表单的webqueryopen中运行一个代理(如下):
Dim session As New notessession
Dim db As notesdatabase
Dim doc As notesdocument
Dim docA As NotesDocument

Dim view As notesview
Dim item As notesitem

Set db = session.currentdatabase
Set docA = Session.DocumentContext

Set view = db.getview("viewGWFWYJList")

Set a =New NotesRichTextItem(docA, "htmlbody")

a.appendtext("[<table border=0 cellpadding=1 cellspacing=1 width=100% bordercolor=#D4D0C8 >]")
a.appendtext("[<tr>]")
a.appendtext("[<td width=9% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff><b>待办标记</b></font></td>]")
a.appendtext("[<td width=9% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff><b>文件编号</b></font></td>]")
a.appendtext("[<td width=6% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff ><b>文号</b></font></td>]")
a.appendtext("[<td width=21% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff><b>文件标题</b></font></td>]")
a.appendtext("[<td width=9% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff><b>发文单位</b></font></td>]")
a.appendtext("[<td width=9% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff><b>发文日期</b></font></td>]")
a.appendtext("[<td width=9% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff><b>公文种类</b></font></td>]")
a.appendtext("[<td width=12% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff><b>文件密级</b></font></td>]")
a.appendtext("[<td width=11% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff> <b>紧急程度</b></font></td>]")
a.appendtext("[<td width=9% height=14 align=center nowrap bgcolor=#0080ff ><font size=2 color=#ffffff> <b>签发人</b></font></td>]")
a.appendtext("[</tr>]")

Set doc = view.GetFirstDocument
Do While Not doc Is Nothing
Set item = doc.getfirstitem("FileSendBLRY")
Forall n In item.values
If n = docA.REMOTE_USER(0) Then
a.appendtext("[<tr>]")
a.appendtext("[<td width=9% align=center height=16 nowrap><input type=radio name=select value="+doc.UniversalID+"></td>]")
a.appendtext("[<td width=9% align=center height=16 nowrap>"+doc.DocNumber(0)+"</td>]")
a.appendtext("[<td width=6% height=16 align=center nowrap>"+doc.FileNumber(0)+"第"+doc.FileSubNumber(0)+"号"+"</td>]")
a.appendtext("[<td width=21% height=16 align=center nowrap>"+doc.FileTitle(0)+"</td>]")
a.appendtext("[<td width=9% height=16 align=center nowrap>"+doc.DispatchUnit(0)+"</td>]")
a.appendtext("[<td width=9% height=16 align=center nowrap>"+doc.DispatchDate(0)+"</td>]")
a.appendtext("[<td width=9% height=16 align=center nowrap>"+doc.FileSort(0)+"</td>]")
a.appendtext("[<td width=12% height=16 align=center nowrap>"+doc.FileSecret(0)+"</td>]")
a.appendtext("[<td width=11% height=16 align=center nowrap>"+doc.InstancyDegree(0)+"</td>]")
a.appendtext("[<td width=9% height=16 align=center nowrap>"+doc.SignMan(0)+"</td>]")
a.appendtext("[</tr>]")
End If
End Forall
Set doc = view.getnextdocument(doc)
Loop
a.appendtext("[</table>]")

在代理中根据当前用户的名称,
在所有正在办理的文件中循环一遍,如果某个文件的待办人员列表中包含当前用户的名称,
那就将文档在RTF域中显示出来让当前用户办理,
否则不管它.

davidnim 2002-11-18
  • 打赏
  • 举报
回复
私有视图有个问题,一旦视图需要做修改也是一件非常麻烦的事。
davidnim 2002-11-18
  • 打赏
  • 举报
回复
small_idiot(开心)兄在BS下实现的方法,小弟不敢苟同。
okmynet 2002-11-18
  • 打赏
  • 举报
回复
small_idiot(开心)是对地!

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧