Пример #1
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
       
        self.singleBiblio = SingleBiblio.SingleBiblio(allTables)

    
        self.loadGlade('biblio.xml')
        self.win1 = self.getWidget('BiblioMainwindow')
        #self.setStatusBar()
        self.allTables = allTables

        self.EntriesBiblio = 'biblio.xml'
        
        self.loadEntries(self.EntriesBiblio)
        
        self.singleBiblio.setEntries(self.getDataEntries('biblio.xml') )
        self.singleBiblio.setGladeXml(self.xml)
        self.singleBiblio.setTreeFields( ['title', 'designation','year','month'] )
        self.singleBiblio.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT, gobject.TYPE_UINT, gobject.TYPE_UINT) ) 
        self.singleBiblio.setTreeOrder('title,year,month')
        self.singleBiblio.setListHeader([_('Title'), _('Designation'), _('Year'),_('Month')])
        self.singleBiblio.setTree(self.xml.get_widget('tree1') )

  
  

        # set values for comboBox

          

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','mi_biblio1')
  

               
        # seperate Menus
        self.addEnabledMenuItems('biblio','mi_biblio1')
          

        # enabledMenues for Address
        self.addEnabledMenuItems('editBiblio','mi_new1')
        self.addEnabledMenuItems('editBiblio','mi_clear1')
        self.addEnabledMenuItems('editBiblio','mi_print1')
        self.addEnabledMenuItems('editBiblio','mi_edit1')


    
        

        # tabs from notebook
        self.tabBiblio = 0
    
        
        

        self.tabChanged()
Пример #2
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
       
        self.singleClient = SingleClient.SingleClient(allTables)

    
        self.loadGlade('address.xml')
        self.win1 = self.getWidget('AddressMainwindow')
        self.setStatusBar()


        self.EntriesAddresses = 'addresses.xml'
        
        self.loadEntries(self.EntriesAddresses)
        
        self.singleAddress.setEntries(self.getDataEntries('addresses.xml') )
        self.singleAddress.setGladeXml(self.xml)
        self.singleAddress.setTreeFields( ['lastname', 'firstname','city'] )
        self.singleAddress.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleAddress.setTreeOrder('lastname, firstname')
        self.singleAddress.setListHeader([_('Lastname'), _('Firstname'), _('City')])
        self.singleAddress.setTree(self.xml.get_widget('tree1') )

  
  

        # set values for comboBox

          

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','mi_address1')
  

               
        # seperate Menus
        self.addEnabledMenuItems('address','mi_address1')
          

        # enabledMenues for Address
        self.addEnabledMenuItems('editAddress','mi_new1')
        self.addEnabledMenuItems('editAddress','mi_clear1')
        self.addEnabledMenuItems('editAddress','mi_print1')
        self.addEnabledMenuItems('editAddress','mi_edit1')


    
        

        # tabs from notebook
        self.tabClients = 0
    
        
        

        self.tabChanged()
Пример #3
0
    def __init__(self):

        chooseWindows.__init__(self)
        fname = '../usr/share/cuon/glade/reportbuilder.glade2'
        try:
            self.xml = gtk.Builder()
            self.xml.add_from_file(fname)
        except Exception, params:
            print Exception, params
Пример #4
0
    def __init__(self, initialWidget = None, initialFilename = None):

        chooseWindows.__init__(self)
        self.chooseMenuitem = None
        
        self.loadGlade('fileselection.xml')
        self.fileWidget = None
        self.fileName = None
        self.filedata = []
        self.fileChooser = self.getWidget('fileselection1')
        if initialWidget:
            self.fileWidget = initalWidget

        if initialFilename:
            self.fileName = initialFilename
            self.getWidget('fileselection1').set_filename(self.fileName)
Пример #5
0
    def __init__(self):

        chooseWindows.__init__(self)
        try:
            self.loadGlade('reportbuilder.xml')
        except:
            
            fname = '../usr/share/cuon/glade/reportbuilder.glade2'
            try:
                self.xml = gtk.Builder()
                self.xml.add_from_file(fname)
            except Exception, params:
                print Exception, params
                
               
            try:
                self.xml.connect_signals(self)
            except Exception, params:
                print Exception, params
Пример #6
0
    def __init__(self, allTables, address_nr=0, partner_nr=0, autoNew = False):
        print 'time 01 = ', time.localtime()
        print "address_nr = " ,  address_nr
        chooseWindows.__init__(self)
        #print 'time 02 = ', time.localtime()

        self.contact_address_id = address_nr
        self.contact_partner_id = partner_nr
        
        self.singleContact = SingleContact.SingleContact(allTables)
        #print 'time 03 = ', time.localtime()

        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        #print 'time 04 = ', time.localtime()
        
        self.singleContact.addressId = address_nr
        
        self.singlePartner = cuon.Addresses.SinglePartner.SinglePartner(allTables)
        
        self.singleContact.partnerId = partner_nr
        #print 'time 05 = ', time.localtime()
    
        self.loadGlade('contact.xml')
        self.win1 = self.getWidget('ContactMainwindow')
        #self.setStatusBar()
        self.allTables = allTables

        self.EntriesContact = 'contact.xml'
        
        self.loadEntries(self.EntriesContact)
        #print 'time 06= ', time.localtime()
        
        self.singleContact.setEntries(self.getDataEntries(self.EntriesContact) )
        self.singleContact.setGladeXml(self.xml)
        self.singleContact.setTreeFields( ['schedul_date','schedul_time_begin','address.lastname as adr '])
        #'select address.lastname where partner_schedul.address_id = address.id) as lastname'] )
        self.singleContact.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT) ) 
        self.singleContact.setListHeader([_('date'), _('time'), _('Address')])
        self.singleContact.setTree(self.getWidget('tree1') )
        self.singleContact.sWhere = ' where address.id = address_id and process_status = 0 and contacter_id = ' +  self.singleContact.getStaffID(self.dicUser) + ' ' 
        if address_nr > 0:
            self.singleContact.sWhere += 'and address_id = ' + `address_nr`
            #self.singleContact.setTreeOrder('schedul_date')

        elif partner_nr > 0:
            self.singleContact.sWhere += 'and partner_id = ' + `partner_nr`
            #self.singleContact.setTreeOrder('schedul_date')
            
        
        #self.singleContact.setTreeOrder("to_date('schedul_date', '" + self.dicUser['DateformatString'] +"')" )
        self.singleContact.setTreeOrder("schedul_date" )


        # set values for comboBox

          

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','contact1')
  

               
        # seperate Menus
        self.addEnabledMenuItems('contact','contact1')
          

        # enabledMenues for Address
        self.addEnabledMenuItems('editContact','new1', self.dicUserKeys['address_new'])
        self.addEnabledMenuItems('editContact','delete1', self.dicUserKeys['address_delete'])
        self.addEnabledMenuItems('editContact','print1')
        self.addEnabledMenuItems('editContact','edit1', self.dicUserKeys['address_edit'])

        # enabledMenues for Save 
        self.addEnabledMenuItems('editSave','save1', self.dicUserKeys['address_save'])
    
        

        # tabs from notebook
        self.tabContact = 0    
        
        

        self.tabChanged()
        
        print 'time 99 ', time.localtime()
        self.win1.add_accel_group(self.accel_group)
        if autoNew:
            self.activateClick('new1')
Пример #7
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
       
        self.singleBank = SingleBank.SingleBank(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        
    
        self.loadGlade('bank.xml')
        self.win1 = self.getWidget('BankMainwindow')
        #self.setStatusBar()
        self.allTables = allTables

        self.EntriesBank = 'bank.xml'
        
        self.loadEntries(self.EntriesBank)
        
        self.singleBank.setEntries(self.getDataEntries(self.EntriesBank) )
        self.singleBank.setGladeXml(self.xml)
        self.singleBank.setTreeFields( ['address.lastname as address_name', \
        'address.city as city','bcn'] )
        self.singleBank.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleBank.setTreeOrder('address_name,city, bcn')
        self.singleBank.setListHeader([_('Lastname'), _('City'),_('BCN')])
        self.singleBank.setTree(self.getWidget('tree1') )
        self.singleBank.sWhere = 'where address.id = address_id '
  
  

        # set values for comboBox

          

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','bank11')
  

               
        # seperate Menus
        self.addEnabledMenuItems('address','bank1')
          

        # enabledMenues for Address
        self.addEnabledMenuItems('editAddress','mi_new1')
        self.addEnabledMenuItems('editAddress','mi_clear1')
        self.addEnabledMenuItems('editAddress','mi_print1')
        self.addEnabledMenuItems('editAddress','mi_edit1')


    
        

        # tabs from notebook
        self.tabClients = 0
    
        
        

        self.tabChanged()
Пример #8
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)

        self.loadGlade('hibernation.xml')
        self.win1 = self.getWidget('HibernationMainwindow')
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulHibernationNumber = 110000        
        self.ModulHibernationPlantNumber = 110100
        
        self.allTables = allTables
        self.dicUserKeys['hibernation_edit'] = 'e'
        self.dicUserKeys['hibernation_delete'] = 'd'
        self.dicUserKeys['hibernation_new'] = 'n'
        self.dicUserKeys['hibernation_print'] = 'p'


        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        self.singleStaff = cuon.Staff.SingleStaff.SingleStaff(allTables)
        self.singleBotany = cuon.Garden.SingleBotany.SingleBotany(allTables)

        self.singleHibernation = SingleHibernation.SingleHibernation(allTables)
        self.singleHibernationPlant = SingleHibernationPlant.SingleHibernationPlant(allTables)
        #self.singleHibernationSales = SingleHibernationSale.SingleHibernationSale(allTables)
        #self.singleHibernationWebshop = SingleHibernationWebshop.SingleHibernationWebshop(allTables)
        #self.singleHibernationStock = SingleHibernationStock.SingleHibernationStock(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        
        # self.singleHibernation.loadTable()
              
        self.EntriesHibernations = 'hibernation.xml'
        self.EntriesHibernationsPlant = 'hibernation_plant.xml'
        #self.EntriesHibernationsSales = 'Hibernations_sales.xml'
        #self.EntriesHibernationsWebshop = 'Hibernations_webshop.xml'
        #self.EntriesHibernationsStock = 'Hibernations_stock.xml'
                
        
        #singleHibernation
 
 
        self.loadEntries(self.EntriesHibernations)
        self.singleHibernation.setEntries(self.getDataEntries( self.EntriesHibernations) )
        self.singleHibernation.setGladeXml(self.xml)
        
        self.singleHibernation.setTree(self.xml.get_widget('tree1') )
        self.singleHibernation.sWhere  = ' where address.id = addressnumber'
        
         #singleHibernationPlant
        
        self.loadEntries(self.EntriesHibernationsPlant)
        self.singleHibernationPlant.setEntries(self.getDataEntries( self.EntriesHibernationsPlant) )
        self.singleHibernationPlant.setGladeXml(self.xml)
##        self.singleHibernationPlant.setTreeFields( ['plant_number','botany_number' ] )
##        self.singleHibernationPlant.setStore( gtk.ListStore(gobject.TYPE_UINT, gobject.TYPE_UINT, gobject.TYPE_UINT) ) 
##        self.singleHibernationPlant.setTreeOrder('plant_number')
#        self.singleHibernationPlant.setListHeader([''])

        self.singleHibernationPlant.sWhere  ='where hibernation_number = ' + `int(self.singleHibernation.ID)` + ' and botany.id = botany_number'
            
        self.singleHibernationPlant.setTree(self.xml.get_widget('tree1') )
  
    
        

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','hibernation1')
        self.addEnabledMenuItems('tabs','plant1')
        #self.addEnabledMenuItems('tabs','mi_sales1')


        # seperate Menus
        self.addEnabledMenuItems('Hibernation','hibernation1')
        self.addEnabledMenuItems('Plant','plant1')
        #self.addEnabledMenuItems('sales','mi_sales1')

        
        # enabledMenues for Hibernation
        self.addEnabledMenuItems('editHibernation','new1', self.dicUserKeys['new'])
        self.addEnabledMenuItems('editHibernation','clear1', self.dicUserKeys['delete'])
        self.addEnabledMenuItems('editHibernation','print1', self.dicUserKeys['print'])
        self.addEnabledMenuItems('editHibernation','edit1',self.dicUserKeys['edit'])

        # enabledMenues for Hibernation_plant
        self.addEnabledMenuItems('editHibernationPlant','PlantNew1', self.dicUserKeys['new'])
        self.addEnabledMenuItems('editHibernationPlant','PlantClear1', self.dicUserKeys['delete'])
        #self.addEnabledMenuItems('editHibernationPlant','PlantPrint1', self.dicUserKeys['hibernation_plant_print'])
        self.addEnabledMenuItems('editHibernationPlant','PlantEdit1',self.dicUserKeys['edit'])

        # enabledMenues for Save 
        self.addEnabledMenuItems('editSave','PlantSave1', self.dicUserKeys['save'])
        self.addEnabledMenuItems('editSave','save1', self.dicUserKeys['save'])


        # tabs from notebook
        self.tabHibernation = 0
        self.tabPlant = 1
        
        # start
        
        self.tabChanged()

##        # enabled menus for Hibernation
##        self.addEnabledMenuItems('editHibernation','new1')
##        self.addEnabledMenuItems('editHibernation','clear1')
##        self.addEnabledMenuItems('editHibernation','print1')
##
##        # enabled menus for Hibernation_Plant
##        self.addEnabledMenuItems('editHibernationPlant','PlantNew1')
##        self.addEnabledMenuItems('editHibernationPlant','PlantClear1')

        
        
##        for i in range(len(tax_vat)) :
##            li = gtk.ListItem(tax_vat[i])
##            cb.list.append_items([li])
##            li.show()
##    
        self.win1.add_accel_group(self.accel_group)
Пример #9
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
        self.loadGlade("leasing.xml", "LeasingMainwindow")
        # self.win1 = self.getWidget('LeasingMainwindow')
        self.win1.maximize()
        self.setStatusBar("vb_main")
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = self.MN["Leasing"]
        self.allTables = allTables
        self.singleLeasing = SingleLeasing.SingleLeasing(allTables)
        #        self.singleLeasingPurchase = SingleLeasingPurchase.SingleLeasingPurchase(allTables)
        #        self.singleLeasingParts = SingleLeasingParts.SingleLeasingParts(allTables)
        #        self.singleLeasingales = SingleLeasingale.SingleLeasingale(allTables)
        #        self.singleLeasingWebshop = SingleLeasingWebshop.SingleLeasingWebshop(allTables)
        #        self.singleLeasingtock = SingleLeasingtock.SingleLeasingtock(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        try:
            self.singleBotany = cuon.Garden.SingleBotany.SingleBotany(allTables)
        except:
            pass

        self.singleMaterialGroup = cuon.Leasing.SingleMaterialgroups.SingleMaterialgroups(allTables)
        # self.singleLeasing.loadTable()

        self.EntriesLeasing = "Leasing.xml"
        #        self.EntriesLeasingPurchase = 'Leasing_purchase.xml'
        #        self.EntriesLeasingParts = 'Leasing_parts.xml'
        #        self.EntriesLeasingSales = 'Leasing_sales.xml'
        #        self.EntriesLeasingWebshop = 'Leasing_webshop.xml'
        #        self.EntriesLeasingStock = 'Leasing_stock.xml'
        #

        # singleLeasing

        self.loadEntries(self.EntriesLeasing)
        self.singleLeasing.setEntries(self.getDataEntries(self.EntriesLeasing))
        self.singleLeasing.setGladeXml(self.xml)
        self.singleLeasing.setTreeFields(["number", "designation"])
        #        self.singleLeasing.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) )
        self.singleLeasing.setTreeOrder("number, designation")
        self.singleLeasing.setTree(self.xml.get_widget("tv_Leasing"))
        self.singleLeasing.setListHeader(["number", "designation"])

        #
        #        #singleLeasingParts
        #
        #        self.loadEntries(self.EntriesLeasingParts)
        #        self.singleLeasingParts.setEntries(self.getDataEntries( self.EntriesLeasingParts) )
        #        self.singleLeasingParts.setGladeXml(self.xml)
        #        self.singleLeasingParts.setTreeFields( ['part_id','designation', 'quantities'] )
        #        self.singleLeasingParts.setListHeader(['Leasing', 'Designation','Quantities' ])
        #        self.singleLeasingParts.setStore( gtk.ListStore(gobject.TYPE_UINT, gobject.TYPE_STRING, gobject.TYPE_STRING,  gobject.TYPE_UINT) )
        #        self.singleLeasingParts.setTreeOrder('part_id')
        ##        self.singleLeasingParts.setListHeader([''])
        #
        #        self.singleLeasingParts.sWhere  ='where Leasing_id = ' + `self.singleLeasing.ID`
        #        self.singleLeasingParts.setTree(self.xml.get_widget('tv_parts') )
        #
        #         #singleLeasingPurchase
        #
        #        self.loadEntries(self.EntriesLeasingPurchase)
        #        self.singleLeasingPurchase.setEntries(self.getDataEntries( self.EntriesLeasingPurchase) )
        #        self.singleLeasingPurchase.setGladeXml(self.xml)
        #        self.singleLeasingPurchase.setTreeFields( ['Leasing_id','vendorsnumber', 'vendorsdesignation',  'unitprice', 'last_date'] )
        #        self.singleLeasingPurchase.setListHeader(['Leasing', 'Vendor ID','Designation','Price', 'Last Date' ])
        #        self.singleLeasingPurchase.setStore( gtk.ListStore(gobject.TYPE_UINT, gobject.TYPE_STRING, gobject.TYPE_STRING,  gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT) )
        #        self.singleLeasingPurchase.setTreeOrder('unitprice asc,vendorsnumber')
        ##        self.singleLeasingPurchase.setListHeader([''])
        #
        #        self.singleLeasingPurchase.sWhere  ='where Leasing_id = ' + `self.singleLeasing.ID`
        #        self.singleLeasingPurchase.setTree(self.xml.get_widget('tv_purchase') )
        #
        #     #singleLeasingales
        #
        #        self.loadEntries(self.EntriesLeasingSales)
        #        self.singleLeasingales.setEntries(self.getDataEntries( self.EntriesLeasingSales) )
        #        self.singleLeasingales.setGladeXml(self.xml)
        #        self.singleLeasingales.setTreeFields( ['designation'] )
        #        self.singleLeasingales.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) )
        #        self.singleLeasingales.setTreeOrder('designation')
        #        self.singleLeasingales.setListHeader([_('Designation')])
        #
        #        self.singleLeasingales.sWhere  ='where Leasing_number = ' + `self.singleLeasing.ID`
        #        self.singleLeasingales.setTree(self.xml.get_widget('tv_sale') )
        #
        #
        #  #singleLeasingWebshop
        #
        #        self.loadEntries(self.EntriesLeasingWebshop)
        #        self.singleLeasingWebshop.setEntries(self.getDataEntries( self.EntriesLeasingWebshop) )
        #        self.singleLeasingWebshop.setGladeXml(self.xml)
        ###        self.singleLeasingWebshop.setTreeFields( ['Leasing_number'] )
        # ##       self.singleLeasingWebshop.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) )
        #  ##      self.singleLeasingWebshop.setTreeOrder('Leasing_number')
        #   ##     self.singleLeasingWebshop.setListHeader([_('Leasing')])
        #
        #        self.singleLeasingWebshop.sWhere  ='where Leasing_number = ' + `self.singleLeasing.ID`
        #        #self.singleLeasingWebshop.setTree(self.xml.get_widget('tree1') )
        #
        #    #singleLeasingtock
        #
        #        self.loadEntries(self.EntriesLeasingStock)
        #        self.singleLeasingtock.setEntries(self.getDataEntries( self.EntriesLeasingStock ))
        #        self.singleLeasingtock.setGladeXml(self.xml)
        ###        self.singleLeasingtock.setTreeFields( ['designation'] )
        ###        self.singleLeasingtock.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) )
        ###        self.singleLeasingtock.setTreeOrder('designation')
        ###        self.singleLeasingtock.setListHeader([_('Designation')])
        #
        #        self.singleLeasingtock.sWhere  ='where Leasing_id = ' + `self.singleLeasing.ID`
        #        #self.singleLeasingtock.setTree(self.xml.get_widget('tree1') )
        #
        #

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems("tabs", "mi_Leasing1")
        self.addEnabledMenuItems("tabs", "mi_purchase1")
        self.addEnabledMenuItems("tabs", "mi_sales1")

        # seperate Menus
        self.addEnabledMenuItems("Leasing", "mi_Leasing1")
        #        self.addEnabledMenuItems('purchase','mi_purchase1')
        #        self.addEnabledMenuItems('sales','mi_sales1')
        #        self.addEnabledMenuItems('sales','parts_list1')
        #
        # enabledMenues for Leasing
        self.addEnabledMenuItems("editLeasing", "new1", self.dicUserKeys["Leasing_new"])
        self.addEnabledMenuItems("editLeasing", "delete1", self.dicUserKeys["Leasing_delete"])
        self.addEnabledMenuItems("editLeasing", "print1", self.dicUserKeys["Leasing_print"])
        self.addEnabledMenuItems("editLeasing", "edit1", self.dicUserKeys["Leasing_edit"])

        #        # enabledMenues for LeasingParts
        #        self.addEnabledMenuItems('editLeasingParts','PartsListNew', self.dicUserKeys['Leasing_new'])
        #        self.addEnabledMenuItems('editPLeasingarts','PartsListDelete')
        #        self.addEnabledMenuItems('editLeasingParts','PartsListEdit', self.dicUserKeys['Leasing_edit'])
        #
        #
        #        # enabledMenues for LeasingPurchase
        #        self.addEnabledMenuItems('editLeasingPurchase','PurchaseNew1', self.dicUserKeys['Leasing_purchase_new'])
        #        self.addEnabledMenuItems('editLeasingPurchase','PurchaseDelete1')
        #        self.addEnabledMenuItems('editLeasingPurchase','PurchaseEdit1', self.dicUserKeys['Leasing_purchase_edit'])
        #
        #       # enabledMenues for Leasingales
        #        self.addEnabledMenuItems('editLeasingales','SalesNew1')
        #        self.addEnabledMenuItems('editLeasingales','SalesDelete1')
        #        self.addEnabledMenuItems('editLeasingales','SalesEdit1')
        #
        #       # enabledMenues for LeasingWebshop
        #        self.addEnabledMenuItems('editLeasingWebshop','WebshopClear1')
        #        self.addEnabledMenuItems('editLeasingWebshop','WebshopEdit1')
        #
        #       # enabledMenues for Leasingtock
        #        self.addEnabledMenuItems('editLeasingtock','StockClear1')
        #        self.addEnabledMenuItems('editLeasingtock','StockEdit1')

        # enabledMenues for Save
        self.addEnabledMenuItems("editSave", "save1", self.dicUserKeys["Leasing_save"])
        #        self.addEnabledMenuItems('editSave','PartsListSave', self.dicUserKeys['Leasing_save'])
        #        self.addEnabledMenuItems('editSave','PurchaseSave1', self.dicUserKeys['Leasing_save'])
        #        self.addEnabledMenuItems('editSave','SalesSave1', self.dicUserKeys['Leasing_save'])
        #        self.addEnabledMenuItems('editSave','WebshopSave1', self.dicUserKeys['Leasing_save'])
        #        self.addEnabledMenuItems('editSave','StockSave1', self.dicUserKeys['Leasing_save'])

        # tabs from notebook
        self.tabLeasing = 0
        self.tabParts = 1
        self.tabPurchase = 2
        self.tabSales = 3
        self.tabWebshop = 4
        self.tabStock = 5

        # start

        self.tabChanged()

        # enabled menus for Leasing
        self.addEnabledMenuItems("editLeasing", "new1")
        self.addEnabledMenuItems("editLeasing", "clear1")
        self.addEnabledMenuItems("editLeasing", "print1")

        #        # enabled menus for Leasing_purchase
        #        self.addEnabledMenuItems('editLeasingPurchase','PurchaseNew1')
        #        self.addEnabledMenuItems('editLeasingPurchase','PurchaseClear1')

        self.win1.add_accel_group(self.accel_group)
Пример #10
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)

        self.loadGlade('botany.xml')
        self.win1 = self.getWidget('BotanyMainwindow')
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = 110500
        self.setStatusBar()
        self.sSearchTable = None

        self.allTables = allTables
        self.singleBotanyDivisio = SingleBotanyDivisio.SingleBotanyDivisio(allTables)
        self.singleBotanyClass = SingleBotanyClass.SingleBotanyClass(allTables)
        self.singleBotanyOrdo = SingleBotanyOrdo.SingleBotanyOrdo(allTables)
        self.singleBotanyFamily = SingleBotanyFamily.SingleBotanyFamily(allTables)
        self.singleBotanyGenus = SingleBotanyGenus.SingleBotanyGenus(allTables)
        self.singleBotany = SingleBotany.SingleBotany(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)

        
        # self.singleBotany.loadTable()
              
        self.EntriesBotanyDivisio = 'botany_divisio.xml'
        self.EntriesBotanyClass = 'botany_class.xml'
        self.EntriesBotanyOrdo = 'botany_ordo.xml'
        self.EntriesBotanyFamily = 'botany_family.xml'
        self.EntriesBotanyGenus = 'botany_genus.xml'
        self.EntriesBotany = 'botany.xml'
                
        
        #singleBotany
 
 
        self.loadEntries(self.EntriesBotanyDivisio)
        self.loadEntries(self.EntriesBotanyClass)
        self.loadEntries(self.EntriesBotanyOrdo)
        self.loadEntries(self.EntriesBotanyFamily)
        self.loadEntries(self.EntriesBotanyGenus)
        self.loadEntries(self.EntriesBotany)
        
        
        self.singleBotanyDivisio.setEntries(self.getDataEntries( self.EntriesBotanyDivisio) )
        self.singleBotanyDivisio.setGladeXml(self.xml)
        self.singleBotanyDivisio.setTree(self.xml.get_widget('tree1') )
        
        self.singleBotanyClass.setEntries(self.getDataEntries( self.EntriesBotanyClass) )
        self.singleBotanyClass.setGladeXml(self.xml)
        self.singleBotanyClass.setTree(self.xml.get_widget('tree1') )

        self.singleBotanyOrdo.setEntries(self.getDataEntries( self.EntriesBotanyOrdo) )
        self.singleBotanyOrdo.setGladeXml(self.xml)
        self.singleBotanyOrdo.setTree(self.xml.get_widget('tree1') )

        self.singleBotanyFamily.setEntries(self.getDataEntries( self.EntriesBotanyFamily) )
        self.singleBotanyFamily.setGladeXml(self.xml)
        self.singleBotanyFamily.setTree(self.xml.get_widget('tree1') )
        
        self.singleBotanyGenus.setEntries(self.getDataEntries( self.EntriesBotanyGenus) )
        self.singleBotanyGenus.setGladeXml(self.xml)
        self.singleBotanyGenus.setTree(self.xml.get_widget('tree1') )
        
        self.singleBotany.setEntries(self.getDataEntries( self.EntriesBotany) )
        self.singleBotany.setGladeXml(self.xml)
        self.singleBotany.setTree(self.xml.get_widget('tree1') )
   
        

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','divisio1')
        self.addEnabledMenuItems('tabs','class1')
        self.addEnabledMenuItems('tabs','ordo1')
        self.addEnabledMenuItems('tabs','family1')
        self.addEnabledMenuItems('tabs','genus1')
        self.addEnabledMenuItems('tabs','botany1')


        # seperate Menus
        self.addEnabledMenuItems('botany','botany1')
        self.addEnabledMenuItems('divisio','divisio1')
        self.addEnabledMenuItems('class','class1')
        self.addEnabledMenuItems('ordo','ordo1')
        self.addEnabledMenuItems('family','family1')
        self.addEnabledMenuItems('genus','genus1')

        
        # enabledMenues for Divisio
        self.addEnabledMenuItems('editDivisio','divisio_new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editDivisio','divisio_clear1', self.dicUserKeys['articles_delete'])
        #self.addEnabledMenuItems('editDivisio','divisio_print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editDivisio','divisio_edit1',self.dicUserKeys['articles_edit'])

        # enabledMenues for Class
        self.addEnabledMenuItems('editClass','class_new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editClass','class_clear1', self.dicUserKeys['articles_delete'])
        #self.addEnabledMenuItems('editClass','class_print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editClass','class_edit1',self.dicUserKeys['articles_edit'])
        # enabledMenues for Ordo
        self.addEnabledMenuItems('editOrdo','ordo_new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editOrdo','ordo_clear1', self.dicUserKeys['articles_delete'])
        #self.addEnabledMenuItems('editOrdo','ordo_print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editOrdo','ordo_edit1',self.dicUserKeys['articles_edit'])
        # enabledMenues for Family
        self.addEnabledMenuItems('editFamily','family_new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editFamily','family_clear1', self.dicUserKeys['articles_delete'])
        #self.addEnabledMenuItems('editFamily','family_print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editFamily','family_edit1',self.dicUserKeys['articles_edit'])
        # enabledMenues for Genus
        self.addEnabledMenuItems('editGenus','genus_new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editGenus','genus_clear1', self.dicUserKeys['articles_delete'])
        #self.addEnabledMenuItems('editGenus','genus_print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editGenus','genus_edit1',self.dicUserKeys['articles_edit'])
        # enabledMenues for Typus
        self.addEnabledMenuItems('editBotany','new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editBotany','clear1', self.dicUserKeys['articles_delete'])
        self.addEnabledMenuItems('editBotany','print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editBotany','edit1',self.dicUserKeys['articles_edit'])
      


        # tabs from notebook
        self.tabDivisio = 0
        self.tabClass = 1
        self.tabOrdo = 2
        self.tabFamily = 3
        self.tabGenus = 4
        self.tabBotany = 5
        

        # start
        
        self.tabChanged()

              
       
    
        self.win1.add_accel_group(self.accel_group)
Пример #11
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
       
        self.singleWeb2 = SingleWeb2.SingleWeb2(allTables)
        self.singleWebImages = SingleWeb2.SingleWeb2(allTables)
        self.singleWebDownload = SingleWeb2.SingleWeb2(allTables)

    
        self.loadGlade('web2.xml', 'Web2Mainwindow')
        #self.win1 = self.getWidget('Web2Mainwindow')
        #self.setStatusBar()
        #self.win1.maximize()
        self.allTables = allTables
        self.ModulNumber = self.MN['Web2']
        self.EntriesWeb2 = 'web2.xml'
        
        self.loadEntries(self.EntriesWeb2)
        
        self.singleWeb2.setEntries(self.getDataEntries('web2.xml') )
        self.singleWeb2.setGladeXml(self.xml)
        self.singleWeb2.setTreeFields( ['name', 'designation'] )
        self.singleWeb2.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT) ) 
        self.singleWeb2.setTreeOrder('type,name')
        self.singleWeb2.setListHeader([_('Name'), _('Designation')])
        self.singleWeb2.setTree(self.xml.get_widget('tree1') )
  

        # set values for comboBox

        self.mi = cuon.Misc.misc.misc()
  

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','websites')
  

               
        # seperate Menus
        self.addEnabledMenuItems('Web2','websites')
          

        # enabledMenues for Address
        self.addEnabledMenuItems('editWeb2','new1')
        self.addEnabledMenuItems('editWeb2','delete1')
        self.addEnabledMenuItems('editWeb2','print1')
        self.addEnabledMenuItems('editWeb2','edit1')


        self.editFilename = None
        
        

        # tabs from notebook
        self.tabWeb2 = 0
        self.tabWebImages = 1
        self.tabWebDownload = 2
        
    
        
        

        self.tabChanged()
Пример #12
0
    def __init__(self, allTables, module = 0, sep_info = None, dicVars={}, dicExtInfo={}):
        
        chooseWindows.__init__(self)

        self.ModulNumber = self.MN['DMS']
        self.dicVars = dicVars
        self.dicExtInfo = dicExtInfo
        self.dicExtInfo['Modul'] = module 
        self.dicExtInfo['Sep_Info'] = sep_info 
        
            
        self.allTables = allTables
        
        self.openDB()
        self.oUser = self.loadObject('User')
        self.closeDB()
        #print self.oUser
        #print '-.............................'
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        
        #print '1 --'
        self.singleDMS = SingleDMS.SingleDMS(allTables)
        #print '2 --'
        self.singleDMS.username = self.oUser.getUserName()
        self.loadGlade('dms.xml', 'DMSMainwindow')
        #self.win1 = self.getWidget('DMSMainwindow')
        #self.win1 = self.getWidget('DMSMainwindow')
        self.diaLink = self.getWidget('diaLink')
        self.diaLink.hide()
        
        self.scanfile = None
        self.liPrintNewsletter = None
        #print '3 --'
        self.EntriesPreferences = 'dms.xml'
        
        if sep_info:
            try:
                if sep_info.has_key('1'):
                    self.sepInfo['1'] = sep_info['1']
                if sep_info.has_key('2'):
                    self.sepInfo['2'] = sep_info['2']
                if sep_info.has_key('3'):
                    self.sepInfo['3'] = sep_info['3']
            except:
                print 'Error by sep-info'
        else:
            self.sepInfo['1'] = self.MN['DMS']

        ##print "Sep-Info 1 ",  self.sepInfo['1']
        #print '4 --'   
        if module > 0:
            self.ModulNumber = module
        if  self.ModulNumber != self.MN['DMS'] :
            self.sWhereStandard = ' where insert_from_module = ' + `self.ModulNumber`
            self.sWhereStandard += ' and  sep_info_1 = ' +  `self.sepInfo['1']`            
        else:
            scd = cuon.Misc.cuon_dialog.cuon_dialog()
        ##print '5 --'        
        if self.ModulNumber == self.MN['Newsletter']:
            cd = cuon.Misc.cuon_dialog.cuon_dialog()
            ok, res = cd.inputLine( _('Print Newsletter'), _('insert label(s) for newsletter'))
            print 'ok = ',  ok, 'Res = ',  res
            if ok and res:
                self.liPrintNewsletter = self.rpc.callRP('Address.getNewsletterAddresses', res, self.dicUser)
                print 'self.liPrintNewsletter = ',  self.liPrintNewsletter
                if self.liPrintNewsletter and self.liPrintNewsletter not in ['NONE','ERROR']:
                    self.getWidget('bFaxNewsletter').set_sensitive(True)
                    self.getWidget('bPrintNewsletter').set_sensitive(True)
    
        
        #print '6 --'
        self.loadEntries(self.EntriesPreferences)
        
        
        self.singleDMS.sWhere = self.sWhereStandard
        self.singleDMS.setEntries(self.getDataEntries('dms.xml') )
        self.singleDMS.setGladeXml(self.xml)
        self.singleDMS.ModulNumber = self.ModulNumber
        print 'self.singleDMS.ModulNumber', self.singleDMS.ModulNumber
        self.singleDMS.setTreeFields( ['title', 'category','document_date',"id"] )
        self.singleDMS.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleDMS.setTreeOrder('title, document_date')
        self.singleDMS.setListHeader([_('Title'), _('Category'), _('Doc.-Date'),_("ID")])
        self.singleDMS.setTree(self.getWidget('tree1') )
        #print '7 --'
        self.singleDMS.imageWidget = self.getWidget('iThumbnail')
        #print '7 -0'
        # Menu-items
        self.initMenuItems()

        #print '7 05'
        
        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','')
        print '7 -1'
        # enabledMenues for Preferences
        #self.addEnabledMenuItems('editProfile','profile1')
        self.addEnabledMenuItems('editDMS','clear1',self.dicUserKeys['delete'])
        #print '7 -2'
        #self.addEnabledMenuItems('editProfile','save1')
        self.addEnabledMenuItems('editDMS','new1',self.dicUserKeys['new'])
        #print '7 -3'
        self.addEnabledMenuItems('editDMS','edit1',self.dicUserKeys['edit'])
        #print '7 -4'
        # enabledMenues for Save 
        self.addEnabledMenuItems('editSave','save1', self.dicUserKeys['save'])
        # tabs from notebook
        self.tabDocument = 0
        self.tabAcc = 1
        self.tabExtract = 2
        
          # add keys
        print "accelgroup = ",  self.accel_group
        try:
            self.win1.add_accel_group(self.accel_group)
        except:
            pass
            
            
        #Now check for automatic-Actions
        self.LastDoc = None
        #print '9 --'
        try:
            if self.dicExtInfo and self.dicExtInfo.has_key('LastDoc'):
                print 'lastdoc found'
                if self.dicExtInfo['Save'] == 'NEW': 
                    self.activateClick('new1')
                    self.LastDoc =self.dicExtInfo['LastDoc']
                    print 'lastDoc = ',  self.LastDoc
                    self.activateClick('bImport',None,'clicked')
                    self.getWidget('eTitle').set_text('NEWLASTDOCUMENT')
                    if  dicExtInfo['Modul'] == self.MN['Address_info']:
                        self.ModulNumber =  self.MN['Address']
                        
                   
                        
                    self.activateClick('save1')
                    self.sWhereStandard = ' where insert_from_module = ' + `self.ModulNumber`
                    self.sWhereStandard += ' and  sep_info_1 = ' +  `self.sepInfo['1']`  
                    self.getWidget('eSearchTitle').set_text('NEWLASTDOCUMENT')
                    self.activateClick('bSearch', 'clicked')
                    del self.dicExtInfo['LastDoc']
                    del self.dicExtInfo['Save'] 
                    
        except Exception,  params:
            print 'error at dicExtInfo',  Exception,  params
Пример #13
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)

        self.loadGlade('garden.xml')
        self.win1 = self.getWidget('GardenMainwindow')
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = self.MN['Garden']        
        self.allTables = allTables
        self.singleArticle = SingleArticle.SingleArticle(allTables)
        self.singleArticlePurchase = SingleArticlePurchase.SingleArticlePurchase(allTables)
        self.singleArticleSales = SingleArticleSale.SingleArticleSale(allTables)
        self.singleArticleWebshop = SingleArticleWebshop.SingleArticleWebshop(allTables)
        self.singleArticleStock = SingleArticleStock.SingleArticleStock(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        
        # self.singleArticle.loadTable()
              
        self.EntriesArticles = 'articles.xml'
        self.EntriesArticlesPurchase = 'articles_purchase.xml'
        self.EntriesArticlesSales = 'articles_sales.xml'
        self.EntriesArticlesWebshop = 'articles_webshop.xml'
        self.EntriesArticlesStock = 'articles_stock.xml'
                
        
        #singleArticle
 
 
        self.loadEntries(self.EntriesArticles)
        self.singleArticle.setEntries(self.getDataEntries( self.EntriesArticles) )
        self.singleArticle.setGladeXml(self.xml)
        self.singleArticle.setTreeFields( ['number', 'designation'] )
#        self.singleArticle.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleArticle.setTreeOrder('number')
        self.singleArticle.setTree(self.xml.get_widget('tree1') )
        self.singleArticle.setListHeader(['number', 'designation', ])
        
         #singleArticlePurchase
        
        self.loadEntries(self.EntriesArticlesPurchase)
        self.singleArticlePurchase.setEntries(self.getDataEntries( self.EntriesArticlesPurchase) )
        self.singleArticlePurchase.setGladeXml(self.xml)
        self.singleArticlePurchase.setTreeFields( ['designation' ] )
        self.singleArticlePurchase.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleArticlePurchase.setTreeOrder('designation')
#        self.singleArticlePurchase.setListHeader([''])

        self.singleArticlePurchase.sWhere  ='where articles_number = ' + `self.singleArticle.ID`
        self.singleArticlePurchase.setTree(self.xml.get_widget('tree1') )
  
     #singleArticleSales
        
        self.loadEntries(self.EntriesArticlesSales)
        self.singleArticleSales.setEntries(self.getDataEntries( self.EntriesArticlesSales) )
        self.singleArticleSales.setGladeXml(self.xml)
        self.singleArticleSales.setTreeFields( ['designation'] )
        self.singleArticleSales.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleArticleSales.setTreeOrder('designation')
        self.singleArticleSales.setListHeader([_('Designation')])

        self.singleArticleSales.sWhere  ='where articles_number = ' + `self.singleArticle.ID`
        self.singleArticleSales.setTree(self.xml.get_widget('tree1') )

  
  #singleArticleWebshop
        
        self.loadEntries(self.EntriesArticlesWebshop)
        self.singleArticleWebshop.setEntries(self.getDataEntries( self.EntriesArticlesWebshop) )
        self.singleArticleWebshop.setGladeXml(self.xml)
##        self.singleArticleWebshop.setTreeFields( ['articles_number'] )
 ##       self.singleArticleWebshop.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
  ##      self.singleArticleWebshop.setTreeOrder('articles_number')
   ##     self.singleArticleWebshop.setListHeader([_('article')])

        self.singleArticleWebshop.sWhere  ='where articles_number = ' + `self.singleArticle.ID`
        self.singleArticleWebshop.setTree(self.xml.get_widget('tree1') )

    #singleArticleStock
        
        self.loadEntries(self.EntriesArticlesStock)
        self.singleArticleStock.setEntries(self.getDataEntries( self.EntriesArticlesStock ))
        self.singleArticleStock.setGladeXml(self.xml)
##        self.singleArticleStock.setTreeFields( ['designation'] )
##        self.singleArticleStock.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
##        self.singleArticleStock.setTreeOrder('designation')
##        self.singleArticleStock.setListHeader([_('Designation')])

        self.singleArticleStock.sWhere  ='where articles_number = ' + `self.singleArticle.ID`
        self.singleArticleStock.setTree(self.xml.get_widget('tree1') )
  
        

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','mi_article1')
        self.addEnabledMenuItems('tabs','mi_purchase1')
        self.addEnabledMenuItems('tabs','mi_sales1')


        # seperate Menus
        self.addEnabledMenuItems('article','mi_article1')
        self.addEnabledMenuItems('purchase','mi_purchase1')
        self.addEnabledMenuItems('sales','mi_sales1')

        
        # enabledMenues for Article
        self.addEnabledMenuItems('editArticle','new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editArticle','clear1', self.dicUserKeys['articles_delete'])
        self.addEnabledMenuItems('editArticle','print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editArticle','edit1',self.dicUserKeys['articles_edit'])

        # enabledMenues for ArticlePurchase
        self.addEnabledMenuItems('editPurchase','PurchaseNew1', self.dicUserKeys['articles_purchase_new'])
        self.addEnabledMenuItems('editPurchase','PurchaseClear1')
        self.addEnabledMenuItems('editPurchase','PurchaseEdit1', self.dicUserKeys['articles_purchase_edit'])
    
       # enabledMenues for ArticleSales
        self.addEnabledMenuItems('editSales','SalesNew1')
        self.addEnabledMenuItems('editSales','SalesClear1')
        self.addEnabledMenuItems('editSales','SalesEdit1')

       # enabledMenues for ArticleWebshop
        self.addEnabledMenuItems('editWebshop','WebshopClear1')
        self.addEnabledMenuItems('editWebshop','WebshopEdit1')

       # enabledMenues for ArticleStock
        self.addEnabledMenuItems('editStock','StockClear1')
        self.addEnabledMenuItems('editStock','StockEdit1')



        # tabs from notebook
        self.tabArticle = 0
        self.tabPurchase = 1
        self.tabSales = 2
        self.tabWebshop = 3
        self.tabStock = 4
        

        # start
        
        self.tabChanged()

        # enabled menus for article
        self.addEnabledMenuItems('editArticle','new1')
        self.addEnabledMenuItems('editArticle','clear1')
        self.addEnabledMenuItems('editArticle','print1')

        # enabled menus for article_purchase
        self.addEnabledMenuItems('editArticlePurchase','PurchaseNew1')
        self.addEnabledMenuItems('editArticlePurchase','PurchaseClear1')

        # init Comboboxes
        tax_vat =  self.rpc.callRP('src.Misc.py_getListOfTaxVat', self.dicUser)
        cb = self.getWidget('cbVat')
        
        for i in range(len(tax_vat)) :
            li = gtk.ListItem(tax_vat[i])
            cb.list.append_items([li])
            li.show()
    
        self.win1.add_accel_group(self.accel_group)
Пример #14
0
    def __init__(self, allTables, preparedTab = 0):

        chooseWindows.__init__(self)
        self.rpc = cuon.XMLRPC.xmlrpc.myXmlRpc()

        self.loadGlade('prefs_finance.xml')
        self.win1 = self.getWidget('PreferencesFinancesMainwindow')
        self.filesel = gtk.FileSelection(title=None)
  
        
        self.allTables = allTables
        self.singlePrefsFinanceVat = SinglePrefsFinanceVat.SinglePrefsFinanceVat(allTables)
        self.singlePrefsFinanceTop = SinglePrefsFinanceTop.SinglePrefsFinanceTop(allTables)
        self.singleFinanceAccountInfo = cuon.Finances.SingleAccountInfo.SingleAccountInfo(allTables)
        self.singleFinanceAccountPlan = cuon.Finances.SingleAccountPlan.SingleAccountPlan(allTables)
        # finances
        #self.sai = cuon.Finances.SingleAccountInfo.SingleAccountInfo(allTables)
        
        # self.singlePrefsFinance.loadTable()
              
        self.EntriesPrefsFinanceVat = 'prefs_finance_vat.xml'
        self.EntriesPrefsFinanceTop = 'prefs_finance_top.xml'
        self.EntriesPrefsFinanceAcctInfo = 'prefs_finance_acctinfo.xml'
        self.EntriesPrefsFinanceAcctPlan = 'prefs_finance_acctplan.xml'
                
        
        #singlePrefsFinanceVat
 
 
        self.loadEntries(self.EntriesPrefsFinanceVat)
        self.singlePrefsFinanceVat.setEntries(self.getDataEntries(self.EntriesPrefsFinanceVat) )
        self.singlePrefsFinanceVat.setGladeXml(self.xml)
        self.singlePrefsFinanceVat.setTreeFields( ['vat_name', 'vat_designation'] )
        self.singlePrefsFinanceVat.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singlePrefsFinanceVat.setTreeOrder('vat_name')
        self.singlePrefsFinanceVat.setTree(self.getWidget('tree1') )
        #self.singlePrefsFinanceVat.setListHeader(['vat_name', 'designation', ])
        
        #singlePrefsFinanceTermsOfPayment(TOP)
 
 
        self.loadEntries(self.EntriesPrefsFinanceTop)
        self.singlePrefsFinanceTop.setEntries(self.getDataEntries(self.EntriesPrefsFinanceTop) )
        self.singlePrefsFinanceTop.setGladeXml(self.xml)
        self.singlePrefsFinanceTop.setTreeFields( ['number', 'designation'] )
        self.singlePrefsFinanceTop.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singlePrefsFinanceTop.setTreeOrder('number')
        self.singlePrefsFinanceTop.setTree(self.getWidget('tree1') )
        #self.singlePrefsFinanceTop.setListHeader(['top_name', 'designation', ])

   
     #singleFinanceAccountInfo
        
        self.loadEntries(self.EntriesPrefsFinanceAcctInfo)
        self.singleFinanceAccountInfo.setEntries(self.getDataEntries(self.EntriesPrefsFinanceAcctInfo) )
        self.singleFinanceAccountInfo.setGladeXml(self.xml)
        self.singleFinanceAccountInfo.setTreeFields( ['account_number', 'designation'] )
        self.singleFinanceAccountInfo.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleFinanceAccountInfo.setTreeOrder('account_plan_number, account_number')
        self.singleFinanceAccountInfo.setListHeader([_('Account-Number'), _('Designation')])

        #self.singleFinanceAccountInfo.sWhere  ='where articles_number = ' + `self.singlePrefsFinance.ID`
        self.singleFinanceAccountInfo.setTree(self.getWidget('tree1') )
  

        #singleFinanceAccountPlan
        
        self.loadEntries(self.EntriesPrefsFinanceAcctPlan)
        self.singleFinanceAccountPlan.setEntries(self.getDataEntries(self.EntriesPrefsFinanceAcctPlan) )
        self.singleFinanceAccountPlan.setGladeXml(self.xml)
        self.singleFinanceAccountPlan.setTreeFields( ['name', 'designation'] )
        self.singleFinanceAccountPlan.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleFinanceAccountPlan.setTreeOrder('name')
        self.singleFinanceAccountPlan.setListHeader([_('Name'), _('Designation')])

        #self.singleFinanceAccountPlan.sWhere  ='where articles_number = ' + `self.singlePrefsFinance.ID`
        self.singleFinanceAccountPlan.setTree(self.getWidget('tree1') )
       

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','mi_vat1')
        self.addEnabledMenuItems('tabs','mi_top11')
        self.addEnabledMenuItems('tabs','mi_acct1')


        # seperate Menus
        self.addEnabledMenuItems('vat','mi_vat1')
        self.addEnabledMenuItems('top','mi_top1')
        self.addEnabledMenuItems('acct','mi_acct1')

        
        # enabledMenues for Vat
        self.addEnabledMenuItems('editVat','new1')
        self.addEnabledMenuItems('editVat','clear1')
        self.addEnabledMenuItems('editVat','print1')
        self.addEnabledMenuItems('editVat','edit1')

        # enabledMenues for Terms of Payment
        self.addEnabledMenuItems('editTop','TopNew1')
        self.addEnabledMenuItems('editTop','TopClear1')
        self.addEnabledMenuItems('editTop','TopEdit1')
    
       # enabledMenues for Account Info
        self.addEnabledMenuItems('editAcct','AcctNew1')
        self.addEnabledMenuItems('editAcct','AcctClear1')
        self.addEnabledMenuItems('editAcct','AcctEdit1')

       # enabledMenues for Account Plan
        self.addEnabledMenuItems('editPlan','AcctPlanNew1')
        self.addEnabledMenuItems('editPlan','AcctPlanClear1')
        self.addEnabledMenuItems('editPlan','AcctPlanEdit1')


        # tabs from notebook
        self.tabVat = 0
        self.tabTop = 1
        self.tabAcctInfo = 2
        self.tabAcctPlan = 3
        
        
        print self.tabVat
        
        # start
        self.tabOption == preparedTab
        self.tabChanged()
Пример #15
0
    def __init__(self, allTables, ClientID = 0, eClient = None):

        chooseWindows.__init__(self)
       
        self.singleClients = SingleClient.SingleClient(allTables)
        self.eClient = eClient 
    
        self.loadGlade('clients.xml')
        self.win1 = self.getWidget('ClientMainwindow')
        #self.setStatusBar()
        if ClientID > 0:
            self.singleClients.ID = ClientID
            
            self.activateClick("bChooseClient")

        else:
            self.EntriesClients = 'clients.xml'
            
            self.loadEntries(self.EntriesClients)
            
            self.singleClients.setEntries(self.getDataEntries('clients.xml') )
            self.singleClients.setGladeXml(self.xml)
            self.singleClients.setTreeFields( ['name', 'designation','client_number'] )
            self.singleClients.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
            self.singleClients.setTreeOrder('name, designation')
            self.singleClients.setListHeader([_('Lastname'), _('Firstname'), _('City')])
            self.singleClients.setTree(self.getWidget('tree1') )
        

      
    
            # set values for comboBox
    
              
    
            # Menu-items
            self.initMenuItems()
    
            # Close Menus for Tab
            self.addEnabledMenuItems('tabs','mi_address1')
      
    
                   
            # seperate Menus
            self.addEnabledMenuItems('address','mi_address1')
              
    
            # enabledMenues for Address
            self.addEnabledMenuItems('editAddress','mi_new1')
            self.addEnabledMenuItems('editAddress','mi_clear1')
            self.addEnabledMenuItems('editAddress','mi_print1')
            self.addEnabledMenuItems('editAddress','mi_edit1')
    
    
        
            
    
            # tabs from notebook
            self.tabClients = 0
        
            
            
    
            self.tabChanged()
Пример #16
0
    def __init__(self, allTables, addrid=0, partnerid=0):

        chooseWindows.__init__(self)
        self.InitForms = True
        self.connectSchedulTreeId = None
        
        #print 'time 1 = ', time.localtime()
        self.ModulNumber = self.MN['MaterialGroups']
        self.singleGroup = SingleMaterialgroups.SingleMaterialgroups(allTables)
        self.singleGroupAccounts = SingleMaterialgroupsAccount.SingleMaterialgroupsAccount(allTables)
        self.singlePrefsFinanceVat = cuon.PrefsFinance.SinglePrefsFinanceVat.SinglePrefsFinanceVat(allTables)
        self.allTables = allTables
        #print 'time 2 = ', time.localtime()
        
        
        # self.singleGroup.loadTable()

        # self.xml = gtk.glade.XML()
    
        self.loadGlade('materialGroup.xml', 'MaterialGroupMainwindow')
        #self.win1 = self.getWidget('AddressMainwindow')
        #self.win1.maximize()
        
        self.setStatusBar()
        #print 'time 3 = ', time.localtime()


        self.EntriesGroups = 'material.xml'
        self.EntriesAccounts = 'material_group_accounts.xml'
        
        #print 'time 4 = ', time.localtime()
        
        self.loadEntries(self.EntriesGroups)
        
        self.singleGroup.setEntries(self.getDataEntries(self.EntriesGroups) )
        self.singleGroup.setGladeXml(self.xml)
        self.singleGroup.setTreeFields( ['name', 'designation'] )
        self.singleGroup.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleGroup.setTreeOrder('name, designation')
        self.singleGroup.setListHeader([_('Name'), _('Designation')])
            
        self.singleGroup.setTree(self.xml.get_widget('tree1') )
        #print 'time 5 = ', time.localtime()
        
      
        #Groupaccounts
        
        self.loadEntries(self.EntriesAccounts )
        self.singleGroupAccounts.setEntries(self.getDataEntries(self.EntriesAccounts) )
        self.singleGroupAccounts.setGladeXml(self.xml)
        self.singleGroupAccounts.setTreeFields([])
        self.singleGroupAccounts.setTreeOrder('id')
        
        self.singleGroupAccounts.sWhere  ='where material_group_id = ' + `self.singleGroup.ID`
        self.singleGroupAccounts.setTree(self.xml.get_widget('tree1') )
        # self.singleMisc.setStore(gtk.ListStore())
        # set values for comboBox

        
        

       
        
            
        #print 'time 11 = ', time.localtime()
        

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','mi_address1')
        self.addEnabledMenuItems('tabs','mi_notes1')
               
        # seperate Menus
        self.addEnabledMenuItems('address','mi_address1')
        self.addEnabledMenuItems('notes','mi_notes1')
        
        # enabledMenues for group
        self.addEnabledMenuItems('editMaterialGroup','new1' , self.dicUserKeys['address_new'])
        self.addEnabledMenuItems('editMaterialGroup','clear1', self.dicUserKeys['address_delete'])
        self.addEnabledMenuItems('editMaterialGroup','print1', self.dicUserKeys['address_print'])
        self.addEnabledMenuItems('editMaterialGroup','edit1', self.dicUserKeys['address_edit'])

        
        # enabledMenues for Notes
        self.addEnabledMenuItems('editNotes', 'NotesEdit1')
  
        # enabledMenues for Save 
        self.addEnabledMenuItems('editSave','save1', self.dicUserKeys['address_save'])
        self.addEnabledMenuItems('editSave','save_account1', self.dicUserKeys['address_save'])

        

        # tabs from notebook
        self.tabGroup = 0
        self.tabAccount = 1
      
        self.tabChanged()
        
        self.win1.add_accel_group(self.accel_group)
Пример #17
0
    def __init__(self, allTables, graveyardid=0, graveid=0,  addressid= 0):

        chooseWindows.__init__(self)
        self.InitForms = True
        self.connectSchedulTreeId = None
        
        self.graveyardID = graveyardid
        self.graveID = graveid
        self.addressID = addressid
        #print 'time 1 = ', time.localtime()
        self.ModulNumber = self.MN['Graveyard']
        self.singleGraveyard = SingleGraveyard.SingleGraveyard(allTables)
        #self.singleGraveyardAccounts = SingleGraveyardsAccount.SingleGraveyardsAccount(allTables)
        self.singlePrefsFinanceVat = cuon.PrefsFinance.SinglePrefsFinanceVat.SinglePrefsFinanceVat(allTables)
        self.allTables = allTables
        #print 'time 2 = ', time.localtime()
        
        
        # self.singleGraveyard.loadTable()

        # self.xml = gtk.glade.XML()
    
        self.loadGlade('graveyard.xml', 'graveyardMainwindow')
        #self.win1 = self.getWidget('graveyardMainwindow')
        print "win1",  self.win1
        #self.win1.maximize()
        
        self.setStatusBar()
        #print 'time 3 = ', time.localtime()


        self.EntriesGraveyard = 'graveyard.xml'
        
        #print 'time 4 = ', time.localtime()
        
        self.loadEntries(self.EntriesGraveyard)
        
        self.singleGraveyard.setEntries(self.getDataEntries(self.EntriesGraveyard) )
        self.singleGraveyard.setGladeXml(self.xml)
        self.singleGraveyard.setTreeFields( ['shortname', 'designation',"id"] )
        self.singleGraveyard.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleGraveyard.setTreeOrder('shortname, designation')
        self.singleGraveyard.setListHeader([_('Name'), _('Designation'),_("ID")])
            
        self.singleGraveyard.setTree(self.getWidget('tree1') )
        #print 'time 5 = ', time.localtime()
        
      
        
        
        

       
        
            
        #print 'time 11 = ', time.localtime()
        

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','graveyard1')
               
        # seperate Menus
        self.addEnabledMenuItems('graveyard','graveyard1')
        self.addEnabledMenuItems('notes','mi_notes1')
        
        # enabledMenues for group
        self.addEnabledMenuItems('editGraveyard','new1' , self.dicUserKeys['address_new'])
        self.addEnabledMenuItems('editGraveyard','clear1', self.dicUserKeys['address_delete'])
        self.addEnabledMenuItems('editGraveyard','print1', self.dicUserKeys['address_print'])
        self.addEnabledMenuItems('editGraveyard','edit1', self.dicUserKeys['address_edit'])

        
#        # enabledMenues for Notes
#        self.addEnabledMenuItems('editNotes', 'NotesEdit1')
#  
#        # enabledMenues for Save 
#        self.addEnabledMenuItems('editSave','save1', self.dicUserKeys['address_save'])
#        self.addEnabledMenuItems('editSave','save_account1', self.dicUserKeys['address_save'])

        

        # tabs from notebook
        self.tabGraveyard = 0
        #self.tabAccount = 1
      
        self.tabChanged()
        
        self.win1.add_accel_group(self.accel_group)
Пример #18
0
    def __init__(self, allTables, dicProject = None, newProject = False, project_id = 0,  project_phase_id = 0, project_task_id = 0 ,  choose = 'Project'):

        chooseWindows.__init__(self)
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = self.MN['Project']
        self.singleProject = SingleProject.SingleProject(allTables)
        self.singleProjectPhases = SingleProjectPhases.SingleProjectPhases(allTables)
        self.singleProjectTasks = SingleProjectTasks.SingleProjectTasks(allTables)
        self.singleProjectTaskStaff = SingleProjectStaffResources.SingleProjectStaffResources(allTables)
        self.singleProjectTaskMaterial = SingleProjectMaterialResources.SingleProjectMaterialResources(allTables)
        #self.singleProjectProgramming = SingleProjectProgramming.SingleProjectProgramming(allTables)
        self.singleStaff = cuon.Staff.SingleStaff.SingleStaff(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        self.singlePartner = cuon.Addresses.SinglePartner.SinglePartner(allTables)
        self.singleArticles = cuon.Articles.SingleArticle.SingleArticle(allTables)
        
        self.allTables = allTables
        self.dicProject = dicProject
        
        # self.singleProject.loadTable()

        # self.xml = gtk.glade.XML()
    
        self.loadGlade('project.xml','ProjectMainwindow' )
        #self.win1 = self.getWidget('ProjectMainwindow')
        self.setStatusBar()


        self.EntriesProject = 'project.xml'
        self.EntriesPhase = 'project_phases.xml'
        self.EntriesTask = 'project_tasks.xml'
        self.EntriesProgramming = 'project_programming.xml'
        self.EntriesTaskStaff = 'project_staff_resources.xml'
        self.EntriesTaskMaterial = 'project_material_resources.xml'
        
        
        self.loadEntries(self.EntriesProject)
        self.loadEntries(self.EntriesPhase)
        self.loadEntries(self.EntriesTask)
        self.loadEntries(self.EntriesProgramming)
        self.loadEntries(self.EntriesTaskStaff)
        self.loadEntries(self.EntriesTaskMaterial)
        
        self.singleProject.setEntries(self.getDataEntries(self.EntriesProject) )
        self.singleProject.setGladeXml(self.xml)
        self.singleProject.setTreeFields( ['name', 'designation', "project_starts_at", "fct_getDays(date(project_starts_at)) as days",  "project_ends_at", 'project_status', 'fct_getLastname(customer_id) as lastname', 'partner_id',"id"] )
        self.singleProject.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_STRING,  gobject.TYPE_STRING, gobject.TYPE_INT,  gobject.TYPE_STRING,gobject.TYPE_STRING,  gobject.TYPE_STRING, gobject.TYPE_UINT, gobject.TYPE_UINT ) ) 
       
        
        self.singleProject.setTreeOrder('id desc')
        
        self.singleProject.setListHeader([_('Name'), _('Designation'),_('Start at'),_('Days'),  _('End at'),  _('Status'),  _('Customer'),  _('Partner'),_("ID")])
        self.singleProject.setTree(self.getWidget('tree1') )

  
        self.singleProjectPhases.setEntries(self.getDataEntries(self.EntriesPhase) )
        self.singleProjectPhases.setGladeXml(self.xml)
        self.singleProjectPhases.setTreeFields( ['name', 'designation',"id"] )
        self.singleProjectPhases.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleProjectPhases.setTreeOrder('name')
        self.singleProjectPhases.setListHeader([_('Name'), _('Designation'),_("ID")])
        self.singleProjectPhases.setTree(self.getWidget('tree1') )

        self.singleProjectTasks.setEntries(self.getDataEntries(self.EntriesTask) )
        self.singleProjectTasks.setGladeXml(self.xml)
        self.singleProjectTasks.setTreeFields( ['name', 'designation',"id"] )
        self.singleProjectTasks.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleProjectTasks.setTreeOrder('name')
        self.singleProjectTasks.setListHeader([_('Name'), _('Designation'),_("ID")])
        self.singleProjectTasks.setTree(self.getWidget('tree1') )

#        self.singleProjectProgramming.setEntries(self.getDataEntries(self.EntriesProgramming) )
        #self.singleProjectProgramming.setGladeXml(self.xml)
        #self.singleProjectProgramming.setTreeFields( ['name', 'designation'] )
        #self.singleProjectProgramming.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        #self.singleProjectProgramming.setTreeOrder('name')
        #self.singleProjectProgramming.setListHeader([_('Name'), _('Designation')])
        #self.singleProjectProgramming.setTree(self.getWidget('tree1') )

        self.singleProjectTaskStaff.setEntries(self.getDataEntries(self.EntriesTaskStaff) )
        self.singleProjectTaskStaff.setGladeXml(self.xml)
        self.singleProjectTaskStaff.setTree(self.getWidget('tree1') )
        self.singleProjectTaskStaff.sWhere = 'where staff.id = staff_id '
        self.singleProjectTaskMaterial.setEntries(self.getDataEntries(self.EntriesTaskMaterial) )
        self.singleProjectTaskMaterial.setGladeXml(self.xml)
        self.singleProjectTaskMaterial.setTree(self.getWidget('tree1') )
        
        self.ProjectID = project_id
        
        # create a new Project from address or somtething else
        if self.dicProject and not newProject and self.ProjectID == 0:
            print self.dicProject
            existProject = self.rpc.callRP('Project.checkExistModulProject', self.dicUser,self.dicProject)
            print 'existProject = ', existProject
            if not existProject or existProject == 'NONE':
                print '~~~~~~~~~~~~~~~~~~~~~~~~~~~~ create new'
                self.rpc.callRP('Projects.createNewProject', self.dicUser,self.dicProject)
            self.singleProject.sWhere = ' where modul_Project_number = ' + `self.dicProject['ModulProjectNumber']` + ' and modul_number = ' + `self.dicProject['ModulNumber']`
        elif self.dicProject and newProject and self.ProjectID == 0:
            dicResult = self.rpc.callRP('Projects.createNewProject', self.dicUser,self.dicProject)
            if dicResult and dicResult not in ['NONE','ERROR']:
                print 'dicResut = ', dicResult
                self.ProjectID = dicResult
                if self.ProjectID > 0:
                    self.singleProject.sWhere = ' where id = ' + `self.ProjectID` 
        elif self.ProjectID > 0:
            self.singleProject.sWhere = ' where id = ' + `self.ProjectID`
            
        liProjectStatus = self.rpc.callRP('Projects.getComboBoxEntries',self.dicUser)
        
        cbProjectStatus = self.getWidget('cbStatus')
        if cbProjectStatus:
            liststore = gtk.ListStore(str)
            for oneStatus in liProjectStatus:
                liststore.append([oneStatus])
            cbProjectStatus.set_model(liststore)
            self.setComboBoxTextColumn(cbProjectStatus)
            cbProjectStatus.show()
            
        # Trees for Proposal,  Order and Invoice 
        self.treeOrder = cuon.Misc.misc.Treeview()
        
        self.treeOrder.start(self.getWidget('tvProjectOrder'),'Text','Order')
         
         
        # Notes
        self.textbufferSources,  self.viewSources = self.getNotesEditor()
        Scrolledwindow = self.getWidget('scSourceNotes')
        Scrolledwindow.add(self.viewSources)
        self.viewSources.show_all()
        Scrolledwindow.show_all()
        # Menu-items
        self.initMenuItems()

        # All window items
        self.addEnabledMenuItems('window','mi_quit1', 'q')
        
        
        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','mi_project1')
        self.addEnabledMenuItems('tabs','mi_phase1')
        self.addEnabledMenuItems('tabs','mi_task1')
        self.addEnabledMenuItems('tabs','mi_staff_resources1')
        self.addEnabledMenuItems('tabs','mi_material_resources1')
        self.addEnabledMenuItems('tabs','programming1')
               
        # seperate Menus
        self.addEnabledMenuItems('project','mi_project1')
        self.addEnabledMenuItems('phase','mi_phase1')
        self.addEnabledMenuItems('tasks','mi_task1')
        self.addEnabledMenuItems('staff_resources','mi_staff_resources1')
        self.addEnabledMenuItems('material_resources','mi_material_resources1')
        self.addEnabledMenuItems('programming','programming1')
        
        
        # enabledMenues for Project
        self.addEnabledMenuItems('editProject','mi_new1' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editProject','mi_clear1', self.dicUserKeys['project_delete'])
#        self.addEnabledMenuItems('editProject','mi_print1', self.dicUserKeys['project_print'])
        self.addEnabledMenuItems('editProject','mi_edit1', self.dicUserKeys['project_edit'])
        
        
        self.addEnabledMenuItems('editPhase','phasenew1' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editPhase','phasedelete1', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editPhase','phaseedit1', self.dicUserKeys['project_edit'])

        self.addEnabledMenuItems('editTasks','task_new' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editTasks','task_delete1', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editTasks','task_edit', self.dicUserKeys['project_edit'])


        self.addEnabledMenuItems('editProgramming','programming_main_new' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editProgramming','programming_main_delete', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editProgramming','programming_main_edit', self.dicUserKeys['project_edit'])

        self.addEnabledMenuItems('editStaffRes','staff_resources_new1' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editStaffRes','staff_resources_delete1', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editStaffRes','staff_resources_edit1', self.dicUserKeys['project_edit'])
        
        self.addEnabledMenuItems('editMaterialRes','material_resources_new1' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editMaterialRes','material_resources_delete1', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editMaterialRes','material_resources_edit1', self.dicUserKeys['project_edit'])

        # enabledMenues for Save 
        self.addEnabledMenuItems('editSave','mi_save1', self.dicUserKeys['project_save'])
        self.addEnabledMenuItems('editSave','phasesave1', self.dicUserKeys['project_save'])
        self.addEnabledMenuItems('editSave','task_save1', self.dicUserKeys['project_save'])
        self.addEnabledMenuItems('editSave','staff_resources_save1', self.dicUserKeys['project_save'])
        self.addEnabledMenuItems('editSave','material_resources_save1', self.dicUserKeys['project_save'])
        self.addEnabledMenuItems('editSave','programming_main_save', self.dicUserKeys['project_save'])
        
        # tabs from notebook
        self.tabProject = 0
        self.tabPhases = 1
        self.tabTasks = 2
        self.tabStaffResources = 3
        self.tabMaterialResources = 4
        self.tabOrder = 5
        self.tabProgramming = 6
        
        self.tabProgrammingMain = 100
        
        print 'tab endet'
        self.win1.add_accel_group(self.accel_group)

        self.tabChanged()
Пример #19
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()

        self.singleProject = SingleProject.SingleProject(allTables)
        self.singleProjectPhases = SingleProjectPhases.SingleProjectPhases(allTables)
        self.singleProjectTasks = SingleProjectTasks.SingleProjectTasks(allTables)
        self.singleProjectTaskStaff = SingleProjectStaffResources.SingleProjectStaffResources(allTables)
        self.singleProjectTaskMaterial = SingleProjectMaterialResources.SingleProjectMaterialResources(allTables)

        self.singleStaff = cuon.Staff.SingleStaff.SingleStaff(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        self.singleArticles = cuon.Articles.SingleArticle.SingleArticle(allTables)

        self.allTables = allTables

        # self.singleProject.loadTable()

        # self.xml = gtk.glade.XML()

        self.loadGlade("project.xml")
        self.win1 = self.getWidget("ProjectMainwindow")
        self.setStatusBar()

        self.EntriesProject = "project.xml"
        self.EntriesPhase = "project_phases.xml"
        self.EntriesTask = "project_tasks.xml"
        self.EntriesTaskStaff = "project_staff_resources.xml"
        self.EntriesTaskMaterial = "project_material_resources.xml"

        self.loadEntries(self.EntriesProject)
        self.loadEntries(self.EntriesPhase)
        self.loadEntries(self.EntriesTask)
        self.loadEntries(self.EntriesTaskStaff)
        self.loadEntries(self.EntriesTaskMaterial)

        self.singleProject.setEntries(self.getDataEntries(self.EntriesProject))
        self.singleProject.setGladeXml(self.xml)
        self.singleProject.setTreeFields(["name", "designation"])
        self.singleProject.setStore(gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT))
        self.singleProject.setTreeOrder("name")
        self.singleProject.setListHeader([_("Name"), _("Designation")])
        self.singleProject.setTree(self.xml.get_widget("tree1"))

        self.singleProjectPhases.setEntries(self.getDataEntries(self.EntriesPhase))
        self.singleProjectPhases.setGladeXml(self.xml)
        self.singleProjectPhases.setTreeFields(["name", "designation"])
        self.singleProjectPhases.setStore(gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT))
        self.singleProjectPhases.setTreeOrder("name")
        self.singleProjectPhases.setListHeader([_("Name"), _("Designation")])
        self.singleProjectPhases.setTree(self.xml.get_widget("tree1"))

        self.singleProjectTasks.setEntries(self.getDataEntries(self.EntriesTask))
        self.singleProjectTasks.setGladeXml(self.xml)
        self.singleProjectTasks.setTreeFields(["name", "designation"])
        self.singleProjectTasks.setStore(gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT))
        self.singleProjectTasks.setTreeOrder("name")
        self.singleProjectTasks.setListHeader([_("Name"), _("Designation")])
        self.singleProjectTasks.setTree(self.xml.get_widget("tree1"))

        self.singleProjectTaskStaff.setEntries(self.getDataEntries(self.EntriesTaskStaff))
        self.singleProjectTaskStaff.setGladeXml(self.xml)
        self.singleProjectTaskStaff.setTree(self.xml.get_widget("tree1"))

        self.singleProjectTaskMaterial.setEntries(self.getDataEntries(self.EntriesTaskMaterial))
        self.singleProjectTaskMaterial.setGladeXml(self.xml)
        self.singleProjectTaskMaterial.setTree(self.xml.get_widget("tree1"))

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems("tabs", "mi_project1")
        self.addEnabledMenuItems("tabs", "mi_phase1")
        self.addEnabledMenuItems("tabs", "mi_task1")
        self.addEnabledMenuItems("tabs", "mi_staff_resources1")
        self.addEnabledMenuItems("tabs", "mi_material_resources1")

        # seperate Menus
        self.addEnabledMenuItems("project", "mi_project1")
        self.addEnabledMenuItems("phase", "mi_phase1")
        self.addEnabledMenuItems("tasks", "mi_task1")
        self.addEnabledMenuItems("staff_resources", "mi_staff_resources1")
        self.addEnabledMenuItems("material_resources", "mi_material_resources1")

        # enabledMenues for Project
        self.addEnabledMenuItems("editProject", "mi_new1", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editProject", "mi_clear1", self.dicUserKeys["project_delete"])
        #        self.addEnabledMenuItems('editProject','mi_print1', self.dicUserKeys['project_print'])
        self.addEnabledMenuItems("editProject", "mi_edit1", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editPhase", "phasenew1", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editPhase", "phasedelete1", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editPhase", "phaseedit1", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editTasks", "task_new", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editTasks", "task_delete1", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editTasks", "task_edit", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editStaffRes", "task_new", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editStaffRes", "task_delete1", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editStaffRes", "task_edit", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editMaterialRes", "task_new", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editMaterialRes", "task_delete1", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editMaterialRes", "task_edit", self.dicUserKeys["project_edit"])

        # tabs from notebook
        self.tabProject = 0
        self.tabPhases = 1
        self.tabTasks = 2
        self.tabStaffResources = 3
        self.tabMaterialResources = 4

        self.tabChanged()
Пример #20
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        
        self.singleProject = SingleProject.SingleProject(allTables)
        self.singleProjectPhases = SingleProjectPhases.SingleProjectPhases(allTables)
        self.singleProjectTasks = SingleProjectTasks.SingleProjectTasks(allTables)
        self.singleProjectTaskStaff = SingleProjectStaffResources.SingleProjectStaffResources(allTables)
        self.singleProjectTaskMaterial = SingleProjectMaterialResources.SingleProjectMaterialResources(allTables)

        self.singleStaff = cuon.Staff.SingleStaff.SingleStaff(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        self.singleArticles = cuon.Articles.SingleArticle.SingleArticle(allTables)
        
        self.allTables = allTables
       
        
        # self.singleProject.loadTable()

        # self.xml = gtk.glade.XML()
    
        self.loadGlade('project.xml')
        self.win1 = self.getWidget('ProjectMainwindow')
        self.setStatusBar()


        self.EntriesProject = 'project.xml'
        self.EntriesPhase = 'project_phases.xml'
        self.EntriesTask = 'project_tasks.xml'
        self.EntriesTaskStaff = 'project_staff_resources.xml'
        self.EntriesTaskMaterial = 'project_material_resources.xml'
        
        
        self.loadEntries(self.EntriesProject)
        self.loadEntries(self.EntriesPhase)
        self.loadEntries(self.EntriesTask)
        self.loadEntries(self.EntriesTaskStaff)
        self.loadEntries(self.EntriesTaskMaterial)
        
        self.singleProject.setEntries(self.getDataEntries(self.EntriesProject) )
        self.singleProject.setGladeXml(self.xml)
        self.singleProject.setTreeFields( ['name', 'designation'] )
        self.singleProject.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleProject.setTreeOrder('name')
        self.singleProject.setListHeader([_('Name'), _('Designation')])
        self.singleProject.setTree(self.xml.get_widget('tree1') )

  
        self.singleProjectPhases.setEntries(self.getDataEntries(self.EntriesPhase) )
        self.singleProjectPhases.setGladeXml(self.xml)
        self.singleProjectPhases.setTreeFields( ['name', 'designation'] )
        self.singleProjectPhases.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleProjectPhases.setTreeOrder('name')
        self.singleProjectPhases.setListHeader([_('Name'), _('Designation')])
        self.singleProjectPhases.setTree(self.xml.get_widget('tree1') )

        self.singleProjectTasks.setEntries(self.getDataEntries(self.EntriesTask) )
        self.singleProjectTasks.setGladeXml(self.xml)
        self.singleProjectTasks.setTreeFields( ['name', 'designation'] )
        self.singleProjectTasks.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleProjectTasks.setTreeOrder('name')
        self.singleProjectTasks.setListHeader([_('Name'), _('Designation')])
        self.singleProjectTasks.setTree(self.xml.get_widget('tree1') )

        self.singleProjectTaskStaff.setEntries(self.getDataEntries(self.EntriesTaskStaff) )
        self.singleProjectTaskStaff.setGladeXml(self.xml)
        self.singleProjectTaskStaff.setTree(self.xml.get_widget('tree1') )
        self.singleProjectTaskStaff.sWhere = 'where staff.id = staff_id '
        self.singleProjectTaskMaterial.setEntries(self.getDataEntries(self.EntriesTaskMaterial) )
        self.singleProjectTaskMaterial.setGladeXml(self.xml)
        self.singleProjectTaskMaterial.setTree(self.xml.get_widget('tree1') )



        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','mi_project1')
        self.addEnabledMenuItems('tabs','mi_phase1')
        self.addEnabledMenuItems('tabs','mi_task1')
        self.addEnabledMenuItems('tabs','mi_staff_resources1')
        self.addEnabledMenuItems('tabs','mi_material_resources1')

               
        # seperate Menus
        self.addEnabledMenuItems('project','mi_project1')
        self.addEnabledMenuItems('phase','mi_phase1')
        self.addEnabledMenuItems('tasks','mi_task1')
        self.addEnabledMenuItems('staff_resources','mi_staff_resources1')
        self.addEnabledMenuItems('material_resources','mi_material_resources1')
        
        # enabledMenues for Project
        self.addEnabledMenuItems('editProject','mi_new1' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editProject','mi_clear1', self.dicUserKeys['project_delete'])
#        self.addEnabledMenuItems('editProject','mi_print1', self.dicUserKeys['project_print'])
        self.addEnabledMenuItems('editProject','mi_edit1', self.dicUserKeys['project_edit'])
        
        
        self.addEnabledMenuItems('editPhase','phasenew1' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editPhase','phasedelete1', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editPhase','phaseedit1', self.dicUserKeys['project_edit'])

        self.addEnabledMenuItems('editTasks','task_new' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editTasks','task_delete1', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editTasks','task_edit', self.dicUserKeys['project_edit'])

        self.addEnabledMenuItems('editStaffRes','task_new' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editStaffRes','task_delete1', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editStaffRes','task_edit', self.dicUserKeys['project_edit'])
        
        self.addEnabledMenuItems('editMaterialRes','task_new' , self.dicUserKeys['project_new'])
        self.addEnabledMenuItems('editMaterialRes','task_delete1', self.dicUserKeys['project_delete'])
        self.addEnabledMenuItems('editMaterialRes','task_edit', self.dicUserKeys['project_edit'])

        # tabs from notebook
        self.tabProject = 0
        self.tabPhases = 1
        self.tabTasks = 2
        self.tabStaffResources = 3
        self.tabMaterialResources = 4
        
        

        self.tabChanged()
Пример #21
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
        self.loadGlade('procurement.xml', 'ProcurementMainwindow')
        #self.win1 = self.getWidget('ArticlesMainwindow')
        #self.win1.maximize()
        self.setStatusBar('vb_main')
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = self.MN['Articles']        
        self.allTables = allTables
        self.singleArticleID = -1
        self.singleArticle = SingleArticle.SingleArticle(allTables)
        self.singleArticleForParts = SingleArticle.SingleArticle(allTables)
        self.singleArticlePurchase = SingleArticlePurchase.SingleArticlePurchase(allTables)
        self.singleArticleParts = SingleArticleParts.SingleArticleParts(allTables)
        self.singleArticleSales = SingleArticleSale.SingleArticleSale(allTables)
        self.singleArticleWebshop = SingleArticleWebshop.SingleArticleWebshop(allTables)
        self.singleArticleStock = SingleArticleStock.SingleArticleStock(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        try:
            self.singleBotany = cuon.Garden.SingleBotany.SingleBotany(allTables)
        except:
            pass
        self.singlePrefsFinanceVat = cuon.PrefsFinance.SinglePrefsFinanceVat.SinglePrefsFinanceVat(allTables)    
        self.singleMaterialGroup = cuon.Articles.SingleMaterialgroups.SingleMaterialgroups(allTables)
        # self.singleArticle.loadTable()
              
        self.EntriesArticles = 'articles.xml'
        self.EntriesArticlesPurchase = 'articles_purchase.xml'
        self.EntriesArticlesParts = 'articles_parts.xml'
        self.EntriesArticlesSales = 'articles_sales.xml'
        self.EntriesArticlesWebshop = 'articles_webshop.xml'
        self.EntriesArticlesStock = 'articles_stock.xml'
                
        
        #singleArticle
 
 
        self.loadEntries(self.EntriesArticles)
        self.singleArticle.setEntries(self.getDataEntries( self.EntriesArticles) )
        self.singleArticle.setGladeXml(self.xml)
        self.singleArticle.setTreeFields( ['number', 'designation'] )
#        self.singleArticle.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleArticle.setTreeOrder('number, designation')
        self.singleArticle.setTree(self.getWidget('tv_article') )
        self.singleArticle.setListHeader(['number', 'designation', ])
        
        
        #singleArticleParts
        
        self.loadEntries(self.EntriesArticlesParts)
        self.singleArticleParts.setEntries(self.getDataEntries( self.EntriesArticlesParts) )
        self.singleArticleParts.setGladeXml(self.xml)
        #self.singleArticleParts.setTreeFields( ['part_id','number','articles.designation', 'quantities'] )
        #self.singleArticleParts.setListHeader(['Article ID', 'Article Number',  'Article Designation', 'Quantities' ])
        #self.singleArticleParts.setStore( gtk.ListStore(gobject.TYPE_UINT, gobject.TYPE_STRING,   gobject.TYPE_STRING, gobject.TYPE_FLOAT,  gobject.TYPE_UINT) ) 
        self.singleArticleParts.setTreeFields( ['part_id','quantities','articles.number as number' ,'articles.designation as ardesignation', 'articles_parts_list.designation as padesignation'] )
        self.singleArticleParts.setListHeader(['Article ID',   'Quantities' , 'Article Number' ,    'Article Designation',  'Part Designation'])
        self.singleArticleParts.setStore( gtk.ListStore(gobject.TYPE_UINT,gobject.TYPE_FLOAT, gobject.TYPE_STRING,  gobject.TYPE_STRING ,  gobject.TYPE_STRING ,  gobject.TYPE_UINT) ) 
        
        self.singleArticleParts.setTreeOrder('part_id')
#        self.singleArticleParts.setListHeader([''])

        self.singleArticleParts.sWhere  ='where article_id = ' + `self.singleArticle.ID` + ' and part_id = articles.id '
        self.singleArticleParts.setTree(self.getWidget('tv_parts') )
  
         #singleArticlePurchase
        
        self.loadEntries(self.EntriesArticlesPurchase)
        self.singleArticlePurchase.setEntries(self.getDataEntries( self.EntriesArticlesPurchase) )
        self.singleArticlePurchase.setGladeXml(self.xml)
        self.singleArticlePurchase.setTreeFields( ['articles_id','vendorsnumber', 'vendorsdesignation',  'unitprice', 'last_date'] )
        self.singleArticlePurchase.setListHeader(['Article', 'Vendor ID','Designation','Price', 'Last Date' ])
        self.singleArticlePurchase.setStore( gtk.ListStore(gobject.TYPE_UINT, gobject.TYPE_STRING, gobject.TYPE_STRING,  gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT) ) 
        self.singleArticlePurchase.setTreeOrder('unitprice asc,vendorsnumber')
#        self.singleArticlePurchase.setListHeader([''])

        self.singleArticlePurchase.sWhere  ='where articles_id = ' + `self.singleArticle.ID`
        self.singleArticlePurchase.setTree(self.getWidget('tv_purchase') )
  
     #singleArticleSales
        
        self.loadEntries(self.EntriesArticlesSales)
        self.singleArticleSales.setEntries(self.getDataEntries( self.EntriesArticlesSales) )
        self.singleArticleSales.setGladeXml(self.xml)
        self.singleArticleSales.setTreeFields( ['designation'] )
        self.singleArticleSales.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleArticleSales.setTreeOrder('designation')
        self.singleArticleSales.setListHeader([_('Designation')])

        self.singleArticleSales.sWhere  ="where articles_number = '" + `self.singleArticle.ID` + "' "
        self.singleArticleSales.setTree(self.getWidget('tv_sale') )

  
  #singleArticleWebshop
        
        self.loadEntries(self.EntriesArticlesWebshop)
        self.singleArticleWebshop.setEntries(self.getDataEntries( self.EntriesArticlesWebshop) )
        self.singleArticleWebshop.setGladeXml(self.xml)
##        self.singleArticleWebshop.setTreeFields( ['articles_number'] )
 ##       self.singleArticleWebshop.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
  ##      self.singleArticleWebshop.setTreeOrder('articles_number')
   ##     self.singleArticleWebshop.setListHeader([_('article')])

        self.singleArticleWebshop.sWhere  ='where articles_number = ' + `self.singleArticle.ID`
        #self.singleArticleWebshop.setTree(self.xml.get_widget('tree1') )

    #singleArticleStock
        
        self.loadEntries(self.EntriesArticlesStock)
        self.singleArticleStock.setEntries(self.getDataEntries( self.EntriesArticlesStock ))
        self.singleArticleStock.setGladeXml(self.xml)
##        self.singleArticleStock.setTreeFields( ['designation'] )
##        self.singleArticleStock.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
##        self.singleArticleStock.setTreeOrder('designation')
##        self.singleArticleStock.setListHeader([_('Designation')])

        self.singleArticleStock.sWhere  ='where articles_id = ' + `self.singleArticle.ID`
        #self.singleArticleStock.setTree(self.xml.get_widget('tree1') )
  
        

        # Menu-items
        self.initMenuItems()

        # All window items
        self.addEnabledMenuItems('window','quit1', 'q')
        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','mi_article1')
        self.addEnabledMenuItems('tabs','mi_purchase1')
        self.addEnabledMenuItems('tabs','mi_sales1')


        # seperate Menus
        self.addEnabledMenuItems('article','mi_article1')
        self.addEnabledMenuItems('purchase','mi_purchase1')
        self.addEnabledMenuItems('sales','mi_sales1')
        self.addEnabledMenuItems('sales','parts_list1')
        
        # enabledMenues for Article
        self.addEnabledMenuItems('editArticle','new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editArticle','delete1', self.dicUserKeys['articles_delete'])
        self.addEnabledMenuItems('editArticle','print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editArticle','edit1',self.dicUserKeys['articles_edit'])
        
        # enabledMenues for ArticleParts
        self.addEnabledMenuItems('editArticleParts','PartsListNew', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editPArticlearts','PartsListDelete')
        self.addEnabledMenuItems('editArticleParts','PartsListEdit', self.dicUserKeys['articles_edit'])
    

        # enabledMenues for ArticlePurchase
        self.addEnabledMenuItems('editArticlePurchase','PurchaseNew1', self.dicUserKeys['articles_purchase_new'])
        self.addEnabledMenuItems('editArticlePurchase','PurchaseDelete1')
        self.addEnabledMenuItems('editArticlePurchase','PurchaseEdit1', self.dicUserKeys['articles_purchase_edit'])
    
       # enabledMenues for ArticleSales
        self.addEnabledMenuItems('editArticleSales','SalesNew1')
        self.addEnabledMenuItems('editArticleSales','SalesDelete1')
        self.addEnabledMenuItems('editArticleSales','SalesEdit1')

       # enabledMenues for ArticleWebshop
        self.addEnabledMenuItems('editArticleWebshop','WebshopClear1')
        self.addEnabledMenuItems('editArticleWebshop','WebshopEdit1')

       # enabledMenues for ArticleStock
        self.addEnabledMenuItems('editArticleStock','StockClear1')
        self.addEnabledMenuItems('editArticleStock','StockEdit1')

        # enabledMenues for Save 
        self.addEnabledMenuItems('editSave','save1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','PartsListSave', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','PurchaseSave1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','SalesSave1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','WebshopSave1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','StockSave1', self.dicUserKeys['articles_save'])

        # tabs from notebook
        self.tabArticle = 0
        self.tabParts = 1
        self.tabPurchase = 2
        self.tabSales = 3
        self.tabWebshop = 4
        self.tabStock = 5
        
        self.textbufferNotes,  self.viewNotes = self.getNotesEditor()
        
        
        
        Scrolledwindow = self.getWidget('scArticleNotes')
        Scrolledwindow.add(self.viewNotes)
        self.viewNotes.show_all()
        Scrolledwindow.show_all()

        # set the widget
        self.singleArticle.NotesArticles = self.textbufferNotes
        # start
        
        self.tabChanged()

        # enabled menus for article
        self.addEnabledMenuItems('editArticle','new1')
        self.addEnabledMenuItems('editArticle','clear1')
        self.addEnabledMenuItems('editArticle','print1')

        # enabled menus for article_purchase
        self.addEnabledMenuItems('editArticlePurchase','PurchaseNew1')
        self.addEnabledMenuItems('editArticlePurchase','PurchaseClear1')

       
        self.win1.add_accel_group(self.accel_group)
Пример #22
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        
        self.singleAddress = SingleAddress.SingleAddress(allTables)
        self.singleMisc = SingleMisc.SingleMisc(allTables)
        self.singlePartner = SinglePartner.SinglePartner(allTables)
        self.singleSchedul = SingleScheduling.SingleScheduling(allTables)
        self.allTables = allTables
       
        
        # self.singleAddress.loadTable()

        # self.xml = gtk.glade.XML()
    
        self.loadGlade('address.xml')
        self.win1 = self.getWidget('AddressMainwindow')
        self.setStatusBar()


        self.EntriesAddresses = 'addresses.xml'
        self.EntriesAddressesMisc = 'addresses_misc.xml'
        self.EntriesAddressesBank = 'addresses_bank.xml'
        self.EntriesPartner = 'partner.xml'
        self.EntriesPartnerSchedul = 'partner_schedul.xml'
        
        self.loadEntries(self.EntriesAddresses)
        
        self.singleAddress.setEntries(self.getDataEntries('addresses.xml') )
        self.singleAddress.setGladeXml(self.xml)
        self.singleAddress.setTreeFields( ['lastname', 'firstname','city'] )
        self.singleAddress.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleAddress.setTreeOrder('lastname, firstname')
        self.singleAddress.setListHeader([_('Lastname'), _('Firstname'), _('City')])
        self.singleAddress.setTree(self.xml.get_widget('tree1') )

  
        #singleMisc
        
        self.loadEntries(self.EntriesAddressesMisc )
        self.singleMisc.setEntries(self.getDataEntries('addresses_misc.xml') )
        self.singleMisc.setGladeXml(self.xml)
        self.singleMisc.setTreeFields([])
        self.singleMisc.setTreeOrder('id')
        
        self.singleMisc.sWhere  ='where address_id = ' + `self.singleAddress.ID`
        self.singleMisc.setTree(self.xml.get_widget('tree1') )
        # self.singleMisc.setStore(gtk.ListStore())
        #singlePartner
        
        self.loadEntries(self.EntriesPartner )
        self.singlePartner.setEntries(self.getDataEntries('partner.xml') )
        self.singlePartner.setGladeXml(self.xml)
        self.singlePartner.setTreeFields( ['lastname', 'firstname','city'] )
        self.singlePartner.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 

        self.singlePartner.setTreeOrder('lastname, firstname')
        self.singlePartner.setListHeader([_('Name of partner'), _('Firstname of partner'), _('City')])

        self.singlePartner.sWhere  ='where addressid = ' + `self.singleAddress.ID`
        self.singlePartner.setTree(self.xml.get_widget('tree1') )



        #singleScheduling
        
        self.loadEntries(self.EntriesPartnerSchedul )
        self.singleSchedul.setEntries(self.getDataEntries('partner_schedul.xml') )
        self.singleSchedul.setGladeXml(self.xml)
        self.singleSchedul.setTreeFields( ['schedul_date','schedul_time_begin','short_remark','priority','process_status'] )
        self.singleSchedul.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT, gobject.TYPE_UINT,   gobject.TYPE_UINT) ) 
        #self.singleSchedul.setTreeFields( [ 'short_remark','priority','process_status'] )
        #self.singleSchedul.setStore( gtk.ListStore( gobject.TYPE_STRING, gobject.TYPE_UINT, gobject.TYPE_UINT,   gobject.TYPE_UINT) ) 
        self.singleSchedul.setTreeOrder('schedul_date, schedul_time_begin')
        self.singleSchedul.setListHeader([_('Date '),_('Time'),  _('shortRemark'), _('Priority'), _('Status')])
 

        self.singleSchedul.sWhere  ='where partnerid = ' + `self.singlePartner.ID`
        self.singleSchedul.setTree(self.xml.get_widget('tree1') )
  

        # set values for comboBox

        cbFashion = self.getWidget('cbFashion')
        if cbFashion:
            cbFashion.set_popdown_strings([_('Customer'),_('Vendor'),_('Authority')])
        
        

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab
        self.addEnabledMenuItems('tabs','mi_address1')
        self.addEnabledMenuItems('tabs','mi_bank1')
        self.addEnabledMenuItems('tabs','mi_misc1')
        self.addEnabledMenuItems('tabs','mi_partner1')
        self.addEnabledMenuItems('tabs','mi_schedul1')

               
        # seperate Menus
        self.addEnabledMenuItems('address','mi_address1')
        self.addEnabledMenuItems('partner','mi_partner1')
        self.addEnabledMenuItems('schedul','mi_schedul1')
        self.addEnabledMenuItems('bank','mi_bank1')
        self.addEnabledMenuItems('misc','mi_misc1')

        # enabledMenues for Address
        self.addEnabledMenuItems('editAddress','mi_new1' , self.dicUserKeys['address_new'])
        self.addEnabledMenuItems('editAddress','mi_clear1', self.dicUserKeys['address_delete'])
        self.addEnabledMenuItems('editAddress','mi_print1', self.dicUserKeys['address_print'])
        self.addEnabledMenuItems('editAddress','mi_edit1', self.dicUserKeys['address_edit'])


        # enabledMenues for Misc
        self.addEnabledMenuItems('editMisc', '')
  

        # enabledMenues for Partner
        self.addEnabledMenuItems('editPartner', 'mi_PartnerNew1', self.dicUserKeys['address_partner_new'])
        self.addEnabledMenuItems('editPartner','mi_PartnerDelete1', self.dicUserKeys['address_partner_delete'])
        #self.addEnabledMenuItems('editPartner','mi_PartnerPrint1', self.dicUserKeys['address_partner_print'])
        self.addEnabledMenuItems('editPartner','mi_PartnerEdit1', self.dicUserKeys['address_partner_edit'])

        # enabledMenues for Schedul
        self.addEnabledMenuItems('editSchedul', 'mi_SchedulNew1')
        self.addEnabledMenuItems('editSchedul', 'mi_SchedulEdit1')
        #self.addEnabledMenuItems('editSchedul','mi_SchedulDelete')
        #self.addEnabledMenuItems('editSchedul','mi_SchedulPrint1')

         
        

        # tabs from notebook
        self.tabAddress = 0
        self.tabBank = 1
        self.tabMisc = 2
        self.tabPartner = 3
        self.tabSchedul = 4
        
        

        self.tabChanged()
Пример #23
0
    def __init__(self, allTables, botid=0):

        chooseWindows.__init__(self)

        self.loadGlade("botany.xml", "BotanyMainwindow")
        # self.win1 = self.getWidget('BotanyMainwindow')
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = self.MN["Botany"]
        self.setStatusBar()
        self.sSearchTable = None

        self.allTables = allTables
        self.singleBotanyDivisio = SingleBotanyDivisio.SingleBotanyDivisio(allTables)
        self.singleBotanyClass = SingleBotanyClass.SingleBotanyClass(allTables)
        self.singleBotanyOrdo = SingleBotanyOrdo.SingleBotanyOrdo(allTables)
        self.singleBotanyFamily = SingleBotanyFamily.SingleBotanyFamily(allTables)
        self.singleBotanyGenus = SingleBotanyGenus.SingleBotanyGenus(allTables)
        self.singleBotany = SingleBotany.SingleBotany(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        self.singleArticle = cuon.Articles.SingleArticle.SingleArticle(allTables)

        # self.singleBotany.loadTable()

        self.EntriesBotanyDivisio = "botany_divisio.xml"
        self.EntriesBotanyClass = "botany_class.xml"
        self.EntriesBotanyOrdo = "botany_ordo.xml"
        self.EntriesBotanyFamily = "botany_family.xml"
        self.EntriesBotanyGenus = "botany_genus.xml"
        self.EntriesBotany = "botany.xml"

        # singleBotany

        self.loadEntries(self.EntriesBotanyDivisio)
        self.loadEntries(self.EntriesBotanyClass)
        self.loadEntries(self.EntriesBotanyOrdo)
        self.loadEntries(self.EntriesBotanyFamily)
        self.loadEntries(self.EntriesBotanyGenus)
        self.loadEntries(self.EntriesBotany)

        self.singleBotanyDivisio.setEntries(self.getDataEntries(self.EntriesBotanyDivisio))
        self.singleBotanyDivisio.setGladeXml(self.xml)
        self.singleBotanyDivisio.setTree(self.getWidget("tree1"))

        self.singleBotanyClass.setEntries(self.getDataEntries(self.EntriesBotanyClass))
        self.singleBotanyClass.setGladeXml(self.xml)
        self.singleBotanyClass.setTree(self.getWidget("tree1"))

        self.singleBotanyOrdo.setEntries(self.getDataEntries(self.EntriesBotanyOrdo))
        self.singleBotanyOrdo.setGladeXml(self.xml)
        self.singleBotanyOrdo.setTree(self.getWidget("tree1"))

        self.singleBotanyFamily.setEntries(self.getDataEntries(self.EntriesBotanyFamily))
        self.singleBotanyFamily.setGladeXml(self.xml)
        self.singleBotanyFamily.setTree(self.getWidget("tree1"))

        self.singleBotanyGenus.setEntries(self.getDataEntries(self.EntriesBotanyGenus))
        self.singleBotanyGenus.setGladeXml(self.xml)
        self.singleBotanyGenus.setTree(self.getWidget("tree1"))

        self.singleBotany.setEntries(self.getDataEntries(self.EntriesBotany))
        self.singleBotany.setGladeXml(self.xml)
        self.singleBotany.setTree(self.getWidget("tree1"))

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems("tabs", "divisio1")
        self.addEnabledMenuItems("tabs", "class1")
        self.addEnabledMenuItems("tabs", "ordo1")
        self.addEnabledMenuItems("tabs", "family1")
        self.addEnabledMenuItems("tabs", "genus1")
        self.addEnabledMenuItems("tabs", "botany1")

        # seperate Menus
        self.addEnabledMenuItems("botany", "botany1")
        self.addEnabledMenuItems("divisio", "divisio1")
        self.addEnabledMenuItems("class", "class1")
        self.addEnabledMenuItems("ordo", "ordo1")
        self.addEnabledMenuItems("family", "family1")
        self.addEnabledMenuItems("genus", "genus1")

        # enabledMenues for Divisio
        self.addEnabledMenuItems("editDivisio", "divisio_new1", self.dicUserKeys["new"])
        self.addEnabledMenuItems("editDivisio", "divisio_clear1", self.dicUserKeys["delete"])
        # self.addEnabledMenuItems('editDivisio','divisio_print1', self.dicUserKeys['print'])
        self.addEnabledMenuItems("editDivisio", "divisio_edit1", self.dicUserKeys["edit"])

        # enabledMenues for Class
        self.addEnabledMenuItems("editClass", "class_new1", self.dicUserKeys["new"])
        self.addEnabledMenuItems("editClass", "class_clear1", self.dicUserKeys["delete"])
        # self.addEnabledMenuItems('editClass','class_print1', self.dicUserKeys['print'])
        self.addEnabledMenuItems("editClass", "class_edit1", self.dicUserKeys["edit"])
        # enabledMenues for Ordo
        self.addEnabledMenuItems("editOrdo", "ordo_new1", self.dicUserKeys["new"])
        self.addEnabledMenuItems("editOrdo", "ordo_clear1", self.dicUserKeys["delete"])
        # self.addEnabledMenuItems('editOrdo','ordo_print1', self.dicUserKeys['print'])
        self.addEnabledMenuItems("editOrdo", "ordo_edit1", self.dicUserKeys["edit"])
        # enabledMenues for Family
        self.addEnabledMenuItems("editFamily", "family_new1", self.dicUserKeys["new"])
        self.addEnabledMenuItems("editFamily", "family_clear1", self.dicUserKeys["delete"])
        # self.addEnabledMenuItems('editFamily','family_print1', self.dicUserKeys['print'])
        self.addEnabledMenuItems("editFamily", "family_edit1", self.dicUserKeys["edit"])
        # enabledMenues for Genus
        self.addEnabledMenuItems("editGenus", "genus_new1", self.dicUserKeys["new"])
        self.addEnabledMenuItems("editGenus", "genus_clear1", self.dicUserKeys["delete"])
        # self.addEnabledMenuItems('editGenus','genus_print1', self.dicUserKeys['print'])
        self.addEnabledMenuItems("editGenus", "genus_edit1", self.dicUserKeys["edit"])
        # enabledMenues for Typus
        self.addEnabledMenuItems("editBotany", "new1", self.dicUserKeys["new"])
        self.addEnabledMenuItems("editBotany", "clear1", self.dicUserKeys["delete"])
        self.addEnabledMenuItems("editBotany", "print1", self.dicUserKeys["print"])
        self.addEnabledMenuItems("editBotany", "edit1", self.dicUserKeys["edit"])

        self.addEnabledMenuItems("editSave", "divisio_save1", self.dicUserKeys["save"])
        self.addEnabledMenuItems("editSave", "class_save1", self.dicUserKeys["save"])
        self.addEnabledMenuItems("editSave", "ordo_save1", self.dicUserKeys["save"])
        self.addEnabledMenuItems("editSave", "family_save1", self.dicUserKeys["save"])
        self.addEnabledMenuItems("editSave", "genus_save1", self.dicUserKeys["save"])

        self.addEnabledMenuItems("editSave", "save1", self.dicUserKeys["save"])

        # tabs from notebook
        self.tabDivisio = 0
        self.tabClass = 1
        self.tabOrdo = 2
        self.tabFamily = 3
        self.tabGenus = 4
        self.tabBotany = 5

        # start
        self.singleBotanyGenus.ID = -3
        nb = self.getWidget("notebook1")
        nb.set_current_page(self.tabBotany)
        # self.tabChanged()

        self.win1.add_accel_group(self.accel_group)
Пример #24
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)

        self.loadGlade('stock.xml')
        self.win1 = self.getWidget('StockMainwindow')
        
        self.allTables = allTables
        self.singleStock = SingleStock.SingleStock(allTables)
        self.singleStockGoods = SingleStockGoods.SingleStockGoods(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        self.singlePartner = cuon.Addresses.SinglePartner.SinglePartner(allTables)
        
        self.singleArticle = cuon.Articles.SingleArticle.SingleArticle(allTables)
       
              
        self.EntriesStock = 'stock.xml'
        self.EntriesStockGoods = 'stockgoods.xml'
        
        
        
        #singleStock
        
        self.loadEntries(self.EntriesStock)
        self.singleStock.setEntries(self.getDataEntries('stock.xml') )
        self.singleStock.setGladeXml(self.xml)
        self.singleStock.setTreeFields( ['name', 'designation'] )
        self.singleStock.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleStock.setTreeOrder('name')
        self.singleStock.setTree(self.xml.get_widget('tree1') )
        self.singleStock.setListHeader([_('name'), _('designation') ])
        
         #singleStockGoods
        
        self.loadEntries(self.EntriesStockGoods)
        self.singleStockGoods.setEntries(self.getDataEntries('stockgoods.xml') )
        self.singleStockGoods.setGladeXml(self.xml)
        self.singleStockGoods.setTreeFields( ['designation' ] )
        self.singleStockGoods.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleStockGoods.setTreeOrder('designation')
        self.singleStockGoods.setListHeader([_('Designation')])

        self.singleStockGoods.sWhere  ='where stock_id = ' + `self.singleStock.ID`
        self.singleStockGoods.setTree(self.xml.get_widget('tree1') )

        

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','stock1')
        self.addEnabledMenuItems('tabs','goods1')


        # seperate Menus
        self.addEnabledMenuItems('stock','stock1')
        self.addEnabledMenuItems('goods','goods1')

        
        # enabledMenues for Stock
        self.addEnabledMenuItems('editStock','New1')
        self.addEnabledMenuItems('editStock','Edit1')
        self.addEnabledMenuItems('editStock','Delete1')

        # enabledMenues for StockGoods
        self.addEnabledMenuItems('editGoods','goodsnew1')
        self.addEnabledMenuItems('editGoods','goodsedit1')
        self.addEnabledMenuItems('editGoods','goodsclear1')
    

        # tabs from notebook
        self.tabStock = 0
        self.tabGoods = 1

        # start
        
        self.tabChanged()
Пример #25
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)

        self.loadGlade('order.xml')
        self.win1 = self.getWidget('OrderMainwindow')
        
        self.allTables = allTables
        self.singleOrder = SingleOrder.SingleOrder(allTables)
        self.singleOrderSupply = SingleOrderSupply.SingleOrderSupply(allTables)
        self.singleOrderGet = SingleOrderGet.SingleOrderGet(allTables)
        self.singleOrderPosition = SingleOrderPosition.SingleOrderPosition(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        self.singlePartner = cuon.Addresses.SinglePartner.SinglePartner(allTables)
        
        self.singleArticle = cuon.Articles.SingleArticle.SingleArticle(allTables)
       
        # self.singleOrder.loadTable()
              
        self.EntriesOrder = 'order.xml'
        self.EntriesOrderSupply = 'order_supply.xml'
        self.EntriesOrderGet = 'order_get.xml'
        self.EntriesOrderPosition = 'order_position.xml'
        self.EntriesOrderMisc = 'order_misc.xml'
        
        
        
        
        #singleOrder
        
        self.loadEntries(self.EntriesOrder)
        self.singleOrder.setEntries(self.getDataEntries(self.EntriesOrder) )
        self.singleOrder.setGladeXml(self.xml)
        self.singleOrder.setTreeFields( ['number', 'designation'] )
        self.singleOrder.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
        self.singleOrder.setTreeOrder('number')
        self.singleOrder.setTree(self.xml.get_widget('tree1') )
        self.singleOrder.setListHeader([_('number'), _('designation') ])
        
         #singleOrderSupply
        
        self.loadEntries(self.EntriesOrderSupply)
        self.singleOrderSupply.setEntries(self.getDataEntries('order_supply.xml') )
        self.singleOrderSupply.setGladeXml(self.xml)
        self.singleOrderSupply.setTreeFields( ['designation' ] )
        self.singleOrderSupply.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleOrderSupply.setTreeOrder('designation')
        self.singleOrderSupply.setListHeader([_('Designation')])

        self.singleOrderSupply.sWhere  ='where ordernumber = ' + `self.singleOrder.ID`
        self.singleOrderSupply.setTree(self.xml.get_widget('tree1') )
  
        #singleOrderGet
        
        self.loadEntries(self.EntriesOrderGet)
        self.singleOrderGet.setEntries(self.getDataEntries('order_get.xml') )
        self.singleOrderGet.setGladeXml(self.xml)
        self.singleOrderGet.setTreeFields( ['designation'] )
        self.singleOrderGet.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleOrderGet.setTreeOrder('designation')
        self.singleOrderGet.setListHeader([_('Designation')])

        self.singleOrderGet.sWhere  ='where ordernumber = ' + `self.singleOrder.ID`
        self.singleOrderGet.setTree(self.xml.get_widget('tree1') )

        # singlePositions
        
        self.loadEntries(self.EntriesOrderPosition)
        self.singleOrderPosition.setEntries(self.getDataEntries(self.EntriesOrderPosition) )
        self.singleOrderPosition.setGladeXml(self.xml)
        self.singleOrderPosition.setTreeFields( ['designation'] )
        self.singleOrderPosition.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleOrderPosition.setTreeOrder('designation')
        self.singleOrderPosition.setListHeader([_('Designation')])

        self.singleOrderPosition.sWhere  ='where orderid = ' + `self.singleOrder.ID`
        self.singleOrderPosition.setTree(self.xml.get_widget('tree1') )
  
        
        self.loadEntries(self.EntriesOrderMisc)
        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','order1')
        self.addEnabledMenuItems('tabs','supply1')
        self.addEnabledMenuItems('tabs','gets1')
        self.addEnabledMenuItems('tabs','positions1')
        self.addEnabledMenuItems('tabs','misc1')


        # seperate Menus
        self.addEnabledMenuItems('order','order1')
        self.addEnabledMenuItems('supply','supply1')
        self.addEnabledMenuItems('gets','gets1')
        self.addEnabledMenuItems('positions','positions1')
        self.addEnabledMenuItems('misc','misc1')
        

        
        # enabledMenues for Order
        self.addEnabledMenuItems('editOrder','new1')
        self.addEnabledMenuItems('editOrder','clear1')
        self.addEnabledMenuItems('editOrder','print1')

        # enabledMenues for Supply
        self.addEnabledMenuItems('editSupply','SupplyNew1')
        self.addEnabledMenuItems('editSuppy','SupplyClear1')
    
       # enabledMenues for Gets
        self.addEnabledMenuItems('editGets','GetsNew1')
        self.addEnabledMenuItems('editGets','GetsClear1')

        # enabledMenues for Positions
        self.addEnabledMenuItems('editPositions','PositionNew1')
        self.addEnabledMenuItems('editPositions','PositionClear1')




        # tabs from notebook
        self.tabOrder = 0
        self.tabSupply = 1
        self.tabGet = 2
        self.tabPosition = 3
        self.tabInvoice = 4
        self.tabMisc = 5

        # start
        
        self.tabChanged()
Пример #26
0
    def __init__(
        self,
        allTables,
        dicProject=None,
        newProject=False,
        project_id=0,
        project_phase_id=0,
        project_task_id=0,
        choose="Project",
    ):

        chooseWindows.__init__(self)
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = self.MN["Project"]
        self.singleProject = SingleProject.SingleProject(allTables)
        self.singleProjectPhases = SingleProjectPhases.SingleProjectPhases(allTables)
        self.singleProjectTasks = SingleProjectTasks.SingleProjectTasks(allTables)
        self.singleProjectTaskStaff = SingleProjectStaffResources.SingleProjectStaffResources(allTables)
        self.singleProjectTaskMaterial = SingleProjectMaterialResources.SingleProjectMaterialResources(allTables)
        self.singleProjectProgramming = SingleProjectProgramming.SingleProjectProgramming(allTables)
        self.singleStaff = cuon.Staff.SingleStaff.SingleStaff(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        self.singlePartner = cuon.Addresses.SinglePartner.SinglePartner(allTables)
        self.singleArticles = cuon.Articles.SingleArticle.SingleArticle(allTables)

        self.allTables = allTables
        self.dicProject = dicProject

        # self.singleProject.loadTable()

        # self.xml = gtk.glade.XML()

        self.loadGlade("project.xml", "ProjectMainwindow")
        # self.win1 = self.getWidget('ProjectMainwindow')
        self.setStatusBar()

        self.EntriesProject = "project.xml"
        self.EntriesPhase = "project_phases.xml"
        self.EntriesTask = "project_tasks.xml"
        self.EntriesProgramming = "project_programming.xml"
        self.EntriesTaskStaff = "project_staff_resources.xml"
        self.EntriesTaskMaterial = "project_material_resources.xml"

        self.loadEntries(self.EntriesProject)
        self.loadEntries(self.EntriesPhase)
        self.loadEntries(self.EntriesTask)
        self.loadEntries(self.EntriesProgramming)
        self.loadEntries(self.EntriesTaskStaff)
        self.loadEntries(self.EntriesTaskMaterial)

        self.singleProject.setEntries(self.getDataEntries(self.EntriesProject))
        self.singleProject.setGladeXml(self.xml)
        self.singleProject.setTreeFields(
            [
                "name",
                "designation",
                "project_starts_at",
                "project_ends_at",
                "project_status",
                "customer_id",
                "partner_id",
            ]
        )
        self.singleProject.setStore(
            gtk.ListStore(
                gobject.TYPE_STRING,
                gobject.TYPE_STRING,
                gobject.TYPE_STRING,
                gobject.TYPE_STRING,
                gobject.TYPE_UINT,
                gobject.TYPE_STRING,
                gobject.TYPE_STRING,
                gobject.TYPE_UINT,
            )
        )
        self.singleProject.setTreeOrder("name")
        self.singleProject.setListHeader(
            [_("Name"), _("Designation"), _("Start at"), _("End at"), _("Status"), _("Customer"), _("Partner")]
        )
        self.singleProject.setTree(self.getWidget("tree1"))

        self.singleProjectPhases.setEntries(self.getDataEntries(self.EntriesPhase))
        self.singleProjectPhases.setGladeXml(self.xml)
        self.singleProjectPhases.setTreeFields(["name", "designation"])
        self.singleProjectPhases.setStore(gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT))
        self.singleProjectPhases.setTreeOrder("name")
        self.singleProjectPhases.setListHeader([_("Name"), _("Designation")])
        self.singleProjectPhases.setTree(self.getWidget("tree1"))

        self.singleProjectTasks.setEntries(self.getDataEntries(self.EntriesTask))
        self.singleProjectTasks.setGladeXml(self.xml)
        self.singleProjectTasks.setTreeFields(["name", "designation"])
        self.singleProjectTasks.setStore(gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT))
        self.singleProjectTasks.setTreeOrder("name")
        self.singleProjectTasks.setListHeader([_("Name"), _("Designation")])
        self.singleProjectTasks.setTree(self.getWidget("tree1"))

        self.singleProjectProgramming.setEntries(self.getDataEntries(self.EntriesProgramming))
        self.singleProjectProgramming.setGladeXml(self.xml)
        self.singleProjectProgramming.setTreeFields(["name", "designation"])
        self.singleProjectProgramming.setStore(
            gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT)
        )
        self.singleProjectProgramming.setTreeOrder("name")
        self.singleProjectProgramming.setListHeader([_("Name"), _("Designation")])
        self.singleProjectProgramming.setTree(self.getWidget("tree1"))

        self.singleProjectTaskStaff.setEntries(self.getDataEntries(self.EntriesTaskStaff))
        self.singleProjectTaskStaff.setGladeXml(self.xml)
        self.singleProjectTaskStaff.setTree(self.getWidget("tree1"))
        self.singleProjectTaskStaff.sWhere = "where staff.id = staff_id "
        self.singleProjectTaskMaterial.setEntries(self.getDataEntries(self.EntriesTaskMaterial))
        self.singleProjectTaskMaterial.setGladeXml(self.xml)
        self.singleProjectTaskMaterial.setTree(self.getWidget("tree1"))

        self.ProjectID = project_id

        # create a new Project from address or somtething else
        if self.dicProject and not newProject and self.ProjectID == 0:
            print self.dicProject
            existProject = self.rpc.callRP("Project.checkExistModulProject", self.dicUser, self.dicProject)
            print "existProject = ", existProject
            if not existProject or existProject == "NONE":
                print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~ create new"
                self.rpc.callRP("Projects.createNewProject", self.dicUser, self.dicProject)
            self.singleProject.sWhere = (
                " where modul_Project_number = "
                + ` self.dicProject["ModulProjectNumber"] `
                + " and modul_number = "
                + ` self.dicProject["ModulNumber"] `
            )
        elif self.dicProject and newProject and self.ProjectID == 0:
            dicResult = self.rpc.callRP("Projects.createNewProject", self.dicUser, self.dicProject)
            if dicResult and dicResult not in ["NONE", "ERROR"]:
                print "dicResut = ", dicResult
                self.ProjectID = dicResult
                if self.ProjectID > 0:
                    self.singleProject.sWhere = " where id = " + ` self.ProjectID `
        elif self.ProjectID > 0:
            self.singleProject.sWhere = " where id = " + ` self.ProjectID `

        liProjectStatus = self.rpc.callRP("Projects.getComboBoxEntries", self.dicUser)

        cbProjectStatus = self.getWidget("cbStatus")
        if cbProjectStatus:
            liststore = gtk.ListStore(str)
            for oneStatus in liProjectStatus:
                liststore.append([oneStatus])
            cbProjectStatus.set_model(liststore)
            cbProjectStatus.set_text_column(0)
            cbProjectStatus.show()

        # Trees for Proposal,  Order and Invoice
        self.treeOrder = cuon.Misc.misc.Treeview()

        self.treeOrder.start(self.getWidget("tvProjectOrder"), "Text", "Order")

        # Notes
        self.textbufferSources, self.viewSources = self.getNotesEditor()
        Scrolledwindow = self.getWidget("scSourceNotes")
        Scrolledwindow.add(self.viewSources)
        self.viewSources.show_all()
        Scrolledwindow.show_all()
        # Menu-items
        self.initMenuItems()

        # All window items
        self.addEnabledMenuItems("window", "mi_quit1", "z")

        # Close Menus for Tab
        self.addEnabledMenuItems("tabs", "mi_project1")
        self.addEnabledMenuItems("tabs", "mi_phase1")
        self.addEnabledMenuItems("tabs", "mi_task1")
        self.addEnabledMenuItems("tabs", "mi_staff_resources1")
        self.addEnabledMenuItems("tabs", "mi_material_resources1")
        self.addEnabledMenuItems("tabs", "programming1")

        # seperate Menus
        self.addEnabledMenuItems("project", "mi_project1")
        self.addEnabledMenuItems("phase", "mi_phase1")
        self.addEnabledMenuItems("tasks", "mi_task1")
        self.addEnabledMenuItems("staff_resources", "mi_staff_resources1")
        self.addEnabledMenuItems("material_resources", "mi_material_resources1")
        self.addEnabledMenuItems("programming", "programming1")

        # enabledMenues for Project
        self.addEnabledMenuItems("editProject", "mi_new1", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editProject", "mi_clear1", self.dicUserKeys["project_delete"])
        #        self.addEnabledMenuItems('editProject','mi_print1', self.dicUserKeys['project_print'])
        self.addEnabledMenuItems("editProject", "mi_edit1", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editPhase", "phasenew1", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editPhase", "phasedelete1", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editPhase", "phaseedit1", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editTasks", "task_new", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editTasks", "task_delete1", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editTasks", "task_edit", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editProgramming", "programming_main_new", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editProgramming", "programming_main_delete", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editProgramming", "programming_main_edit", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editStaffRes", "staff_resources_new1", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editStaffRes", "staff_resources_delete1", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editStaffRes", "staff_resources_edit1", self.dicUserKeys["project_edit"])

        self.addEnabledMenuItems("editMaterialRes", "material_resources_new1", self.dicUserKeys["project_new"])
        self.addEnabledMenuItems("editMaterialRes", "material_resources_delete1", self.dicUserKeys["project_delete"])
        self.addEnabledMenuItems("editMaterialRes", "material_resources_edit1", self.dicUserKeys["project_edit"])

        # enabledMenues for Save
        self.addEnabledMenuItems("editSave", "mi_save1", self.dicUserKeys["project_save"])
        self.addEnabledMenuItems("editSave", "phasesave1", self.dicUserKeys["project_save"])
        self.addEnabledMenuItems("editSave", "task_save1", self.dicUserKeys["project_save"])
        self.addEnabledMenuItems("editSave", "staff_resources_save1", self.dicUserKeys["project_save"])
        self.addEnabledMenuItems("editSave", "material_resources_save1", self.dicUserKeys["project_save"])
        self.addEnabledMenuItems("editSave", "programming_main_save", self.dicUserKeys["project_save"])

        # tabs from notebook
        self.tabProject = 0
        self.tabPhases = 1
        self.tabTasks = 2
        self.tabStaffResources = 3
        self.tabMaterialResources = 4
        self.tabOrder = 5
        self.tabProgramming = 6

        self.tabProgrammingMain = 100

        print "tab endet"
        self.win1.add_accel_group(self.accel_group)

        self.tabChanged()
Пример #27
0
    def __init__(self,   allTables ):
        
        chooseWindows.__init__(self)
        
        
        self.loadGlade('support_ticket.xml','SupportTicketMainwindow' )
        self.win1 = self.getWidget('SupportTicketMainwindow')
        self.ModulNumber = self.MN['SupportTicket']        
        self.allTables = allTables
        
        self.singleSupportProject = SingleSupportProject.SingleSupportProject(allTables)
        self.singleSupportTicket = SingleSupportTicket.SingleSupportTicket(allTables)
        
        self.singleProject = cuon.Project.SingleProject.SingleProject(allTables)
        self.singlePartner = cuon.Addresses.SinglePartner.SinglePartner(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        
        self.entriesSupportProject = 'support_project.xml'
        self.entriesSupportTicket = 'support_ticket.xml'
    
        print "single Project settings"
      #singleSupportProject
        print "tree1 = " ,  self.getWidget('ProjectTree')
        self.loadEntries(self.entriesSupportProject)
        self.singleSupportProject.setEntries(self.getDataEntries( self.entriesSupportProject) )
        self.singleSupportProject.setGladeXml(self.xml)
        self.singleSupportProject.setTreeFields( ['support_project_number', 'designation'])
        self.singleSupportProject.setStore( gtk.ListStore( gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT) ) 
        self.singleSupportProject.setTreeOrder('support_project_number')
        self.singleSupportProject.setTree(self.getWidget('ProjectTree') )
        self.singleSupportProject.setListHeader([_('Number'),  _('Designation')])
        #print 'Widgets - win = ', `self.win1`
    
        #singleSupportTicket
        
        self.loadEntries(self.entriesSupportTicket)
        self.singleSupportTicket.setEntries(self.getDataEntries( self.entriesSupportTicket) )
        self.singleSupportTicket.setGladeXml(self.xml)
        self.singleSupportTicket.setTreeFields( ['ticket_number', 'short_designation'])
        self.singleSupportTicket.setStore( gtk.ListStore( gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT) ) 
        self.singleSupportTicket.setTreeOrder('reported_day')
        self.singleSupportTicket.setTree(self.getWidget('TicketTree') )
        self.singleSupportTicket.setListHeader([_('Ticket'), _('Short Designation')])
        #print 'Widgets - win = ', `self.win1`
        #print 'Widgets - tree1 = ', `self.xml.get_widget('tree1')`
        
        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems('Support','Projects')
        self.addEnabledMenuItems('Support','Ticket')


        # seperate Menus
        self.addEnabledMenuItems('Projects','Projects')
        self.addEnabledMenuItems('Ticket','Ticket')
        
        # enabledMenues for  Project
        self.addEnabledMenuItems('editProject','new1', self.dicUserKeys['new'])
        self.addEnabledMenuItems('editProject','edit1', self.dicUserKeys['edit'])
        self.addEnabledMenuItems('editProject','delete1', self.dicUserKeys['delete'])

        # enabledMenues for  Ticket
        self.addEnabledMenuItems('editTicket','Ticket_new1', self.dicUserKeys['new'])
        self.addEnabledMenuItems('editTicket','Ticket_edit1', self.dicUserKeys['edit'])
        self.addEnabledMenuItems('editTicket','Ticket_delete1', self.dicUserKeys['delete'])
        # enabledMenues for Save 
        self.addEnabledMenuItems('editSave','save1', self.dicUserKeys['save'])
        self.addEnabledMenuItems('editSave','Ticket_Save1', self.dicUserKeys['save'])
        
        
        # add comboboxes
        liStatus,  liSeverity, liPriority, liReproduced, liPlatform= self.rpc.callRP('Support.getTicketComboBoxEntries',self.dicUser)
        
        print liStatus,  '\n\n',  liSeverity,  '\n\n', liPriority,  '\n\n', liReproduced ,  '\n\n', liPlatform,  '\n\n'
        
        cbTypeOfStatus = self.getWidget('cbTicketStatus')
        if cbTypeOfStatus:
            liststore = gtk.ListStore(str)
            for TypeOfStatus in liStatus:
                liststore.append([TypeOfStatus])
            cbTypeOfStatus.set_model(liststore)
            cbTypeOfStatus.set_text_column(0)
            cbTypeOfStatus.show()

        #same for the find field 
        cbFindTypeOfStatus = self.getWidget('cbFindStatus')
        if cbFindTypeOfStatus:
            liststore = gtk.ListStore(str)
            for TypeOfStatus in liStatus:
                liststore.append([TypeOfStatus])
            cbFindTypeOfStatus.set_model(liststore)
            cbFindTypeOfStatus.set_text_column(0)
            cbFindTypeOfStatus.show()
            
            
        cbTypeOfSeverity = self.getWidget('cbTicketSeverity')
        if cbTypeOfSeverity:
            liststore = gtk.ListStore(str)
            for TypeOfSeverity in liSeverity:
                liststore.append([TypeOfSeverity])
            cbTypeOfSeverity.set_model(liststore)
            cbTypeOfSeverity.set_text_column(0)
            cbTypeOfSeverity.show()

     #same for the find field 
        cbFindTypeOfSeverity = self.getWidget('cbFindSeverity')
        if cbFindTypeOfSeverity:
            liststore = gtk.ListStore(str)
            for TypeOfSeverity in liSeverity:
                liststore.append([TypeOfSeverity])
            cbFindTypeOfSeverity.set_model(liststore)
            cbFindTypeOfSeverity.set_text_column(0)
            cbFindTypeOfSeverity.show()
            
            
            
            
        cbTypeOfPriority = self.getWidget('cbTicketPriority')
        if cbTypeOfPriority:
            liststore = gtk.ListStore(str)
            for TypeOfPriority in liPriority:
                liststore.append([TypeOfPriority])
            cbTypeOfPriority.set_model(liststore)
            cbTypeOfPriority.set_text_column(0)
            cbTypeOfPriority.show()
        
        
        
           
        cbTypeOfReproduced = self.getWidget('cbTicketReproduced')
        if cbTypeOfReproduced:
            liststore = gtk.ListStore(str)
            for TypeOfReproduced in liReproduced:
                liststore.append([TypeOfReproduced])
            cbTypeOfReproduced.set_model(liststore)
            cbTypeOfReproduced.set_text_column(0)
            cbTypeOfReproduced.show()
            
         
           
        cbTypeOfPlatform = self.getWidget('cbTicketPlatform')
        if cbTypeOfPlatform:
            liststore = gtk.ListStore(str)
            for TypeOfPlatform in liPlatform:
                liststore.append([TypeOfPlatform])
            cbTypeOfPlatform.set_model(liststore)
            cbTypeOfPlatform.set_text_column(0)
            cbTypeOfPlatform.show()
            
            
            
        self.tabSupportProject = 0
        self.tabSupportTicket = 1
        # start
        
        self.tabChanged()
     
        self.win1.add_accel_group(self.accel_group)
Пример #28
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)

        self.loadGlade('staff.xml')
        self.win1 = self.getWidget('StaffMainwindow')
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = self.MN['Staff']        
        self.allTables = allTables
        self.singleStaff = SingleStaff.SingleStaff(allTables)
        self.singleStaffFee = SingleStaffFee.SingleStaffFee(allTables)
      
        # self.singleStaff.loadTable()
              
        self.entriesStaffs = 'staff.xml'
        self.entriesStaffsFee = 'staff_fee.xml'
                
        
        #singleStaff
 
 
        self.loadEntries(self.entriesStaffs)
        self.singleStaff.setEntries(self.getDataEntries( self.entriesStaffs) )
        self.singleStaff.setGladeXml(self.xml)
        self.singleStaff.setTreeFields( ['lastname','firstname'] )
        self.singleStaff.setStore( gtk.ListStore( gobject.TYPE_STRING, gobject.TYPE_STRING,gobject.TYPE_UINT) ) 
        self.singleStaff.setTreeOrder('lastname')
        self.singleStaff.setTree(self.xml.get_widget('tree1') )
        self.singleStaff.setListHeader(['lastname','firstname' ])
        print 'Widgets - win = ', `self.win1`
        print 'Widgets - tree1 = ', `self.xml.get_widget('tree1')`
        
         #singleStaffFee
        
        self.loadEntries(self.entriesStaffsFee)
        self.singleStaffFee.setEntries(self.getDataEntries( self.entriesStaffsFee) )
        self.singleStaffFee.setGladeXml(self.xml)
        #self.singleStaffFee.setTreeFields( ['designation' ] )
        #self.singleStaffFee.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        #self.singleStaffFee.setTreeOrder('designation')
#        self.singleStaffFee.setListHeader([''])

        self.singleStaffFee.sWhere  ='where staff_id = ' + `self.singleStaff.ID`
        self.singleStaffFee.setTree(self.xml.get_widget('tree1') )
  
     
        

        # Menu-items
        self.initMenuItems()

        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','staff1')
        self.addEnabledMenuItems('tabs','fee1')


        # seperate Menus
        self.addEnabledMenuItems('staff','staff1')
        self.addEnabledMenuItems('fee','fee1')

        
        # enabledMenues for Staff
        self.addEnabledMenuItems('editStaff','new1', self.dicUserKeys['staff_new'])
        self.addEnabledMenuItems('editStaff','clear1', self.dicUserKeys['staff_delete'])
        self.addEnabledMenuItems('editStaff','print1', self.dicUserKeys['staff_print'])
        self.addEnabledMenuItems('editStaff','edit1',self.dicUserKeys['staff_edit'])

        #enabledMenues for Stafffee
        self.addEnabledMenuItems('editFee','fee_new1', self.dicUserKeys['staff_fee_new'])
        self.addEnabledMenuItems('editFee','fee_clear1')
        self.addEnabledMenuItems('editFee','fee_edit1', self.dicUserKeys['staff_fee_edit'])
    
       


        # tabs from notebook
        self.tabStaff = 0
        self.tabFee = 1
        

        # start
        
        self.tabChanged()

        
##        # init Comboboxes
##        tax_vat =  self.rpc.callRP('src.Misc.py_getListOfTaxVat', self.dicUser)
##        cb = self.getWidget('cbVat')
##        
##        for i in range(len(tax_vat)) :
##            li = gtk.ListItem(tax_vat[i])
##            cb.list.append_items([li])
##            li.show()
    
        self.win1.add_accel_group(self.accel_group)
Пример #29
0
    def __init__(self, allTables):

        chooseWindows.__init__(self)
        self.loadGlade('articles.xml', 'ArticlesMainwindow')
        #self.win1 = self.getWidget('ArticlesMainwindow')
        #self.win1.maximize()
        self.setStatusBar('vb_main')
        self.oDocumentTools = cuon.DMS.documentTools.documentTools()
        self.ModulNumber = self.MN['Articles']        
        self.allTables = allTables
        self.singleArticleID = -1
        self.singleArticle = SingleArticle.SingleArticle(allTables)
        self.singleArticleForParts = SingleArticle.SingleArticle(allTables)
        self.singleArticlePurchase = SingleArticlePurchase.SingleArticlePurchase(allTables)
        self.singleArticleParts = SingleArticleParts.SingleArticleParts(allTables)
        self.singleArticleSales = SingleArticleSale.SingleArticleSale(allTables)
        self.singleArticleWebshop = SingleArticleWebshop.SingleArticleWebshop(allTables)
        self.singleArticleStock = SingleArticleStock.SingleArticleStock(allTables)
        self.singleArticleBarcode = SingleArticleBarcode.SingleArticleBarcode(allTables)
        self.singleAddress = cuon.Addresses.SingleAddress.SingleAddress(allTables)
        try:
            self.singleBotany = cuon.Garden.SingleBotany.SingleBotany(allTables)
        except:
            pass
        self.singlePrefsFinanceVat = cuon.PrefsFinance.SinglePrefsFinanceVat.SinglePrefsFinanceVat(allTables)    
        self.singleMaterialGroup = cuon.Articles.SingleMaterialgroups.SingleMaterialgroups(allTables)
        # self.singleArticle.loadTable()
              
        self.EntriesArticles = 'articles.xml'
        self.EntriesArticlesPurchase = 'articles_purchase.xml'
        self.EntriesArticlesParts = 'articles_parts.xml'
        self.EntriesArticlesSales = 'articles_sales.xml'
        self.EntriesArticlesWebshop = 'articles_webshop.xml'
        self.EntriesArticlesStock = 'articles_stock.xml'
        self.EntriesArticlesBarcode = 'articles_barcode.xml'  
        
        #singleArticle
 
 
        self.loadEntries(self.EntriesArticles)
        self.singleArticle.setEntries(self.getDataEntries( self.EntriesArticles) )
        self.singleArticle.setGladeXml(self.xml)
        liFields = self.rpc.callRP('Misc.getTreeInfo', "articles",self.dicUser)
        print "liFields = ", liFields
        self.singleArticle.setTree(self.getWidget('tv_article') )
        if liFields:
            self.liSearchFields = liFields[0]
            self.singleArticle.setTreeFields(liFields[1])
            self.singleArticle.setStore(self.getListStore(liFields[2]))
            self.singleArticle.setListHeader(liFields[3])
            self.singleArticle.setTreeOrder(liFields[4][0])
        else:
            self.singleArticle.setTreeFields( ['number', 'designation', "fct_getValueAsCurrency(sellingprice1) as price1", "fct_getValueAsCurrency(sellingprice2) as price2", "fct_getValueAsCurrency(sellingprice3) as price3", "fct_getValueAsCurrency(sellingprice4) as price4", 'unit', 'weight', ] )
            #        self.singleArticle.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING,   gobject.TYPE_UINT) ) 
            self.singleArticle.setStore( gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT) ) 
            self.singleArticle.setTreeOrder('number, designation')
           
            self.singleArticle.setListHeader(['number', 'designation', 'preis 1', 'preis 2', 'preis 3', 'preis 4', 'Einheit', 'Gewicht', ])
            self.singleArticle.setTreeOrder('number, designation')
        
        #singleArticleParts
        
        self.loadEntries(self.EntriesArticlesParts)
        self.singleArticleParts.setEntries(self.getDataEntries( self.EntriesArticlesParts) )
        self.singleArticleParts.setGladeXml(self.xml)
        #self.singleArticleParts.setTreeFields( ['part_id','number','articles.designation', 'quantities'] )
        #self.singleArticleParts.setListHeader(['Article ID', 'Article Number',  'Article Designation', 'Quantities' ])
        #self.singleArticleParts.setStore( gtk.ListStore(gobject.TYPE_UINT, gobject.TYPE_STRING,   gobject.TYPE_STRING, gobject.TYPE_FLOAT,  gobject.TYPE_UINT) ) 
        self.singleArticleParts.setTreeFields( ['part_id','quantities','articles.number as number' ,'articles.designation as ardesignation', 'articles_parts_list.designation as padesignation'] )
        self.singleArticleParts.setListHeader(['Article ID',   'Quantities' , 'Article Number' ,    'Article Designation',  'Part Designation'])
        self.singleArticleParts.setStore( gtk.ListStore(gobject.TYPE_UINT,gobject.TYPE_FLOAT, gobject.TYPE_STRING,  gobject.TYPE_STRING ,  gobject.TYPE_STRING ,  gobject.TYPE_UINT) ) 
        
        self.singleArticleParts.setTreeOrder('part_id')
#        self.singleArticleParts.setListHeader([''])

        self.singleArticleParts.sWhere  ='where article_id = ' + `self.singleArticle.ID` + ' and part_id = articles.id '
        self.singleArticleParts.setTree(self.getWidget('tv_parts') )
  
         #singleArticlePurchase
        
        self.loadEntries(self.EntriesArticlesPurchase)
        self.singleArticlePurchase.setEntries(self.getDataEntries( self.EntriesArticlesPurchase) )
        self.singleArticlePurchase.setGladeXml(self.xml)
        self.singleArticlePurchase.setTreeFields( ['articles_id','vendorsnumber', 'vendorsdesignation',  'unitprice', 'last_date'] )
        self.singleArticlePurchase.setListHeader(['Article', 'Vendor ID','Designation','Price', 'Last Date' ])
        self.singleArticlePurchase.setStore( gtk.ListStore(gobject.TYPE_UINT, gobject.TYPE_STRING, gobject.TYPE_STRING,  gobject.TYPE_STRING, gobject.TYPE_STRING, gobject.TYPE_UINT) ) 
        self.singleArticlePurchase.setTreeOrder('unitprice asc,vendorsnumber')
#        self.singleArticlePurchase.setListHeader([''])

        self.singleArticlePurchase.sWhere  ='where articles_id = ' + `self.singleArticle.ID`
        self.singleArticlePurchase.setTree(self.getWidget('tv_purchase') )
  
     #singleArticleSales
        
        self.loadEntries(self.EntriesArticlesSales)
        self.singleArticleSales.setEntries(self.getDataEntries( self.EntriesArticlesSales) )
        self.singleArticleSales.setGladeXml(self.xml)
        self.singleArticleSales.setTreeFields( ['designation'] )
        self.singleArticleSales.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
        self.singleArticleSales.setTreeOrder('designation')
        self.singleArticleSales.setListHeader([_('Designation')])

        self.singleArticleSales.sWhere  ="where articles_number = '" + `self.singleArticle.ID` + "' "
        self.singleArticleSales.setTree(self.getWidget('tv_sale') )

  
  #singleArticleWebshop
        
        self.loadEntries(self.EntriesArticlesWebshop)
        self.singleArticleWebshop.setEntries(self.getDataEntries( self.EntriesArticlesWebshop) )
        self.singleArticleWebshop.setGladeXml(self.xml)
##        self.singleArticleWebshop.setTreeFields( ['articles_number'] )
 ##       self.singleArticleWebshop.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
  ##      self.singleArticleWebshop.setTreeOrder('articles_number')
   ##     self.singleArticleWebshop.setListHeader([_('article')])

        self.singleArticleWebshop.sWhere  ='where articles_number = ' + `self.singleArticle.ID`
        #self.singleArticleWebshop.setTree(self.xml.get_widget('tree1') )

    #singleArticleStock
        
        self.loadEntries(self.EntriesArticlesStock)
        self.singleArticleStock.setEntries(self.getDataEntries( self.EntriesArticlesStock ))
        self.singleArticleStock.setGladeXml(self.xml)
##        self.singleArticleStock.setTreeFields( ['designation'] )
##        self.singleArticleStock.setStore( gtk.ListStore(gobject.TYPE_STRING,  gobject.TYPE_UINT) ) 
##        self.singleArticleStock.setTreeOrder('designation')
##        self.singleArticleStock.setListHeader([_('Designation')])

        self.singleArticleStock.sWhere  ='where articles_id = ' + `self.singleArticle.ID`
        #self.singleArticleStock.setTree(self.xml.get_widget('tree1') )
  
        #singleArticleBarcode
        
        self.loadEntries(self.EntriesArticlesBarcode)
        self.singleArticleBarcode.setEntries(self.getDataEntries( self.EntriesArticlesBarcode ))
        self.singleArticleBarcode.setGladeXml(self.xml)
        self.singleArticleBarcode.sWhere  ='where articles_id = ' + `self.singleArticle.ID`
        #self.singleArticleStock.setTree(self.xml.get_widget('tree1') )
  
        

        # Menu-items
        self.initMenuItems()

        # All window items
        self.addEnabledMenuItems('window','quit1', 'q')
        # Close Menus for Tab

        self.addEnabledMenuItems('tabs','mi_article1')
        self.addEnabledMenuItems('tabs','mi_purchase1')
        self.addEnabledMenuItems('tabs','mi_sales1')


        # seperate Menus
        self.addEnabledMenuItems('article','mi_article1')
        self.addEnabledMenuItems('purchase','mi_purchase1')
        self.addEnabledMenuItems('sales','mi_sales1')
        self.addEnabledMenuItems('sales','parts_list1')
        
        # enabledMenues for Article
        self.addEnabledMenuItems('editArticle','new1', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editArticle','delete1', self.dicUserKeys['articles_delete'])
        self.addEnabledMenuItems('editArticle','print1', self.dicUserKeys['articles_print'])
        self.addEnabledMenuItems('editArticle','edit1',self.dicUserKeys['articles_edit'])
        
        # enabledMenues for ArticleParts
        self.addEnabledMenuItems('editArticleParts','PartsListNew', self.dicUserKeys['articles_new'])
        self.addEnabledMenuItems('editPArticlearts','PartsListDelete')
        self.addEnabledMenuItems('editArticleParts','PartsListEdit', self.dicUserKeys['articles_edit'])
    

        # enabledMenues for ArticlePurchase
        self.addEnabledMenuItems('editArticlePurchase','PurchaseNew1', self.dicUserKeys['articles_purchase_new'])
        self.addEnabledMenuItems('editArticlePurchase','PurchaseDelete1')
        self.addEnabledMenuItems('editArticlePurchase','PurchaseEdit1', self.dicUserKeys['articles_purchase_edit'])
    
       # enabledMenues for ArticleSales
        self.addEnabledMenuItems('editArticleSales','SalesNew1')
        self.addEnabledMenuItems('editArticleSales','SalesDelete1')
        self.addEnabledMenuItems('editArticleSales','SalesEdit1')

       # enabledMenues for ArticleWebshop
        self.addEnabledMenuItems('editArticleWebshop','WebshopClear1')
        self.addEnabledMenuItems('editArticleWebshop','WebshopEdit1')

       # enabledMenues for ArticleStock
        self.addEnabledMenuItems('editArticleStock','StockClear1')
        self.addEnabledMenuItems('editArticleStock','StockEdit1')

       # enabledMenues for ArticleBarcode
        #self.addEnabledMenuItems('editArticleBarcode','StockClear1')
        self.addEnabledMenuItems('editArticleBarcode','BarcodeEdit')


        # enabledMenues for Save 
        self.addEnabledMenuItems('editSave','save1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','PartsListSave', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','PurchaseSave1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','SalesSave1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','WebshopSave1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','StockSave1', self.dicUserKeys['articles_save'])
        self.addEnabledMenuItems('editSave','BarcodeSave', self.dicUserKeys['articles_save'])

        # tabs from notebook
        self.tabArticle = 0
        self.tabParts = 1
        self.tabPurchase = 2
        self.tabSales = 3
        self.tabWebshop = 4
        self.tabStock = 5
        self.tabBarcode = 6
        
        self.textbufferNotes,  self.viewNotes = self.getNotesEditor()
        cbAscociatedWith = self.getWidget('cbAssociatedWith' )
        if cbAscociatedWith:
            liststore = gtk.ListStore(str)
            liststore2 = gtk.ListStore(str)
            for ac in ["None","Botany"]:
                liststore.append([ac])
               
            cbAscociatedWith.set_model(liststore)
            self.setComboBoxTextColumn(cbAscociatedWith)
            cbAscociatedWith.show()
        
        
        Scrolledwindow = self.getWidget('scArticleNotes')
        Scrolledwindow.add(self.viewNotes)
        self.viewNotes.show_all()
        Scrolledwindow.show_all()

        # set the widget
        self.singleArticle.NotesArticles = self.textbufferNotes
        # start
        
        self.tabChanged()

        # enabled menus for article
        self.addEnabledMenuItems('editArticle','new1')
        self.addEnabledMenuItems('editArticle','clear1')
        self.addEnabledMenuItems('editArticle','print1')

        # enabled menus for article_purchase
        self.addEnabledMenuItems('editArticlePurchase','PurchaseNew1')
        self.addEnabledMenuItems('editArticlePurchase','PurchaseClear1')

       
        self.win1.add_accel_group(self.accel_group)