Index: typo3/class.db_list.inc =================================================================== --- typo3/class.db_list.inc (revision 9054) +++ typo3/class.db_list.inc (working copy) @@ -354,61 +354,62 @@ * * @return string HTML for the sys-notes (if any) */ - function showSysNotesForPage() { - global $TCA; + function showSysNotesForPage() { + $out = ''; - $out=''; - // Checking if extension is loaded: - if (!t3lib_extMgm::isLoaded('sys_note')) return ''; + if (!t3lib_extMgm::isLoaded('sys_note')) { + return $out; + } // Create query for selecting the notes: - $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','sys_note','pid IN ('.$this->id.') AND (personal=0 OR cruser='.intval($GLOBALS['BE_USER']->user['uid']).')'.t3lib_BEfunc::deleteClause('sys_note').t3lib_BEfunc::versioningPlaceholderClause('sys_note')); + $where = 'pid IN (' . $this->id . ') AND (personal=0 OR cruser=' . $GLOBALS['BE_USER']->user['uid'] . ')' . + t3lib_BEfunc::deleteClause('sys_note') . + t3lib_BEfunc::versioningPlaceholderClause('sys_note'); + $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_note', $where); - // Executing query: - $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result); + // Load full table description: + t3lib_div::loadTCA('sys_note'); + $cat = array(); - // If some notes were found, render them: - if ($dbCount) { - $cat = array(); - - // Load full table description: - t3lib_div::loadTCA('sys_note'); - - // Traverse note-types and get labels: - if ($TCA['sys_note'] && $TCA['sys_note']['columns']['category'] && is_array($TCA['sys_note']['columns']['category']['config']['items'])) { - foreach($TCA['sys_note']['columns']['category']['config']['items'] as $el) { - $cat[$el[1]]=$GLOBALS['LANG']->sL($el[0]); - } + // Traverse note-types and get labels: + if ($GLOBALS['TCA']['sys_note'] && $GLOBALS['TCA']['sys_note']['columns']['category'] && + is_array($GLOBALS['TCA']['sys_note']['columns']['category']['config']['items'])) { + foreach($GLOBALS['TCA']['sys_note']['columns']['category']['config']['items'] as $item) { + $cat[$item[1]] = $GLOBALS['LANG']->sL($item[0]); } + } - // For each note found, make rendering: - while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { + // For each note found, make rendering: + while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) { - // Create content: - $iconImg = t3lib_iconWorks::getSpriteIconForRecord('sys_note', $row); - $subject = htmlspecialchars($row['subject']); - $fields = array(); - $fields['Author:'] = htmlspecialchars($row['author'].($row['email'] && $row['author'] ? ', ':'').$row['email']); - $fields['Category:'] = htmlspecialchars($cat[$row['category']]); - $fields['Note:'] = nl2br(htmlspecialchars($row['message'])); + // Create content: + $iconImg = t3lib_iconWorks::getSpriteIconForRecord('sys_note', $row); + $author = $row['author'] . ($row['email'] && $row['author'] ? ', ' : '') . $row['email']; - // Compile content: - $out.=' + // Compile content: + $out .= ' + + + + + + + + + + + + + + + + +
' . $iconImg . htmlspecialchars($row['subject']) . '
' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.category', TRUE) . '' . htmlspecialchars($cat[$row['category']]) . '
' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.author', TRUE) . '' . htmlspecialchars($author) . '
' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.note', TRUE) . '' . nl2br(htmlspecialchars($row['message'])) . '
+ '; + } + $GLOBALS['TYPO3_DB']->sql_free_result($result); - - - - - - - -
'.$iconImg.''.$subject.'
'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.category',1).''.$fields['Category:'].'
'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.author',1).''.$fields['Author:'].'
'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.note',1).''.$fields['Note:'].'
- '; - } - } return $out; } Index: typo3/sysext/sys_note/ext_emconf.php =================================================================== --- typo3/sysext/sys_note/ext_emconf.php (revision 9054) +++ typo3/sysext/sys_note/ext_emconf.php (working copy) @@ -33,7 +33,7 @@ 'author_company' => 'Curby Soft Multimedia', 'CGLcompliance' => '', 'CGLcompliance_note' => '', - 'version' => '1.1.2', + 'version' => '1.1.3', '_md5_values_when_last_written' => 'a:5:{s:12:"ext_icon.gif";s:4:"bf22";s:14:"ext_tables.php";s:4:"847c";s:14:"ext_tables.sql";s:4:"18f7";s:25:"locallang_csh_sysnote.xml";s:4:"efaa";s:17:"locallang_tca.xml";s:4:"456e";}', 'constraints' => array( 'depends' => array( Index: typo3/sysext/sys_note/ext_tables.php =================================================================== --- typo3/sysext/sys_note/ext_tables.php (revision 9054) +++ typo3/sysext/sys_note/ext_tables.php (working copy) @@ -1,80 +1,82 @@ Array ( + $TCA['sys_note'] = array( + 'ctrl' => array( 'label' => 'subject', 'default_sortby' => 'ORDER BY crdate', 'tstamp' => 'tstamp', 'crdate' => 'crdate', 'cruser_id' => 'cruser', - 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy', + 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.xml:LGL.prependAtCopy', 'delete' => 'deleted', - 'title' => 'LLL:EXT:sys_note/locallang_tca.php:sys_note', - 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'ext_icon.gif', + 'title' => 'LLL:EXT:sys_note/locallang_tca.xml:sys_note', + 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif', ), - 'interface' => Array ( + 'interface' => array( 'showRecordFieldList' => 'category,subject,message,author,email,personal' ), - 'columns' => Array ( - 'category' => Array ( - 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.category', - 'config' => Array ( + 'columns' => array( + 'category' => array( + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.category', + 'config' => array( 'type' => 'select', - 'items' => Array ( - Array('', '0'), - Array('LLL:EXT:sys_note/locallang_tca.php:sys_note.category.I.1', '1'), - Array('LLL:EXT:sys_note/locallang_tca.php:sys_note.category.I.2', '3'), - Array('LLL:EXT:sys_note/locallang_tca.php:sys_note.category.I.3', '4'), - Array('LLL:EXT:sys_note/locallang_tca.php:sys_note.category.I.4', '2') + 'items' => array( + array('', '0'), + array('LLL:EXT:sys_note/locallang_tca.xml:sys_note.category.I.1', '1'), + array('LLL:EXT:sys_note/locallang_tca.xml:sys_note.category.I.2', '3'), + array('LLL:EXT:sys_note/locallang_tca.xml:sys_note.category.I.3', '4'), + array('LLL:EXT:sys_note/locallang_tca.xml:sys_note.category.I.4', '2') ), 'default' => '0' ) ), - 'subject' => Array ( - 'label' => 'LLL:EXT:sys_note/locallang_tca.php:sys_note.subject', - 'config' => Array ( + 'subject' => array( + 'label' => 'LLL:EXT:sys_note/locallang_tca.xml:sys_note.subject', + 'config' => array( 'type' => 'input', 'size' => '40', 'max' => '256' ) ), - 'message' => Array ( - 'label' => 'LLL:EXT:sys_note/locallang_tca.php:sys_note.message', - 'config' => Array ( + 'message' => array( + 'label' => 'LLL:EXT:sys_note/locallang_tca.xml:sys_note.message', + 'config' => array( 'type' => 'text', 'cols' => '40', 'rows' => '15' ) ), - 'author' => Array ( - 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.author', - 'config' => Array ( + 'author' => array( + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.author', + 'config' => array( 'type' => 'input', 'size' => '20', 'eval' => 'trim', 'max' => '80' ) ), - 'email' => Array ( - 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.email', - 'config' => Array ( + 'email' => array( + 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.email', + 'config' => array( 'type' => 'input', 'size' => '20', 'eval' => 'trim', 'max' => '80' ) ), - 'personal' => Array ( - 'label' => 'LLL:EXT:sys_note/locallang_tca.php:sys_note.personal', - 'config' => Array ( + 'personal' => array( + 'label' => 'LLL:EXT:sys_note/locallang_tca.xml:sys_note.personal', + 'config' => array( 'type' => 'check' ) ) ), - 'types' => Array ( - '0' => Array('showitem' => 'category;;;;2-2-2, author, email, personal, subject;;;;3-3-3, message') + 'types' => array( + '0' => array('showitem' => 'category;;;;2-2-2, author, email, personal, subject;;;;3-3-3, message') ) );