From ed6275164e3ffc5dd22d489ef42061415e657ba9 Mon Sep 17 00:00:00 2001 From: lutranf Date: Wed, 10 Sep 2014 18:06:56 +0200 Subject: [PATCH] table name in uppercase in profile --- inc/databap.php | 24 ++++++++++++------------ todo | 1 - 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/inc/databap.php b/inc/databap.php index 629c3d7..90ef74d 100644 --- a/inc/databap.php +++ b/inc/databap.php @@ -989,6 +989,7 @@ class Databap extends PhpObject if($bSuccess) { $asTable['date'] = self::getDateFormat($asTable['timestamp'], self::DATE_FORMAT); + $asTable['title'] = $asTable['table_name']; unset($asTable['timestamp']); $asTable['id'] = $asTable[MySqlManager::getId(self::TABL_TABLE)]; @@ -1157,6 +1158,7 @@ class Databap extends PhpObject { $asTable['system'] = self::getTableFormat($asTable['system']); $asTable['description'] = self::getDescriptionFormat($asTable['description']); + $asTable['table_name'] = self::getTableFormat($asTable['title']); $asTable['title'] = self::getTableFormat($asTable['title']).' - '.$asTable['description']; $asTable['led'] = self::getDateFormat($asTable['led']); $asTable['formated_keywords'] = ToolBox::formatText($asTable['keywords']); @@ -1379,27 +1381,25 @@ class Databap extends PhpObject //History Info $asTables = $this->getTypeInfo('table'); + unset($asTables[self::ART_TYPE]); //Skip articles foreach($asTables as $sType=>$sTableName) { - //Skip articles - if($sTableName==self::ART_TABLE) continue; - //Add Text $sText = mb_strtolower($this->getPageTitles($this->getPagesFromHash($sType))); if(!$sText) $this->addError('Pas de texte pour le type "'.$sType.'"'); //Loop through items - $asSqlInfo = array('from'=>$sTableName, 'constraint'=>array(MySqlManager::getId(self::USER_TABLE)=>$iUserId)); + $asSqlInfo = array('select'=>MySqlManager::getId($sTableName), 'from'=>$sTableName, 'constraint'=>array(MySqlManager::getId(self::USER_TABLE)=>$iUserId)); $asHistory = $this->oMySql->selectRows($asSqlInfo); - foreach($asHistory as $asInfo) + foreach($asHistory as $iItemId) { - $sLed = $asInfo['led']; - $iItemId = $asInfo[MySqlManager::getId($sTableName)]; - $asProfile['history'][$sLed]['type'] = $sType; - $asProfile['history'][$sLed]['id'] = $iItemId; - $asProfile['history'][$sLed]['action'] = (($asInfo['refer_id']==$iItemId)?'Création':'Modification').' de '.$sText; - $asProfile['history'][$sLed]['date'] = self::getDateFormat($sLed); - $asProfile['history'][$sLed]['title'] = array_key_exists('title', $asInfo)?$asInfo['title']:$asInfo['description']; + $asInfo = $this->getItemInfo($sType, $iItemId); + $sKey = $asInfo['timestamp'].$sType.$iItemId; + $asProfile['history'][$sKey]['type'] = $sType; + $asProfile['history'][$sKey]['id'] = $iItemId; + $asProfile['history'][$sKey]['action'] = (($asInfo['refer_id']==$iItemId)?'Création':'Modification').' de '.$sText; + $asProfile['history'][$sKey]['date'] = $asInfo['led']; + $asProfile['history'][$sKey]['title'] = $asInfo['title']; } } diff --git a/todo b/todo index 11b77a0..43b6774 100644 --- a/todo +++ b/todo @@ -9,7 +9,6 @@ Internal: Bug fix: - [1.0.0] Recherche : conflit entre "rank" et author / date -- [1.0.0] nom de la table en majuscule dans le profil - [1.0.0] Tab dans chat - [1.0.1] Check le document type plutot que l'extension pour les /img - [1.0.1] Resize .gif