• Moderation - locking,sticking,moving

    By Craig Vertigan 2 decades ago

    I think it makes sense to lock the whole topic not just one response. The same goes for sticking. I also think you should be able to move a topic by moderating any of the responses.



    So I made those changes by looking up the maintopic doc if they didn't moderate that one:



    Sub Initialize

    <br/>
    Dim s As New NotesSession<br/>
    Dim db As NotesDatabase<br/>
    Dim agent As NotesAgent<br/>
    Dim doc As NotesDocument<br/>
    Dim parent As NotesDocument<br/>
    

    %REM

    Changed by Craig Vertigan March 2008

    Instead of just locking the post, we'll lock the whole topic thread (as in most other forums).

    So need to look for the parent document and lock that one.

    %END REM

    <br/>
    Set db = s.CurrentDatabase  <br/>
    Set agent = s.CurrentAgent<br/>
    Set doc= db.GetDocumentByID(agent.ParameterDocID)<br/>
    If Not (doc Is Nothing) Then<br/>
        If doc.ParentDocumentUNID &lt;&gt; &quot;&quot; Then<br/>
            'they have locked a response doc so find the main doc<br/>
            Set parent = db.GetDocumentByUNID(doc.MainUNID(0))<br/>
            If Not (parent Is Nothing) Then<br/>
                Call parent.ReplaceItemValue(&quot;Lock&quot;,&quot;YES&quot;)<br/>
                Call parent.Save(False, False)<br/>
            End If<br/>
        Else<br/>
            'they have locked the parent doc<br/>
            Call doc.ReplaceItemValue(&quot;Lock&quot;,&quot;YES&quot;)<br/>
            Call doc.Save(False, False)<br/>
        End If<br/>
        <br/>
    End If<br/>
    <br/>
    

    End Sub