Exemplo n.º 1
0
 def addCheckBox2CloneConf(cls, obj, list):
     """ we show the clone checkbox if:
         * The XMPP Plugin is active.
         * There are rooms in the event created by the user who wants to clone
     """
     #list of creators of the chat rooms
     ownersList = [
         cr.getOwner() for cr in DBHelpers().getChatroomList(obj._conf)
     ]
     if PluginsWrapper(
             'InstantMessaging',
             'XMPP').isActive() and obj._rh._aw._currentUser in ownersList:
         list['cloneOptions'] += i18nformat(
             """<li><input type="checkbox" name="cloneChatrooms" id="cloneChatrooms" value="1" />_("Chat Rooms")</li>"""
         )
Exemplo n.º 2
0
    def cloneEvent(cls, confToClone, params):
        """ we'll clone only the chat rooms created by the user who is cloning the conference """
        conf = params['conf']
        user = params['user']
        options = params['options']

        if options.get("chatrooms", True):
            crList = DBHelpers().getChatroomList(confToClone)
            ownersList = [cr.getOwner() for cr in crList]
            if PluginsWrapper('InstantMessaging', 'XMPP').isActive():
                for cr in crList:
                    if user is cr.getOwner():
                        cls()._notify('addConference2Room', {
                            'room': cr,
                            'conf': conf.getId(),
                            'clone': True
                        })