public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger, $ordVerdDAO, $merknadDAO) { parent::__construct(Constants::getXMLFilename('NOARKSAK'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger); $this->ordVerdDAO = $ordVerdDAO; $this->merknadDAO = $merknadDAO; $this->selectQuery = "select JOURAARNR, JOURAAR, JOURNR, PAPIR, AAPNET, INNH1, INNH2, MERKNAD, U1, STATUS, FYSARK, FRAARKDEL, SAKTYPE, SAKART, JOURENHET, OTYPE, OKODE1, UNAVN, ADMID, SBHID, UNNTOFF, HJEMMEL from " . $SRC_TABLE_NAME . ""; }
/** * Before action load knight data of user * @param unknown_type $action */ public function beforeAction($action) { //Load user's knight data if (!Yii::app()->user->isGuest) { $this->user_data['knights'] = Knights::model()->with('knightsCard', 'knightsStats')->find('id=:id', array(':id' => Yii::app()->user->knights_id)); $this->user_data['knights_card'] =& $this->user_data['knights']->knightsCard; //Load stats of knight $this->user_data['knights_stats'] =& $this->user_data['knights']->knightsStats; //Load if user has new friendship request $sql = 'SELECT friends.id as id, k1.name as name, k1.avatars_id as avatars_id FROM friends INNER JOIN users ON users.id = friends.from_user INNER JOIN knights as k1 ON k1.users_id = users.id WHERE friends.status = :status AND to_user = :users_knights_id1 ORDER BY start_date DESC'; $command = Yii::app()->db->createCommand($sql); $command->bindValue(':status', Friends::STATUS_ONWAITING, PDO::PARAM_INT); $command->bindValue(':users_knights_id1', $this->user_data['knights']->id, PDO::PARAM_INT); $this->user_data['knights_new_friends'] = $command->queryAll(); //Load last messages $this->user_data['new_messages'] = Messages::getNewMessages(Yii::app()->user->users_id); //Load all attributes name attributes $this->app_data['attribute_list'] = Constants::model()->findAll('type=:type', array(':type' => Constants::KNIGHTS_ATTRIBUTES)); } return true; }
/** * @author Thuanth6589 <*****@*****.**> * action create/edit user * @return mixed */ public function action_index() { $data = array(); $user_id = Input::get('user_id'); if (isset($user_id)) { $data['user'] = \Model_Muser::find_by_pk($user_id); if (!isset($data['user'])) { Session::set_flash('error', 'ユーザが存在しません'); return Response::redirect('/master/users'); } } if (Input::method() == 'POST') { $url = Session::get('users_url') ? Session::get('users_url') : Uri::base() . 'master/users'; $user_id = Input::post('user_id', null); if ($user_id && !\Model_Muser::find_by_pk($user_id)) { Session::set_flash('success', 'ユーザーは存在しません'); return Response::redirect($url); } $user = new \Model_Muser(); $fields = $user->set_data(Input::post()); $check = $user->validate_unique_login_id($fields['login_id'], isset($fields['user_id']) ? $fields['user_id'] : null); if ($check && $user->save_data($fields)) { Session::set_flash('success', \Constants::$message_create_success); return Response::redirect($url); } $message = \Constants::$message_create_error; if (!$check) { $message = '入力したIDは既存に存在してます。'; } Session::set_flash('error', $message); } $data['department'] = \Constants::get_create_department(); $this->template->title = 'UOS求人システム'; $this->template->content = View::forge('user', $data); }
/** * @author Thuanth6589 <*****@*****.**> * list media */ public function action_index() { $m_group = new \Model_Mgroups(); $m_partner = new \Model_Mpartner(); $tmp = array('' => 'その他'); $data['groups'] = $tmp + (new \Model_Mgroups())->get_type(2); $data['partners'] = $this->_partners; $filters = Input::get(); $query_string = empty($filters) ? '' : '?' . http_build_query($filters); Session::set('medias_url', Uri::base() . 'master/medias' . $query_string); if (isset($filters['m_group_id']) && $filters['m_group_id']) { $data['partners'] += array_column($m_partner->get_partner_group($filters['m_group_id'], $this->_partner_type), 'branch_name', 'partner_code'); } $m_media = new \Model_Mmedia(); $m_post = new \Model_Mpost(); $data['count_media'] = $m_media->count_data($filters); $pagination = \Uospagination::forge('pagination', array('pagination_url' => Uri::base() . 'master/medias' . $query_string, 'total_items' => $data['count_media'], 'per_page' => \Constants::$default_limit_pagination, 'num_links' => \Constants::$default_num_links, 'uri_segment' => 'page', 'show_last' => true)); $filters['offset'] = $pagination->offset; $filters['limit'] = $pagination->per_page; $medias = $m_media->get_data($filters); foreach ($medias as $media) { $media->count_post = $m_post->count_by_media_id($media->m_media_id); } $data['pagination'] = $pagination; $data['medias'] = $medias; $data['type'] = \Constants::$media_type; $data['classification'] = \Constants::get_search_media_classification(); $data['filters'] = $filters; $this->template->title = 'UOS求人システム'; $this->template->content = View::forge('medias', $data); }
public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger, $utvSakDAO, $utvBehDoDAO) { parent::__construct(Constants::getXMLFilename('UTVBEH'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger); $this->selectQuery = "select UTVID, BEHID, JOURAARNR, BEHNR, MOTEID, SAKSNR, SAKSAAR, STATUS, PROTOKOLL from " . $SRC_TABLE_NAME . ""; $this->utvSakDAO = $utvSakDAO; $this->utvBehDoDAO = $utvBehDoDAO; }
public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger) { parent::__construct(Constants::getXMLFilename('UTVMOTE'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger); $this->selectQuery = "select ID, MOTENR, UTVID, LUKKET, MOTEDATO, MOTETID, FRIST, SAKSKART, PROTOKOLL, JOURAARNR FROM " . $SRC_TABLE_NAME . ""; // Yes $SRC_TABLE_NAME is wrong but I need to finish this!!! $this->utvMoteDokDAO = new UtvMoteDokDAO($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger); }
public function init() { Constants::$host = self::$host; Constants::$pass = self::$pass; Constants::$user = self::$user; Constants::$database = self::$database; }
public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger) { parent::__construct(Constants::getXMLFilename('TLKODE'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger); $this->selectQuery = "select TILLEGSK, EKODE3, ETEXT3 from " . $SRC_TABLE_NAME . " group by TILLEGSK, EKODE3, ETEXT3 ORDER BY TILLEGSK"; $this->logger->log($this->XMLfilename, "Created based on following query. select TILLEGSK, EKODE3, ETEXT3 from dgjmjo group by TILLEGSK, EKODE3, ETEXT3 ORDER BY TILLEGSK", Constants::LOG_INFO); $this->logger->log($this->XMLfilename, "This will not be correct if tilleggskoder are used that are not part of K-Koder. Manual check in DGJMJO.TILLEGSK advised.", Constants::LOG_TODO); }
public function actionGo() { if (isset($_POST)) { $val = $_POST['constant']; Constants::model()->setCvalue('dayup', $val); } $this->render('go', array('model' => $val)); }
function auth_exists() { $path = Constants::GET_CONFIG_DIRECTORY() . '/cred.php'; if (file_exists($path)) { return true; } else { return false; } }
function perform() { if (!is_writable($this->config->get('data_dir'))) { $this->ae->add('error', $this->config->get('data_dir') . 'に書き込み権限がありません'); return 'error'; } $constants = new Constants(); $constants->set('C_ADMIN_PASS', md5($this->af->get('admin_pass'))); $constants->set('C_ADMIN_MAIL', $this->af->get('admin_mail')); $constants->set('C_AUTO_SELECT', '0'); $fp = fopen($this->config->get('config_file'), 'w+b'); if (!$fp || !fwrite($fp, $constants->toString())) { $this->ae->add('error', $this->config->get('config_file') . 'に書き込めませんでした'); return 'error'; } fclose($fp); return 'login'; }
public function __construct($srcBase, $uttrekksBase, $SRC_TABLE_NAME, $kommuneName, $logger) { parent::__construct(Constants::getXMLFilename('DOKLINK'), $srcBase, $uttrekksBase, $SRC_TABLE_NAME, $logger); $this->selectFromFilerQuery = "select REFAARNR, DOKID, FILNOKKEL, OPPRETTETDATO, OPPRETTETAVID, FILNR, AKTIV from FILER WHERE REFAARNR = '"; $this->selectFromVedleggQuery = "select REFAARNR, VEDLNR, BESKRIVELSE, DOKID, DOKNAVN, DOKODE, TKDATO, TKAV, PAPIR, LOKPAPIR, DOKSTATUS, DOKKAT, PNID, GRUPPE, GRUPPEID, UNNTOFF, HJEMMEL, AVGRADER, AGDATO from DGJMVEDLEGG WHERE REFAARNR = '"; $this->kommuneName = $kommuneName; $this->dokVersDAO = new DokVersDAO($this->srcBase, $this->uttrekksBase, "", $kommuneName, $logger); $this->dokBeskDAO = new DokBeskDAO($this->srcBase, $this->uttrekksBase, "", $kommuneName, $logger); }
function __construct() { $this->form_fields = array(); $this->use_bootstrap = false; $this->bootstrap_form_orientation = "horizontal"; $this->form_method = "POST"; $this->form_action = ""; $this->constants = Constants::getInstance(); }
public static function init() { Constants::$host = self::$host; Constants::$pass = self::$pass; Constants::$user = self::$user; Constants::$database = self::$database; UploadHandler::$projectFilesPath = ProjectGlobal::$projectFilesPath; UploadHandler::$rootFilesPath = "/upload/generated_files/"; }
function test_Constants() { $this->dir('Constants'); $original = file_get_contents($this->dir() . 'in.css'); $expected = file_get_contents($this->dir() . 'out.css'); $css = Constants::pre_process($original); $css = Constants::replace($css); $this->assertEqual($css, $expected); }
function main() { $g = Constants::gen1(); var_dump($g->current()); $g = Constants::gen2(); var_dump($g->current()); $g = Constants::gen3("baz"); var_dump($g->current()); }
public static function redefine($name, $value) { if (\XLib\Engine::extLoaded('uopz')) { if (Constants::exists($name)) { uopz_undefine($name); Constants::define($name, $value); } } return false; }
public function saveBlock() { $io = new FileIO(); //Build the file name from the bucket path (includes the bucket extension) //and the block id. $filename = Constants::GET_PAGES_DIRECTORY() . '/' . $this->getBucketId() . '/' . $this->getBlockId() . '.incl'; $serialized = serialize($this); $io = new FileIO(); $io->writeFile($filename, $serialized); }
public function init() { $this->n_str = Constants::model()->getCvalue('nstr_'.Yii::app()->user->uid); $this->n_fin = Constants::model()->getCvalue('nfin_'.Yii::app()->user->uid); $this->n_nom = Constants::model()->getCvalue('nnom_'.Yii::app()->user->uid); $this->n_art = Constants::model()->getCvalue('nart_'.Yii::app()->user->uid); $this->n_quant = Constants::model()->getCvalue('nquant_'.Yii::app()->user->uid); $this->n_price = Constants::model()->getCvalue('nprice_'.Yii::app()->user->uid); $this->department = Constants::model()->getCvalue('dep_'.Yii::app()->user->uid); $this->client = Constants::model()->getCvalue('cli_'.Yii::app()->user->uid); }
public static function init() { Constants::$host = self::$host; Constants::$pass = self::$pass; Constants::$user = self::$user; Constants::$database = self::$database; Account_v0::$confirmation_url = Import::getImportPath(true) . "confirmation.php"; Account_v0::$forgot_url = Import::getImportPath(true) . "forgot.php"; UploadHandler::$projectFilesPath = ProjectGlobal::$projectFilesPath; UploadHandler::$rootFilesPath = "upload/generated_files/"; }
function main() { $g = Constants::genA(); $g = Constants::genB($g); $g = Constants::genC($g); $g = Constants::genD($g); $g = Constants::genE($g); $g = Constants::genF($g); $g = Constants::genG($g); $g = Constants::genH($g); var_dump($g->current()); }
/** * Gets the XML and sets each of the nodes as constants * * @author Anthony Short * @return Void */ public static function pre_process() { $file = CSScaffold::config('XML_constants.xml_path'); # If the xml file doesn't exist if (!file_exists($file)) { throw new Scaffold_Exception('XML_constants.doesnt_exist', $file); } # Load the xml $xml = simplexml_load_file($file); # Loop through them and set them as constants foreach ($xml->constant as $key => $value) { Constants::set((string) $value->name, (string) $value->value); } }
/** * Parses @fors within the css * * @author Anthony Short * @param $string * @return string */ public static function parse($css) { if ($found = self::find_fors($css)) { foreach ($found[0] as $key => $value) { $s = ""; $constant = $found[1][$key]; $from = Constants::replace($found[2][$key]); $to = Constants::replace($found[3][$key]); $content = $found[6][$key]; for ($i = $from; $i <= $to; $i++) { Constants::set($constant, $i); $s .= Constants::replace($content); } $css = str_replace($found[0][$key], $s, $css); } } return $css; }
/** * @author Thuanth6589 <*****@*****.**> * action list ss */ public function action_index() { $filters = Input::get(); $query_string = empty($filters) ? '' : '?' . http_build_query($filters); Session::set('sslist_url', Uri::base() . 'master/sslist' . $query_string); $m_ss = new \Model_Mss(); $data = array(); $data['count_ss'] = $m_ss->count_data($filters); $pagination = \Uospagination::forge('pagination', array('pagination_url' => Uri::base() . 'master/sslist' . $query_string, 'total_items' => $data['count_ss'], 'per_page' => \Constants::$default_limit_pagination, 'num_links' => \Constants::$default_num_links, 'uri_segment' => 'page', 'show_last' => true)); $filters['offset'] = $pagination->offset; $filters['limit'] = $pagination->per_page; $data['ss'] = $m_ss->get_data($filters); $data['addr1'] = \Constants::get_search_address(); $data['filters'] = $filters; $data['pagination'] = $pagination; $this->template->title = 'UOS求人システム'; $this->template->content = View::forge('sslist', $data); }
/** * @author Thuanth6589 <*****@*****.**> * action create/update ss */ public function action_index() { $ss_id = Input::get('ss_id'); $filter_group = $this->filter_group; $data_filter['field'] = $filter_group; if (isset($ss_id)) { $ss = \Model_Mss::find_by_pk($ss_id); if (!isset($ss)) { Session::set_flash('error', 'SSは存在しません'); return Response::redirect('/master/sslist'); } $data['ss'] = $ss; $data['json'] = $ss->edit_data != '' ? json_decode($ss->edit_data) : $ss; $data_filter['datafilter'] = \Presenter_Group_Filter::edit($filter_group['step'], $filter_group['type'], $data['json']->partner_code); $partner = \Model_Mpartner::find_by_pk($ss->partner_code); $group = \Model_Mgroups::find_by_pk($partner->m_group_id); $data['branch_name'] = $partner->branch_name; $data['group_name'] = $group->name; $data['is_view'] = $this->_compare_data_json($ss, $ss->edit_data); } $submit = Input::post('submit'); if (isset($submit)) { $url = Session::get('sslist_url') ? Session::get('sslist_url') : Uri::base() . 'master/sslist'; $ss = new \Model_Mss(); $ss->set_data(Input::post()); if (isset($ss->fields['ss_id']) && !\Model_Mss::find_by_pk($ss->fields['ss_id'])) { Session::set_flash('error', 'SSは存在しません'); return Response::redirect($url); } if (!\Model_Mpartner::find_by_pk(Input::post('partner_code'))) { Session::set_flash('error', '取引先(受注先)は存在しません'); } else { if ($ss->save_data()) { Session::set_flash('success', \Constants::$message_create_success); return Response::redirect($url); } Session::set_flash('error', \Constants::$message_create_error); } } $data['address1'] = \Constants::get_create_address(); $this->template->title = 'UOS求人システム'; $this->template->content = View::forge('ss', $data); $this->template->content->filtergroup = \Presenter::forge('group/filter')->set('custom', $data_filter); }
/** * @author Thuanth6589 <*****@*****.**> * action create/edit media */ public function action_index() { $m_media_id = Input::get('id', null); $filter_group = $this->filter_group; $datafilter['field'] = $filter_group; $media = new \Model_Mmedia(); if (isset($m_media_id)) { $media = \Model_Mmedia::find_by_pk($m_media_id); if (!isset($media)) { Session::set_flash('error', '媒体は存在しません'); return Response::redirect('/master/medias'); } $datafilter['datafilter'] = \Presenter_Group_Filter::edit($filter_group['step'], $filter_group['type'], $media->partner_code); $data['media'] = $media; $data['posts'] = \Model_Mpost::find_by_m_media_id($m_media_id); } $data['media_name_existed'] = $media->get_list_media('media_name'); $data['media_version_name_existed'] = $media->get_list_media('media_version_name'); if (Input::method() == 'POST') { $url = Session::get('medias_url') ? Session::get('medias_url') : Uri::base() . 'master/medias'; $m_media_id = Input::post('m_media_id', null); if ($m_media_id && !\Model_Mmedia::find_by_pk($m_media_id)) { Session::set_flash('error', '媒体は存在しません'); return Response::redirect($url); } if (!\Model_Mpartner::find_by_pk(Input::post('partner_code'))) { Session::set_flash('error', '取引先(受注先)は存在しません'); } else { $media = new \Model_Mmedia(); $media_data = $media->set_data(Input::post()); $umedia = new \Model_Umedia(); $posts = Input::post('post') != null ? Input::post('post') : array(); if ($umedia->save_media($media_data, $posts, Input::post('m_media_id'))) { Session::set_flash('success', \Constants::$message_create_success); return Response::redirect($url); } Session::set_flash('error', \Constants::$message_create_error); } } $data['classification'] = \Constants::get_create_media_classification(); $this->template->title = 'UOS求人システム'; $this->template->content = View::forge('media', $data); $this->template->content->filtergroup = \Presenter::forge('group/filter')->set('custom', $datafilter); }
public function load($bucketid) { $io = new FileIO(); $bucketConfigString = $io->readFile(Constants::GET_PAGES_DIRECTORY() . '/' . $bucketid . '/.bucket'); $config = unserialize($bucketConfigString); if (isset($config['type'])) { $type = $config['type']; switch ($type) { case BucketTypes::Text: return $this->buildTextBucket($config); break; case BucketTypes::Blog: return $this->buildBlogBucket($config); break; default: break; } } }
/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionUpdate($id) { $model = $this->loadModel($id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Requirements'])) { // Set NUll value foreach ($_POST['Requirements'] as $key => $value) { if (empty($value)) { $_POST['Requirements'][$key] = null; } } $model->attributes = $_POST['Requirements']; //die(var_export($_POST['Requirements'],true)); if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('update', array('model' => $model, 'attributeList' => Constants::model()->findAll('type=:type', array(':type' => Constants::KNIGHTS_ATTRIBUTES)), 'skillList' => Constants::model()->findAll('type=:type', array(':type' => Constants::KNIGHTS_SKILLS)))); }
/** * Creates constants.php that contains variable * definitions that the codev admin may want to tune. * * WARN: depending on your HTTP server installation, the file may be created * by user 'apache', so be sure that this user has write access * to the CoDev install directory * * @return NULL if OK, or an error message starting with 'ERROR' . */ function createConstantsFile($mantisPath, $mantisURL, $codevURL) { // --- general --- Constants::$homepage_title = 'Welcome'; Constants::$codevURL = $codevURL; Constants::$mantisURL = $mantisURL; Constants::$mantisPath = $mantisPath; Constants::$codevRootDir = dirname(dirname(__FILE__)); Constants::$codevtt_logfile = Constants::$codevRootDir . '/codevtt.log'; // --- database --- // already set... // --- mantis --- // already set... // --- status --- $status_new = array_search('new', Constants::$statusNames); $status_feedback = array_search('feedback', Constants::$statusNames); #$status_acknowledged = array_search('acknowledged', Constants::$statusNames); $status_open = array_search('open', Constants::$statusNames); $status_closed = array_search('closed', Constants::$statusNames); Constants::$status_new = $status_new; Constants::$status_feedback = $status_feedback; Constants::$status_open = NULL != $status_open ? $status_open : 50; // (50 = 'assigned' in default mantis workflow) Constants::$status_closed = $status_closed; // --- resolution --- Constants::$resolution_fixed = array_search('fixed', Constants::$resolution_names); Constants::$resolution_reopened = array_search('reopened', Constants::$resolution_names); // --- relationships --- define('BUG_CUSTOM_RELATIONSHIP_CONSTRAINED_BY', 2500); define('BUG_CUSTOM_RELATIONSHIP_CONSTRAINS', 2501); Constants::$relationship_constrained_by = 2500; Constants::$relationship_constrains = 2501; $retCode = Constants::writeConfigFile(); if (!$retCode) { // TODO throw exception... return "ERROR: Could not create file " . Constants::$config_file; } return NULL; }
public function actionIndex() { $modelff = new FileRead(); if (isset($_POST['TmpXml'])) { $model = $_POST['TmpXml']; $res = $this->writesimple($model); $this->render('result', array('model' => $res)); } else { if (isset($_POST['FileRead'])) { $modelff->attributes = $_POST['FileRead']; if (!$modelff->validate()) { $this->render('fform', array('model' => $modelff)); return; } $modelff->image = CUploadedFile::getInstance($modelff, 'image'); if (is_object($modelff->image)) { // $path=Yii::app()->params['load_xml']; $path = 'docs/go.csv'; $modelff->image->saveAs($path); } $thefile = Yii::app()->params['load_csv']; $ii = $this->readsimple($thefile, $modelff); // $model=new TmpXml('search'); $doc = new TmpDocd('search'); // $this->render('admin',array('model'=>$model,'doc'=>$doc,'rr'=>$ii)); Constants::model()->setCvalue('nstr_' . Yii::app()->user->uid, $modelff->n_str); Constants::model()->setCvalue('nfin_' . Yii::app()->user->uid, $modelff->n_fin); Constants::model()->setCvalue('nnom_' . Yii::app()->user->uid, $modelff->n_nom); Constants::model()->setCvalue('nart_' . Yii::app()->user->uid, $modelff->n_art); Constants::model()->setCvalue('nquant_' . Yii::app()->user->uid, $modelff->n_quant); Constants::model()->setCvalue('nprice_' . Yii::app()->user->uid, $modelff->n_price); Constants::model()->setCvalue('dep_' . Yii::app()->user->uid, $modelff->department); Constants::model()->setCvalue('cli_' . Yii::app()->user->uid, $modelff->client); $this->render('admin', array('model' => $doc)); } else { $this->render('fform', array('model' => $modelff)); } } }