コード例 #1
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     date_default_timezone_set('Europe/Berlin');
     if (!$this->IsPostBack || !$this->IsCallBack) {
         $sql = "SELECT idta_organisation_type, org_type_name FROM ta_organisation_type";
         $data = PFH::convertdbObjectArray(OrganisationTypeRecord::finder()->findAllBySql($sql), array("idta_organisation_type", "org_type_name"));
         $this->RCedidta_organisation_type->DataSource = $data;
         $this->RCedidta_organisation_type->dataBind();
         $this->RCedidta_organisation_art->DataSource = $this->idta_organisation_art;
         $this->RCedidta_organisation_art->dataBind();
         $this->RCedorg_idtm_user_role->DataSource = PFH::build_SQLPullDown(UserRoleRecord::finder(), "tm_user_role", array("idtm_user_role", "user_role_name"));
         $this->RCedorg_idtm_user_role->dataBind();
         $this->RCedidta_branche->DataSource = PFH::build_SQLPullDown(BrancheRecord::finder(), "ta_branche", array("idta_branche", "bra_name"));
         $this->RCedidta_branche->dataBind();
         $this->RCedidtm_ressource->DataSource = PFH::build_SQLPullDown(RessourceRecord::finder(), "tm_ressource", array("idtm_ressource", "res_name"));
         $this->RCedidtm_ressource->dataBind();
         $this->RCedidtm_country->DataSource = PFH::build_SQLPullDown(CountryRecord::finder(), "tm_country", array("idtm_country", "country_iso"));
         $this->RCedidtm_country->dataBind();
         $this->RCedkom_type->DataSource = array(1 => "Telefon", "Fax", "Mail");
         $this->RCedkom_type->dataBind();
         $this->RCedorg_status->DataSource = array(0 => "offen", "interessant", "nicht interessant", "Kunde", "EX-Kunde");
         $this->RCedorg_status->dataBind();
         if (isset($_GET['idtm_organisation'])) {
             $this->view_Organisation($_GET['idtm_organisation']);
         } else {
             $this->view_Organisation(1);
         }
         //$this->bindListOrgListe();
     }
 }
コード例 #2
0
ファイル: newuser.php プロジェクト: quantrocket/planlogiq
 public function onLoad($param)
 {
     parent::onLoad($param);
     $sql = "SELECT idtm_user_role, user_role_name FROM tm_user_role WHERE user_role_name = 'Benutzer'";
     $data = PFH::convertdbObjectArray(UserRoleRecord::finder()->findAllBySql($sql), array("idtm_user_role", "user_role_name"));
     $this->Role->DataSource = $data;
     $this->Role->dataBind();
 }
コード例 #3
0
ファイル: GSProcUser.php プロジェクト: quantrocket/planlogiq
 /**
  * Creates a BlogUser object based on the specified username.
  * This method is required by TDbUser. It checks the database
  * to see if the specified username is there. If so, a BlogUser
  * object is created and initialized.
  * @param string the specified username
  * @return BlogUser the user object, null if username is invalid.
  */
 public function createUser($username)
 {
     // use UserRecord Active Record to look for the specified username
     $userRecord = UserRecord::finder()->find('user_username = ?', $username);
     if ($userRecord instanceof UserRecord) {
         $user = new GSProcUser($this->Manager);
         $user->Name = $username;
         // set username
         $userRoleRecord = UserRoleRecord::finder()->find('idtm_user_role = ?', $userRecord->idtm_user_role);
         $user->Roles = $userRoleRecord->idtm_user_role == 1 ? 'Administrator' : $userRoleRecord->user_role_name;
         // set role
         $user->IsGuest = false;
         // the user is not a guest
         return $user;
     } else {
         return null;
     }
 }
コード例 #4
0
ファイル: myaccount.php プロジェクト: quantrocket/planlogiq
 /**
  * Initializes the inputs with existing user data.
  * This method is invoked by the framework when the page is being initialized.
  * @param mixed event parameter
  */
 public function onInit($param)
 {
     parent::onInit($param);
     if (!$this->IsPostBack && !$this->isCallback) {
         $sql = "SELECT idtm_user_role, user_role_name FROM tm_user_role";
         $this->User->isInRole('Administrator') ? '' : ($sql .= " WHERE user_role_name = 'Benutzer'");
         $data = PFH::convertdbObjectArray(UserRoleRecord::finder()->findAllBySql($sql), array("idtm_user_role", "user_role_name"));
         $this->Role->DataSource = $data;
         $this->Role->dataBind();
         // Retrieves the existing user data. This is equivalent to:
         $userRecord = $this->getUserRecord();
         //$userRecord=$this->UserRecord;
         // Populates the input controls with the existing user data
         $this->Username->Text = $userRecord->user_username;
         $this->Email->Text = $userRecord->user_mail;
         $this->Role->SelectedValue = $userRecord->idtm_user_role;
         $this->FirstName->Text = $userRecord->user_vorname;
         $this->LastName->Text = $userRecord->user_name;
         $parteiRecord = ParteiRecord::finder()->findBy_idtm_user($userRecord->idtm_user);
         $this->idta_partei->Text = $parteiRecord->idta_partei;
         $this->bind_lstAdress();
     }
 }