Skip to content

Commit

Permalink
Dev Removed 5.4 dependent functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Jan 13, 2015
1 parent c07ce02 commit c13ab2a
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 28 deletions.
4 changes: 2 additions & 2 deletions application/controllers/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ public function getTokenId($iSurveyId)

$aFieldValue=$this->getFieldValue($iSurveyId);
// Now construct the text returned
$oToken=Token::model($iSurveyId)->findByAttributes([
$oToken=Token::model($iSurveyId)->findByAttributes(array(
'email' => $aFieldValue['sEmail']
]);
));
if ($oToken)
{
if($oToken->usesleft<1 && $aSurveyInfo['alloweditaftercompletion']!='Y')
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/admin/assessments.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private function _collectGroupData($iSurveyID)
private function _collectEditData(array $aData)
{
$assessments = Assessment::model()->findAllByAttributes(array(
'id' => sanitize_int($_POST['id'])
'id' => sanitize_int($_POST['id']),
'language' => App()->language
));

Expand Down
4 changes: 2 additions & 2 deletions application/core/db/DbConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ class DbConnection extends \CDbConnection
{
public function __construct($dsn = '', $username = '', $password = '') {
parent::__construct($dsn, $username, $password);
$this->driverMap = array_merge($this->driverMap, [
$this->driverMap = array_merge($this->driverMap, array(
'mysql' => 'MysqlSchema',
'mysqli' => 'MysqlSchema',
'mssql' => 'MssqlSchema',
'dblib' => 'MssqlSchema',
'sqlsrv' => 'MssqlSchema',
]);
));
}
}
?>
9 changes: 8 additions & 1 deletion application/core/db/MssqlSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ public function getColumnType($type)
* Not confirmed.
* If resulting type doesn't contain NULL then add it.
*/
$result = parent::getColumnType($type);
if (preg_match('/([[:alpha:]]+)\s*(\(.+?\)).*/', $type, $matches)) {
$baseType = parent::getColumnType($type);
$param = $matches[2];
$result = preg_replace('/\(.+?\)/', $param, $baseType, 1);
} else {
$result = parent::getColumnType($type);
}

if (stripos($result, 'NULL') === false) {
$result .= ' NULL';
}
Expand Down
14 changes: 12 additions & 2 deletions application/core/db/MysqlSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

class MysqlSchema extends CMysqlSchema
{
use SmartColumnTypeTrait;

public function __construct($conn) {
parent::__construct($conn);
/**
Expand All @@ -18,4 +16,16 @@ public function createTable($table, $columns, $options = null) {
return $result;
}

public function getColumnType($type)
{
if (preg_match('/([[:alpha:]]+)\s*(\(.+?\)).*/', $type, $matches)) {
$baseType = parent::getColumnType($type);
$param = $matches[2];
$result = preg_replace('/\(.+?\)/', $param, $baseType, 1);
} else {
$result = parent::getColumnType($type);
}
return $result;
}

}
13 changes: 12 additions & 1 deletion application/core/db/PgsqlSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

class PgsqlSchema extends CPgsqlSchema
{
use SmartColumnTypeTrait;
public function __construct($conn) {
parent::__construct($conn);
/**
* Auto increment.
*/
$this->columnTypes['autoincrement'] = 'serial';
}

public function getColumnType($type)
{
if (preg_match('/([[:alpha:]]+)\s*(\(.+?\)).*/', $type, $matches)) {
$baseType = parent::getColumnType($type);
$param = $matches[2];
$result = preg_replace('/\(.+?\)/', $param, $baseType, 1);
} else {
$result = parent::getColumnType($type);
}
return $result;
}
}
19 changes: 0 additions & 19 deletions application/core/db/SmartColumnTypeTrait.php

This file was deleted.

0 comments on commit c13ab2a

Please sign in to comment.