Example #1
0
 def get(self):
     user = users.get_current_user()
     url = users.create_login_url(self.request.uri)
     url_linktext = 'Login'
     title= 'Ajouter une entreprise'
     #from models.userprofilemodel import UserProfileModel
     
     #'userinfo': userinfo,          
     if user:
         url = users.create_logout_url(self.request.uri)
         url_linktext = 'Logout'
         userinfo = UserProfileModel.getCurrent() 
    
         lecv = CvProfileModel.getCv()
                   
     values = {
         'title': title,
         'userinfo': userinfo,
         'cv' : lecv,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
       }
               
     self.response.out.write(template.render('templates/monprofile.html', values))           
Example #2
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)
      lespace = EspaceModel.get_by_id(id)
      note  = NoteEspaceModel(
             profile  = UserProfileModel.getCurrent() ,
             texnote = self.request.get('notebody'),
             espace = lespace)
      note.put();
Example #3
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();
Example #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'
                 
     if user:
         url = users.create_logout_url(self.request.uri)
         url_linktext = 'Logout'
         raw_id = self.request.get('id')
         id = int(raw_id)
         lespace = EspaceModel.get_by_id(id)
         emails = EspaceEmailsModel.getAllEmailsByEspaceID(id)
         notes = NoteEspaceModel.all().order('-creedate').filter('espace', EspaceModel.get_by_id(id))
         userinfo = UserProfileModel.getCurrent()
         usersemailsinespace = EspaceEmailsModel.getEspaceMembers(id)
         selectionsview = SelectionSujetModel.getSelectionByEspaceID(raw_id)
         selectionsdescontacts = SelectionModel.getSelectionByEspaceID(id)
       
         candidaturesaffectees = CandidatsModel.getCandidaturesInEspaceBystatus(id,'affecte')
         candidaturesfiledattente = CandidatsModel.getCandidaturesInEspaceBystatus(id,'filedattente')
         candidaturesenattente = CandidatsModel.getCandidaturesInEspaceBystatus(id,'en attente')
         candidaturesrefusee = CandidatsModel.getCandidaturesInEspaceBystatus(id,'refusee')
         
     
     values = {
         'candidaturesaffectees' : candidaturesaffectees,
         'candidaturesfiledattente' : candidaturesfiledattente ,
         'candidaturesenattente' : candidaturesenattente ,
         'candidaturesrefusee' :candidaturesrefusee ,
         'selectionsdescontacts' :selectionsdescontacts ,
         'candidaturesrefusee' :candidaturesrefusee ,
         'selections' : selectionsview,
         'emailsinespace': usersemailsinespace,
         'userinfo': userinfo,
         'idespace' :id,      
         'notes' : notes,      
         'emails' : emails,
         'espace': lespace,
         'title': title,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
       }
               
     self.response.out.write(template.render('templates/espace.html', values))           
Example #5
0
 def get(self):
     user = users.get_current_user()
     url = users.create_login_url(self.request.uri)
     url_linktext = 'Login'
     title= 'Ajouter une entreprise'
     listedesujet = SujetModel.all().filter('sujetaddedby =', user)
               
     if user:
         url = users.create_logout_url(self.request.uri)
         url_linktext = 'Logout'
         userinfo = UserProfileModel.getCurrent() 
    
       
     
     values = {
         'title': title,
         'userinfo': userinfo,
         'listedesujet': listedesujet,
         'user': user,
         'url': url,
         'url_linktext': url_linktext,
       }
               
     self.response.out.write(template.render('templates/sujetproposer.html', values))           
Example #6
0
 def isNewUser(self):
   query = UserProfileModel.gql("WHERE user = :1",
       users.get_current_user())
   return (query.count() == 0)
Example #7
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))
Example #8
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))  
Example #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:
       url = users.create_logout_url(self.request.uri)
       url_linktext = 'Logout'
       espaceid = self.request.get('espaceid')
       raw_id = self.request.get('id')
       id = int(raw_id)
       lesujet = SujetModel.get_by_id(id)
       emails = EncadreurSujetModel.getAllEmailsBySujetID(id)
       notes = NoteSujetModel.all().order('creedate').filter('sujet', SujetModel.get_by_id(id))
       mots = MotcleSujetModel.all().filter('sujet', SujetModel.get_by_id(id))
       userinfo = UserProfileModel.getCurrent()
       candidatures_query = CandidatsModel.all().filter('sujet = ', lesujet)
       candidatures = candidatures_query.fetch(10)
       filedattenteview = list()
       candidaturesview = list()
       affectedto = CandidatureView()
       for c in candidatures:
           candidatureview = CandidatureView()
           candidatureview.etatcandidature = c.etatcandidature
           candidatureview.id = c.key().id_or_name()
           emails = EspaceEmailsModel.getEspaceMembers(c.espace.key().id_or_name())
           usersprofiles = list()
           for email in emails:
               uprofile = UserProfileModel.getProfileByEmail(email)
               if uprofile:
                   usersprofiles.append(uprofile)
                   
           candidatureview.eid = c.espace.key().id()
           candidatureview.up = usersprofiles
           candidatureview.usersemails = emails
           if candidatureview.etatcandidature=="filedattente":
               filedattenteview.append(candidatureview)
           elif candidatureview.etatcandidature=="affecte":
               affectedto = candidatureview
           else:    
               candidaturesview.append(candidatureview) 
       
        
   
   values = {
       'affectedto' : affectedto,
       'filedattenteview' : filedattenteview,
       'candidatures' : candidaturesview ,
       'espaceid' : espaceid,
       'userinfo': userinfo,
       'idsujet' :id,      
       'notes' : notes,
       'mots' : mots,     
       'emails' : emails,
       'sujet': lesujet,
       'title': title,
       'user': user,
       'url': url,
       'url_linktext': url_linktext,
     }
             
   self.response.out.write(template.render('templates/fiche_sujet.html', values))