Exemplo n.º 1
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $FilterEmployee = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterEmployee'];
         if ($FilterEmployee) {
             $this->FilterEmployee->Text = $FilterEmployee;
         }
         $FilterDepartment = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterDepartment'];
         $this->FilterDepartment->DataSource = $this->DepartmentList;
         $this->FilterDepartment->dataBind();
         if ($FilterDepartment) {
             $this->FilterDepartment->setSelectedValue($FilterDepartment);
         } else {
             $this->FilterDepartment->setSelectedIndex(0);
         }
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 2
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $app = $this->getApplication();
     $usedId = $app->getUser()->getUserID() == null ? 0 : $app->getUser()->getUserID();
     $cmd = $this->db->createCommand("SELECT user_id FROM hr_superusers WHERE id={$usedId}");
     $data = $cmd->query();
     $dataUser = $data->read();
     $this->userId = $dataUser['user_id'];
     $this->employee = new employee($this->userId);
     $this->tbb->setTitle(Prado::localize("Leave request") . " - " . $this->employee->getFullName());
     if (!$this->IsPostBack) {
         if (Prado::getApplication()->getSession()->contains($this->getApplication()->getService()->getRequestedPagePath() . 'FilterState')) {
             $FilterState = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterState'];
         } else {
             $FilterState = 'all';
         }
         $this->FilterState->setSelectedValue($FilterState);
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 3
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $this->setHoruxSysTray(true);
     if (!$this->IsPostBack) {
         $FilterIdentificator = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterIdentificator'];
         $FilterUsed = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterUsed'];
         $FilterStatus = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterStatus'];
         $FilterSerialNumber = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterSerialNumber'];
         if ($FilterIdentificator) {
             $this->FilterIdentificator->Text = $FilterIdentificator;
         }
         if ($FilterSerialNumber) {
             $this->FilterSerialNumber->Text = $FilterSerialNumber;
         }
         if ($FilterUsed) {
             $this->FilterUsed->setSelectedValue($FilterUsed);
         }
         if ($FilterStatus) {
             $this->FilterStatus->setSelectedValue($FilterStatus);
         }
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterIdentificator'] = $this->FilterIdentificator->SafeText;
     $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterSerialNumber'] = $this->FilterSerialNumber->SafeText;
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 4
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
 }
Exemplo n.º 5
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $app = $this->getApplication();
     $usedId = $app->getUser()->getUserID() == null ? 0 : $app->getUser()->getUserID();
     $cmd = $this->db->createCommand("SELECT user_id FROM hr_superusers WHERE id={$usedId}");
     $data = $cmd->query();
     $dataUser = $data->read();
     $this->userId = $dataUser['user_id'];
     $this->employee = new employee($this->userId);
     $this->tbb->setTitle(Prado::localize("My sign in/out") . " - " . $this->employee->getFullName());
     if (!$this->IsPostBack) {
         $cmd = $this->db->createCommand("SELECT t.date FROM hr_tracking AS t WHERE t.id_user="******" ORDER BY t.date LIMIT 0,1");
         $data = $cmd->query();
         $data = $data->readAll();
         $year = date("Y");
         if (count($data) > 0) {
             $year = explode("-", $data[0]['date']);
             $year = $year[0];
         }
         $currentYear = date("Y");
         $yearList = array();
         for ($i = $year; $i <= $currentYear; $i++) {
             $yearList[] = array('Value' => $i, 'Text' => $i);
         }
         $this->FilterYear->DataSource = $yearList;
         $this->FilterYear->dataBind();
         if (Prado::getApplication()->getSession()->contains($this->getApplication()->getService()->getRequestedPagePath() . 'FilterYear')) {
             $FilterYear = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterYear'];
             $FilterMonth = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterMonth'];
         } else {
             $FilterYear = date('Y');
             $FilterMonth = date('n');
         }
         $FilterStatus = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterStatus'];
         if ($FilterStatus) {
             $this->FilterStatus->setSelectedValue($FilterStatus);
         }
         if ($FilterYear) {
             $this->FilterYear->setSelectedValue($FilterYear);
         }
         if ($FilterMonth) {
             $this->FilterMonth->setSelectedValue($FilterMonth);
         }
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 6
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $app = $this->getApplication();
     $usedId = $app->getUser()->getUserID() == null ? 0 : $app->getUser()->getUserID();
     $cmd = $this->db->createCommand("SELECT user_id FROM hr_superusers WHERE id={$usedId}");
     $data = $cmd->query();
     $dataUser = $data->read();
     $this->userId = $dataUser['user_id'];
     $this->employee = new employee($this->userId);
     if (!$this->IsPostBack) {
         $FilterEmployee = "";
         if (isset($this->Request['id'])) {
             $cmd = $this->db->createCommand("SELECT CONCAT(name, ' ' , firstname) AS employee FROM hr_user  WHERE id=:id");
             $id = $this->Request['id'];
             $cmd->bindValue(":id", $id, PDO::PARAM_STR);
             $data = $cmd->query();
             $data = $data->read();
             $FilterEmployee = $data['employee'];
         } else {
             $FilterEmployee = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterEmployee'];
         }
         $FilterTimecode = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterTimecode'];
         $FilterDepartment = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterDepartment'];
         $this->FilterTimecode->DataSource = $this->TimeCode;
         $this->FilterTimecode->dataBind();
         $this->FilterDepartment->DataSource = $this->DepartmentList;
         $this->FilterDepartment->dataBind();
         if ($FilterEmployee) {
             $this->FilterEmployee->Text = $FilterEmployee;
         }
         if ($FilterDepartment) {
             $this->FilterDepartment->setSelectedValue($FilterDepartment);
         } else {
             $this->FilterDepartment->setSelectedIndex(0);
         }
         if ($FilterTimecode) {
             $this->FilterTimecode->setSelectedValue($FilterTimecode);
         } else {
             $this->FilterTimecode->setSelectedIndex(0);
         }
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 8
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $asset = $this->Application->getAssetManager();
     $url = $asset->publishFilePath('./protected/pages/components/translate/assets/icon-48-translate.png');
     if (!$this->IsPostBack) {
         $this->language->DataTextField = "Text";
         $this->language->DataValueField = "Value";
         $this->language->DataSource = $this->getLanguage();
         $this->language->dataBind();
         $this->extension->DataTextField = "Text";
         $this->extension->DataValueField = "Value";
     }
 }
Exemplo n.º 9
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!is_writeable('./tmp')) {
         $this->displayMessage(Prado::localize('The directory ./tmp must be writeable to install an extension'), false);
     }
     if (!$this->IsPostBack) {
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 10
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $cmd = $this->db->createCommand("SELECT t.startDate FROM hr_timux_workingtime AS t ORDER BY t.startDate LIMIT 0,1");
         $data = $cmd->query();
         $data = $data->readAll();
         $year = date("Y");
         if (count($data) > 0) {
             $year = explode("-", $data[0]['startDate']);
             $year = $year[0];
         }
         $currentYear = date("Y");
         $yearList = array();
         for ($i = $year; $i <= $currentYear; $i++) {
             $yearList[] = array('Value' => $i, 'Text' => $i);
         }
         $this->FilterYear->DataSource = $yearList;
         $this->FilterYear->dataBind();
         if (Prado::getApplication()->getSession()->contains($this->getApplication()->getService()->getRequestedPagePath() . 'FilterYear')) {
             $FilterYear = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterYear'];
         } else {
             $FilterYear = date('Y');
         }
         if ($FilterYear) {
             $this->FilterYear->setSelectedValue($FilterYear);
         }
         if ($this->FilterYear->getSelectedValue() == date('Y')) {
             $month = date('n');
             for ($i = 1; $i <= 12; $i++) {
                 if ($i >= $month) {
                     $b = 'monthBalance_' . $i;
                     $this->{$b}->setVisible(false);
                     $b = 'monthLoad_' . $i;
                     $this->{$b}->setVisible(false);
                 }
             }
         }
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 11
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
     $param = $this->Application->getParameters();
     $superAdmin = $this->Application->getUser()->getSuperAdmin();
     if ($param['appMode'] == 'demo' && $superAdmin == 0) {
         $this->tbb->delete->setEnabled(false);
     }
 }
Exemplo n.º 12
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $update = new HoruxGuiUpdate();
         $res = $update->compareFiles();
         if (is_array($res)) {
             if (count($res) > 0) {
                 $this->displayMessage(Prado::localize("Your version is not up to date"), false);
                 $this->DataGrid->DataSource = $res;
                 $this->DataGrid->dataBind();
             } else {
                 $this->displayMessage(Prado::localize("Your version is up to date"), true);
             }
         } else {
             $this->displayMessage($res, false);
         }
     }
 }
Exemplo n.º 13
0
 public function onLoad($param)
 {
     $url = $this->publishAsset('./assets/icon.css');
     $this->publishAsset('./assets/icon-32-import.png');
     $this->getClientScript()->registerStyleSheetFile('treeCss', $url);
     //$this->getClientScript()->registerStyleSheetFile('treeCss','./protected/pages/components/export/assets/icon.css');
     parent::onLoad($param);
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
     if (!$this->IsPostBack) {
         $cmd = NULL;
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
 }
Exemplo n.º 14
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $this->display->DataTextField = 'Text';
         $this->display->DataValueField = 'Value';
         $this->display->DataSource = $this->Display;
         $this->display->dataBind();
         if (count($this->Display) > 0) {
             $this->display->setSelectedIndex(0);
             $this->DataGrid->DataSource = $this->Data;
             $this->DataGrid->dataBind();
         }
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 15
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $cmd = $this->db->createCommand("SELECT id\n                                            FROM `hr_timux_booking_bde` AS tbb\n                                            LEFT JOIN hr_timux_booking AS tb ON tbb.tracking_id = tb.tracking_id\n                                            WHERE `action` =254");
     $data = $cmd->query();
     $data = $data->readAll();
     foreach ($data as $d) {
         $cmd = $this->db->createCommand("UPDATE hr_timux_booking_bde SET tracking_id = tracking_id +1 WHERE id=" . $d['id']);
         $cmd->execute();
     }
     if (!$this->IsPostBack) {
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
 public function onLoad($param)
 {
     parent::onLoad($param);
     $app = $this->getApplication();
     $usedId = $app->getUser()->getUserID() == null ? 0 : $app->getUser()->getUserID();
     $cmd = $this->db->createCommand("SELECT user_id FROM hr_superusers WHERE id={$usedId}");
     $data = $cmd->query();
     $dataUser = $data->read();
     $this->userId = $dataUser['user_id'];
     $this->employee = new employee($this->userId);
     if (!$this->IsPostBack) {
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 17
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
         $sql = "SELECT id AS Value, name AS Text FROM hr_vp_subscription ORDER BY Name";
         $cmd = $this->db->createCommand($sql);
         $data = $cmd->query();
         $data = $data->readAll();
         $c[] = array("Value" => 0, "Text" => Prado::localize("-- Select one --"));
         $data = array_merge($c, $data);
         $this->subscription->DataSource = $data;
         $this->subscription->dataBind();
         $this->userId->Value = $this->Request['id'];
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 18
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->IsPostBack) {
     }
 }
Exemplo n.º 19
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $session = Prado::getApplication()->getSession();
     $selected_conf = $session['selected_conf'];
     if ($selected_conf != "") {
         $cmd = $this->db->createCommand(SQL::SQL_GET_IMPORT);
         $cmd->bindValue(":id", $selected_conf, PDO::PARAM_INT);
         $query = $cmd->query();
         if ($query) {
             $data = $query->read();
             $csv_terminated = $data['terminated_by'];
             $csv_enclosed = $data['enclosed_by'];
             $csv_escaped = $data['escaped_by'];
             $tb_name = $data['tb_name'];
             $cols = $data['cols'];
         }
     }
     // default values (TODO: should perhaps be declare as const...)
     if ($csv_terminated == "" || $csv_enclosed == "" || $csv_escaped == "") {
         $csv_terminated = ',';
         $csv_enclosed = '"';
         $csv_escaped = '\\';
     }
     if ($tb_name == "") {
         $tb_name = $session['tbl_name'];
     }
     if ($cols != "") {
         $colNames = str_getcsv($cols);
     }
     $idRow = -1;
     $fname = "./tmp/" . $session['upfile'];
     if (is_file($fname) && $tb_name != "hr_") {
         $handle = fopen($fname, "r");
         $data = array();
         $colNames;
         while ($row = fgetcsv($handle, 1000, $csv_terminated, $csv_enclosed, $csv_escaped)) {
             if ($idRow >= 0 || $cols != "") {
                 $idCol = 0;
                 foreach ($colNames as $col) {
                     if ($row[0] != "") {
                         if ($col == "") {
                             $idCol++;
                         } else {
                             $row[$idCol] = stripcslashes($row[$idCol]);
                             $data[$idRow][$col] = $row[$idCol++];
                         }
                     }
                 }
             } else {
                 $colNames = $row;
             }
             $idRow++;
         }
         fclose($handle);
         $this->DataGrid->DataSource = $data;
         $this->DataGrid->dataBind();
         $this->fname = $fname;
         $this->data = $data;
         $this->colNames = $colNames;
         $this->tblName = $tb_name;
     } else {
         $msg = array('koMsg' => Prado::localize('Can\'t import the file!') . $session['selected_conf']);
         $this->Response->redirect($this->Service->constructUrl('components.export.import', $msg));
     }
 }
Exemplo n.º 20
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $asset = $this->Application->getAssetManager();
     $url = $asset->publishFilePath('./protected/pages/components/tracking/assets/icon-48-tracking.png');
     if (!$this->IsPostBack) {
         $cmd = NULL;
         if ($this->db->DriverName == 'sqlite') {
             $cmd = $this->db->createCommand("SELECT name || ' ' || firstname AS Text, id AS Value FROM hr_user WHERE name!='??'");
         } else {
             $cmd = $this->db->createCommand("SELECT CONCAT(name,' ', firstname) AS Text, id AS Value FROM hr_user WHERE name!='??'");
         }
         $data = $cmd->query();
         $data = $data->readAll();
         $d[0]['Value'] = 'all';
         $d[0]['Text'] = Prado::localize('All');
         $data = array_merge($d, $data);
         $this->FilterName->DataTextField = "Text";
         $this->FilterName->DataValueField = "Value";
         $this->FilterName->DataSource = $data;
         $this->FilterName->dataBind();
         $this->FilterName->setSelectedValue('all');
         $cmd = $this->db->createCommand(SQL::SQL_GET_ACCESS_POINT);
         $data = $cmd->query();
         $data = $data->readAll();
         $d[0]['Value'] = 'all';
         $d[0]['Text'] = Prado::localize('All');
         $data = array_merge($d, $data);
         $this->FilterAccessPoint->DataTextField = "Text";
         $this->FilterAccessPoint->DataValueField = "Value";
         $this->FilterAccessPoint->DataSource = $data;
         $this->FilterAccessPoint->dataBind();
         $this->FilterAccessPoint->setSelectedValue('all');
         if (Prado::getApplication()->getSession()->contains($this->getApplication()->getService()->getRequestedPagePath() . 'FilterName')) {
             $FilterName = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterName'];
             $FilterAccessPoint = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterAccessPoint'];
             $FilterStatus = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterStatus'];
         } else {
             $FilterName = 'all';
             $FilterAccessPoint = 'all';
             $FilterStatus = 'all';
         }
         $FilterFrom = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterFrom'];
         $FilterUntil = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterUntil'];
         if ($FilterName) {
             $this->FilterName->setSelectedValue($FilterName);
         }
         if ($FilterAccessPoint) {
             $this->FilterAccessPoint->setSelectedValue($FilterAccessPoint);
         }
         if ($FilterStatus) {
             $this->FilterStatus->setSelectedValue($FilterStatus);
         }
         if ($FilterFrom) {
             $this->from->Text = $FilterFrom;
         }
         if ($FilterUntil) {
             $this->until->Text = $FilterUntil;
         }
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
 }
Exemplo n.º 21
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $sql = "SELECT picturepath FROM hr_config WHERE id=1";
     $cmd = $this->db->createCommand($sql);
     $data = $cmd->query();
     $data = $data->read();
     if ($data['picturepath'] != "") {
         if (!is_writeable('.' . DIRECTORY_SEPARATOR . 'pictures' . DIRECTORY_SEPARATOR . $data['picturepath'])) {
             $this->displayMessage(Prado::localize('The directory ./pictures{p} must be writeable to save/delete your picture', array('p' => DIRECTORY_SEPARATOR . $data['picturepath'])), false);
         } else {
             $this->picturepath = '.' . DIRECTORY_SEPARATOR . 'pictures' . DIRECTORY_SEPARATOR . $data['picturepath'] . DIRECTORY_SEPARATOR;
         }
     } else {
         if (!is_writeable('.' . DIRECTORY_SEPARATOR . 'pictures')) {
             $this->displayMessage(Prado::localize('The directory ./pictures{p} must be writeable to save/delete your picture', array('p' => "")), false);
         } else {
             $this->picturepath = '.' . DIRECTORY_SEPARATOR . 'pictures' . DIRECTORY_SEPARATOR;
         }
     }
     //$this->setHoruxSysTray(true);
     if (!$this->IsPostBack) {
         $this->FilterGroup->DataTextField = 'Text';
         $this->FilterGroup->DataValueField = 'Value';
         $this->FilterGroup->DataSource = $this->Group;
         $this->FilterGroup->dataBind();
         $this->FilterGroup->setSelectedValue(0);
         $this->FilterAccessPoint->DataTextField = 'Text';
         $this->FilterAccessPoint->DataValueField = 'Value';
         $this->FilterAccessPoint->DataSource = $this->AccessPoint;
         $this->FilterAccessPoint->dataBind();
         $this->FilterAccessPoint->setSelectedValue(0);
         $FilterName = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterName'];
         $FilterFirstName = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterFirstName'];
         $FilterStatus = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterStatus'];
         $FilterGroup = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterGroup'];
         $FilterAccessPoint = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterAccessPoint'];
         if ($FilterName) {
             $this->FilterName->Text = $FilterName;
         }
         if ($FilterFirstName) {
             $this->FilterFirstName->Text = $FilterFirstName;
         }
         if ($FilterStatus) {
             $this->FilterStatus->setSelectedValue($FilterStatus);
         }
         if ($FilterGroup) {
             $this->FilterGroup->setSelectedValue($FilterGroup);
         }
         if ($FilterAccessPoint) {
             $this->FilterAccessPoint->setSelectedValue($FilterAccessPoint);
         }
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterName'] = $this->FilterName->SafeText;
     $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterFirstName'] = $this->FilterFirstName->SafeText;
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 22
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $app = $this->getApplication();
     $usedId = $app->getUser()->getUserID() == null ? 0 : $app->getUser()->getUserID();
     $cmd = $this->db->createCommand("SELECT user_id FROM hr_superusers WHERE id={$usedId}");
     $data = $cmd->query();
     $dataUser = $data->read();
     $this->userId = $dataUser['user_id'];
     $this->employee = new employee($this->userId);
     if (!$this->IsPostBack) {
         $cmd = $this->db->createCommand("SELECT t.startDate FROM hr_timux_workingtime AS t ORDER BY t.startDate LIMIT 0,1");
         $data = $cmd->query();
         $data = $data->readAll();
         $year = date("Y");
         if (count($data) > 0) {
             $year = explode("-", $data[0]['startDate']);
             $year = $year[0];
         }
         $currentYear = date("Y");
         $yearList = array();
         for ($i = $year; $i <= $currentYear; $i++) {
             $yearList[] = array('Value' => $i, 'Text' => $i);
         }
         $this->FilterYear->DataSource = $yearList;
         $this->FilterYear->dataBind();
         if (Prado::getApplication()->getSession()->contains($this->getApplication()->getService()->getRequestedPagePath() . 'FilterYear')) {
             $FilterYear = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterYear'];
             $FilterMonth = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterMonth'];
         } else {
             $FilterYear = date('Y');
             $FilterMonth = date('n');
         }
         $FilterDepartment = $this->Session[$this->getApplication()->getService()->getRequestedPagePath() . 'FilterDepartment'];
         if ($FilterMonth == 0) {
             $FilterMonth = 12;
             $FilterYear -= 1;
         }
         $this->FilterDepartment->DataSource = $this->DepartmentList;
         $this->FilterDepartment->dataBind();
         if ($FilterYear) {
             $this->FilterYear->setSelectedValue($FilterYear);
         } else {
             $this->FilterYear->setSelectedIndex(0);
         }
         if ($FilterMonth) {
             $this->FilterMonth->setSelectedValue($FilterMonth);
         }
         if ($FilterDepartment) {
             $this->FilterDepartment->setSelectedValue($FilterDepartment);
         } else {
             $this->FilterDepartment->setSelectedIndex(0);
         }
         $this->DataGrid->DataSource = $this->Data;
         $this->DataGrid->dataBind();
     }
     if (isset($this->Request['okMsg'])) {
         $this->displayMessage($this->Request['okMsg'], true);
     }
     if (isset($this->Request['koMsg'])) {
         $this->displayMessage($this->Request['koMsg'], false);
     }
 }
Exemplo n.º 23
0
 public function onLoad($param)
 {
     parent::onLoad($param);
 }