bug fixing: options display (text lower than input), adding a new
backgorund color in options and sorting options by name
This commit is contained in:
@@ -130,7 +130,8 @@ class Databap extends PhpObject
|
|||||||
const OPT_SELECT = 'S';
|
const OPT_SELECT = 'S';
|
||||||
const OPT_NICKNAME = 1;
|
const OPT_NICKNAME = 1;
|
||||||
const OPT_BG = 2;
|
const OPT_BG = 2;
|
||||||
const OPT_BRIGHT_BG = 3;
|
const OPT_BG_2 = 11;
|
||||||
|
const OPT_BG_3 = 3;
|
||||||
const OPT_HOVER = 4;
|
const OPT_HOVER = 4;
|
||||||
const OPT_IMAGE_CHAT = 6;
|
const OPT_IMAGE_CHAT = 6;
|
||||||
const OPT_STATUS = 7;
|
const OPT_STATUS = 7;
|
||||||
@@ -355,7 +356,8 @@ class Databap extends PhpObject
|
|||||||
$sOptionValueIdCol = MySqlManager::getId(self::OPTVAL_TABLE);
|
$sOptionValueIdCol = MySqlManager::getId(self::OPTVAL_TABLE);
|
||||||
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_NICKNAME, $sOptionNameCol=>'pseudo du chat', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_NICKNAME, $sOptionNameCol=>'pseudo du chat', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
||||||
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_BG, $sOptionNameCol=>'couleur de fond', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_BG, $sOptionNameCol=>'couleur de fond', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
||||||
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_BRIGHT_BG, $sOptionNameCol=>'couleur de fond 2 (claire)', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::POT_BG_2, $sOptionNameCol=>'couleur de fond 2', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
||||||
|
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_BG_3, $sOptionNameCol=>'couleur de fond 3', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
||||||
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_HOVER, $sOptionNameCol=>'couleur de survol', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_HOVER, $sOptionNameCol=>'couleur de survol', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
||||||
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_IMAGE_CHAT, $sOptionNameCol=>'image du chat', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_IMAGE_CHAT, $sOptionNameCol=>'image du chat', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
||||||
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_STATUS, $sOptionNameCol=>'mission en cours', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
$this->oMySql->insertRow(self::OPTNAME_TABLE, array($sOptionNameIdCol=>self::OPT_STATUS, $sOptionNameCol=>'mission en cours', 'type'=>self::OPT_TEXT, 'language'=>self::LANG_FR));
|
||||||
@@ -366,7 +368,8 @@ class Databap extends PhpObject
|
|||||||
//Select and Default Option values
|
//Select and Default Option values
|
||||||
$asDefaultValues = array( self::OPT_CONSOLE=>array(self::OPT_VAL_YES=>false, self::OPT_VAL_NO=>true),
|
$asDefaultValues = array( self::OPT_CONSOLE=>array(self::OPT_VAL_YES=>false, self::OPT_VAL_NO=>true),
|
||||||
self::OPT_BG=>array('#04357B'=>true),
|
self::OPT_BG=>array('#04357B'=>true),
|
||||||
self::OPT_BRIGHT_BG=>array('#D9E5F2'=>true),
|
self::OPT_BG_2=>array('#88B2F0'=>true),
|
||||||
|
self::OPT_BG_3=>array('#D9E5F2'=>true),
|
||||||
self::OPT_HOVER=>array('#EFAB00'=>true),
|
self::OPT_HOVER=>array('#EFAB00'=>true),
|
||||||
self::OPT_IMAGE_CHAT=>array('images/sap_gold_332.jpg'=>true),
|
self::OPT_IMAGE_CHAT=>array('images/sap_gold_332.jpg'=>true),
|
||||||
self::OPT_STATUS=>array('aucune mission en cours'=>true),
|
self::OPT_STATUS=>array('aucune mission en cours'=>true),
|
||||||
@@ -1299,10 +1302,12 @@ class Databap extends PhpObject
|
|||||||
$asSelectedOptions = array();
|
$asSelectedOptions = array();
|
||||||
foreach($asAvailableOptions as $sOptNameId=>$asOption)
|
foreach($asAvailableOptions as $sOptNameId=>$asOption)
|
||||||
{
|
{
|
||||||
$asSelectedOptions[$sOptNameId]['option_name'] = self::getDescriptionFormat($asOption[$sOptNameTextCol]);
|
$sOptionName = self::getDescriptionFormat($asOption[$sOptNameTextCol]);
|
||||||
$asSelectedOptions[$sOptNameId]['user_value_id'] = array_key_exists($sOptNameId, $asUserOptions)?$asUserOptions[$sOptNameId][$sOptValueIdCol]:0;
|
$asSelectedOptions[$sOptionName]['option_id'] = $sOptNameId;
|
||||||
$asSelectedOptions[$sOptNameId]['user_value'] = array_key_exists($sOptNameId, $asUserOptions)?$asUserOptions[$sOptNameId][$sOptionTextCol]:'';
|
$asSelectedOptions[$sOptionName]['option_name'] = $sOptionName;
|
||||||
$asSelectedOptions[$sOptNameId]['type'] = $asOption['type'];
|
$asSelectedOptions[$sOptionName]['user_value_id'] = array_key_exists($sOptNameId, $asUserOptions)?$asUserOptions[$sOptNameId][$sOptValueIdCol]:0;
|
||||||
|
$asSelectedOptions[$sOptionName]['user_value'] = array_key_exists($sOptNameId, $asUserOptions)?$asUserOptions[$sOptNameId][$sOptionTextCol]:'';
|
||||||
|
$asSelectedOptions[$sOptionName]['type'] = $asOption['type'];
|
||||||
if($asOption['type']==self::OPT_SELECT)
|
if($asOption['type']==self::OPT_SELECT)
|
||||||
{
|
{
|
||||||
$asOptionValuesInfo = array('select'=>array($sOptValueIdCol, $sOptValueTextCol),
|
$asOptionValuesInfo = array('select'=>array($sOptValueIdCol, $sOptValueTextCol),
|
||||||
@@ -1310,9 +1315,10 @@ class Databap extends PhpObject
|
|||||||
'constraint'=>array('language'=>$this->sLanguage,
|
'constraint'=>array('language'=>$this->sLanguage,
|
||||||
MySqlManager::getId(self::OPTNAME_TABLE)=>$sOptNameId),
|
MySqlManager::getId(self::OPTNAME_TABLE)=>$sOptNameId),
|
||||||
'orderBy'=>array('led'=>'ASC'));
|
'orderBy'=>array('led'=>'ASC'));
|
||||||
$asSelectedOptions[$sOptNameId]['select'] = $this->oMySql->selectRows($asOptionValuesInfo, true, $sOptValueIdCol);
|
$asSelectedOptions[$sOptionName]['select'] = $this->oMySql->selectRows($asOptionValuesInfo, true, $sOptValueIdCol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ksort($asSelectedOptions);
|
||||||
return $this->jsonExport($asSelectedOptions);
|
return $this->jsonExport($asSelectedOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2669,7 +2675,7 @@ class Databap extends PhpObject
|
|||||||
public function getStyleSheet()
|
public function getStyleSheet()
|
||||||
{
|
{
|
||||||
$sStyle = file_get_contents(self::STYLE_PATH);
|
$sStyle = file_get_contents(self::STYLE_PATH);
|
||||||
$asStyleParams = array(self::OPT_BG, self::OPT_BRIGHT_BG, self::OPT_HOVER, self::OPT_IMAGE_CHAT);
|
$asStyleParams = array(self::OPT_BG, self::OPT_BG_2, self::OPT_BG_3, self::OPT_HOVER, self::OPT_IMAGE_CHAT);
|
||||||
|
|
||||||
//Inserting Color Anchors
|
//Inserting Color Anchors
|
||||||
$asDefaultValues = $this->getDefaultOptionValues($asStyleParams, false);
|
$asDefaultValues = $this->getDefaultOptionValues($asStyleParams, false);
|
||||||
|
|||||||
@@ -58,8 +58,9 @@ databap.onResize = function()
|
|||||||
self.setScrollBarSize('maximize');
|
self.setScrollBarSize('maximize');
|
||||||
};
|
};
|
||||||
|
|
||||||
function addOption(optNameId, optInfo, $Box)
|
function addOption(iArrayId, optInfo, $Box)
|
||||||
{
|
{
|
||||||
|
var optNameId = optInfo.option_id;
|
||||||
$Box = $Box || $('#options_input');
|
$Box = $Box || $('#options_input');
|
||||||
var selected = '';
|
var selected = '';
|
||||||
var $Option = $('<div>', {'class':'option_line'}).append($('<p>').text(optInfo.option_name));
|
var $Option = $('<div>', {'class':'option_line'}).append($('<p>').text(optInfo.option_name));
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1042,6 +1042,7 @@
|
|||||||
border-width:1px;
|
border-width:1px;
|
||||||
font-size:$size_vbig;
|
font-size:$size_vbig;
|
||||||
padding:5px;
|
padding:5px;
|
||||||
|
margin-top:6px;
|
||||||
float:right;
|
float:right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
todo
12
todo
@@ -54,15 +54,7 @@ Testing
|
|||||||
- LOAD DATA LOCAL INFILE '/var/www/databap/test.csv' INTO TABLE tables CHARACTER SET UTF8 FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\';
|
- LOAD DATA LOCAL INFILE '/var/www/databap/test.csv' INTO TABLE tables CHARACTER SET UTF8 FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\';
|
||||||
- Rebuild search : ?a=build_index
|
- Rebuild search : ?a=build_index
|
||||||
|
|
||||||
MEP 1.1
|
MEP 1.2
|
||||||
-------
|
-------
|
||||||
|
|
||||||
ALTER TABLE option_values add default_value tinyint(1) default 0 after option_value;
|
-
|
||||||
update option_values set default_value = 1 where id_option_value = 2;
|
|
||||||
insert into option_names (id_option_name, option_name, type, language) values (10, 'Chat: nombre de jours d\'historique', 'T', 'FR');
|
|
||||||
insert into option_values (id_option_name, option_value, default_value, language) values (2, '#04357B', 1, 'FR');
|
|
||||||
insert into option_values (id_option_name, option_value, default_value, language) values (3, '#D9E5F2', 1, 'FR');
|
|
||||||
insert into option_values (id_option_name, option_value, default_value, language) values (4, '#EFAB00', 1, 'FR');
|
|
||||||
insert into option_values (id_option_name, option_value, default_value, language) values (6, 'images/sap_gold_332.jpg', 1, 'FR');
|
|
||||||
insert into option_values (id_option_name, option_value, default_value, language) values (7, 'aucune mission en cours', 1, 'FR');
|
|
||||||
insert into option_values (id_option_name, option_value, default_value, language) values (10, '0', 1, 'FR');
|
|
||||||
Reference in New Issue
Block a user