From 2fcb764f3e4cba372e44397395b395f3a928ad03 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 8 Oct 2004 11:13:01 +0000 Subject: [PATCH] - more pm updates git-svn-id: file:///svn/phpbb/trunk@4998 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_pm.php | 43 +++-- phpBB/includes/ucp/ucp_pm_compose.php | 92 +++++----- phpBB/includes/ucp/ucp_pm_options.php | 165 ++++++++++++++++-- phpBB/includes/ucp/ucp_pm_viewfolder.php | 11 +- phpBB/includes/ucp/ucp_pm_viewmessage.php | 8 +- phpBB/language/en/ucp.php | 38 +++- phpBB/language/en/viewforum.php | 2 + .../template/ucp_pm_message_header.html | 2 +- .../subSilver/template/ucp_pm_options.html | 29 ++- .../subSilver/template/ucp_pm_popup.html | 9 +- .../subSilver/template/ucp_pm_viewfolder.html | 12 +- 11 files changed, 319 insertions(+), 92 deletions(-) diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index d0eb0d8eae..964077a2c1 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -48,7 +48,7 @@ class ucp_pm extends module if ($user->data['user_id'] == ANONYMOUS) { - trigger_error('NO_PM'); + trigger_error('NO_MESSAGE'); } // Is PM disabled? @@ -60,7 +60,9 @@ class ucp_pm extends module $user->add_lang('posting'); $template->assign_var('S_PRIVMSGS', true); + // Folder directly specified? $folder_specified = request_var('folder', ''); + if (!in_array($folder_specified, array('inbox', 'outbox', 'sentbox'))) { $folder_specified = (int) $folder_specified; @@ -98,16 +100,13 @@ class ucp_pm extends module { $l_new_message = $user->lang['YOU_NO_NEW_PM']; } - - $l_new_message .= '

' . sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '', ''); - } - else - { - $l_new_message = $user->lang['LOGIN_CHECK_PM']; } $template->assign_vars(array( - 'MESSAGE' => $l_new_message) + 'MESSAGE' => $l_new_message, + 'S_NOT_LOGGED_IN' => ($user->data['user_id'] == ANONYMOUS) ? true : false, + 'CLICK_TO_VIEW' => sprintf($user->lang['CLICK_VIEW_PRIVMSG'], '', ''), + 'U_INBOX' => "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=inbox") ); break; @@ -118,7 +117,7 @@ class ucp_pm extends module if (!$auth->acl_get('u_sendpm')) { - trigger_error('NOT_AUTHORIZED'); + trigger_error('NO_AUTH_SEND_MESSAGE'); } include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.'.$phpEx); @@ -162,7 +161,7 @@ class ucp_pm extends module if (!$auth->acl_get('u_readpm')) { - trigger_error('NOT_AUTHORIZED'); + trigger_error('NO_AUTH_READ_MESSAGE'); } // First Handle Mark actions and moving messages @@ -172,7 +171,11 @@ class ucp_pm extends module { $message_limit = (!$user->data['group_message_limit']) ? $config['pm_max_msgs'] : $user->data['group_message_limit']; - if (move_pm($user->data['user_id'], $message_limit)) + $move_msg_ids = (isset($_POST['marked_msg_id'])) ? array_map('intval', $_POST['marked_msg_id']) : array(); + $dest_folder = request_var('dest_folder', PRIVMSGS_NO_BOX); + $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); + + if (move_pm($user->data['user_id'], $message_limit, $move_msg_ids, $dest_folder, $cur_folder_id)) { // Return to folder view if single message moved if ($action == 'view_message') @@ -211,7 +214,7 @@ class ucp_pm extends module $result = $db->sql_query_limit($sql, 1); if (!($row = $db->sql_fetchrow($result))) { - trigger_error('MESSAGE_NO_LONGER_AVAILABLE'); + trigger_error('NO_MESSAGE'); } $folder_id = (int) $row['folder_id']; } @@ -258,7 +261,7 @@ class ucp_pm extends module if (!($message_row = $db->sql_fetchrow($result))) { - trigger_error('MESSAGE_NO_LONGER_AVAILABLE'); + trigger_error('NO_MESSAGE'); } // Update unread status @@ -294,7 +297,7 @@ class ucp_pm extends module // Header for message view - folder and so on $folder_status = get_folder_status($folder_id, $folder); $url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id"; - + $template->assign_vars(array( 'CUR_FOLDER_ID' => $folder_id, 'CUR_FOLDER_NAME' => $folder_status['folder_name'], @@ -307,11 +310,15 @@ class ucp_pm extends module 'S_FOLDER_ACTION' => "$url&mode=view_messages&action=view_folder", 'S_PM_ACTION' => "$url&mode=$mode&action=$action", - 'U_INBOX' => ($folder_id != PRIVMSGS_INBOX) ? "$url&folder=inbox" : '', - 'U_OUTBOX' => ($folder_id != PRIVMSGS_OUTBOX) ? "$url&folder=outbox" : '', - 'U_SENTBOX' => ($folder_id != PRIVMSGS_SENTBOX) ? "$url&folder=sentbox" : '', + 'U_INBOX' => "$url&folder=inbox", + 'U_OUTBOX' => "$url&folder=outbox", + 'U_SENTBOX' => "$url&folder=sentbox", 'U_CREATE_FOLDER' => "$url&mode=options", + 'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false, + 'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false, + 'S_IN_SENTBOX' => ($folder_id == PRIVMSGS_SENTBOX) ? true : false, + 'FOLDER_STATUS' => $folder_status['message'], 'FOLDER_MAX_MESSAGES' => $folder_status['max'], 'FOLDER_CUR_MESSAGES' => $folder_status['cur'], @@ -347,7 +354,7 @@ class ucp_pm extends module break; default: - trigger_error('NOT_AUTHORIZED'); + trigger_error('NO_ACTION_MODE'); } $template->assign_vars(array( diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 7f1c87efdc..60dd4b33b9 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -75,7 +75,7 @@ function compose_pm($id, $mode, $action) case 'post': if (!$auth->acl_get('u_sendpm')) { - trigger_error('NOT_AUTHORIZED_POST_PM'); + trigger_error('NO_AUTH_SEND_MESSAGE'); } break; @@ -85,7 +85,7 @@ function compose_pm($id, $mode, $action) case 'forward': if (!$msg_id) { - trigger_error('NO_PM'); + trigger_error('NO_MESSAGE'); } if ($quote_post) @@ -110,7 +110,7 @@ function compose_pm($id, $mode, $action) case 'edit': if (!$msg_id) { - trigger_error('NO_PM'); + trigger_error('NO_MESSAGE'); } // check for outbox (not read) status, we do not allow editing if one user already having the message @@ -125,15 +125,15 @@ function compose_pm($id, $mode, $action) case 'delete': if (!$auth->acl_get('u_pm_delete')) { - trigger_error('NOT_AUTHORIZED_DELETE_PM'); + trigger_error('NO_AUTH_DELETE_MESSAGE'); } if (!$msg_id) { - trigger_error('NO_PM'); + trigger_error('NO_MESSAGE'); } - $sql = 'SELECT msg_id, unread, new, author_id + $sql = 'SELECT msg_id, unread, new, author_id, folder_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE user_id = ' . $user->data['user_id'] . " AND msg_id = $msg_id"; @@ -144,27 +144,27 @@ function compose_pm($id, $mode, $action) break; default: - trigger_error('NO_POST_MODE'); + trigger_error('NO_ACTION_MODE'); } if ($action == 'reply' && !$auth->acl_get('u_sendpm')) { - trigger_error('NOT_AUTHORIZED_REPLY_PM'); + trigger_error('NO_AUTH_REPLY_MESSAGE'); } if ($action == 'quote' && (!$config['auth_quote_pm'] || !$auth->acl_get('u_sendpm'))) { - trigger_error('NOT_AUTHORIZED_QUOTE_PM'); + trigger_error('NO_AUTH_QUOTE_MESSAGE'); } if ($action == 'forward' && (!$config['forward_pm'] || !$auth->acl_get('u_pm_forward'))) { - trigger_error('NOT_AUTHORIZED_FORWARD_PM'); + trigger_error('NO_AUTH_FORWARD_MESSAGE'); } if ($action == 'edit' && !$auth->acl_get('u_pm_edit')) { - trigger_error('NOT_AUTHORIZED_EDIT_PM'); + trigger_error('NO_AUTH_EDIT_MESSAGE'); } if ($sql) @@ -173,7 +173,7 @@ function compose_pm($id, $mode, $action) if (!($row = $db->sql_fetchrow($result))) { - trigger_error('NOT_AUTHORIZED'); + trigger_error('NO_MESSAGE'); } extract($row); @@ -184,7 +184,7 @@ function compose_pm($id, $mode, $action) if (!$author_id && $msg_id) { - trigger_error('NO_USER'); + trigger_error('NO_AUTHOR'); } if (($action == 'reply' || $action == 'quote') && !sizeof($address_list) && !$refresh && !$submit && !$preview) @@ -217,14 +217,14 @@ function compose_pm($id, $mode, $action) if (($to_group_id || isset($address_list['g'])) && !$config['allow_mass_pm']) { - trigger_error('NOT_ALLOWED_MASS_PM'); + trigger_error('NO_AUTH_GROUP_MESSAGE'); } if ($action == 'edit' && !$refresh && !$preview && !$submit) { if (!($message_time > time() - $config['pm_edit_time'] || !$config['pm_edit_time'])) { - trigger_error('NOT_AUTHORIZED_EDIT_TIME'); + trigger_error('CANNOT_EDIT_MESSAGE_TIME'); } } @@ -233,6 +233,8 @@ function compose_pm($id, $mode, $action) $icon_id = 0; } + + $message_parser = new parse_message(); $message_subject = (isset($message_subject)) ? $message_subject : ''; @@ -243,6 +245,34 @@ function compose_pm($id, $mode, $action) $s_action .= ($msg_id) ? "&p=$msg_id" : ''; $s_action .= ($quote_post) ? "&q=1" : ''; + // Delete triggered ? + if ($action == 'delete') + { + // Folder id has been determined by the SQL Statement + // $folder_id = request_var('f', PRIVMSGS_NO_BOX); + + $s_hidden_fields = ''; + + // Do we need to confirm ? + if (confirm_box(true)) + { + delete_pm($user->data['user_id'], $msg_id, $folder_id); + + // TODO - jump to next message in "history"? + $meta_info = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=$folder_id"; + $message = $user->lang['MESSAGE_DELETED']; + + meta_refresh(3, $meta_info); + $message .= '

' . sprintf($user->lang['RETURN_FOLDER'], '', ''); + trigger_error($message); + } + else + { + // "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose" + confirm_box(false, 'DELETE_MESSAGE', $s_hidden_fields); + } + } + // Handle User/Group adding/removing handle_message_list_actions($address_list, $remove_u, $remove_g, $add_to, $add_bcc); @@ -301,34 +331,6 @@ function compose_pm($id, $mode, $action) $message_parser->bbcode_uid = $bbcode_uid; } - // Delete triggered ? - if ($action == 'delete') - { - // Get Folder ID - $folder_id = request_var('f', PRIVMSGS_NO_BOX); - - $s_hidden_fields = ''; - - // Do we need to confirm ? - if (confirm_box(true)) - { - delete_pm($user->data['user_id'], $msg_id, $folder_id); - - // TODO - jump to next message in "history"? - $meta_info = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=$folder_id"; - $message = $user->lang['PM_DELETED']; - - meta_refresh(3, $meta_info); - $message .= '

' . sprintf($user->lang['RETURN_FOLDER'], '', ''); - trigger_error($message); - } - else - { - // "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=compose" - confirm_box(false, 'DELETE_PM', $s_hidden_fields); - } - } - $html_status = ($config['allow_html'] && $config['auth_html_pm'] && $auth->acl_get('u_pm_html')); $bbcode_status = ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')); $smilies_status = ($config['allow_smilies'] && $config['auth_smilies_pm'] && $auth->acl_get('u_pm_smilies')); @@ -716,7 +718,7 @@ function compose_pm($id, $mode, $action) break; default: - trigger_error('NOT_AUTHORIZED'); + trigger_error('NO_ACTION_MODE'); } $s_hidden_fields = ''; @@ -738,7 +740,7 @@ function compose_pm($id, $mode, $action) 'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], - 'MINI_POST_IMG' => $user->img('icon_post', $user->lang['POST']), + 'MINI_POST_IMG' => $user->img('icon_post', $user->lang['PM']), 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', 'S_EDIT_POST' => ($action == 'edit'), diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index 69e802b4da..7b4a213e0b 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -17,6 +17,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit $redirect_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=options"; + // Change "full folder" setting - what to do if folder is full if (isset($_POST['fullfolder'])) { $full_action = request_var('full_action', 0); @@ -52,6 +53,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit } } + // Add Folder if (isset($_POST['addfolder'])) { $folder_name = request_var('foldername', ''); @@ -60,7 +62,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit { $sql = 'SELECT folder_name FROM ' . PRIVMSGS_FOLDER_TABLE . " - WHERE folder_name = '$folder_name' + WHERE folder_name = '" . $db->sql_escape($folder_name) . "' AND user_id = " . $user->data['user_id']; $result = $db->sql_query_limit($sql, 1); @@ -88,10 +90,148 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit $message = $user->lang['FOLDER_ADDED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); meta_refresh(3, $redirect_url); trigger_error($message); - } } + // Rename folder + if (isset($_POST['rename_folder'])) + { + $new_folder_name = request_var('new_folder_name', ''); + $rename_folder_id= request_var('rename_folder_id', 0); + + if (!$new_folder_name) + { + trigger_error('NO_NEW_FOLDER_NAME'); + } + + // Select custom folder + $sql = 'SELECT folder_name, pm_count + FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND folder_id = $rename_folder_id"; + $result = $db->sql_query_limit($sql, 1); + $folder_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$folder_row) + { + trigger_error('CANNOT_RENAME_FOLDER'); + } + + $sql = 'UPDATE ' . PRIVMSGS_FOLDER_TABLE . " + SET folder_name = '" . $db->sql_escape($new_folder_name) . "' + WHERE folder_id = $rename_folder_id + AND user_id = {$user->data['user_id']}"; + $db->sql_query($sql); + + $message = $user->lang['FOLDER_RENAMED'] . '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + meta_refresh(3, $redirect_url); + trigger_error($message); + } + + // Remove Folder + if (isset($_POST['remove_folder'])) + { + $remove_folder_id = request_var('remove_folder_id', 0); + + // Default to "move all messages to inbox" + $remove_action = request_var('remove_action', 1); + $move_to = request_var('move_to', PRIVMSGS_INBOX); + + // Move to same folder? + if ($remove_action == 1 && $remove_folder_id == $move_to) + { + trigger_error('CANNOT_MOVE_TO_SAME_FOLDER'); + } + + // Select custom folder + $sql = 'SELECT folder_name, pm_count + FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND folder_id = $remove_folder_id"; + $result = $db->sql_query_limit($sql, 1); + $folder_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$folder_row) + { + trigger_error('CANNOT_REMOVE_FOLDER'); + } + + $s_hidden_fields = ''; + $s_hidden_fields .= ''; + $s_hidden_fields .= ''; + $s_hidden_fields .= ''; + + // Do we need to confirm? + if (confirm_box(true)) + { + // Gather message ids + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE user_id = ' . $user->data['user_id'] . " + AND folder_id = $remove_folder_id"; + $result = $db->sql_query($sql); + + $msg_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $msg_ids[] = (int) $row['msg_id']; + } + $db->sql_freeresult($result); + + // First of all, copy all messages to another folder... or delete all messages + switch ($remove_action) + { + // Move Messages + case 1: + $message_limit = (!$user->data['group_message_limit']) ? $config['pm_max_msgs'] : $user->data['group_message_limit']; + $num_moved = move_pm($user->data['user_id'], $message_limit, $msg_ids, $move_to, $remove_folder_id); + + // Something went wrong, only partially moved? + if ($num_moved != $folder_row['pm_count']) + { + trigger_error(sprintf($user->lang['MOVE_PM_ERROR'], $num_moved, $folder_row['pm_count'])); + } + break; + + // Remove Messages + case 2: + delete_pm($user->data['user_id'], $msg_ids, $remove_folder_id); + break; + } + + // Remove folder + $sql = 'DELETE FROM ' . PRIVMSGS_FOLDER_TABLE . " + WHERE user_id = {$user->data['user_id']} + AND folder_id = $remove_folder_id"; + $db->sql_query($sql); + + // Check full folder option. If the removed folder has been specified as destination switch back to inbox + if ($user->data['user_full_folder'] == $remove_folder_id) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_full_folder = ' . PRIVMSGS_INBOX . ' + WHERE user_id = ' . $user->data['user_id']; + $db->sql_query($sql); + + $user->data['user_full_folder'] = PRIVMSGS_INBOX; + } + + $meta_info = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=$mode"; + $message = $user->lang['FOLDER_REMOVED']; + + meta_refresh(3, $meta_info); + $message .= '

' . sprintf($user->lang['RETURN_UCP'], '', ''); + trigger_error($message); + } + else + { + confirm_box(false, 'REMOVE_FOLDER', $s_hidden_fields); + } + } + + // Add Rule if (isset($_POST['add_rule'])) { $check_option = request_var('check_option', 0); @@ -116,14 +256,14 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit } $rule_ary = array( - 'user_id' => $user->data['user_id'], - 'rule_check' => $check_option, + 'user_id' => $user->data['user_id'], + 'rule_check' => $check_option, 'rule_connection' => $rule_option, - 'rule_string' => $rule_string, - 'rule_user_id' => $rule_user_id, - 'rule_group_id' => $rule_group_id, - 'rule_action' => $action, - 'rule_folder_id'=> $folder_id + 'rule_string' => $rule_string, + 'rule_user_id' => $rule_user_id, + 'rule_group_id' => $rule_group_id, + 'rule_action' => $action, + 'rule_folder_id' => $folder_id ); $sql = 'SELECT rule_id @@ -145,6 +285,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit trigger_error($message); } + // Remove Rule if (isset($_POST['delete_rule']) && !isset($_POST['cancel'])) { $delete_id = array_map('intval', array_keys($_POST['delete_rule'])); @@ -157,7 +298,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit $s_hidden_fields = ''; - // Do we need to confirm ? + // Do we need to confirm? if (confirm_box(true)) { $sql = 'DELETE FROM ' . PRIVMSGS_RULES_TABLE . ' @@ -176,7 +317,6 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit { confirm_box(false, 'DELETE_RULE', $s_hidden_fields); } - } $folder = array(); @@ -216,7 +356,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit if ($user->data['user_full_folder'] == FULL_FOLDER_NONE) { // -3 here to let the correct folder id be selected - $to_folder_id = $config['full_folder_action']-3; + $to_folder_id = $config['full_folder_action'] - 3; } else { @@ -245,6 +385,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit case 1: $s_delete_checked = ' checked="checked"'; break; + case 2: $s_hold_checked = ' checked="checked"'; break; diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 9e186f4ca4..059760c500 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -129,6 +129,7 @@ function view_folder($id, $mode, $folder_id, $folder, $type) // Generate all URIs ... $message_author = "' . $row['username'] . ''; $view_message_url = "$url&f=$folder_id&p=$message_id"; + $remove_message_url = "$url&mode=compose&action=delete&p=$message_id"; $row_indicator = ''; foreach ($color_rows as $var) @@ -159,8 +160,10 @@ function view_folder($id, $mode, $folder_id, $folder, $type) 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment'] && $config['allow_pm_attach'] && $config['auth_download_pm']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['message_attachment'])) : '', 'S_PM_REPORTED' => (!empty($row['message_reported']) && $auth->acl_get('m_')) ? true : false, + 'S_PM_DELETED' => ($row['deleted']) ? true : false, - 'U_VIEW_PM' => $view_message_url, + 'U_VIEW_PM' => ($row['deleted']) ? '' : $view_message_url, + 'U_REMOVE_PM' => ($row['deleted']) ? $remove_message_url : '', 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '', 'U_MCP_REPORT' => "{$phpbb_root_path}mcp.$phpEx?sid={$user->session_id}&mode=reports&pm=$message_id") // 'U_MCP_QUEUE' => "mcp.$phpEx?sid={$user->session_id}&mode=mod_queue&t=$topic_id") @@ -182,7 +185,7 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder') { global $user, $db, $template, $config, $auth, $_POST; - $start = request_var('start', 0); + $start = request_var('start', 0); $sort_days = (isset($_REQUEST['st'])) ? max(intval($_REQUEST['st']), 0) : ((!empty($user->data['user_show_days'])) ? $user->data['user_show_days'] : 0); $sort_key = (!empty($_REQUEST['sk'])) ? htmlspecialchars($_REQUEST['sk']) : ((!empty($user->data['user_sortby_type'])) ? $user->data['user_sortby_type'] : 't'); @@ -191,7 +194,7 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder') // PM ordering options $limit_days = array(0 => $user->lang['ALL_MESSAGES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); - $sort_by_sql = array('a' => 'u.username', 't' => 'p.message_time', 's' => 'p.subject'); + $sort_by_sql = array('a' => 'u.username', 't' => 'p.message_time', 's' => 'p.message_subject'); $sort_key = (!in_array($sort_key, array('a', 't', 's'))) ? 't' : $sort_key; @@ -319,7 +322,7 @@ function get_pm_from($folder_id, $folder, $user_id, $url, $type = 'folder') $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); - while($row = $db->sql_fetchrow($result)) + while ($row = $db->sql_fetchrow($result)) { $rowset[$row['msg_id']] = $row; $pm_list[] = $row['msg_id']; diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 2e7115e842..b8edbcc0db 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -21,6 +21,12 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) $folder_id = (int) $folder_id; $author_id = (int) $message_row['author_id']; + // Not able to view message, it was deleted by the sender + if ($message_row['deleted']) + { + trigger_error('NO_AUTH_READ_REMOVED_MESSAGE'); + } + // Grab icons $icons = array(); obtain_icons($icons); @@ -157,7 +163,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'AUTHOR_FROM' => (!empty($user_info['user_from'])) ? $user_info['user_from'] : '', 'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($user_info['online']) ? $user->img('btn_online', $user->lang['ONLINE']) : $user->img('btn_offline', $user->lang['OFFLINE'])), - 'DELETE_IMG' => $user->img('btn_delete', $user->lang['DELETE_PM']), + 'DELETE_IMG' => $user->img('btn_delete', $user->lang['DELETE_MESSAGE']), 'INFO_IMG' => $user->img('btn_info', $user->lang['VIEW_PM_INFO']), 'REPORT_IMG' => $user->img('btn_report', $user->lang['REPORT_PM']), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['MESSAGE_REPORTED_MESSAGE']), diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 164f862e43..f107e4ac0e 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -37,7 +37,7 @@ $lang += array( 'ADD_BCC' => 'Add [Bcc]', 'ADD_FOES' => 'Add new foes', 'ADD_FOES_EXPLAIN' => 'You may enter several usernames each on a different line', - 'ADD_FOLDER' => 'Add Folder', + 'ADD_FOLDER' => 'Add folder', 'ADD_FRIENDS' => 'Add new friends', 'ADD_FRIENDS_EXPLAIN' => 'You may enter several usernames each on a different line', 'ADD_NEW_RULE' => 'Add new Rule', @@ -68,6 +68,10 @@ $lang += array( 'BOOKMARKS_DISABLED' => 'Bookmarks are disabled on this board', 'BOOKMARKS_REMOVED' => 'Bookmarks removed successfully', + 'CANNOT_EDIT_MESSAGE_TIME' => 'You can no longer edit or delete that message', + 'CANNOT_MOVE_TO_SAME_FOLDER'=> 'Messages can not be moved to the folder which will be removed.', + 'CANNOT_RENAME_FOLDER' => 'This folder can not be renamed.', + 'CANNOT_REMOVE_FOLDER' => 'This folder can not be removed.', 'CHANGE_PASSWORD' => 'Change password', 'CHANGE_PASSWORD_EXPLAIN' => 'Must be between %1$d and %2$d characters.', 'CLICK_RETURN_FOLDER' => 'Click %1$sHere%2$s to return to your "%3$s" Folder', @@ -107,7 +111,9 @@ $lang += array( 'DELETE_MARKED_PM' => 'Delete Marked Messages', 'DELETE_MARKED_PM_CONFIRM' => 'Are you sure you want to delete all marked messages?', 'DELETE_OLDEST_MESSAGES' => 'Delete Oldest Messages', - 'DELETE_PM' => 'Delete PM', + 'DELETE_MESSAGE' => 'Delete Message', + 'DELETE_MESSAGE_CONFIRM' => 'Are you sure you want to delete this private message?', + 'DELETE_MESSAGES_IN_FOLDER' => 'Delete all messages within removed folder', 'DELETE_RULE' => 'Delete Rule', 'DELETE_RULE_CONFIRM' => 'Are you sure you want to delete this rule?', 'DISABLE_CENSORS' => 'Enable Word censoring', @@ -144,6 +150,8 @@ $lang += array( 'FOLDER_MESSAGE_STATUS' => '%1$d from %2$d messages stored', 'FOLDER_NAME_EXIST' => 'Folder %s already exist', 'FOLDER_OPTIONS' => 'Folder Options', + 'FOLDER_RENAMED' => 'Folder successfully renamed', + 'FOLDER_REMOVED' => 'Folder successfully removed', 'FOLDER_STATUS_MSG' => 'Folder is %1$d%% full (%2$d from %3$d messages stored)', 'FORWARD_PM' => 'Forward PM', 'FRIEND_MESSAGE' => 'Message from friend', @@ -179,16 +187,18 @@ $lang += array( 'MAX_FOLDER_REACHED' => 'Maximum number of allowed user defined folder reached', 'MESSAGE_COLOURS' => 'Message Colours', 'MESSAGE_HISTORY' => 'Message History', + 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message has been removed by it\'s author before it was delivered', 'MESSAGE_REPORTED' => 'Click to view reports', 'MESSAGE_REPORTED_MESSAGE' => 'Reported Message', 'MESSAGE_STORED' => 'The message has been send successfully', - 'MINIMUM_KARMA' => 'Minimum User Karma', - 'MINIMUM_KARMA_EXPLAIN' => 'Posts by users with Karma less than this will be ignored.', + 'MOVE_DELETED_MESSAGES_TO' => 'Move messages from removed folder to', 'MOVE_DOWN' => 'Move down', + 'MOVE_PM_ERROR' => 'An error occurred while moving the messages to the new folder, only %1d from %2d messages were moved.', 'MOVE_TO_FOLDER' => 'Move to Folder', 'MOVE_UP' => 'Move up', 'NEW_EMAIL_ERROR' => 'The email addresses you entered do not match.', + 'NEW_FOLDER_NAME' => 'New folder name', 'NEW_PASSWORD' => 'Password', 'NEW_PASSWORD_ERROR' => 'The passwords you entered do not match.', 'NEW_PASSWORD_EXPLAIN' => 'Must be between %1$d and %2$d characters.', @@ -202,10 +212,26 @@ $lang += array( 'NOT_ENOUGH_SPACE_FOLDER' => 'The Destination Folder "%s" seems to be full. The requested action has not been taken.', 'NOT_MOVED_MESSAGE' => 'You have 1 private message currently on hold because of full folder.', 'NOT_MOVED_MESSAGES' => 'You have %d private messages currently on hold because of full folder.', + 'NO_ACTION_MODE' => 'No message action specified', + 'NO_AUTHOR' => 'No author defined for this message', + + 'NO_AUTH_DELETE_MESSAGE' => 'You are not authorized to delete private messages.', + 'NO_AUTH_EDIT_MESSAGE' => 'You are not authorized to edit private messages.', + 'NO_AUTH_FORWARD_MESSAGE' => 'You are not authorized to forward private messages.', + 'NO_AUTH_GROUP_MESSAGE' => 'You are not authorized to send private messages to groups.', + 'NO_AUTH_QUOTE_MESSAGE' => 'You are not authorized to quote private messages.', + 'NO_AUTH_READ_MESSAGE' => 'You are not authorized to read private messages.', + 'NO_AUTH_READ_REMOVED_MESSAGE' => 'You are not able to read this message because it was removed by the author.', + 'NO_AUTH_REPLY_MESSAGE' => 'You are not authorized to reply to private messages.', + 'NO_AUTH_SEND_MESSAGE' => 'You are not authorized sending private messages.', + + 'NO_BOOKMARKS_SELECTED' => 'You have selected no bookmarks', 'NO_FOES' => 'No foes currently defined', 'NO_FRIENDS' => 'No friends currently defined', 'NO_FRIENDS_OFFLINE' => 'No friends offline', 'NO_FRIENDS_ONLINE' => 'No friends online', + 'NO_MESSAGE' => 'Private Message could not be found', + 'NO_NEW_FOLDER_NAME' => 'You have to specify a new folder name', 'NO_NEWER_PM' => 'No newer messages', 'NO_OLDER_PM' => 'No older messages', 'NO_RECIPIENT' => 'No recipient defined', @@ -245,10 +271,14 @@ $lang += array( 'REMOVE_SELECTED_BOOKMARKS_CONFIRM' => 'Are you sure you want to delete all selected bookmarks?', 'REMOVE_BOOKMARK_MARKED' => 'Remove marked bookmarks', 'REMOVE_FOLDER' => 'Remove folder', + 'REMOVE_FOLDER_CONFIRM' => 'Are you sure you want to remove this folder?', + 'RENAME' => 'Rename', + 'RENAME_FOLDER' => 'Rename folder', 'REPLIED_MESSAGE' => 'Replied to Message', 'REPORT_PM' => 'Report PM', 'REPORT_PM_NOTIFY' => 'Send report notifications as PM', 'REPORT_PM_NOTIFY_EXPLAIN' => 'If enabled, notifications and status updates to new reports get send as PM instead of emailing them.', + 'RETURN_FOLDER' => 'Click %1$sHere%2$s to return to folder', 'RETURN_UCP' => 'Click %sHere%s to return to the User Control Panel', 'RULE_ADDED' => 'Rule successfully added', 'RULE_ALREADY_DEFINED' => 'This rule was defined previously', diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php index 0769970918..ff8f4d1e40 100644 --- a/phpBB/language/en/viewforum.php +++ b/phpBB/language/en/viewforum.php @@ -47,6 +47,8 @@ $lang += array( 'POST_FORUM_LOCKED' => 'Forum is locked', 'POST_NEW_TOPIC' => 'Post new topic', + 'SORRY_AUTH_READ' => 'You are not authorized to read this forum', + 'TOPICS_MARKED' => 'The topics for this forum have now been marked read', 'VIEW_FORUM' => 'View Forum', diff --git a/phpBB/styles/subSilver/template/ucp_pm_message_header.html b/phpBB/styles/subSilver/template/ucp_pm_message_header.html index 24476f3770..ff2c80e5a4 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/subSilver/template/ucp_pm_message_header.html @@ -17,7 +17,7 @@ function marklist(form_name, status) {L_UNREAD_MESSAGES}{FOLDER_STATUS} - {L_PM_INBOX}{L_PM_INBOX} | {L_PM_OUTBOX}{L_PM_OUTBOX} | {L_PM_SENTBOX}{L_PM_SENTBOX} | {L_CREATE_FOLDER} + {L_PM_INBOX}{L_PM_INBOX} | {L_PM_OUTBOX}{L_PM_OUTBOX} | {L_PM_SENTBOX}{L_PM_SENTBOX} | {L_CREATE_FOLDER} diff --git a/phpBB/styles/subSilver/template/ucp_pm_options.html b/phpBB/styles/subSilver/template/ucp_pm_options.html index 90ce7ccb11..8741ae7b4c 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_options.html +++ b/phpBB/styles/subSilver/template/ucp_pm_options.html @@ -93,6 +93,27 @@
+ + + + + + + + + + + + + + + + +
{L_RENAME_FOLDER}
{L_RENAME_FOLDER}:
{L_NEW_FOLDER_NAME}:
+ +
+ + @@ -121,20 +142,20 @@ - + - + - + - +
{L_ADD_FOLDER}
{L_REMOVE_FOLDER}: {L_AND}
  Move messages from removed folder to   {L_MOVE_DELETED_MESSAGES_TO}  
  Delete all messages within removed folder {L_DELETE_MESSAGES_IN_FOLDER}
 
diff --git a/phpBB/styles/subSilver/template/ucp_pm_popup.html b/phpBB/styles/subSilver/template/ucp_pm_popup.html index 08314acf87..ba7421dd39 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_popup.html +++ b/phpBB/styles/subSilver/template/ucp_pm_popup.html @@ -15,7 +15,14 @@ function jump_to_inbox() - +

{MESSAGE}

{L_CLOSE_WINDOW}

+
+ + {L_LOGIN_CHECK_PM} + + {MESSAGE}

{CLICK_TO_VIEW} + +

{L_CLOSE_WINDOW}

diff --git a/phpBB/styles/subSilver/template/ucp_pm_viewfolder.html b/phpBB/styles/subSilver/template/ucp_pm_viewfolder.html index fc538e4266..7227377f99 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/subSilver/template/ucp_pm_viewfolder.html @@ -41,7 +41,7 @@ {messagerow.PM_ICON_IMG} - + {REPORTED_IMG}  @@ -50,7 +50,15 @@ {messagerow.PM_IMG}  -

{messagerow.ATTACH_ICON_IMG} {messagerow.SUBJECT}

+

+ {messagerow.ATTACH_ICON_IMG} + + {L_MESSAGE_REMOVED_FROM_OUTBOX}
+ {L_DELETE_MESSAGE} + + {messagerow.SUBJECT} + +

{messagerow.RECIPIENTS}{messagerow.MESSAGE_AUTHOR}

{messagerow.FOLDER}{L_UNKNOWN_FOLDER}