예제 #1
0
    def get(self):
        user = users.get_current_user()
        url = users.create_login_url(self.request.uri)
        url_linktext = 'Login'
                    
        if user:
            url = users.create_logout_url(self.request.uri)
            url_linktext = 'Logout'
            raw_id = self.request.get('id')
            ido = int(raw_id)
            lentrepriseo = CompanyModel.get_by_id(ido)
            
        else:
            self.redirect(users.create_login_url(self.request.uri))
# GQL is similar to SQL
      
        
        
        values = {
            'company': lentrepriseo,
        
            'user': user,
            'url': url,
            'url_linktext': url_linktext,
        }
        self.response.out.write(template.render('templates/editcompany.html', values))
예제 #2
0
    def post(self):
        user = users.get_current_user()
        if user:
         

         tagname = self.request.get('tags')
         raw_id = self.request.get('id')
         id = int(raw_id)
         lespace = EspaceModel.get_by_id(id)
         
         tag = TagModel(name =tagname , espace = lespace)
         tag.put();
         idlist = self.request.get_all('id[]')
         for idcompany in idlist:
             idc = int(idcompany)
             company = CompanyModel.get_by_id(idc)
             
             selection = SelectionModel(espace = lespace, company = company, tag = tag,
                                        selectedby =users.get_current_user()).put()

         
         values = {
             
            
	    'idlist': idlist,
	    
          }
예제 #3
0
 def get(self):
     user = users.get_current_user()
     url = users.create_login_url(self.request.uri)
     url_linktext = 'Login'
     title= 'Ajouter une entreprise'        
     raw_id = self.request.get('id')
     id = int(raw_id)
     company = CompanyModel.get_by_id(id)
     tasks = TasksAboutModel.all().filter('organisme', CompanyModel.get_by_id(id)).filter('profile', UserProfileModel.getCurrent())
     values = {
         'idcompany' : id,
         'tasks' : tasks,      
         'company': company,
         'title': title,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
       }
               
     self.response.out.write(template.render('templates/loadtasksabout.html', values))  
예제 #4
0
 def get(self):
     user = users.get_current_user()
     url = users.create_login_url(self.request.uri)
     url_linktext = 'Login'
     title = 'Ajouter une entreprise'        
     raw_id = self.request.get('id')
     id = int(raw_id)
     lentreprise = CompanyModel.get_by_id(id)
     emails = CompanyEmailsModel.getAllEmailsByCompanyID(id)
     tels = CompanyTelModel.getAllTelsByCompanyID(id)
     notes = NoteCompanyModel.all().order('creedate').filter('company', CompanyModel.get_by_id(id))
     values = { 
         'emails' : emails,
         'tels' : tels,
         'company': lentreprise,
         'idcompany' : id,
         'notes' : notes,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
        }
     self.response.out.write(template.render('templates/loadnotecompany.html', values))
예제 #5
0
 def post(self):
     user = users.get_current_user()
     url = users.create_login_url(self.request.uri)
     url_linktext = 'Login'
     title= 'Ajouter une entreprise'
     if user:
      raw_id = self.request.get('noteespace')
      id = int(raw_id)
      lacompany = CompanyModel.get_by_id(id)
      note  = NoteCompanyModel(
             profile  = UserProfileModel.getCurrent(),
             texnote = self.request.get('notebody'),
             company = lacompany)
      note.put();
예제 #6
0
    def get(self):
        user = users.get_current_user()
        url = users.create_login_url(self.request.uri)
        url_linktext = 'Login'
                    
        if user:
            url = users.create_logout_url(self.request.uri)
            url_linktext = 'Logout'
            raw_id = self.request.get('id')
            id = int(raw_id)
            lentreprise = CompanyModel.get_by_id(id)
            emails = CompanyEmailsModel.getAllEmailsByCompanyID(id)
            notes = NoteCompanyModel.all().order('creedate').filter('company', CompanyModel.get_by_id(id))
            tels = CompanyTelModel.getAllTelsByCompanyID(id)
            persons = PersonModel.all().filter('organisme =', lentreprise)
            sujets = SujetModel.all().filter('organismeref =', lentreprise)
            tasks = TasksAboutModel.all().filter('organisme', lentreprise).filter('profile', UserProfileModel.getCurrent())
        else:
            self.redirect(users.create_login_url(self.request.uri))
		

       
        values = {
            'emails' : emails,
            'idcompany' : id,
            'sujets' : sujets,
            'tasks' : tasks,
            'tels' : tels,
            'persons' : persons,
            'company': lentreprise,
            'notes' : notes,
            'user': user,
            'url': url,
            'url_linktext': url_linktext,
        }
        self.response.out.write(template.render('templates/fiche_entreprise.html', values))
예제 #7
0
 def post(self):
     user = users.get_current_user()
     url = users.create_login_url(self.request.uri)
     url_linktext = 'Login'
     title= 'Ajouter une entreprise'
     if user:
      raw_id = self.request.get('id')
      id = int(raw_id)
      company = CompanyModel.get_by_id(id)
      
      tache = TasksAboutModel(
             profile  = UserProfileModel.getCurrent() ,
             titretache = self.request.get('task[body]'),
             tachepourdate = self.request.get('task[date]'),
             etattache = True,
             organisme = company)
      tache.put();
예제 #8
0
 def post(self):
     user = users.get_current_user()
     if user:
       raw_id = self.request.get('id')
       id = int(raw_id)
       lentreprise = CompanyModel.get_by_id(id)
       lentreprise.companyaddedby  = users.get_current_user()
       lentreprise.companyname = self.request.get('companyname')
       lentreprise.companytel = self.request.get('companytel')
       lentreprise.companymail = self.request.get('companymail')
       lentreprise.companywebsite = self.request.get('companywebsite')
       lentreprise.companyaddress = self.request.get('companyaddress')
       lentreprise.companywilaya = self.request.get('companyawilaya')
       lentreprise.companydescription = self.request.get('companydescription')
         
       lentreprise.put();
       self.redirect('/company?id='+raw_id)
예제 #9
0
 def get(self):
    user = users.get_current_user()
    url = users.create_login_url(self.request.uri)
    url_linktext = 'Login'
    title= 'Ajouter une entreprise'
    if user:
     raw_id = self.request.get('id')
     id = int(raw_id)
     company = CompanyModel.get_by_id(id)
     values = {
        'company': company,
        'title': title,
        'user': user,
        'url': url,
        'url_linktext': url_linktext,
      }
              
    self.response.out.write(template.render('templates/addnewpersonat.html', values))  
예제 #10
0
    def post(self):
        user = users.get_current_user()
        if user:
         

         tagname = self.request.get('tags')
         listdesespaces = EspaceEmailsModel.getMyEspaces()
         
         tag = TagModel(name =tagname).put();
         
         for idespace in listdesespaces:
             lespace = EspaceModel.get_by_id(idespace)
                
            
             idlist = self.request.get_all('id[]')
             for idcompany in idlist:
                 idc = int(idcompany)
                 company = CompanyModel.get_by_id(idc)
             
                 
             
                 selection = SelectionModel(espace = lespace, company = company, tag = tag,
                                        selectedby =users.get_current_user()).put()