ソースを参照

show value on inline edit if has perm to read

Piotr Labudda 10 年 前
コミット
64d18b151b
1 ファイル変更17 行追加6 行削除
  1. 17 6
      SE/se-lib/TableAjax.php

+ 17 - 6
SE/se-lib/TableAjax.php

@@ -4049,14 +4049,25 @@ function <?php echo $jsToogleFiltrProcesuFunctionName; ?>(n) {
 			<?php endif; ?>
 		</label>
 		<?php
-			echo $this->_acl->showFormItem('W', $fieldID, "f{$fieldID}", $fieldVal, $fieldParams, $row);
-			if ($typeSpecial
-					|| $this->_acl->isDateField($fieldName)
-					|| $this->_acl->isDateTimeField($fieldName)
-				 ) {
-				echo '<p style="padding:120px 0;"></p>';
+			if (!$this->_acl->isAllowed($fieldID, 'W', $row)) {
+				// TODO: hide Zapisz btn on frontend side
+				if (!$this->_acl->isAllowed($fieldID, 'R', $row)) {
+					SE_Layout::alert('warning', "Brak uprawnień do odczytu i zapisu");
+				} else {
+					echo '<p style="margin-top:16px">' . $fieldVal . '</p>';
+					SE_Layout::alert('warning', "Brak uprawnień do zapisu");
+				}
+			} else {
+				echo $this->_acl->showFormItem('W', $fieldID, "f{$fieldID}", $fieldVal, $fieldParams, $row);
+				if ($typeSpecial
+						|| $this->_acl->isDateField($fieldName)
+						|| $this->_acl->isDateTimeField($fieldName)
+				) {
+					echo '<p style="padding:120px 0;"></p>';
+				}
 			}
 
+
 		$response['legacy_html'] = ob_get_clean();
 		//$response['legacy_html'] = utf8_encode($response['legacy_html']);// pl chars bug
 		return $response;