PHPOS Web Operating system MIT License (c) 2013 Marcin Szczyglinski szczyglis83@gmail.com GitHUB: https://github.com/phpos/ File version: 1.0.0, 2013.10.08 ********************************** */ if (!defined('PHPOS')) { die; } $msg_id = $my_app->get_param('msg_id'); if ($msg_id === null) { $msg = new phpos_messages(); $c = $msg->count_sended(); echo $layout->subtitle(txt('messager_sended_title'), MY_RESOURCES_URL . 'msg_sended.png'); echo $layout->txtdesc(txt('messager_sended_desc')); echo $layout->tbl_start(); echo $layout->head(array('' => '5%', txt('messager_tbl_message') => '40%', '<img style="display:inline-block; vertical-align:middle" src="' . MY_RESOURCES_URL . 'time_icon.png" /> ' . txt('messager_tbl_sended') => '15%', '<img style="display:inline-block; vertical-align:middle" src="' . MY_RESOURCES_URL . 'time_icon.png" /> ' . txt('messager_tbl_readed') => '15%', '<img style="display:inline-block; vertical-align:middle" src="' . MY_RESOURCES_URL . 'user_icon.png" />' . txt('messager_tbl_to') => '15%', txt('messager_tbl_actions') => '15%')); if ($c != 0) { $records = $msg->get_sended(); foreach ($records as $row) { $icon = MY_RESOURCES_URL . 'readed_icon.png'; $readed = date('Y.m.d H:i', $row['readed_at']); $title = $row['title']; if (!$msg->is_readed($row['id'])) { $icon = MY_RESOURCES_URL . 'unreaded_icon.png'; $title = '<b>' . $row['title'] . '</b>'; $readed = txt('messager_tbl_not_yet');
$i = 0; $my_id = logged_id(); foreach ($users_ids as $id) { $usr_info = new phpos_users(); $usr_info->set_id_user($id); $usr_info->get_user_by_id(); $items[$id] = $usr_info->get_user_login(); if ($my_id == $id) { $items[$id] = txt('messager_tbl_me'); } $i++; } $reply_id = $my_app->get_param('reply_id'); $start_user_to = ''; $start_title = ''; $start_msg = ''; if ($reply_id !== null) { $msg = new phpos_messages(); $reply = $msg->get_msg($reply_id); $start_user_to = $reply['id_user_from']; $start_title = 'Re: ' . $reply['title']; $start_msg = '<br /><br />------------------------<br /><b>Reply for message:</b><br />Sent: ' . date('Y.m.d H:i:s', $reply['sended_at']) . '<br /><i>' . $reply['msg'] . '</i><br />------------------------'; } $form->select('msg_to', txt('messager_form_to'), txt('messager_form_to_desc'), $items, $start_user_to); echo $form->render(); echo $layout->end('column'); echo $layout->clr(); $form->texteditor('msg_body', null, null, $start_msg); $form->submit('', txt('messager_btn_send')); echo $form->render(); echo $form->form_end();
_phpos/logo.png" /> <br/>v.<?php echo PHPOS_VERSION_NAME; ?> <br/> <?php echo PHPOS_BUILD; ?> <br /> <?php echo txt('language') . ':' . strtoupper($config->get_user('lang')); ?> </div> <?php $msg = new phpos_messages(); if ($msg->have_unreaded()) { $msg_message = txt('messager_tray_got_now_messages') . '<br/><a href="javascript:open_msg()" ><span style="font-size:14px"><b>' . txt('messager_tray_click_to_read') . '</b></span></a>'; $link = helper::win(txt('updater_tray_title'), 'app', 'app_id:messenger'); echo ' <script> function open_msg() { ' . $link . ' } </script>'; msg::messenger($msg_message); } if ($updater_message !== null) { $link = helper::win(txt('updater_tray_title'), 'app', 'app_id:updater'); echo ' <script>
PHPOS Web Operating system MIT License (c) 2013 Marcin Szczyglinski szczyglis83@gmail.com GitHUB: https://github.com/phpos/ File version: 1.0.0, 2013.10.08 ********************************** */ if (!defined('PHPOS')) { die; } global $footer; echo $layout->back_button(null, helper_reload(array('msg_id' => null)), null, null); $msg = new phpos_messages(); $msg_data = $msg->get_msg($my_app->get_param('msg_id')); $form = new phpos_forms(); //$form->onsuccess(helper_reload(array('section' => 'sended'))); echo $form->form_start('', '', array('app_params' => '')); $form->texteditor('msg_body', null, null, $msg_data['msg']); if ($msg->is_to_me($my_app->get_param('msg_id'))) { $u = new phpos_users(); $u->set_id_user($msg_data['id_user_from']); $u->get_user_by_id(); $authors = '<span style="color:black; font-weight:bold;font-size:16px">' . txt('messager_tbl_from') . ': ' . $u->get_user_login() . ' </span>'; $form->button(txt('messager_btn_reply'), helper_reload(array('section' => 'new', 'reply_id' => $my_app->get_param('msg_id'))), 'reply'); } else { $u = new phpos_users(); $u->set_id_user($msg_data['id_user_to']); $u->get_user_by_id();
PHPOS Web Operating system MIT License (c) 2013 Marcin Szczyglinski szczyglis83@gmail.com GitHUB: https://github.com/phpos/ File version: 1.0.0, 2013.10.08 ********************************** */ if (!defined('PHPOS')) { die; } $tray['id'] = 'messenger'; $tray['access_level'] = 1; $tray['version'] = 1.0; $tray['load_only_with_app'] = false; $tray['app_id'] = 'messenger'; $tray['use_custom_icons'] = true; $tray['use_lang'] = true; $tmp_context_menu = array(); $tray['icons'] = array(ICONS . 'tray/messager.png'); $tray['title'] = txt('messager_tray_tip_no_messages'); $tmp_context_menu[] = 'app::<b>' . txt('tray_messager_open') . '</b>::' . helper::win(txt('app_messager'), 'app', 'app_id:messenger') . '::letter'; $tray['context_menu'] = $tmp_context_menu; $msg = new phpos_messages(); if ($msg->have_unreaded()) { $how_many_new = $msg->count_unreaded(); $tray['icons'] = array(ICONS . 'tray/messager_alert.png'); $tray['title'] = txt('messager_tray_tip_new_messages') . ': ' . $how_many_new; }
$my_app->set_param('delete_id', ''); $my_app->set_param('delete_sended_id', null); $my_app->set_param('delete_received_id', null); $my_app->set_param('msg_id', null); $my_app->set_param('reply_id', null); $my_app->set_param('section', 'received'); $my_app->set_param('action', null); $my_app->using('params'); $my_app->using('toolbar'); winConfig('use_sections'); cache_param('section'); cache_param('delete_sended_id'); cache_param('delete_received_id'); cache_param('reply_id'); //cache_param('msg_id'); $msg = new phpos_messages(); if ($my_app->get_param('msg_id') !== null && $my_app->get_param('delete_received_id') === null) { if (globalconfig('demo_mode') != 1 || is_root()) { if (!$msg->is_readed($my_app->get_param('msg_id')) && $msg->is_to_me($my_app->get_param('msg_id'))) { $msg->set_as_readed($my_app->get_param('msg_id')); } } } if (globalconfig('demo_mode') != 1 || is_root()) { if ($my_app->get_param('delete_sended_id') !== null) { $msg->delete_sended($my_app->get_param('delete_sended_id')); $my_app->set_param('delete_sended_id', null); cache_param('delete_sended_id'); } if ($my_app->get_param('delete_received_id') !== null) { $msg->delete_received($my_app->get_param('delete_received_id'));