Преглед изворни кода

fixed process tree questions tooltip view

Piotr Labudda пре 7 година
родитељ
комит
0e66ac9139
2 измењених фајлова са 83 додато и 46 уклоњено
  1. 83 46
      SE/procesy5.php
  2. 0 0
      SE/static/p5UI/table.js

+ 83 - 46
SE/procesy5.php

@@ -1756,6 +1756,14 @@ a.btn-sm {font-size:x-small;}
 " . '</style>' . "\n";
 " . '</style>' . "\n";
 }
 }
 
 
+function view_CRM_PROCES_Helper__get_class($procesType) {
+	switch ($procesType) {
+		case 'PROCES_INIT': return 'red';
+		case 'PROCES_GROUP_1': return 'group1';
+		case 'PROCES_GROUP_2': return 'group2';
+		default: return null;
+	}
+}
 
 
 function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 //	$dbg=debug_backtrace();
 //	$dbg=debug_backtrace();
@@ -1829,21 +1837,19 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 
 
 	if (!empty($wsk)) echo'<div class="has_wsk">';
 	if (!empty($wsk)) echo'<div class="has_wsk">';
 
 
-	$out_id = ($r->ID < 10)? '&nbsp;'.$r->ID.'' : $r->ID;
-	$proces_type_css_class = null;
-	if ($r->TYPE == 'PROCES_INIT') {
-		$proces_type_css_class = 'red';
-	} else if ($r->TYPE == 'PROCES_GROUP_1') {
-		$proces_type_css_class = 'group1';
-	} else if ($r->TYPE == 'PROCES_GROUP_2') {
-		$proces_type_css_class = 'group2';
-	}
-
-	$cls = array();
-	$cls[] = 'item_id';
-	$cls[] = 'btn-box';
-	if ($proces_type_css_class) $cls[] = 'btn-box-'.$proces_type_css_class;
-	echo App::link($out_id, array('task'=>"CRM_PROCES", 'filtr_id'=>$r->ID, '#'=>'TREE'.$r->ID), array('class'=>implode(' ', $cls)));
+	$out_id = ($r->ID < 10) ? "&nbsp;{$r->ID}" : $r->ID;
+	$proces_type_css_class = view_CRM_PROCES_Helper__get_class($r->TYPE);
+	echo App::link($out_id, [
+		'task' => "CRM_PROCES",
+		'filtr_id' => $r->ID,
+		'#' => "TREE{$r->ID}"
+	], [
+		'class' => implode(' ', [
+			'item_id',
+			'btn-box',
+			($proces_type_css_class) ? "btn-box-{$proces_type_css_class}" : ''
+		])
+	]);
 
 
 	//if($r->TYPE == 'PROCES_INIT')  {
 	//if($r->TYPE == 'PROCES_INIT')  {
 	$tree->log('show item -> fetch-IF_TRUE_GOTO start');
 	$tree->log('show item -> fetch-IF_TRUE_GOTO start');
@@ -1856,9 +1862,9 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 		$linkStyle = '';
 		$linkStyle = '';
 		if ('popover' == $linkStyle) {
 		if ('popover' == $linkStyle) {
 			?>
 			?>
-				<a href="<?php echo $popupLink; ?>"><i class="<?php echo $popupIcon; ?> wsk-help popover-with-html">
-					<span class="popover-heading"><?php echo $popupTitle; ?></span>
-					<span class="popover-body"><?php echo $popupContent; ?></span>
+				<a href="<?php echo $popupLink; ?>"><i class="<?php echo $popupIcon; ?> wsk-help popover-with-html p5-L<?= __LINE__; ?>">
+					<div class="popover-heading"><?php echo $popupTitle; ?></div>
+					<div class="popover-body"><?php echo $popupContent; ?></div>
 				</i><?php echo $gotoId; ?></a>
 				</i><?php echo $gotoId; ?></a>
 			<?php
 			<?php
 		} else {
 		} else {
@@ -1924,9 +1930,9 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 						$popupTitle = "#{$pytanie->ID} " . htmlspecialchars($pytanie->PYTANIE);
 						$popupTitle = "#{$pytanie->ID} " . htmlspecialchars($pytanie->PYTANIE);
 						$popupContent = implode('<hr style="margin:0.5em 0;">', $odpowiedzi);
 						$popupContent = implode('<hr style="margin:0.5em 0;">', $odpowiedzi);
 						?>
 						?>
-							<a target="_blank" href="<?php echo $popupLink; ?>"><i class="<?php echo $popupIcon; ?> wsk-help popover-with-html">
-								<span class="popover-heading"><?php echo $popupTitle; ?></span>
-								<span class="popover-body"><?php echo $popupContent; ?></span>
+							<a target="_blank" href="<?= $popupLink; ?>"><i class="<?= $popupIcon; ?> wsk-help popover-with-html p5-L<?= __LINE__; ?>">
+								<div class="popover-heading"><?= $popupTitle; ?></div>
+								<div class="popover-body"><?= $popupContent; ?></div>
 							</i></a>
 							</i></a>
 						<?php
 						<?php
 					}
 					}
@@ -1969,20 +1975,45 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 	}
 	}
 
 
 	echo'<span class="desc">';
 	echo'<span class="desc">';
-		$cls = ($proces_type_css_class)? ' class="desc-'.$proces_type_css_class.'"' : '';
-		echo'<b'.$cls.'>'.$r->DESC.'</b>';
+		echo UI::h('b', [
+			'class' => ($proces_type_css_class) ? "desc-{$proces_type_css_class}" : "",
+		], $r->DESC);
 		{// status ico
 		{// status ico
 			if ($r->TYPE == 'PROCES_INIT') {
 			if ($r->TYPE == 'PROCES_INIT') {
-				$status_ico = ($r->A_STATUS == 'NORMAL')? "icon/status-ok.gif" : "icon/status-notok.gif";
-				echo'<img src="'.$status_ico.'" alt="'.$r->A_STATUS.'" width="16" title="'."Status: ".$r->A_STATUS." ".$r->L_APPOITMENT_DATE.'" style="vertical-align:middle;cursor:help" />';
-				echo "<a href=?task=PROCES_VIEW&id_proces=".$r->ID."&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1>P</a>";
-				echo "<a href=?task=PROCES_VIEW_LIST&id_proces=".$r->ID."&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1>L</a>";
-				echo "<a href=index.php?FUNCTION_INIT=GRAPH_VIEW_PROCES&id_proces={$r->ID} target=blank>M</a>";
-			} else {
-				if ( strstr($r->TYPE,'PROCES_GROUP')) {
-					echo "&nbsp;<a href=?task=PROCES_VIEW_LIST&id_proces=".$r->ID."&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1>L</a>";
-					echo " <a href=index.php?FUNCTION_INIT=GRAPH_VIEW_PROCES&id_proces={$r->ID}&PROCES_INIT_SCAN=1 target=blank>M</a>";
-				}
+				echo implode(' ', [
+					"&nbsp;",
+					UI::h('img', [
+						'src' => ($r->A_STATUS == 'NORMAL') ? "icon/status-ok.gif" : "icon/status-notok.gif",
+						'alt' => $r->A_STATUS,
+						'width' => "16",
+						'title' => "Status: {$r->A_STATUS} {$r->L_APPOITMENT_DATE}",
+						'style' => "vertical-align:middle;cursor:help",
+					]),
+					UI::h('a', [ 'href' => "procesy5.php?task=PROCES_VIEW&id_proces={$r->ID}&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1",
+						'class' => "btn btn-xs btn-default",
+						'title' => "Przeglądaj proces {$r->ID} (drzewo)"
+					], "P"),
+					UI::h('a', [ 'href' => "procesy5.php?task=PROCES_VIEW_LIST&id_proces={$r->ID}&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1",
+						'class' => "btn btn-xs btn-default",
+						'title' => "Przeglądaj proces {$r->ID} (lista)"
+					], "L"),
+					UI::h('a', [ 'href' => "index.php?FUNCTION_INIT=GRAPH_VIEW_PROCES&id_proces={$r->ID}",
+						'class' => "btn btn-xs btn-default",
+						'title' => "Mapa procesu"
+					], "M"),
+				]);
+			} else if ('PROCES_GROUP' === substr($r->TYPE, 0, strlen('PROCES_GROUP'))) {
+				echo implode(' ', [
+					"&nbsp;",
+					// UI::h('a', [ 'href' => "procesy5.php?task=PROCES_VIEW_LIST&id_proces={$r->ID}&HIDE_PANEL=0&show_big_img=1&group_stanowiska=1",
+					// 	'class' => "btn btn-xs btn-default",
+					// 	'title' => "Przeglądaj proces {$r->ID} (lista)"
+					// ], "L"), // Brak upraenień - widok listy tylko dla PROCES_INIT
+					UI::h('a', [ 'href' => "index.php?FUNCTION_INIT=GRAPH_VIEW_PROCES&id_proces={$r->ID}&PROCES_INIT_SCAN=1",
+						'class' => "btn btn-xs btn-default",
+						'target' => "_blank",
+					], "M"),
+				]);
 			}
 			}
 		}
 		}
 		//if ($bold) echo "***";
 		//if ($bold) echo "***";
@@ -2011,9 +2042,9 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 		}
 		}
 		else if (!empty($r->OPIS)) {
 		else if (!empty($r->OPIS)) {
 			?>
 			?>
-				<i class="glyphicon glyphicon-info-sign wsk-help popover-with-html">
-					<span class="popover-heading"><?php echo "[{$r->ID}] " . $r->DESC; ?></span>
-					<span class="popover-body"><?php echo $r->OPIS; ?></span>
+				<i class="glyphicon glyphicon-info-sign wsk-help popover-with-html p5-L<?= __LINE__; ?>">
+					<div class="popover-heading"><?php echo "[{$r->ID}] " . $r->DESC; ?></div>
+					<div class="popover-body"><?php echo $r->OPIS; ?></div>
 				</i>
 				</i>
 			<?php
 			<?php
 		 }
 		 }
@@ -2156,11 +2187,17 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 					$popupLink = "index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID={$tblPytaniaId}&task=CRM_PROCES#EDIT/{$pytanie->ID}";// TODO: add rand _hash?
 					$popupLink = "index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID={$tblPytaniaId}&task=CRM_PROCES#EDIT/{$pytanie->ID}";// TODO: add rand _hash?
 					$popupTitle = "#{$pytanie->ID} " . htmlspecialchars($pytanie->PYTANIE);
 					$popupTitle = "#{$pytanie->ID} " . htmlspecialchars($pytanie->PYTANIE);
 					$popupContent = implode('<hr style="margin:0.5em 0">', $odpowiedzi);
 					$popupContent = implode('<hr style="margin:0.5em 0">', $odpowiedzi);
+					echo UI::h('a', [
+						'target' => "_blank",
+						'class' => "popover-with-html wsk-help",
+						'href' => $popupLink,
+					], [
+						UI::h('i', [ 'class' => "{$popupIcon} p5-L" . __LINE__ ]),
+					]);
 					?>
 					?>
-						<a target="_blank" href="<?php echo $popupLink; ?>"><i class="<?php echo $popupIcon; ?> wsk-help popover-with-html">
-							<span class="popover-heading"><?php echo $popupTitle; ?></span>
-							<span class="popover-body"><?php echo $popupContent; ?></span>
-						</i></a>
+							<span class="popover-heading"><?= $popupTitle; ?></span>
+							<span class="popover-body"><?= $popupContent; ?></span>
+						</a>
 					<?php
 					<?php
 				}
 				}
 			}
 			}
@@ -2232,9 +2269,9 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 							<?php
 							<?php
 						} else {
 						} else {
 							?>
 							?>
-							<i class="glyphicon glyphicon-info-sign wsk-help popover-with-html">
-								<span class="popover-heading"><?php echo "[{$w->CW_ID}] " . $w->OPIS; ?></span>
-								<span class="popover-body"><?php echo $w->OPIS_ZASOB; ?></span>
+							<i class="glyphicon glyphicon-info-sign wsk-help popover-with-html p5-L<?= __LINE__; ?>">
+								<div class="popover-heading"><?php echo "[{$w->CW_ID}] " . $w->OPIS; ?></div>
+								<div class="popover-body"><?php echo $w->OPIS_ZASOB; ?></div>
 							</i>
 							</i>
 							<?php
 							<?php
 						}
 						}
@@ -2248,9 +2285,9 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 			}
 			}
 			else if (!empty($w->OPIS_ZASOB)) {
 			else if (!empty($w->OPIS_ZASOB)) {
 				?>
 				?>
-					<i class="glyphicon glyphicon-info-sign wsk-help popover-with-html">
-						<span class="popover-heading"><?php echo "[" . $w->CW_ID . "] " . $w->OPIS; ?></span>
-						<span class="popover-body"><?php echo "[{$w->ID}]" . $w->OPIS_ZASOB; ?></span>
+					<i class="glyphicon glyphicon-info-sign wsk-help popover-with-html p5-L<?= __LINE__; ?>">
+						<div class="popover-heading"><?php echo "[" . $w->CW_ID . "] " . $w->OPIS; ?></div>
+						<div class="popover-body"><?php echo "[{$w->ID}]" . $w->OPIS_ZASOB; ?></div>
 					</i>
 					</i>
 				<?php
 				<?php
 			}
 			}

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
SE/static/p5UI/table.js


Неке датотеке нису приказане због велике количине промена