- $result_assign = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin='%s' WHERE id=%s LIMIT 1",
- array(GET_ADMIN_ID(get_session('admin_login')), bigintval($tid)), __FILE__, __LINE__);
- }
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_task_system` SET `assigned_admin`=%s WHERE `id`=%s LIMIT 1",
+ array(getCurrentAdminId(), bigintval($tid)), __FILE__, __LINE__);
+ } // END - if
+
+ $add = '';
+ // @TODO Rewrite this to a filter
+ if ($type == 'SUPPORT_MEMBER') {
+ $mode = substr($text, 0, strpos($text, ':'));
+ $text = substr($text, strpos($text, ':') + 1);
+ $add = "<li>{--ADMIN_TASK_SUPPORT_MODE--}: <strong>".$mode."</strong></li>";
+ } // END - if
+
+ // Is a userid assign?
+ if ($userid > 0) {
+ // Then load his data!
+ // @TODO Can this SQL be encapsulated in a function, so all similar queries can be rewritten?
+ $result_user = SQL_QUERY_ESC("SELECT `gender`, `surname`, `family`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
+ array(bigintval($userid)), __FILE__, __LINE__);
+
+ // Entry found?
+ if (SQL_NUMROWS($result_user) == 1) {
+ // Fetch row
+ $content = SQL_FETCHARRAY($result_user);
+ // Generate HTML list entry
+ $add = "<li>{--ADMIN_MEMBER_UID--}: <strong>".generateUserProfileLink($userid, 'user_data')." (<a href=\"".generateEmailLink($content['email'], 'user_data')."\">".translateGender($content['gender'])." ".$content['surname']." ".$content['family']."</a>)</strong></li>";
+ } else {
+ // Invalid userid, so log and zero it
+ logDebugMessage(__FUNCTION__, __LINE__, 'Invalid userid=' . $userid . ' -> not found!');
+ $userid = 0;
+ }