Пример #1
0
 public function init()
 {
     parent::init();
     $this->GAD_728x90 = SiteVariable::model()->findByPk('GAD_728x90')->value;
     $this->GAD_336x280 = SiteVariable::model()->findByPk('GAD_336x280')->value;
     $this->GAD_728x15 = SiteVariable::model()->findByPk('GAD_728x15')->value;
 }
Пример #2
0
 public function init()
 {
     $this->folderFiles = Yii::app()->getModule('exchange1c')->folderFiles;
     $this->readFileProducts = Yii::app()->getModule('exchange1c')->readFileProducts;
     $this->readFileCategory = Yii::app()->getModule('exchange1c')->readFileCategory;
     return parent::init();
 }
Пример #3
0
 public function init()
 {
     $this->getFromMemory();
     $criteria = new CDbCriteria();
     $criteria->order = "communication_port asc, communication_type asc";
     $stations = Station::model()->findAll($criteria);
     if (count($stations) > 0) {
         foreach ($stations as $station) {
             switch ($station->communication_type) {
                 case 'direct':
                 case 'sms':
                     $connection_type = $station->communication_port;
                     break;
                 case 'tcpip':
                     $connection_type = $station->communication_esp_ip . ':' . $station->communication_esp_port;
                     break;
                 case 'gprs':
                     $connection_type = 'poller:' . $station->station_id_code;
                     break;
                 case 'server':
                     $connection_type = 'tcp:' . $station->communication_esp_ip . ':' . $station->communication_esp_port;
                     break;
             }
             $this->all_sources[$connection_type] = $connection_type;
         }
     }
     return parent::init();
 }
Пример #4
0
 public function init()
 {
     if (file_exists($this->getSavePath() . $this->fileName)) {
         $this->setAttributes(unserialize(file_get_contents($this->getSavePath() . $this->fileName)));
     }
     return parent::init();
 }
Пример #5
0
 public function init()
 {
     foreach ($this->getConfig() as $config) {
         $this->config[$config->key] = $config->value;
     }
     parent::init();
 }
Пример #6
0
 public function init() {
     if (file_exists(Yii::app()->basePath . '/data/version'))
         $this->_sversion = file_get_contents(Yii::app()->basePath . '/data/version');
     else
         $this->_sversion = "3.0";
     return parent::init();
 }
Пример #7
0
 public function init()
 {
     $yiidatetimesec = Yii::app()->locale->getDateFormat('yiidatetimesec');
     $phpdatetime = Yii::app()->locale->getDateFormat('phpdatetimes');
     $this->from_date = date($phpdatetime, CDateTimeParser::parse('01/01/' . date('Y') . ' 00:00:00', $yiidatetimesec));
     $this->to_date = date($phpdatetime);
     return parent::init();
 }
 public function init()
 {
     $this->required_tables['settings'] = array('settings', 'station', 'station_group', 'station_group_destination', 'station_calculation', 'station_calculation_variable', 'station_sensor', 'station_sensor_feature', 'sensor_handler', 'sensor_handler_default_feature');
     $this->not_critical_tables['settings'] = array('schedule_report', 'schedule_report_to_station', 'schedule_report_destination', 'ex_schedule_report', 'ex_schedule_report_destination');
     $this->depends_tables = array('schedule_report_to_station' => array('schedule_report', 'schedule_report_destination'));
     $this->required_tables["user_settings"] = array("user", "access_user", "access_global");
     //        $this->_logger = LoggerFactory::getFileLogger('exportAdminSettings');
     parent::init();
 }
Пример #9
0
 public function init()
 {
     // PHP 5.4 only ;(
     /*array_map(function($item){
     			$this->{$item} = param($item);
     		}, self::$settings);*/
     $this->loadSettings();
     parent::init();
 }
Пример #10
0
 public function init()
 {
     parent::init();
     foreach ($this->getAttributes() as $prop => $value) {
         if ($attr = SiteVariable::model()->findByPk($prop)) {
             $this->{$prop} = $attr->value;
         }
     }
 }
Пример #11
0
 public function init()
 {
     // Intercept this controller
     Yii::app()->interceptor->intercept($this);
     // Fire Event
     if ($this->hasEventHandler('onInit')) {
         $this->onInit(new CEvent($this));
     }
     return parent::init();
 }
Пример #12
0
 public function init()
 {
     $sql = "SELECT `station_id`, CONCAT(`station_id_code`, ' - ', `display_name`) AS `name`\n                FROM `" . Station::model()->tableName() . "`\n                WHERE `station_type` = 'rain' ORDER BY `station_id_code` ";
     $stations = CStubActiveRecord::getDbConnect(true)->createCommand($sql)->queryAll();
     if ($stations) {
         $this->stations = CHtml::listData($stations, 'station_id', 'name');
     }
     $this->getFromMemory();
     return parent::init();
 }
Пример #13
0
 public function init()
 {
     $cur_time = time();
     $some_time_ago = $cur_time - 86400;
     $sql = "SELECT `station_id`, CONCAT(`station_id_code`, ' - ', `display_name`) AS `name`\n                FROM `" . Station::model()->tableName() . "`\n                ORDER BY `station_id_code` ";
     $stations = CStubActiveRecord::getDbConnect(true)->createCommand($sql)->queryAll();
     if ($stations) {
         $this->all_stations = CHtml::listData($stations, 'station_id', 'name');
     }
     $this->date_from = date('m/d/Y', $some_time_ago);
     $this->date_to = date('m/d/Y', $cur_time);
     $this->time_from = date('H:i', $some_time_ago);
     $this->time_to = date('H:i', $cur_time);
     return parent::init();
 }
Пример #14
0
 public function init()
 {
     $cur_time = strtotime(date('Y-m-d H:i:s'));
     $some_time_ago = $cur_time - 7200;
     $this->all_stations = Station::getList('all', false);
     $this->date_from = date('m/d/Y', $some_time_ago);
     $this->date_to = date('m/d/Y', $cur_time);
     $this->time_from = date('H:i', $some_time_ago);
     $this->time_to = date('H:i', $cur_time);
     $this->interval = 30;
     if ($this->all_stations) {
         foreach ($this->all_stations as $key => $value) {
             $this->stations[$value['station_id']] = $value['station_id_code'] . ' ' . $value['display_name'];
         }
     }
     $this->do_import = 0;
     $this->station_id = $this->all_stations[0]['station_id'];
     return parent::init();
 }
Пример #15
0
 public function init()
 {
     $this->getFromMemory();
     $this->all_stations = Station::getList('rain');
     $handler = array();
     SensorDBHandler::handlerWithFeature($handler, 'rg');
     $features = array_shift($handler)->features;
     if ($this->all_stations) {
         foreach ($this->all_stations as $key => $value) {
             $this->all_stations[$key]['filter_limit_max'] = round($features['rain']->filter_max / 60 * $this->rate_volume, 2);
             $this->all_stations[$key]['filter_limit_min'] = round($features['rain']->filter_min / 60 * $this->rate_volume, 2);
             $this->all_stations[$key]['filter_limit_diff'] = round($features['rain']->filter_diff / 60 * $this->rate_volume, 2);
             //                $this->all_stations[$key]['filter_limit_max'] = round(($value['filter_limit_max']/60) * $this->rate_volume,2);
             //                $this->all_stations[$key]['filter_limit_min'] = round(($value['filter_limit_min']/60) * $this->rate_volume,2);
             //                $this->all_stations[$key]['filter_limit_diff'] = round(($value['filter_limit_diff']/60) * $this->rate_volume,2);
             $this->stations[$value['station_id']] = $value['station_id_code'] . ' - ' . $value['display_name'];
         }
     }
     return parent::init();
 }
Пример #16
0
 public function init()
 {
     parent::init();
     $this->setup = array_replace_recursive($this->defaultSetup, $this->_setup());
     foreach ($this->attributeNames() as $name) {
         if (isset($this->setup["inputs"][$name])) {
             continue;
         }
         $this->setup["inputs"][$name] = array();
     }
     foreach ($this->setup["inputs"] as $inputName => &$input) {
         $input = array_replace_recursive($this->setup["defaultInput"], $input);
         if (!isset($input["attr"]["placeholder"])) {
             $input["attr"]["placeholder"] = $this->getAttributeLabel($inputName);
         }
     }
     //print_r($this->setup);die();
     if ($this->setup["model"]) {
         $this->setAttributes($this->setup["model"]->getAttributes());
     }
 }
Пример #17
0
 public function init()
 {
     $this->_configForm = new ConfigForm(Synchronization::getSettingsFilePath());
     $this->_data = $this->_configForm->getConfig();
     $this->server_ip = $this->_data['SERVER_IP']['value'];
     $this->server_port = $this->_data['SERVER_PORT']['value'];
     $this->remote_server_ip = $this->_data['REMOTE_SERVER_IP']['value'];
     $this->remote_server_port = $this->_data['REMOTE_SERVER_PORT']['value'];
     $this->switch_variant = $this->_data['SWITCH_VARIANT']['value'];
     $this->flexibility_role = $this->_data['FLEXIBILITY_ROLE']['value'];
     $this->process_status = $this->_data['PROCESS_STATUS']['value'];
     $this->main_role = $this->_data['MAIN_ROLE']['value'];
     $this->forwarding_messages_ip = $this->_data['FOR_COMES_FORWARDING_MESSAGES_IP']['value'];
     $this->forwarding_messages_port = $this->_data['FOR_COMES_FORWARDING_MESSAGES_PORT']['value'];
     $this->for_send_messages_to_ip = $this->_data['FOR_SEND_MESSAGES_TO_IP']['value'];
     $this->for_send_messages_port = $this->_data['FOR_SEND_MESSAGES_PORT']['value'];
     $this->identificator = $this->_data['IDENTIFICATOR']['value'];
     $this->tcp_server_command_port = $this->_data['TCP_SERVER_COMMAND_PORT']['value'];
     $this->tcp_client_command_port = $this->_data['TCP_CLIENT_COMMAND_PORT']['value'];
     $this->tcp_server_command_pid = $this->_data['TCP_SERVER_COMMAND_PID'];
     $this->tcp_client_command_pid = $this->_data['TCP_CLIENT_COMMAND_PID'];
     parent::init();
 }
Пример #18
0
 public function init()
 {
     $this->selected_aws_format = 1;
     $this->list_formats = self::listFormats();
     parent::init();
 }
Пример #19
0
 public function init()
 {
     parent::init();
 }
Пример #20
0
 public function init()
 {
     $this->date_type = array('message date', 'created date');
     $this->getFromMemory();
     return parent::init();
 }
Пример #21
0
 public function init()
 {
     $this->language = Yii::app()->language;
     return parent::init();
 }
Пример #22
0
 public function init()
 {
     $this->getFromMemory();
     return parent::init();
 }
Пример #23
0
 public function init()
 {
     parent::init();
     $this->errors = [1 => 'Ошибка в параметрах', 2 => 'Неверный логин или пароль', 3 => 'Недостаточно средств на счету Клиента', 4 => 'IP-адрес временно заблокирован из-за частых ошибок в запросах', 5 => 'Неверный формат даты', 6 => 'Сообщение запрещено (по тексту или по имени отправителя)', 7 => 'Неверный формат номера телефона', 8 => 'Сообщение на указанный номер не может быть доставлено', 9 => 'Отправка более одного одинакового запроса на передачу SMS-сообщения в течение минуты'];
 }
Пример #24
0
 public function init()
 {
     //            $this->addDefault();
     $param = Config::get(self::optionName);
     $this->period = $param[self::optionName . '_PERIOD']->value;
     $this->clientName = $param[self::optionName . '_CLIENT_NAME']->value;
     $this->status = $param[self::optionName . '_STATUS']->value;
     $this->email = $param[self::optionName . '_EMAIL']->value;
     $this->ftp = $param[self::optionName . '_FTP']->value;
     $this->ftpPort = $param[self::optionName . '_FTP_PORT']->value;
     $this->ftpDir = $param[self::optionName . '_FTP_DIR']->value;
     $this->ftpUser = $param[self::optionName . '_FTP_USER']->value;
     $this->ftpPassword = $param[self::optionName . '_FTP_PASSWORD']->value;
     return parent::init();
 }
Пример #25
0
 public function init()
 {
     parent::init();
     $this->errors = [1 => Yii::t('site', 'Invalid parameters'), 2 => Yii::t('site', 'Invalid login or password'), 3 => Yii::t('site', 'Insufficient funds in the account'), 4 => Yii::t('site', 'IP-address temporarily blocked due to frequent errors in querie'), 5 => Yii::t('site', 'Invalid date'), 6 => Yii::t('site', 'Message is prohibited (by text or by the name of the sender)'), 7 => Yii::t('site', 'Invalid phone number format'), 8 => Yii::t('site', 'Message to the specified number can not be delivered'), 9 => Yii::t('site', 'Sending more than one of the same request to send SMS-messages within minutes')];
 }
Пример #26
0
 public function init()
 {
     parent::init();
     $this->ignoreIp = @Yii::app()->params['default_ignore_ip'];
 }
 /**
  * Initializes the model
  */
 public function init()
 {
     // Preselect the current language
     $this->language = Yii::app()->language;
     parent::init();
 }
Пример #28
0
 public function init()
 {
     $this->config_params_path = Yii::app()->basePath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'params' . DIRECTORY_SEPARATOR;
     $this->createDefaultFilesMain();
     $applicationsPaths = $this->getConfigFile('application_params');
     if (empty($applicationsPaths['php_exe_path']) || empty($applicationsPaths['mysqldump_exe_path']) || empty($applicationsPaths['mysql_exe_path']) || empty($applicationsPaths['site_url_for_console'])) {
         $res = explode(DIRECTORY_SEPARATOR, dirname(php_ini_loaded_file()));
         $basePath = $res[0] . DIRECTORY_SEPARATOR . $res[1];
         if (empty($applicationsPaths['php_exe_path'])) {
             $value = false;
             if (It::isWindows()) {
                 $value = $this->findFile('php.exe', $basePath);
             } else {
                 if (It::isLinux()) {
                     $value = $this->findFile('php', '/usr/bin/');
                 }
             }
             $applicationsPaths['php_exe_path'] = $value === false ? null : $value;
         }
         if (empty($applicationsPaths['mysqldump_exe_path'])) {
             $value = false;
             if (It::isWindows()) {
                 $value = $this->findFile('mysqldump.exe', $basePath);
             } else {
                 if (It::isLinux()) {
                     $value = $this->findFile('mysqldump', '/usr/bin/');
                 }
             }
             $applicationsPaths['mysqldump_exe_path'] = $applicationsPaths['mysqldump_exe_path'] = $value === false ? null : $value;
         }
         if (empty($applicationsPaths['mysql_exe_path'])) {
             $value = false;
             if (It::isWindows()) {
                 $value = $this->findFile('mysql.exe', $basePath);
             } else {
                 if (It::isLinux()) {
                     $value = $this->findFile('mysql', '/usr/bin/');
                 }
             }
             $applicationsPaths['mysql_exe_path'] = $applicationsPaths['mysql_exe_path'] = $value === false ? null : $value;
         }
         if (empty($applicationsPaths['site_url_for_console'])) {
             $applicationsPaths['site_url_for_console'] = It::baseUrl();
         }
     }
     $this->php_exe_path = $applicationsPaths['php_exe_path'];
     $this->mysqldump_exe_path = $applicationsPaths['mysqldump_exe_path'];
     $this->mysql_exe_path = $applicationsPaths['mysql_exe_path'];
     $this->site_url_for_console = $applicationsPaths['site_url_for_console'];
     $this->writeApplicationsPaths();
     $this->db_backup_id = 'delaircoDbBackup';
     $this->each_minute_process_id = 'delaircoScheduleScript';
     $this->get_xml_process_id = 'delaircoGetXml';
     $this->check_processes_process_id = 'delaircoCheckProcessesScript';
     $this->each_minute_prepare_process_id = 'delaircoPrepareScript';
     $this->backup_process_id = 'delaircoBackupOldDataScript';
     $values = $this->getConfigFile('install');
     if (isset($values['install_status'])) {
         $this->install_completed = $values['install_status'];
     } else {
         $this->install_completed = 0;
     }
     //$this->apache_mod_rewrite = (apache_get_modules('mod_rewrite')) ? 1 : 0;
     $this->apache_mod_rewrite = 1;
     $this->htaccess = file_exists(dirname(Yii::app()->request->scriptFile) . DIRECTORY_SEPARATOR . '.htaccess') ? 1 : 0;
     $this->getAvailableStep();
     return parent::init();
 }
 /**
  * (non-PHPdoc).
  *
  * @see CFormModel::init()
  */
 public function init()
 {
     $this->renderTime = time();
     parent::init();
 }
Пример #30
0
 /**
  * Initializes default values.
  */
 public function init()
 {
     parent::init();
     //$this->setPageIndex(0);
     $this->setPageSize($this->getDefaultPageSize());
     $this->setScopes($this->getDefaultScopes());
     $this->setSortOrder($this->getDefaultSortOrder());
     $this->setSortDirection($this->getDefaultSortDirection());
 }