Explorar el Código

UserMsgs: replace view function, fixed dbg

Piotr Labudda hace 10 años
padre
commit
005d1b7618
Se han modificado 2 ficheros con 29 adiciones y 3 borrados
  1. 29 3
      SE/se-lib/Route/UserMsgs.php
  2. 0 0
      SE/stuff/bundle.se_route_user_msgs.js

+ 29 - 3
SE/se-lib/Route/UserMsgs.php

@@ -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>
+		&raquo; 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',

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
SE/stuff/bundle.se_route_user_msgs.js


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio