Esempio n. 1
0
 public function onDefault($sender, $param)
 {
     $cbs = $this->findControlsByType("TActiveCheckBox");
     $nDelete = 0;
     $koMsg = '';
     $cbChecked = 0;
     foreach ($cbs as $cb) {
         if ((bool) $cb->getChecked() && $cb->Value != "0") {
             $cbChecked++;
         }
     }
     if ($cbChecked == 0) {
         $koMsg = Prado::localize('Select one item');
     } elseif ($cbChecked == 1) {
         foreach ($cbs as $cb) {
             if ((bool) $cb->getChecked() && $cb->Value != "0") {
                 $cmd = $this->db->createCommand("UPDATE hr_install SET `default`='0' WHERE type='template'");
                 $cmd->execute();
                 $cmd = $this->db->createCommand("UPDATE hr_install SET `default`='1' WHERE id=:id");
                 $cmd->bindValue(":id", $cb->Value);
                 $cmd->execute();
             }
         }
     } else {
         $koMsg = Prado::localize('Select only one item');
     }
     if ($koMsg !== '') {
         $pBack = array('koMsg' => $koMsg);
     } else {
         $pBack = array('okMsg' => Prado::localize('New default template updated'));
     }
     $this->Response->redirect($this->Service->constructUrl('installation.template', $pBack));
 }
Esempio n. 2
0
 protected function getData()
 {
     $d = array();
     $cmd = $this->db->createCommand("SELECT * FROM hr_config WHERE id=1");
     $query = $cmd->query();
     $data = $query->read();
     $dir = $data['log_path'];
     if (file_exists($dir)) {
         if (!is_readable($dir)) {
             $this->displayMessage(Prado::localize('The directory {dir} is not readable', array("dir" => $dir)), false);
             return false;
         }
     } else {
         $this->displayMessage(Prado::localize('The directory {dir} does not exist', array("dir" => $dir)), false);
         return false;
     }
     $list = scandir($dir);
     $i = 0;
     foreach ($list as $l) {
         if ($l != "." && $l != "..") {
             $d[$i]['Value'] = "./horuxlog/" . $l;
             $d[$i++]['Text'] = $l;
         }
     }
     return $d;
 }
 public function displayHardwareList()
 {
     $path = './protected/pages/hardware/device/';
     $files = scandir($path);
     $types = array();
     foreach ($files as $f) {
         if ($f != '..' && $f != '.' && $f != '.svn' && is_dir($path . $f)) {
             $t = explode("_", $f);
             $type = $t;
             unset($type[0]);
             $types[$t[0]][] = implode("_", $type);
         }
     }
     $html = '<ul id="menu-item" class="jtree">';
     foreach ($types as $k => $v) {
         $html .= '<li id="internal-node">';
         $html .= '<div class="node-open"><span></span>';
         $html .= Prado::localize("{type} technology", array('type' => $k));
         $html .= '</div><ul>';
         foreach ($v as $k2 => $v2) {
             $html .= '<li>';
             $html .= '<div class="leaf"><span></span>';
             $html .= '<a href="' . $this->Service->constructUrl('hardware.device.' . $k . '_' . $v2 . '.add') . '">' . $v2 . '</a>';
             $html .= '</div>';
             $html .= '</li>';
         }
         $html .= '</ul>';
         $html .= '</li>';
     }
     $html .= '</ul>';
     return $html;
 }
Esempio n. 4
0
 public function onLoad($param)
 {
     $this->Page->Title = Prado::localize('Confirm');
     $id = 0;
     $code = "";
     if (isset($_GET["id"])) {
         $id = $_GET["id"];
     }
     if (isset($_GET["code"])) {
         $code = $_GET["code"];
     }
     if ($id != 0 && $code != "") {
         $user = TblUsers::finder()->findBy_id($id);
         if ($user != null) {
             if ($user->active == 1) {
                 $this->result->Text = Prado::localize('USER_ALREADY_ACTIVE') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
             } else {
                 if ($user->confirm_code != $code) {
                     $this->result->Text = Prado::localize('USER_WRONG_CODE') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
                 } else {
                     $user->active = 1;
                     $user->save();
                     $this->result->Text = Prado::localize('ACTIVATION_OK');
                 }
             }
         } else {
             $this->result->Text = Prado::localize('USER_NOT_EXIST') . " <a href='mailto:" . $this->Application->Parameters['EMAIL_ASSISTENZE'] . "'>" . Prado::localize('ASSISTENZE') . "</a>";
         }
     } else {
     }
 }
Esempio n. 5
0
 public function onLoad($param)
 {
     $this->Page->Title = Prado::localize('NewCustomer');
     $this->content->Visible = true;
     $this->reg_ok->Visible = false;
     $this->Save->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/save.gif';
     $this->btnCancelSelect->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/cancel.gif';
     if (isset($_GET["status"])) {
         $this->content->Visible = false;
         $this->reg_ok->Visible = true;
     }
     if ($this->User->UserDB->type_user_id == 4) {
         $this->Save->Visible = false;
         $this->btnCancelSelect->Visible = false;
     } else {
         $this->Save->Visible = true;
         $this->btnCancelSelect->Visible = true;
     }
     $criteria = new TActiveRecordCriteria();
     $criteria->OrdersBy['id'] = 'desc';
     $classifiche = TblClassifica::finder()->findAll($criteria);
     $this->DDLClassifica->DataSource = $classifiche;
     $this->DDLClassifica->dataBind();
     $this->DDLClassifica->SelectedValue = 1;
 }
Esempio n. 6
0
 function Footer()
 {
     //Positionnement � 1,5 cm du bas
     $this->SetY(-15);
     //Police Arial italique 8
     $this->SetFont('Arial', 'I', 8);
     //Num�ro de page
     $this->Cell(0, 10, Prado::localize('Page', array(), "messages") . ' ' . $this->PageNo(), 'T', 0, 'C');
 }
Esempio n. 7
0
 public function onLoad($param)
 {
     $this->Page->Title = Prado::localize('LostPassword');
     $this->Send->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/send.gif';
     if ($this->User->UserDB->type_user_id == 4) {
         $this->Send->Visible = false;
     } else {
         $this->Send->Visible = true;
     }
 }
Esempio n. 8
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The interface was added successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The interface was not added'));
         }
         $this->Response->redirect($this->Service->constructUrl('hardware.HardwareList', $pBack));
     }
 }
Esempio n. 9
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The activity counter was modified successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The activity counter was not modified'));
         }
         $this->Response->redirect($this->Service->constructUrl('components.timuxuser.counter.counter', $pBack));
     }
 }
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The message was setted successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The message was not setted'));
         }
         $this->Response->redirect($this->Service->constructUrl('user.UserList', $pBack));
     }
 }
Esempio n. 11
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The messages was modified successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The messages was not modified'));
         }
         $this->Response->redirect($this->Service->constructUrl('components.media.infoDisplay', $pBack));
     }
 }
Esempio n. 12
0
 protected function Checkin()
 {
     $cmd = NULL;
     if ($this->db->DriverName == 'sqlite') {
         $cmd = $this->db->createCommand("select * from sqlite_master");
     } else {
         $cmd = $this->db->createCommand("SHOW TABLE STATUS");
     }
     $data = $cmd->query();
     $data = $data->readAll();
     $tables = array();
     foreach ($data as $d) {
         $cmd = NULL;
         if ($this->db->DriverName == 'sqlite') {
             $cmd = $this->db->createCommand("pragma table_info('" . $d['name'] . "')");
             $data3 = $cmd->query();
             $data3 = $data3->readAll();
             $data2 = false;
             if ($data3) {
                 foreach ($data3 as $data4) {
                     if ($data4['name'] == 'locked') {
                         $data2 = true;
                     }
                 }
             }
         } else {
             $cmd = $this->db->createCommand("SHOW COLUMNS FROM " . $d['Name'] . " WHERE Field='locked'");
             $data2 = $cmd->query();
             $data2 = $data2->read();
         }
         if ($data2) {
             if ($this->db->DriverName == 'sqlite') {
                 $cmd = $this->db->createCommand("SELECT COUNT(*) AS nb FROM " . $d['name'] . " WHERE locked>0");
             } else {
                 $cmd = $this->db->createCommand("SELECT COUNT(*) AS nb FROM " . $d['Name'] . " WHERE locked>0");
             }
             $data2 = $cmd->query();
             $data2 = $data2->read();
             if ($this->db->DriverName == 'sqlite') {
                 $cmd = $this->db->createCommand("UPDATE " . $d['name'] . " SET locked=0");
             } else {
                 $cmd = $this->db->createCommand("UPDATE " . $d['Name'] . " SET locked=0");
             }
             $cmd->execute();
             if ($this->db->DriverName == 'sqlite') {
                 $tables[] = array('name' => $d['name'], 'item' => Prado::localize('Checked in {n} Items', array('n' => $data2['nb'])));
             } else {
                 $tables[] = array('name' => $d['Name'], 'item' => Prado::localize('Checked in {n} Items', array('n' => $data2['nb'])));
             }
         }
     }
     $this->DataGrid->DataSource = $tables;
     $this->DataGrid->dataBind();
 }
Esempio n. 13
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The service was added successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The service was not added'));
         }
         $this->Response->redirect($this->Service->constructUrl('components.velopark.config', $pBack));
     }
 }
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The configuration was saved successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The configuration was not saved'));
         }
         $this->Response->redirect($this->Service->constructUrl('installation.components', $pBack));
     }
 }
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The attribution was modified successfully'), 'id' => $this->Request['userid']);
         } else {
             $pBack = array('koMsg' => Prado::localize('The attribution was not modified'), 'id' => $this->Request['userid']);
         }
         $this->Response->redirect($this->Service->constructUrl('components.velopark.attribution', $pBack));
     }
 }
Esempio n. 16
0
 public function getData()
 {
     $cmd = $this->db->createCommand("SELECT * FROM hr_install WHERE type='language'");
     $data = $cmd->query();
     $data = $data->readAll();
     $l[] = array('param' => 'default', 'name' => Prado::localize('default'));
     foreach ($data as $d) {
         $l[] = array('param' => $d['param'], 'name' => $d['name']);
     }
     return $l;
 }
Esempio n. 17
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The non working day was added successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The non working day was not added'));
         }
         $this->Response->redirect($this->Service->constructUrl('nonWorkingDay.nonWorkingDay', $pBack));
     }
 }
Esempio n. 18
0
 public function onLoad($param)
 {
     $this->Page->Title = Prado::localize('Register');
     $this->content->Visible = true;
     $this->reg_ok->Visible = false;
     $this->Save->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/save.gif';
     if (isset($_GET["status"])) {
         $this->content->Visible = false;
         $this->reg_ok->Visible = true;
     }
 }
Esempio n. 19
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The Horux Controller was added successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The Horux Controller was not added'));
         }
         $this->Response->redirect($this->Service->constructUrl('horuxController.horuxController', $pBack));
     }
 }
Esempio n. 20
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         $res = $this->saveData();
         if ($res) {
             $pBack = array('okMsg' => Prado::localize('The config was modified successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The config was not modified') . $this->emailError);
         }
         $this->Response->redirect($this->Service->constructUrl('components.timuxadmin.config.config', $pBack));
     }
 }
Esempio n. 21
0
 public function onApply($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($lastId = $this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The leave was add successfully'), 'id' => $lastId);
             $this->Response->redirect($this->Service->constructUrl('components.timuxuser.leave.mod', $pBack));
         } else {
             $pBack = array('koMsg' => Prado::localize('The leave was not add'), 'id' => $this->id->Value);
             $this->Response->redirect($this->Service->constructUrl('components.timuxuser.leave.add', $pBack));
         }
     }
 }
Esempio n. 22
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $this->application->clearGlobalState('listBoxAccessTime');
             $pBack = array('okMsg' => Prado::localize('The group was added successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The group was not added'));
         }
         $this->Response->redirect($this->Service->constructUrl('userGroup.UserGroupList', $pBack));
     }
 }
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The subscription was modified successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The subscription was not modified'));
         }
         $this->blockRecord('hr_vp_subscription', $this->id->Value, 0);
         $this->Response->redirect($this->Service->constructUrl('components.velopark.subscription', $pBack));
     }
 }
Esempio n. 24
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The device was modified successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The device was not modified'));
         }
         $this->blockRecord('hr_device', $this->id->Value, 0);
         $this->Response->redirect($this->Service->constructUrl('hardware.HardwareList', $pBack));
     }
 }
Esempio n. 25
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             // message en cas de succès
             $pBack = array('okMsg' => Prado::localize('The hello world text was saved correctly'));
         } else {
             // Message en cas d'erreur
             $pBack = array('koMsg' => Prado::localize('The hello world text was not modified'));
         }
         // redirection de la page sur la même page. Nous pourrions aussi rediriger ailleurs si nécessaire
         $this->Response->redirect($this->Service->constructUrl('components.helloworld.helloworld', $pBack));
     }
 }
Esempio n. 26
0
 public function onSave($sender, $param)
 {
     if ($this->Page->IsValid) {
         if ($this->saveData()) {
             $pBack = array('okMsg' => Prado::localize('The import configuration was modified successfully'));
         } else {
             $pBack = array('koMsg' => Prado::localize('The import configuration was not modified'));
         }
         if (isset($this->Request['id'])) {
             $this->blockRecord('hr_import', $this->id->Value, 0);
         }
         $this->Response->redirect($this->Service->constructUrl('components.export.import', $pBack));
     }
 }
Esempio n. 27
0
 protected function getData()
 {
     $this->alarmMessage[1001] = Prado::localize("1001");
     $this->alarmMessage[1002] = Prado::localize("1002");
     $this->alarmMessage[1003] = Prado::localize("1003");
     $this->alarmMessage[1004] = Prado::localize("1004");
     $this->alarmMessage[1005] = Prado::localize("1005");
     $this->alarmMessage[1006] = Prado::localize("1006");
     $this->alarmMessage[1007] = Prado::localize("1007");
     $this->alarmMessage[1008] = Prado::localize("1008");
     $this->alarmMessage[1009] = Prado::localize("1009");
     $this->alarmMessage[1010] = Prado::localize("1010");
     $this->alarmMessage[1011] = Prado::localize("1011");
     $this->alarmMessage[1012] = Prado::localize("1012");
     $this->alarmMessage[1013] = Prado::localize("1013");
     $this->alarmMessage[1014] = Prado::localize("1014");
     $this->alarmMessage[1015] = Prado::localize("1015");
     $this->alarmMessage[1016] = Prado::localize("1016");
     $this->alarmMessage[1017] = Prado::localize("1017");
     $this->alarmMessage[1100] = Prado::localize("1100");
     $this->alarmMessage[1101] = Prado::localize("1101");
     $this->alarmMessage[1102] = Prado::localize("1102");
     $this->alarmMessage[1200] = Prado::localize("1200");
     $from = "";
     $until = "";
     $from = $this->dateToSql($this->from->SafeText);
     $until = $this->dateToSql($this->until->SafeText);
     if ($from == "" && $until == "") {
         $cmd = $this->db->createCommand(SQL::SQL_GET_ALARMS);
     } else {
         if ($from != "" && $until != "") {
             $cmd = $this->db->createCommand(SQL::SQL_GET_ALARMS_BY_DATE);
             $cmd->bindValue(":from", $from, PDO::PARAM_STR);
             $cmd->bindValue(":until", $until, PDO::PARAM_STR);
         }
         if ($from != "" && $until == "") {
             $cmd = $this->db->createCommand(SQL::SQL_GET_ALARMS_BY_DATE_FROM);
             $cmd->bindValue(":from", $from, PDO::PARAM_STR);
         }
         if ($from == "" && $until != "") {
             $cmd = $this->db->createCommand(SQL::SQL_GET_ALARMS_BY_DATE_UNTIL);
             $cmd->bindValue(":until", $until, PDO::PARAM_STR);
         }
     }
     $indexStart = $this->DataGrid->CurrentPageIndex * 15;
     $indexStop = $indexStart + 15;
     $data = $cmd->query();
     $data = $data->readAll();
     return $this->getObjectAlarms($data, $indexStart, $indexStop);
 }
Esempio n. 28
0
 public function onLoad($param)
 {
     $this->Page->Title = Prado::localize('PersonalData');
     $this->Save->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/save.gif';
     $this->btnCancelSelect->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/cancel.gif';
     $this->btnUpload->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/upload.gif';
     if (!$this->IsPostBack) {
         $this->content->Visible = true;
         $user = $this->User->UserDB;
         $this->Email->Text = $user->email;
         $this->Name->Text = $user->name;
         $this->Surname->Text = $user->surname;
         $this->Telephone->Text = $user->telephone;
         $this->MobileTelephone->Text = $user->mobile_telephone;
         $this->Fax->Text = $user->fax;
         $this->Cost->Text = $user->cost;
         $criteria = new TActiveRecordCriteria();
         $criteria->OrdersBy['description'] = 'asc';
         $brands = TblWeightUnit::finder()->findAll($criteria);
         $this->DDLWeightUnit->DataSource = $brands;
         $this->DDLWeightUnit->dataBind();
         $this->DDLWeightUnit->SelectedValue = $user->tbl_weight_unit_id;
         $brands = TblCurrencyUnit::finder()->findAll($criteria);
         $this->DDLCurrencyUnit->DataSource = $brands;
         $this->DDLCurrencyUnit->dataBind();
         $this->DDLCurrencyUnit->SelectedValue = $user->tbl_currency_unit_id;
         $this->Piva->Text = $user->piva;
         $urlJpg = 'themes/White/images/logo/' . $this->User->UserDB->id . ".jpg";
         $urlPng = 'themes/White/images/logo/' . $this->User->UserDB->id . ".png";
         if (!file_exists($urlJpg)) {
             //if (!file_exists($urlPng))
             $this->ImageLogo->ImageUrl = $this->Page->Theme->BaseUrl . '/images/logo-st-www.jpg';
         } else {
             $this->ImageLogo->ImageUrl = $urlJpg;
         }
     }
     if ($this->User->UserDB->type_user_id == 4) {
         $this->Save->Visible = false;
         $this->btnCancelSelect->Visible = false;
         $this->btnUpload->Visible = false;
     } else {
         $this->Save->Visible = true;
         $this->btnCancelSelect->Visible = true;
         $this->btnUpload->Visible = true;
     }
 }
Esempio n. 29
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);
         }
     }
 }
Esempio n. 30
0
 public function onLoad($param)
 {
     $this->Close->ImageUrl = $this->Page->Theme->BaseUrl . '/images/' . $this->getApplication()->getGlobalization()->Culture . '/close.gif';
     $type = $this->Request['type'];
     if ($type == 'strings') {
         $this->Type->Text = Prado::localize('ExplanationString');
     } else {
         if ($type == 'cr') {
             $this->Type->Text = Prado::localize('ExplanationUserRacquet');
         } else {
             if ($type == 'HelpCustomers') {
                 $this->Type->Text = Prado::localize('HelpCustomers');
             } else {
                 if ($type == 'HelpStringMains') {
                     $this->Type->Text = Prado::localize('HelpStringMains');
                 }
             }
         }
     }
 }