removing option migration kit & fixing nickname bug
This commit is contained in:
@@ -1292,26 +1292,6 @@ class Databap extends PhpObject
|
||||
/* Options Management */
|
||||
//TODO Create class
|
||||
|
||||
//TODO delete
|
||||
public function migrateOptionValues()
|
||||
{
|
||||
$sResult = 'ok';
|
||||
$asInfo = array('select' => array('id_option', 'id_option_name', 'option'),
|
||||
'from' => self::OPT_TABLE,
|
||||
'constraint'=> array('id_option_value'=>'NULL'),
|
||||
'constOpe' => array('id_option_value'=>" IS "),
|
||||
'constVar' => true);
|
||||
$asOptions = $this->oMySql->selectRows($asInfo, true, 'id_option');
|
||||
|
||||
foreach($asOptions as $iOptionId=>$asOption)
|
||||
{
|
||||
$iOptionValueId = $this->oMySql->insertRow(self::OPTVAL_TABLE, array('id_option_name'=>$asOption['id_option_name'], 'option_value'=>$asOption['option'], 'language'=>self::LANG_FR));
|
||||
if($iOptionValueId>0) $this->oMySql->updateRow(self::OPT_TABLE, $iOptionId, array('id_option_value'=>$iOptionValueId));
|
||||
else $sResult = 'ko';
|
||||
}
|
||||
return $sResult;
|
||||
}
|
||||
|
||||
private function getAvailableOptions()
|
||||
{
|
||||
$sOptNameIdCol = MySqlManager::getId(self::OPTNAME_TABLE);
|
||||
@@ -2200,7 +2180,7 @@ class Databap extends PhpObject
|
||||
{
|
||||
$sChanId = $asUser[MySqlManager::getId(self::CHAN_TABLE)];
|
||||
$iUserId = $asUser[$iUserIdCol];
|
||||
if(!array_key_exists($iUserId, $asUserOptions)) $asUserOptions[$iUserId] = $this->getUserOptions(array(self::OPT_NICKNAME, self::OPT_STATUS));
|
||||
if(!array_key_exists($iUserId, $asUserOptions)) $asUserOptions[$iUserId] = $this->getUserOptions(array(self::OPT_NICKNAME, self::OPT_STATUS), $iUserId);
|
||||
$sNickName = self::getNickNameFormat($asUserOptions[$iUserId][self::OPT_NICKNAME][MySqlManager::getText(self::OPTVAL_TABLE)]);
|
||||
$asConnectedUsers[$sChanId][$sNickName.$iUserId]['id_user'] = $iUserId;
|
||||
$asConnectedUsers[$sChanId][$sNickName.$iUserId]['name'] = self::getNameFormat($asUser['first_name'], $asUser['last_name']);
|
||||
|
||||
@@ -206,9 +206,6 @@ if($bUserOk && $sAction!=Databap::EXT_ACCESS)
|
||||
case 'reset_chan_safe_names':
|
||||
$sResult = $oDatabap->resetChanSafeNames();
|
||||
break;
|
||||
case 'migrate':
|
||||
$sResult = $oDatabap->migrateOptionValues();
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
8
todo
8
todo
@@ -58,10 +58,4 @@ Testing
|
||||
MEP 1.2
|
||||
-------
|
||||
|
||||
- ALTER TABLE option_values MODIFY option_value varchar(100) NOT NULL;
|
||||
- insert into option_values (id_option_name, option_value, default_value, language) values (1, 'utilisateur inconnu', 1, 'FR');
|
||||
- insert into option_values (id_option_name, option_value, default_value, language) values (9, 'email inconnu', 1, 'FR');
|
||||
- Commit & push git
|
||||
- ALTER TABLE `options` DROP `option`;
|
||||
- delete migrateOptionValues(); (databap.php)
|
||||
- delete case 'migrate' (index.php)
|
||||
-
|
||||
Reference in New Issue
Block a user