protected function getCache()
 {
     if (!$this->_cache) {
         $this->_cache = Prado::getApplication()->getCache();
     }
     return $this->_cache;
 }
Exemple #2
0
 protected function getData($offset, $limit)
 {
     $session = Prado::getApplication()->getSession();
     $langID = $session->itemAt('jezyk');
     $this->DataGrid->DataSource = PagesRecord::finder()->findAll('LanguageID = ? AND PageID = 19 ORDER BY Position', $langID);
     return $this->DataGrid->dataBind();
 }
 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);
     }
 }
 public function onImport($sender, $param)
 {
     $session = Prado::getApplication()->getSession();
     $session['format'] = $this->format->Value;
     //////$session['csv_terminated'] = $this->csv_terminated->SafeText;
     //////$session['csv_enclosed'] = $this->csv_enclosed->SafeText;
     //////$session['csv_escaped'] = $this->csv_escaped->SafeText;
     $session['tbl_name'] = $this->tbl_name->SafeText;
     //W$session['csv_new_line'] = $this->csv_new_line->SafeText;
     //$session['csv_col_names'] = $this->csv_col_names->Value;
     $this->file->saveAs("./tmp/" . $this->file->Filename);
     $session['upfile'] = $this->file->FileName;
     $cbs = $this->findControlsByType("TActiveCheckBox");
     $session['selected_conf'] = "";
     if ($this->custom_config->Checked) {
         foreach ($cbs as $cb) {
             if ((bool) $cb->getChecked() && $cb->Value != "0") {
                 $session['selected_conf'] = $cb->Value;
             }
         }
     }
     $this->Response->redirect($this->Service->constructUrl('components.export.importData'));
     /* $msg = array('okMsg'=>Prado::localize('...'));
        $this->Response->redirect($this->Service->constructUrl('components.export.import',$msg));*/
 }
Exemple #5
0
 function setup()
 {
     parent::setup();
     $app = Prado::getApplication();
     $this->userDao = $app->getModule('daos')->getDao('UserDao');
     $this->flushDatabase();
 }
 public function getShortLang()
 {
     $source = Prado::getApplication()->getGlobalization();
     if (Prado::getApplication()->getRequest()->contains('culture')) {
         $source->setCulture(Prado::getApplication()->getRequest()->itemAt('culture'));
     }
     return $source->getCulture();
 }
 function setup()
 {
     parent::setup();
     $app = Prado::getApplication();
     $this->categoryDao = $app->getModule('daos')->getDao('CategoryDao');
     $this->projectDao = $app->getModule('daos')->getDao('ProjectDao');
     $this->flushDatabase();
 }
 /**
  * Creates a new instance of TimeTrackerUser
  * @param array result data
  * @return TimeTrackerUser new user instance
  */
 public function createNewInstance($row = null)
 {
     $manager = Prado::getApplication()->getModule('users');
     if (is_null($manager)) {
         $manager = new UserManager();
     }
     return new TimeTrackerUser($manager);
 }
 protected function getComponentShortCut()
 {
     $data = array();
     $app = $this->getApplication();
     $db = $app->getModule('horuxDb')->DbConnection;
     $db->Active = true;
     $cmd = $this->db->createCommand("SELECT * FROM hr_install WHERE type='component' AND name!='tracking'");
     $data_ = $cmd->query();
     $data_ = $data_->readAll();
     $isComponentHasOne = false;
     foreach ($data_ as $d) {
         $doc = new TXmlDocument();
         $doc->loadFromFile('./protected/pages/components/' . $d['name'] . '/install.xml');
         $name = $doc->getElementByTagName('name');
         $installName = $doc->getElementByTagName('installName')->getValue();
         $cmd = $this->db->createCommand("SELECT * FROM hr_install WHERE type='component' AND name='{$installName}'");
         $data1 = $cmd->query();
         $data1 = $data1->readAll();
         foreach ($data1 as $d1) {
             $cmd = $this->db->createCommand("SELECT * FROM hr_install AS i LEFT JOIN hr_component as c ON c.id_install=i.id WHERE i.type='component' AND c.parentmenu=0 AND i.id=" . $d1['id']);
             $data2 = $cmd->query();
             $data2 = $data2->read();
             $url = "./themes/letux/images/header/icon-48-link.png";
             if (!$isComponentHasOne) {
                 if ($this->isAccess($data2['page'])) {
                     $data[] = array('page' => $data2['page'], 'Name' => Prado::localize($name->getValue(), array(), $data2['name']), 'icon' => $url);
                 }
                 $isComponentHasOne = true;
             } else {
                 if ($this->isAccess($data2['page'])) {
                     $data[] = array('page' => $data2['page'], 'Name' => Prado::localize($name->getValue(), array(), $data2['name']), 'icon' => $url);
                 }
             }
             $cmd = $this->db->createCommand("SELECT * FROM hr_install AS i LEFT JOIN hr_component as c ON c.id_install=i.id WHERE i.type='component' AND c.parentmenu=" . $data2['id'] . " AND c.parentmenu>0 AND i.id=" . $d1['id']);
             $data2 = $cmd->query();
             $data2 = $data2->readAll();
             foreach ($data2 as $d2) {
                 if ($this->isAccess($d2['page'])) {
                     $pagePath = str_replace(".", "/", $d2['page']);
                     if (file_exists('./protected/pages/' . $pagePath . '.page')) {
                         $content = file_get_contents('./protected/pages/' . $pagePath . '.page');
                         if (preg_match("/IconAsset=\"<%~(.*)%>\"/", $content, $matches)) {
                             if (($assetPos = strrpos($matches[1], "assets/")) !== false) {
                                 $icon = substr($matches[1], $assetPos + 7);
                                 $icon = trim($icon);
                                 if ($icon) {
                                     $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getApplication()->getBasePath() . '/pages/components/' . $d2['name'] . '/assets/' . $icon);
                                 }
                             }
                         }
                     }
                     $data[] = array('page' => $d2['page'], 'Name' => Prado::localize($d2['menuname'], array(), $d2['name']), 'icon' => $url);
                 }
             }
         }
     }
     return $data;
 }
 public function init($config)
 {
     $request = Prado::getApplication()->getRequest();
     if ($request->contains('pivotbar')) {
         $this->type = TPropertyValue::ensureString($request['pivotbar']);
     } else {
         throw new TConfigurationException('You must specify the type of the graph');
     }
     if ($request->contains('numberpivots')) {
         $this->numberpivots = TPropertyValue::ensureInteger($request['numberpivots']);
     } else {
         throw new TConfigurationException('You must calculate the number of base elements');
     }
     if ($request->contains('numberdimensions')) {
         $this->numberdimensions = TPropertyValue::ensureInteger($request['numberdimensions']);
     } else {
         throw new TConfigurationException('You must calculate the number of dim elements');
     }
     if ($request->contains('numberchildren')) {
         $this->numberchildren = TPropertyValue::ensureInteger($request['numberchildren']);
     } else {
         throw new TConfigurationException('You must calculate the number of children');
     }
     if ($request->contains('width')) {
         $temp = explode(',', TPropertyValue::ensureInteger($request['width']));
         $this->width = $temp[0];
     }
     if ($request->contains('height')) {
         $temp = explode(',', TPropertyValue::ensureInteger($request['height']));
         $this->height = $temp[0];
     }
     if ($request->contains('title')) {
         $temp = explode(',', TPropertyValue::ensureString($request['title']));
         $this->title = $temp[0];
     }
     if ($request->contains('legend')) {
         $temp = explode(',', TPropertyValue::ensureString($request['legend']));
         $this->legend = $temp[0];
     }
     if ($request->contains('xdata')) {
         $this->xdata = explode(',', TPropertyValue::ensureString($request['xdata']));
     } else {
         throw new TConfigurationException('You must specify the x data for the graph');
     }
     for ($ii = 1; $ii <= $this->numberdimensions; $ii++) {
         $variable = 'ydata' . $ii;
         if ($request->contains($variable)) {
             $this->ydata[$ii] = explode(',', TPropertyValue::ensureString($request[$variable]));
         } else {
             throw new TConfigurationException('You must specify the y data for the graph');
         }
     }
     if ($request->contains('ytitle')) {
         $this->ytitle = TPropertyValue::ensureString($request['ytitle']);
     } else {
         throw new TConfigurationException('You must specify the y title for the graph.');
     }
 }
Exemple #11
0
 private function _startThemeManager()
 {
     $themeManager = new TThemeManager();
     $themeManager->BasePath = "System.Wsat.themes";
     $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat'));
     $themeManager->BaseUrl = "{$url}/themes";
     $themeManager->init(null);
     $this->setThemeManager($themeManager);
 }
 /**
  * Parses the application configuration file.
  * @param string configuration file name
  * @throws TConfigurationException if there is any parsing error
  */
 public function loadFromFile($fname)
 {
     if (Prado::getApplication()->getConfigurationType() == TApplication::CONFIG_TYPE_PHP) {
         $fcontent = (include $fname);
         $this->loadFromPhp($fcontent, dirname($fname));
     } else {
         $dom = new TXmlDocument();
         $dom->loadFromFile($fname);
         $this->loadFromXml($dom, dirname($fname));
     }
 }
 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);
     }
 }
 /**
  * Creates the DB connection.
  * @param string the module ID for TDataSourceConfig
  * @return TDbConnection the created DB connection
  * @throws TConfigurationException if module ID is invalid or empty
  */
 protected function createDbConnection($connectionID)
 {
     if ($connectionID !== '') {
         $conn = Prado::getApplication()->getModule($connectionID);
         if ($conn instanceof TDataSourceConfig) {
             return $conn->getDbConnection();
         } else {
             throw new TConfigurationException('messagesource_connectionid_invalid', $connectionID);
         }
     } else {
         throw new TConfigurationException('messagesource_connectionid_required');
     }
 }
Exemple #15
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->isPostBack) {
         $date = getDate();
         if (Prado::getApplication()->getSession()->contains('nonWorkingDayYear')) {
             $this->until->setTimeStamp(mktime(0, 0, 0, 1, 1, $this->Session['nonWorkingDayYear']));
             $this->from->setTimeStamp(mktime(0, 0, 0, 1, 1, $this->Session['nonWorkingDayYear']));
         } else {
             $this->until->setTimeStamp(mktime(0, 0, 0, 1, 1, $date['year']));
             $this->from->setTimeStamp(mktime(0, 0, 0, 1, 1, $date['year']));
         }
     }
 }
Exemple #16
0
 /**
  * Save untranslated messages to the catalogue.
  */
 public static function saveMessages()
 {
     static $onceonly = true;
     if ($onceonly) {
         foreach (self::$formatters as $catalogue => $formatter) {
             $app = Prado::getApplication()->getGlobalization();
             $config = $app->getTranslationConfiguration();
             if (isset($config['autosave'])) {
                 $formatter->getSource()->setCulture($app->getCulture());
                 $formatter->getSource()->save($catalogue);
             }
         }
         $onceonly = false;
     }
 }
Exemple #17
0
 public function deleteItem($sender, $param)
 {
     if ($this->Language->DataKeys[$param->Item->ItemIndex] == 1) {
         echo 'Error : nie można usunąć domyslnego języka';
         die;
     } else {
         PagesRecord::finder()->deleteAllByLanguageID($this->Language->DataKeys[$param->Item->ItemIndex]);
         SettingsRecord::finder()->deleteAllByLanguageID($this->Language->DataKeys[$param->Item->ItemIndex]);
         TransUnitRecord::finder()->deleteAllBycat_id($this->Language->DataKeys[$param->Item->ItemIndex]);
         CatalogueRecord::finder()->deleteBycat_id($this->Language->DataKeys[$param->Item->ItemIndex]);
         $session = Prado::getApplication()->getSession();
         $session->add('jezyk', 1);
         $this->Response->redirect($this->Service->constructUrl("Home"));
     }
 }
 /**
  * Highlights a string as php code
  * @param string $address The php code to highlight
  * @return array lat, long
  * @soapmethod
  */
 public static function getLatAndLong($address)
 {
     $address = urlencode($address);
     $apiKey = Prado::getApplication()->Parameters['GMapApiKey'];
     $apiUrl = "http://maps.google.com/maps/geo?&output=xml&key=" . $apiKey . "&q=" . $address;
     $wsql = new htmlsql();
     // connect to a URL
     if (!$wsql->connect('url', $apiUrl)) {
         print 'Error while connecting: ' . $wsql->error;
     }
     if (!$wsql->query('SELECT * FROM coordinates')) {
         print "Query error: " . $wsql->error;
     }
     $temp = $wsql->fetch_array();
     return $temp[0]['text'];
 }
Exemple #19
0
 public function saveItem($sender, $param)
 {
     $session = Prado::getApplication()->getSession();
     $langID = $session->itemAt('jezyk');
     $id = $param->Item->ItemIndex + 1;
     $item = $param->Item;
     $rows = SettingsRecord::finder()->find('ID = ? AND LanguageID = ?', $id, $langID);
     $rows->Value = $item->Value->TextBox->Text;
     $rows->save();
     $this->DataGrid->EditItemIndex = -1;
     $this->DataGrid->DataSource = $this->Data;
     $this->DataGrid->dataBind();
     $session = Prado::getApplication()->getSession();
     $langID = $session->itemAt('jezyk');
     $this->Response->redirect($this->Service->constructUrl("Settings.Index", array('id' => $langID)));
 }
 public function onPreInit($param)
 {
     $this->db = $this->Application->getModule('horuxDb')->DbConnection;
     $this->db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
     $this->db->Active = true;
     $sql = "SELECT * FROM hr_install WHERE `default`=1 AND type='template'";
     $cmd = $this->db->createCommand($sql);
     $data = $cmd->query();
     $data = $data->read();
     $this->setTheme($data['name']);
     $this->setMasterClass('themes.' . $data['name'] . '.MainLayout');
     if (isset($this->Request['lang'])) {
         $lang = $this->Request['lang'];
         if ($lang != "default") {
             $this->Session['lang'] = $lang;
         } else {
             $sql = "SELECT * FROM hr_install WHERE `default`=1 AND type='language'";
             $cmd = $this->db->createCommand($sql);
             $data = $cmd->query();
             $data = $data->read();
             $lang = $data['param'];
             $userID = Prado::getApplication()->getUser()->getUserID();
             $cmd = $this->db->createCommand("SELECT user_id FROM hr_superusers WHERE id={$userID}");
             $data = $cmd->query();
             $dataUser = $data->read();
             $userID = $dataUser['user_id'];
             if ($userID > 0) {
                 $cmd = $this->db->createCommand("SELECT language FROM hr_user WHERE id={$userID}");
                 $data = $cmd->query();
                 $dataUser = $data->read();
                 $lang = $dataUser['language'];
             }
             $this->Session['lang'] = $lang;
         }
     } else {
         if (!($lang = $this->Session['lang'])) {
             $sql = "SELECT * FROM hr_install WHERE `default`=1 AND type='language'";
             $cmd = $this->db->createCommand($sql);
             $data = $cmd->query();
             $data = $data->read();
             $lang = $data['param'];
             $this->Session['lang'] = $lang;
         }
     }
     $this->getApplication()->getGlobalization()->setCulture($this->Session['lang']);
     $this->checkUsersSession();
 }
Exemple #21
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (isset($this->Request['barcode'])) {
         $objCode = new pi_barcode();
         $objCode->setSize(50);
         $objCode->hideCodeType();
         $objCode->setColors('#000000');
         $objCode->setSize(80);
         $param = Prado::getApplication()->getParameters();
         $objCode->setType($param['barcodetype']);
         $objCode->setCode($this->Request['code']);
         $objCode->setFiletype('PNG');
         $objCode->showBarcodeImage();
         exit;
     }
 }
 protected function getMysqlSqlMapManager()
 {
     static $conn;
     static $sqlMapManager;
     if (Prado::getApplication() === null) {
         Prado::setApplication(new TApplication(dirname(__FILE__) . '/app'));
     }
     if ($conn === null) {
         $conn = new TDbConnection('mysql:host=localhost;dbname=prado_system_data_sqlmap', 'prado_unitest', 'prado_system_data_sqlmap_unitest');
     }
     $conn->setActive(true);
     if ($sqlMapManager === null) {
         $sqlMapManager = new TSqlMapManager($conn);
         $sqlMapManager->configureXml(dirname(__FILE__) . '/DynamicParameterTestMap.xml');
     }
     return $sqlMapManager;
 }
Exemple #23
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     $this->staticPage = PagesRecord::finder()->findByPk($this->getRequest()->itemAt("id"));
     if ($this->getRequest()->contains("id") == true && isset($this->staticPage) == true) {
         $session = Prado::getApplication()->getSession();
         $langID = $session->itemAt('jezyk');
         $parentID = $this->getRequest()->itemAt("id");
         if (!$this->getPage()->IsPostBack) {
             $this->PagesChildren->DataSource = UserRecord::finder()->findAll('PagesID = ?', $parentID);
             $this->PagesChildren->dataBind();
             $this->InCorrect->Visible = false;
         }
     } else {
         $this->Response->redirect($this->Service->constructUrl("Pages.Add"));
     }
 }
Exemple #24
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);
     }
 }
Exemple #25
0
 public function onLogin($sender, $param)
 {
     $authManager = $this->Application->getModule('Auth');
     if (!$authManager->login(strtolower($this->username->SafeText), $this->password->SafeText)) {
         $param->IsValid = false;
     } else {
         $this->log($this->username->SafeText . " is logged in");
         $userID = Prado::getApplication()->getUser()->getUserID();
         $cmd = $this->db->createCommand("SELECT defaultPage FROM hr_superuser_group AS sg LEFT JOIN  hr_superusers AS s ON s.group_id=sg.id WHERE s.id={$userID}");
         $data = $cmd->query();
         $dataUser = $data->read();
         $defaultPage = $dataUser['defaultPage'];
         if ($defaultPage == '') {
             $this->Response->redirect($this->Service->constructUrl('controlPanel.ControlPanel', array('lang' => $this->lang->getSelectedValue())));
         } else {
             $this->Response->redirect($this->Service->constructUrl($defaultPage, array('lang' => $this->lang->getSelectedValue())));
         }
     }
 }
 public function init($config)
 {
     $request = Prado::getApplication()->getRequest();
     if ($request->contains('graph')) {
         $this->type = TPropertyValue::ensureString($request['graph']);
     } else {
         throw new TConfigurationException('You must specify the type of the graph');
     }
     if ($request->contains('width')) {
         $temp = explode(',', TPropertyValue::ensureInteger($request['width']));
         $this->width = $temp[0];
     }
     if ($request->contains('height')) {
         $temp = explode(',', TPropertyValue::ensureInteger($request['height']));
         $this->height = $temp[0];
     }
     if ($request->contains('title')) {
         //$temp = explode( ',', );
         $this->title = TPropertyValue::ensureString($request['title']);
     }
     if ($request->contains('legend')) {
         $this->legend = explode(',', TPropertyValue::ensureString($request['legend']));
     }
     if ($request->contains('xdata')) {
         $this->xdata = explode(',', TPropertyValue::ensureString($request['xdata']));
     } else {
         throw new TConfigurationException('You must specify the x data for the graph');
     }
     if ($request->contains('ydata1')) {
         $this->ydata1 = explode(',', TPropertyValue::ensureString($request['ydata1']));
     } else {
         throw new TConfigurationException('You must specify the y data for the graph');
     }
     if ($request->contains('ydata2')) {
         $this->ydata2 = explode(',', TPropertyValue::ensureString($request['ydata2']));
     }
     if ($request->contains('ytitle')) {
         $this->ytitle = TPropertyValue::ensureString($request['ytitle']);
     } else {
         throw new TConfigurationException('You must specify the y title for the graph.');
     }
 }
Exemple #27
0
 public function onLoad($param)
 {
     $session = Prado::getApplication()->getSession();
     $langID = $session->itemAt('jezyk');
     $this->ActLang = $langID;
     $this->PagesParent->DataSource = PagesRecord::finder()->findAll('PageID IS NULL AND LanguageID = ?', $langID);
     $this->PagesParent->dataBind();
     $m = null;
     if ($this->getPage()->getPagePath() == 'Pages.Index' || $this->getPage()->getPagePath() == 'Pages.Add') {
         $m = $this->getRequest()->itemAt("id");
     }
     $this->activeLi = array(0);
     if ($m != null) {
         array_push($this->activeLi, $m);
         do {
             $b = PagesRecord::finder()->find('ID = ?', $m);
             $m = $b->PageID;
             $breadcrumbs[$m] = $b->Name;
             array_push($this->activeLi, $m);
         } while ($m != null);
     }
 }
 public function init($config)
 {
     $request = Prado::getApplication()->getRequest();
     if ($request->contains('xlabel')) {
         $this->xlabel = explode(',', TPropertyValue::ensureString($request['xlabel']));
     } else {
         throw new TConfigurationException('You must specify the x data for the graph');
     }
     if ($request->contains('ylabel')) {
         $this->ylabel = explode(',', TPropertyValue::ensureString($request['ylabel']));
     } else {
         throw new TConfigurationException('You must specify the x data for the graph');
     }
     if ($request->contains('xdata')) {
         $this->xdata = explode(',', TPropertyValue::ensureString($request['xdata']));
     } else {
         throw new TConfigurationException('You must specify the x data for the graph');
     }
     if ($request->contains('ydata')) {
         $this->ydata = explode(',', TPropertyValue::ensureString($request['ydata']));
     } else {
         throw new TConfigurationException('You must specify the y data for the graph');
     }
     if ($request->contains('ydata')) {
         $this->zdata = explode(',', TPropertyValue::ensureString($request['zdata']));
     } else {
         throw new TConfigurationException('You must specify the z data for the graph');
     }
     if ($request->contains('datalabel')) {
         $this->datalabel = explode(',', TPropertyValue::ensureString($request['datalabel']));
     } else {
         throw new TConfigurationException('You must specify the x data for the graph');
     }
     if ($request->contains('title')) {
         $this->title = TPropertyValue::ensureString($request['title']);
     } else {
         throw new TConfigurationException('You must specify the y title for the graph.');
     }
 }
Exemple #29
0
 public function onLoad($param)
 {
     parent::onLoad($param);
     if (!$this->isPostBack) {
         $this->id->Value = $this->Request['id'];
         $this->setData();
         $this->onTypeChanged(NULL, NULL);
     }
     if (isset($this->Request['barcode'])) {
         $objCode = new pi_barcode();
         $objCode->setSize(50);
         $objCode->hideCodeType();
         $objCode->setColors('#000000');
         $objCode->setSize(80);
         $param = Prado::getApplication()->getParameters();
         $objCode->setType($param['barcodetype']);
         $objCode->setCode($this->Request['code']);
         $objCode->setFiletype('PNG');
         $objCode->showBarcodeImage();
         exit;
     }
 }
Exemple #30
0
 /**
  * Apply behavior of {@link SecureConnection} property by conditionaly prefixing
  * URL with {@link THttpRequest::getBaseUrl()}
  *
  * @param string $url
  * @return string
  * @since 3.2
  */
 protected function applySecureConnectionPrefix($url)
 {
     static $request;
     if ($request === null) {
         $request = Prado::getApplication()->getRequest();
     }
     static $isSecureConnection;
     if ($isSecureConnection === null) {
         $isSecureConnection = $request->getIsSecureConnection();
     }
     switch ($this->getSecureConnection()) {
         case TUrlMappingPatternSecureConnection::EnableIfNotSecure:
             if ($isSecureConnection) {
                 return $url;
             }
             return $request->getBaseUrl(true) . $url;
             break;
         case TUrlMappingPatternSecureConnection::DisableIfSecure:
             if (!$isSecureConnection) {
                 return $url;
             }
             return $request->getBaseUrl(false) . $url;
             break;
         case TUrlMappingPatternSecureConnection::Enable:
             return $request->getBaseUrl(true) . $url;
             break;
         case TUrlMappingPatternSecureConnection::Disable:
             return $request->getBaseUrl(false) . $url;
             break;
         case TUrlMappingPatternSecureConnection::Automatic:
         default:
             return $url;
             break;
     }
 }