Ejemplo n.º 1
0
 def CreateGroupMenu(self,gid,mlist,by,ip):
     try:
             self.UserLogger.debug('[%s] mlist= %s'%('CreateGroupMenu',mlist))
             str_selected_menu = ''
             count  = 0
             for x in mlist:
                 str_selected_menu = str_selected_menu + x + ','
                 count = count + 1
             str_selected_menu = str_selected_menu[:-1]
             self.UserLogger.debug('[%s] str_selected_menu= %s'%('CreateGroupMenu',str_selected_menu))
             details = {
                        'groupid':gid,
                        'menulist':str_selected_menu,
                        'menuid_len':count,
                        'logsdesc':'logsdesc',
                        'by':by,
                        'ip':ip,
                        }
             res2 = DBAddMenuToGroup(details)
             self.UserLogger.debug('[%s] %s,%s'%('CreateGroupMenu',str(details),str(res2)))
             return (res2,decode(int(res2['result']), res2['rescode']))
     except:
         exception_log = ('[%s] %s %s,%s,%s')%('CreateGroupMenu',gid,mlist,by,ip)
         self.UserLogger.exception(exception_log)
         return (-1,'Exception Occoured at Business Functions of CreateGroupMenu')
Ejemplo n.º 2
0
 def UpdateMultipleMenuFromSite(self,csv_mid,permission,mpid,by,ip):
     try:
         details = {'csv_mid':csv_mid,
                    'mpid':mpid,
                    'permission':permission,
                    'logsdesc':csv_mid + '-' + permission,
                    'by':by,
                    'ip':ip,
                    }
         result = DBUpdateMultiple(details)
         self.UserLogger.debug('[%s] %s,%s'%('UpdateMultipleMenuFromSite',str(details),str(result)))
         return (result,decode(int(result['result']), result['rescode']))
     except:
         exception_log = ('[%s] %s %s,%s,%s,%s')%('UpdateMultipleMenuFromSite',str(csv_mid),str(permission),str(mpid),str(by),str(ip))
         self.UserLogger.exception(exception_log)
         return (-1,'Exception Occoured at Business Functions while updating multiple menu')
Ejemplo n.º 3
0
 def CreateMenuFromSite(self,name,desc,murl,pid,micon,by,ip):  
     self.UserLogger.debug('inside CreateMenuFromSite')
     try: 
         details = {'name':name,
                    'desc':desc,
                    'murl':murl,
                    'pid':pid,
                    'micon':micon,
                    'by':by,
                    'ip':ip,
                    }
         result = DBInertMenu(details)
         self.UserLogger.debug('[%s] %s,%s'%('UpdateMultipleMenuFromSite',str(details),str(result)))
         return (result,decode(int(result['result']), result['rescode']))
     except:
         exception_log = ('[%s] %s,%s,%s,%s,%s,%s,%s')%('CreateMenuFromSite',name,desc,murl,pid,micon,by,ip)
         self.UserLogger.exception(exception_log)
         return (-1,'Exception Occoured at Business Functions while creating menu')
Ejemplo n.º 4
0
 def UpdateMenuFromSite(self,mid,name,desc,murl,pid,micon,by,ip):
     try:
         tempm = Menu.objects.get(id=mid)
         #TODO : yoy need to dump the previous menu's load here
         details = {'mid':mid,
                    'name':name,
                    'desc':desc,
                    'murl':murl,
                    'pid':pid,
                    'micon':micon,
                    'maction':'UPDATE',
                    'logsdesc': tempm.encode("zip").encode("base64").strip(),
                    'prev':'prev',
                    'by':by,
                    'ip':ip,
                    }
         result = DBUpdateMenu(details)
         self.UserLogger.debug('[%s] %s,%s'%('UpdateMultipleMenuFromSite',str(details),str(result)))
         return (result,decode(int(result['result']), result['rescode']))
     except:
         exception_log = ('[%s] %s %s,%s,%s,%s,%s,%s,%s')%('UpdateMenuFromSite',mid,name,desc,murl,pid,micon,by,ip)
         self.UserLogger.exception(exception_log)
         return (-1,'Exception Occoured at Business Functions while updating menu')