|
|
@@ -646,7 +646,7 @@ function tblMsgsLoadMoreRows(n) {
|
|
|
if (!$res || $db->has_errors()) throw new Exception("Wystąpiły błędy podczas próby zapisu wiadomości: " . implode("\n<br>", $db->get_errors()));
|
|
|
}
|
|
|
|
|
|
- public function viewMsg($msg) {
|
|
|
+ public function viewMsg__OLD($msg) {
|
|
|
$tblName = $msg['tblName'];
|
|
|
$usrLogin = $msg['usrLogin'];
|
|
|
$idTable = ProcesHelper::getZasobTableID($tblName);
|
|
|
@@ -706,7 +706,33 @@ function tblMsgsLoadMoreRows(n) {
|
|
|
if (V::get('DBG_VIEW', '', $_GET)) $this->_testViewMsg($msg);
|
|
|
}
|
|
|
|
|
|
- public function _testViewMsg($msg) {
|
|
|
+ public function viewMsg($msg) {
|
|
|
+ $usrLogin = User::getLogin();
|
|
|
+ $idTable = 0;
|
|
|
+ if (!empty($msg['tblName'])) {
|
|
|
+ $tblName = $msg['tblName'];
|
|
|
+ $idTable = ProcesHelper::getZasobTableID($tblName);
|
|
|
+ if (!$idTable) throw new Exception("Nie udało się odnaleźć nr tabeli '{$tblName}'");
|
|
|
+ $idRow = $msg['idRow'];
|
|
|
+ $usrAcl = User::getAcl();
|
|
|
+ $tblAcl = $usrAcl->getTableAcl($idTable);
|
|
|
+ }
|
|
|
+ $linkBase = "index.php?_route=UserMsgs";
|
|
|
+ $linkBase .= "&usrLogin={$usrLogin}";
|
|
|
+ //$rmMsgLink = "{$linkBase}&_task=removeMsg&id={$msg['_raw']->ID}";
|
|
|
+ $backLink = "{$linkBase}";
|
|
|
+ ?>
|
|
|
+<div class="container">
|
|
|
+ <h3><i class="glyphicon glyphicon-envelope"></i> <a href="<?php echo $backLink; ?>">Wiadomości <?php echo $usrLogin; ?></a>
|
|
|
+ » Wiadomość nr <?php echo $msg['_raw']->ID; ?>
|
|
|
+ <?php if ($idTable > 0) : ?>
|
|
|
+ <br><small>wiadomość powiązana z rekordem <a href="index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $idTable; ?>#EDIT/<?php echo $idRow; ?>"><?php echo $idRow; ?></a>
|
|
|
+ z tabeli <a href="index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $idTable; ?>"><?php echo $tblAcl->getLabel(); ?></a>
|
|
|
+ </small>
|
|
|
+ <?php endif; ?>
|
|
|
+ </h3>
|
|
|
+</div>
|
|
|
+<?php
|
|
|
$messageList = array();
|
|
|
$uiTargetName = $msg['_raw']->uiTargetName;
|
|
|
$uiTargetType = $msg['_raw']->uiTargetType;
|
|
|
@@ -841,7 +867,7 @@ function tblMsgsLoadMoreRows(n) {
|
|
|
};
|
|
|
})(),
|
|
|
saveReply: function(data, callback) {
|
|
|
- console.log('#widget-msg-tree/MsgThread::saveReply: data:', data, 'callback', callback);
|
|
|
+ //console.log('#widget-msg-tree/MsgThread::saveReply: data:', data, 'callback', callback);
|
|
|
$.ajax({
|
|
|
url: '<?php echo $replyLink; ?>',
|
|
|
method: 'POST',
|