Follow-up to bug #8399: Table index was too long after changing the field size
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_befunc.php
index 9391753..408f60e 100755 (executable)
@@ -341,7 +341,7 @@ final class t3lib_BEfunc {
         * @param       array           Array of fields
         * @param       string          Table in which we are searching (for DBAL detection of quoteStr() method)
         * @return      string          WHERE clause for search
         * @param       array           Array of fields
         * @param       string          Table in which we are searching (for DBAL detection of quoteStr() method)
         * @return      string          WHERE clause for search
-        * @deprecated          Use $GLOBALS['TYPO3_DB']->searchQuery() directly!
+        * @deprecated since TYPO3 4.0 - Use $GLOBALS['TYPO3_DB']->searchQuery() directly!
         */
        public static function searchQuery($searchWords, $fields, $table = '') {
                return $GLOBALS['TYPO3_DB']->searchQuery($searchWords, $fields, $table);
         */
        public static function searchQuery($searchWords, $fields, $table = '') {
                return $GLOBALS['TYPO3_DB']->searchQuery($searchWords, $fields, $table);
@@ -356,7 +356,7 @@ final class t3lib_BEfunc {
         * @param       string          Table field name
         * @param       string          Value to find in list
         * @return      string          WHERE clause for a query
         * @param       string          Table field name
         * @param       string          Value to find in list
         * @return      string          WHERE clause for a query
-        * @deprecated          Use $GLOBALS['TYPO3_DB']->listQuery() directly!
+        * @deprecated since TYPO3 4.0 - Use $GLOBALS['TYPO3_DB']->listQuery() directly!
         */
        public static function listQuery($field, $value) {
                return $GLOBALS['TYPO3_DB']->listQuery($field, $value, '');
         */
        public static function listQuery($field, $value) {
                return $GLOBALS['TYPO3_DB']->listQuery($field, $value, '');
@@ -500,7 +500,7 @@ final class t3lib_BEfunc {
         * @param       string          Optional ORDER BY field(s), if none, supply blank string.
         * @param       string          Optional LIMIT value ([begin,]max), if none, supply blank string.
         * @return      string          Full SQL query
         * @param       string          Optional ORDER BY field(s), if none, supply blank string.
         * @param       string          Optional LIMIT value ([begin,]max), if none, supply blank string.
         * @return      string          Full SQL query
-        * @deprecated
+        * @deprecated since TYPO3 4.0
         * @see t3lib_DB::exec_SELECT_mm_query()
         */
        public static function mm_query($select, $local_table, $mm_table, $foreign_table, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '') {
         * @see t3lib_DB::exec_SELECT_mm_query()
         */
        public static function mm_query($select, $local_table, $mm_table, $foreign_table, $whereClause = '', $groupBy = '', $orderBy = '', $limit = '') {
@@ -523,7 +523,7 @@ final class t3lib_BEfunc {
         * @param       string          Table name
         * @param       array           Field values as key=>value pairs.
         * @return      string          Full SQL query for INSERT
         * @param       string          Table name
         * @param       array           Field values as key=>value pairs.
         * @return      string          Full SQL query for INSERT
-        * @deprecated
+        * @deprecated since TYPO3 4.0
         */
        public static function DBcompileInsert($table, $fields_values) {
                return $GLOBALS['TYPO3_DB']->INSERTquery($table, $fields_values);
         */
        public static function DBcompileInsert($table, $fields_values) {
                return $GLOBALS['TYPO3_DB']->INSERTquery($table, $fields_values);
@@ -537,7 +537,7 @@ final class t3lib_BEfunc {
         * @param       string          WHERE clause, eg. "uid=1"
         * @param       array           Field values as key=>value pairs.
         * @return      string          Full SQL query for UPDATE
         * @param       string          WHERE clause, eg. "uid=1"
         * @param       array           Field values as key=>value pairs.
         * @return      string          Full SQL query for UPDATE
-        * @deprecated
+        * @deprecated since TYPO3 4.0
         */
        public static function DBcompileUpdate($table, $where, $fields_values) {
                return $GLOBALS['TYPO3_DB']->UPDATEquery($table, $where, $fields_values);
         */
        public static function DBcompileUpdate($table, $where, $fields_values) {
                return $GLOBALS['TYPO3_DB']->UPDATEquery($table, $where, $fields_values);
@@ -1642,7 +1642,7 @@ final class t3lib_BEfunc {
         * @param       string          String to set as title-attribute. If no $content is given only the attribute name is returned.
         * @param       boolean         If $hsc is set, then content of the attribute is htmlspecialchar()'ed (which is good for XHTML and other reasons...)
         * @return      string
         * @param       string          String to set as title-attribute. If no $content is given only the attribute name is returned.
         * @param       boolean         If $hsc is set, then content of the attribute is htmlspecialchar()'ed (which is good for XHTML and other reasons...)
         * @return      string
-        * @deprecated          The idea made sense with older browsers, but now all browsers should support the "title" attribute - so just hardcode the title attribute instead!
+        * @deprecated since TYPO3 4.0 - The idea made sense with older browsers, but now all browsers should support the "title" attribute - so just hardcode the title attribute instead!
         */
        public static function titleAttrib($content = '', $hsc = 0) {
                global $CLIENT;
         */
        public static function titleAttrib($content = '', $hsc = 0) {
                global $CLIENT;
@@ -2896,6 +2896,7 @@ final class t3lib_BEfunc {
                if ($table && $uid) {
                        $fields_values = array(
                                'userid' => $user_id,
                if ($table && $uid) {
                        $fields_values = array(
                                'userid' => $user_id,
+                               'feuserid' => 0,
                                'tstamp' => $GLOBALS['EXEC_TIME'],
                                'record_table' => $table,
                                'record_uid' => $uid,
                                'tstamp' => $GLOBALS['EXEC_TIME'],
                                'record_table' => $table,
                                'record_uid' => $uid,
@@ -2930,16 +2931,34 @@ final class t3lib_BEfunc {
                                                                AND sys_lockedrecords.tstamp > '.($GLOBALS['EXEC_TIME']-2*3600)
                                                );
                        while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                                                AND sys_lockedrecords.tstamp > '.($GLOBALS['EXEC_TIME']-2*3600)
                                                );
                        while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
+                                       // Get the type of the user that locked this record: 
+                               if ($row['userid']) {
+                                       $userTypeLabel = 'beUser';
+                               } elseif ($row['feuserid']) {
+                                       $userTypeLabel = 'feUser';
+                               } else {
+                                       $userTypeLabel = 'user';
+                               }
+                               $userType = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.' . $userTypeLabel);
+                                       // Get the username (if available):
+                               if ($row['username']) {
+                                       $userName = $row['username'];
+                               } else {
+                                       $userName = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.unknownUser');
+                               }
+
                                $LOCKED_RECORDS[$row['record_table'].':'.$row['record_uid']] = $row;
                                $LOCKED_RECORDS[$row['record_table'].':'.$row['record_uid']]['msg'] = sprintf(
                                $LOCKED_RECORDS[$row['record_table'].':'.$row['record_uid']] = $row;
                                $LOCKED_RECORDS[$row['record_table'].':'.$row['record_uid']]['msg'] = sprintf(
-                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.lockedRecord'),
-                                       $row['username'],
+                                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.lockedRecordUser'),
+                                       $userType,
+                                       $userName,
                                        t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME']-$row['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'))
                                );
                                if ($row['record_pid'] && !isset($LOCKED_RECORDS[$row['record_table'].':'.$row['record_pid']])) {
                                        $LOCKED_RECORDS['pages:'.$row['record_pid']]['msg'] = sprintf(
                                        t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME']-$row['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'))
                                );
                                if ($row['record_pid'] && !isset($LOCKED_RECORDS[$row['record_table'].':'.$row['record_pid']])) {
                                        $LOCKED_RECORDS['pages:'.$row['record_pid']]['msg'] = sprintf(
-                                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.lockedRecord_content'),
-                                               $row['username'],
+                                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.lockedRecordUser_content'),
+                                               $userType,
+                                               $userName,
                                                t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME']-$row['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'))
                                        );
                                }
                                                t3lib_BEfunc::calcAge($GLOBALS['EXEC_TIME']-$row['tstamp'], $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'))
                                        );
                                }
@@ -4061,7 +4080,7 @@ final class t3lib_BEfunc {
         * @param       string          The URL/script to jump to (used in A tag)
         * @return      array           Two keys, rows and list
         * @internal
         * @param       string          The URL/script to jump to (used in A tag)
         * @return      array           Two keys, rows and list
         * @internal
-        * @deprecated
+        * @deprecated since TYPO3 4.0
         * @obsolete
         */
        public static function getListOfBackendModules($name, $perms_clause, $backPath = '', $script = 'index.php') {
         * @obsolete
         */
        public static function getListOfBackendModules($name, $perms_clause, $backPath = '', $script = 'index.php') {