mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-23 12:22:15 +09:00
Removed a few redundant TODOs in code.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8710 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
bbe95e94ff
commit
f3c3adc5d4
4 changed files with 35 additions and 47 deletions
|
|
@ -540,7 +540,6 @@
|
|||
function getDeleteSql($query, $with_values = true){
|
||||
$sql = 'DELETE ';
|
||||
|
||||
// TODO Add support for deleting based on alias, for both simple FROM and multi table join FROM clause
|
||||
$tables = $query->getTables();
|
||||
|
||||
$sql .= $tables[0]->getAlias();
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@
|
|||
// Else return object instead of array
|
||||
else return $output[0];
|
||||
}
|
||||
return $output;
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -626,7 +626,6 @@
|
|||
* to get a specific page list easily in select statement,\n
|
||||
* a method, navigation, is used
|
||||
**/
|
||||
// TODO Rewrite with Query object as input
|
||||
function _executeSelectAct($queryObject){
|
||||
$query = $this->getSelectSql($queryObject);
|
||||
if(is_a($query, 'Object')) return;
|
||||
|
|
@ -655,14 +654,14 @@
|
|||
|
||||
function queryPageLimit($queryObject, $result){
|
||||
if ($queryObject->getLimit() && $queryObject->getLimit()->isPageHandler()) {
|
||||
|
||||
|
||||
// Total count
|
||||
$count_query = sprintf('select count(*) as "count" %s %s', 'FROM ' . $queryObject->getFromString(), ($queryObject->getWhereString() === '' ? '' : ' WHERE '. $queryObject->getWhereString()));
|
||||
if ($queryObject->getGroupByString() != '') {
|
||||
$count_query = sprintf('select count(*) as "count" from (%s) xet', $count_query);
|
||||
}
|
||||
|
||||
$count_query .= (__DEBUG_QUERY__&1 && $queryObject->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
|
||||
$count_query .= (__DEBUG_QUERY__&1 && $queryObject->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
$result = $this->_query($count_query);
|
||||
$count_output = $this->_fetch($result);
|
||||
$total_count = (int)$count_output->count;
|
||||
|
|
@ -685,13 +684,13 @@
|
|||
// check the page variables
|
||||
if ($page > $total_page) $page = $total_page;
|
||||
$start_count = ($page - 1) * $list_count;
|
||||
|
||||
|
||||
$query = $this->getSelectPageSql($queryObject, true, $start_count, $list_count);
|
||||
$query .= (__DEBUG_QUERY__&1 && $queryObject->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):'';
|
||||
$result = $this->_query ($query);
|
||||
if ($this->isError ())
|
||||
return $this->queryError($queryObject);
|
||||
|
||||
|
||||
$virtual_no = $total_count - ($page - 1) * $list_count;
|
||||
$data = $this->_fetch($result, $virtual_no);
|
||||
|
||||
|
|
@ -712,13 +711,13 @@
|
|||
function getParser(){
|
||||
return new DBParser('"', '"', $this->prefix);
|
||||
}
|
||||
|
||||
|
||||
function getSelectPageSql($query, $with_values = true, $start_count = 0, $list_count = 0) {
|
||||
|
||||
$select = $query->getSelectString($with_values);
|
||||
if($select == '') return new Object(-1, "Invalid query");
|
||||
$select = 'SELECT ' .$select;
|
||||
|
||||
|
||||
$from = $query->getFromString($with_values);
|
||||
if($from == '') return new Object(-1, "Invalid query");
|
||||
$from = ' FROM '.$from;
|
||||
|
|
@ -735,7 +734,7 @@
|
|||
$limit = $query->getLimitString();
|
||||
if ($limit != '') {
|
||||
if ($query->getLimit()) {
|
||||
|
||||
|
||||
if($orderBy != '')
|
||||
$limit = sprintf (' for orderby_num() between %d and %d', $start_count + 1, $list_count + $start_count);
|
||||
else{
|
||||
|
|
@ -744,7 +743,7 @@
|
|||
else{
|
||||
if ($where != '')
|
||||
$limit = sprintf (' and inst_num() between %d and %d', $start_count + 1, $list_count + $start_count);
|
||||
else
|
||||
else
|
||||
$limit = sprintf(' where inst_num() between %d and %d', $start_count + 1, $list_count + $start_count);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,15 +159,6 @@
|
|||
* object if a row returned \n
|
||||
* return\n
|
||||
**/
|
||||
|
||||
// TODO Support array arguments in sql server
|
||||
/*
|
||||
* $query_emp="select name from employee where id in (?,?,?)";
|
||||
$params_emp= Array(1,2,3);
|
||||
$res_emp = sqlsrv_query($conn, $query_emp, $params_emp);
|
||||
*
|
||||
*/
|
||||
|
||||
function _query($query) {
|
||||
if($this->is_connected == false || !$query) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
* Note: this test can fail when comaparing regdate from the $args with
|
||||
* regdate from the expected string - a few seconds difference
|
||||
*/
|
||||
function test_module_insertModule_escapeContent(){
|
||||
function test_module_insertModule_escapeContent(){
|
||||
$xml_file = _XE_PATH_ . "modules/module/queries/insertModule.xml";
|
||||
|
||||
$args->module_category_srl = 0;
|
||||
|
||||
$args->module_category_srl = 0;
|
||||
$args->browser_title = "test";
|
||||
$args->layout_srl = 0;
|
||||
$args->mlayout_srl = 0;
|
||||
|
|
@ -18,12 +18,12 @@
|
|||
$args->site_srl = 0;
|
||||
$args->module_srl = 47374;
|
||||
$args->content = "hello \' moto";
|
||||
|
||||
|
||||
$output = executeQuery('module.insertModule', $args);
|
||||
|
||||
$this->assertTrue(!$output->error, $output->message);
|
||||
}
|
||||
|
||||
|
||||
$this->assertTrue(!$output->error, $output->message);
|
||||
}
|
||||
|
||||
function test_document_insertDocument_defaultVarcharValue(){
|
||||
$args->module_srl = 102;
|
||||
$args->content = '<p>yuhuuuuu</p>';
|
||||
|
|
@ -47,40 +47,39 @@
|
|||
$args->title = 'yuhuu';
|
||||
$args->lang_code;
|
||||
$output = executeQuery('document.insertDocument', $args);
|
||||
|
||||
|
||||
$this->assertNotEquals(-225, $output->error);
|
||||
$this->assertNotEquals('Missing value for attribute "homepage" with the NOT NULL constraint.', $output->message);
|
||||
}
|
||||
|
||||
|
||||
function test_communication_addFriendGroup(){
|
||||
$args->member_srl = 202;
|
||||
$args->member_srl = 202;
|
||||
$args->title = "Grup";
|
||||
|
||||
|
||||
$output = executeQuery("communication.addFriendGroup", $args);
|
||||
$this->assertEquals(0, $output->error, $output->message);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function test_communication_addFriendGroup_NullId(){
|
||||
$args->member_srl = 202;
|
||||
$args->member_srl = 202;
|
||||
$args->title = "Grup";
|
||||
$args->friend_group_srl = trim(null);
|
||||
|
||||
|
||||
$output = executeQuery("communication.addFriendGroup", $args);
|
||||
$this->assertEquals(0, $output->error, $output->message);
|
||||
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
|
||||
}
|
||||
|
||||
protected function tearDown() {
|
||||
$db = &DB::getInstance();
|
||||
$db->_query("DELETE FROM xe_modules WHERE module_srl = 47374");
|
||||
$db->_query("DELETE FROM xe_modules WHERE module_srl = 47374");
|
||||
$db->_query("DELETE FROM xe_documents WHERE document_srl = 9200");
|
||||
$db->_query("DELETE FROM xe_member_friend_group WHERE member_srl = 202");
|
||||
$db->close();
|
||||
|
||||
|
||||
parent::tearDown();
|
||||
// TODO Delete inserted value
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue