Piotr Labudda 11 лет назад
Родитель
Сommit
bd5b82d993
2 измененных файлов с 66 добавлено и 17 удалено
  1. 1 1
      SE/VERSION
  2. 65 16
      SE/procesy5.php

+ 1 - 1
SE/VERSION

@@ -1 +1 @@
-3.9.9-11
+3.9.9-12

+ 65 - 16
SE/procesy5.php

@@ -1332,6 +1332,7 @@ function task_CRM_WYSWIETL_OBOWIAZKI() {
 		echo ' <b>'.$zasob->TYPE.'</b>';
 		echo ' <span>'.$zasob->DESC.'</span>';
 		echo '<br /><span>'.$zasob->OPIS.'</span>';
+		echo '<br> <a href=index.php?FUNCTION_INIT=GRAPH_VIEW_PROCES&PROCES_INIT_SCAN=1&id_zasob='.$zasob->ID.'&RESOURCES=1><span>Wyświetl mapę </span>';
 	echo'</p>';
 
 	$db = DB::getDB();
@@ -2097,12 +2098,14 @@ a.btn-small {font-size:x-small;}
 function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 //	$dbg=debug_backtrace();
 //	DEBUG_S(-3,'backtrace',$dbg);
-	
+	$db = DB::getDB();
 	$wsk = array();
 	Lib::loadClass('ProcesHelper');
 	if ($tree->get_param('rozwin_proces')) {
 		$wsk = ProcesHelper::get_wskazniki( $r->ID );//TODO: proces helper
 	}
+	$tblCRM_TESTY_PYTANIAid = ProcesHelper::getZasobTableID('CRM_TESTY_PYTANIA');
+	
 	$show_form = ($tree->get_param('show_form_at_item') == $r->ID);
 	$show_form = ($tree->get_param('show_form_at_item') > 0);// TODO: RMME
 	$cls = array();
@@ -2146,10 +2149,10 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 	//echo App::link("&#9872;", array('task'=>"CRM_PROCES", 'filtr_id'=>$r->ID, '#'=>'TREE'.$r->ID), array('class'=>''));
 	if ($tree->get_param('editable')) {
 		//echo'('.$r->SORT_PRIO.')';//TODO: DBG
-		echo App::link("<b>^</b>", array('task'=>'CRM_PROCES', 'function_init'=>'SORT_PRIO_PROCES', 'arg1'=>$r->ID, 'arg1_val'=>'upup'), array('class'=>"btn-clean", 'title'=>"w gore o 5 pol"));
-		echo App::link("^", array('task'=>'CRM_PROCES', 'function_init'=>'SORT_PRIO_PROCES', 'arg1'=>$r->ID, 'arg1_val'=>'up'), array('class'=>"btn-clean", 'title'=>"w gore"));
-		echo App::link("v", array('task'=>'CRM_PROCES', 'function_init'=>'SORT_PRIO_PROCES', 'arg1'=>$r->ID, 'arg1_val'=>'dw'), array('class'=>"btn-clean", 'title'=>"w dol"));
-		echo App::link("V", array('task'=>'CRM_PROCES', 'function_init'=>'SORT_PRIO_PROCES', 'arg1'=>$r->ID, 'arg1_val'=>'downdown'), array('class'=>"btn-clean", 'title'=>"w dol o 5 pol"));
+		echo App::link("<b>^</b>", array('task'=>'CRM_PROCES', 'function_init'=>'SORT_PRIO_PROCES', 'arg1'=>$r->ID, 'arg1_val'=>'upup','#'=>'TREE'.$r->ID), array('class'=>"btn-clean", 'title'=>"w gore o 5 pol"));
+		echo App::link("^", array('task'=>'CRM_PROCES', 'function_init'=>'SORT_PRIO_PROCES', 'arg1'=>$r->ID, 'arg1_val'=>'up','#'=>'TREE'.$r->ID), array('class'=>"btn-clean", 'title'=>"w gore"));
+		echo App::link("v", array('task'=>'CRM_PROCES', 'function_init'=>'SORT_PRIO_PROCES', 'arg1'=>$r->ID, 'arg1_val'=>'dw','#'=>'TREE'.$r->ID), array('class'=>"btn-clean", 'title'=>"w dol"));
+		echo App::link("V", array('task'=>'CRM_PROCES', 'function_init'=>'SORT_PRIO_PROCES', 'arg1'=>$r->ID, 'arg1_val'=>'downdown','#'=>'TREE'.$r->ID), array('class'=>"btn-clean", 'title'=>"w dol o 5 pol"));
 		echo' ';
 
 		if ($tree->get_param('ProcesTblId') > 0) {
@@ -2167,6 +2170,22 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 				echo App::link("P+", array('task'=>"CRM_TESTY_ADD_PYTANIA", 'id_proces'=>$r->ID), array('title'=>'Dodaj pytanie do testow', 'class'=>'btn-p5 btn-red'));
 			} else {
 				echo App::link("P+", array('task'=>"CRM_TESTY_ADD_PYTANIA", 'id_proces'=>$r->ID), array('title'=>'Dodaj pytanie do testow', 'class'=>'btn-p5'));
+				if(0){// TODO: Mysql::get_searched_obj
+					$get_obj->ID_PROCES = $r->ID;
+					$get_obj->ID_WSKAZNIK = ($tree->get_param('rozwin_proces'))? 0 : '%';
+					$rquest = $db->get_searched_obj('CRM_TESTY_PYTANIA', $get_obj, null, null, null);
+					while ($rq = $db->fetch($rquest)) {
+						$txt = "";
+						if (!empty($rq->ODP_0)) $txt .= "<font color=".($rq->ODP_0_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_0)." </font>";
+						if (!empty($rq->ODP_1)) $txt .= "<hr><font color=".($rq->ODP_1_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_1)." </font>";
+						if (!empty($rq->ODP_2)) $txt .= "<hr><font color=".($rq->ODP_2_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_2)." </font>";
+						if (!empty($rq->ODP_3)) $txt .= "<hr><font color=".($rq->ODP_3_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_3)." </font>";
+						if (!empty($rq->ODP_4)) $txt .= "<hr><font color=".($rq->ODP_4_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_4)." </font>";
+						?>											
+							<a target=blank href="index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $tblCRM_TESTY_PYTANIAid."&task=CRM_PROCES#EDIT/".$rq->ID."=".$rq->ID."#TREE".$r->ID ; ?>"><i class="<?php  echo (($rq->TEST_TYPE=='TEORETYCZNY') ? 'icon-question-sign' : 'icon-exclamation-sign'); ?> wsk-help" data-toggle="popover" data-trigger="hover" title="" data-content="<?php echo $txt; ?>" data-original-title="<?php echo "#{$rq->ID} {$rq->PYTANIE}"; ?>"></a></i>
+						<?php
+					}
+				}
 			}
 		}
 	}
@@ -2221,8 +2240,7 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 			}
 		}
 		//if ($bold) echo "***";
-
-		if ($tree->get_param('editable')) echo App::link("Z+", "?task=ADD_PROCES_ID&id=".$r->ID, array('title'=>'Dodaj', 'class'=>'btn-p5'));
+		if ($tree->get_param('editable')) echo App::link("Z+", "index.php?MENU_INIT=PROCES_ADD_ZASOB&procesID=".$r->ID, array('title'=>'Dodaj', 'class'=>'btn-p5'));
 
 		$opis_before = ''; $opis_after = '';
 		$tbl = 'CRM_PROCES';
@@ -2241,7 +2259,14 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 
 		echo' <span class="more-desc">';
 		echo $opis_before;
-		if ($tree->get_param('rozwin_opis') && $r->OPIS) echo ' '.$r->OPIS;
+		if ($tree->get_param('rozwin_opis') && $r->OPIS) {
+			echo ' '.$r->OPIS;
+		}
+		else if (!empty($r->OPIS)) {
+			?>
+				<i class="icon-info-sign wsk-help" data-toggle="popover" data-trigger="hover" title="" data-content='<?php echo htmlspecialchars($r->OPIS); ?>' data-original-title="<?php echo "[{$r->ID}] {$r->DESC}"; ?>"></i>
+			<?php
+		 }
 		echo $opis_after;
 		echo '</span>';
 
@@ -2326,10 +2351,10 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 			//echo ' ('.$w->SORT_PRIO.')';
 			//echo $w->CW_SORT_PRIO;// DBG
 			if ($tree->get_param('editable')) {
-				echo App::link("<b>^</b>", array('function_init'=>'SORT_PRIO_WSKAZNIK', 'arg1'=>$w->CW_ID, 'arg1_val'=>'upup'), array('class'=>"btn-clean", 'title'=>"w gore o 5 pol"));
-				echo App::link("^", array('function_init'=>'SORT_PRIO_WSKAZNIK', 'arg1'=>$w->CW_ID, 'arg1_val'=>'up'), array('class'=>"btn-clean", 'title'=>"w gore"));
-				echo App::link("v", array('function_init'=>'SORT_PRIO_WSKAZNIK', 'arg1'=> $w->CW_ID, 'arg1_val'=>'dw'), array('class'=>"btn-clean", 'title'=>"w dol"));
-				echo App::link("V", array('function_init'=>'SORT_PRIO_WSKAZNIK', 'arg1'=> $w->CW_ID, 'arg1_val'=>'downdown'), array('class'=>"btn-clean", 'title'=>"w dol o 5 pol"));
+				echo App::link("<b>^</b>", array('function_init'=>'SORT_PRIO_WSKAZNIK', 'arg1'=>$w->CW_ID, 'arg1_val'=>'upup','_hash'=>rand(0,9999),'#'=>'TREE'.$r->ID), array('class'=>"btn-clean", 'title'=>"w gore o 5 pol"));
+				echo App::link("^", array('function_init'=>'SORT_PRIO_WSKAZNIK', 'arg1'=>$w->CW_ID, 'arg1_val'=>'up','_hash'=>rand(0,9999),'#'=>'TREE'.$r->ID), array('class'=>"btn-clean", 'title'=>"w gore"));
+				echo App::link("v", array('function_init'=>'SORT_PRIO_WSKAZNIK', 'arg1'=> $w->CW_ID, 'arg1_val'=>'dw','_hash'=>rand(0,9999),'#'=>'TREE'.$r->ID), array('class'=>"btn-clean", 'title'=>"w dol"));
+				echo App::link("V", array('function_init'=>'SORT_PRIO_WSKAZNIK', 'arg1'=> $w->CW_ID, 'arg1_val'=>'downdown','_hash'=>rand(0,9999),'#'=>'TREE'.$r->ID), array('class'=>"btn-clean", 'title'=>"w dol o 5 pol"));
 				echo' ';
 				echo App::link("E", "?task=CRM_EDIT_CRM_WSKAZNIK&EDIT=".$w->CW_ID."&ID=".$w->CW_ID, array('title'=>'Edytuj', 'class'=>'btn-p5'));
 
@@ -2339,6 +2364,24 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 			}
 
 			//echo ' <span class="btn-box btn-box-lgreen"'.$w_title_parents_out.'>'.$w->ID.'</span>';
+			if(0){// TODO: Mysql::get_searched_obj //if ($tree->get_param('editable')) {
+				$get_obj->ID_PROCES = $r->ID;
+				$get_obj->ID_WSKAZNIK = $w->CW_ID;
+				$rquest = $db->get_searched_obj('CRM_TESTY_PYTANIA', $get_obj, null, null, null);
+				while ($rq = $db->fetch($rquest)) {
+					$txt = "";
+					if (!empty($rq->ODP_0)) $txt .= "<font color=".($rq->ODP_0_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_0)." </font>";
+					if (!empty($rq->ODP_1)) $txt .= "<hr><font color=".($rq->ODP_1_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_1)." </font>";
+					if (!empty($rq->ODP_2)) $txt .= "<hr><font color=".($rq->ODP_2_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_2)." </font>";
+					if (!empty($rq->ODP_3)) $txt .= "<hr><font color=".($rq->ODP_3_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_3)." </font>";
+					if (!empty($rq->ODP_4)) $txt .= "<hr><font color=".($rq->ODP_4_ODP=='TAK' ? 'green' : 'red')." >".htmlspecialchars($rq->ODP_4)." </font>";
+					?>
+						<a target=blank href="index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $tblCRM_TESTY_PYTANIAid."&task=CRM_PROCES#EDIT/".$rq->ID."=".$rq->ID."#TREE".$r->ID ; ?>">
+						<i class="<?php  echo (($rq->TEST_TYPE=='TEORETYCZNY') ? 'icon-question-sign' : 'icon-exclamation-sign') ; ?> wsk-help" data-toggle="popover" data-trigger="hover" title="" data-content="<?php echo $txt; ?>" data-original-title="<?php echo "#{$rq->ID} {$rq->PYTANIE}"; ?>"></a></i>
+					<?php
+				}
+			}
+		
 			echo'<span class="green"'.$w_title_parents_out.'>['.$w->ID.']</span>';
 			echo' <i title="'.$w->CP_PYTANIE.' '.$w->CP_OPIS.'">'.$w->CP_FORM_TREAT.'</i>';
 			echo'';
@@ -2409,9 +2452,15 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 					echo ' <span class="green">'.$w->OPIS.'</span>';// opis zasobu
 				}
 			}
-			if ($tree->get_param('rozwin_opis')) echo ' <span style="color:#000;">'.$w->OPIS_ZASOB.'</span>';// komentarz wskaznika
-			//echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;">';print_r($w);echo'</pre>';
-			if ($show_form) $zasoby_id[ $w->TYPE ] [$w->ID]= $w->CW_ID;
+			if ($tree->get_param('rozwin_opis')) {
+				echo ' <span style="color:#000;">'.$w->OPIS_ZASOB.'</span>';// komentarz wskaznika
+			}
+			else if (!empty($w->OPIS_ZASOB)) {
+				?>
+					<i class="icon-info-sign wsk-help" data-toggle="popover" data-trigger="hover" title="" data-content="<?php echo "[".$w->ID."]".htmlspecialchars($w->OPIS_ZASOB); ?>" data-original-title="<?php echo "{{{$w->CW_ID}}} {$w->OPIS}"; ?>"></i>
+				<?php
+			}
+			if ($show_form) $zasoby_id[$w->TYPE][$w->ID] = $w->CW_ID;
 
 			if ($tree->get_param('rozwin_zasoby')) {
 				echo $w_parents_out;
@@ -2419,7 +2468,7 @@ function tree_callback__show_item_from_CRM_PROCES( &$r, &$tree ) {
 
 			echo'</p>';
 			echo'</li>';
-		}//end foreach
+		}
 		echo'</ul>';