|
|
@@ -2623,53 +2623,56 @@ function task_TEST_SORT() {
|
|
|
$cols['DESC'] = "DESC";
|
|
|
//$cols['TEST_SORT_PRIO'] = "Kolejno????";
|
|
|
|
|
|
- echo '<link rel="stylesheet" type="text/css" href="stuff/jquery-ui-smoothness/jquery-ui-1.10.1.custom.min.css">';
|
|
|
- echo '<style type="text/css">' . "
|
|
|
+ //echo '<link rel="stylesheet" type="text/css" href="stuff/jquery-ui-smoothness/jquery-ui-1.10.1.custom.min.css">';
|
|
|
+ ?>
|
|
|
+ <style type="text/css">
|
|
|
.tbl-view .selected td {background:#FCFFCE;}
|
|
|
.tbl-view tr { background:#fff; }
|
|
|
.tbl-view tr:nth-child(even) { background:#F3F3F3; }
|
|
|
|
|
|
-#sortable-proces-list tr {cursor:pointer;}
|
|
|
-#sortable-proces-list td {color:#000;}
|
|
|
-#sortable-proces-list .ui-state-highlight { height:1.1em; line-height:1em; }
|
|
|
+#sortableProcesList tr {cursor:pointer;}
|
|
|
+#sortableProcesList td {color:#000;}
|
|
|
+#sortableProcesList .ui-state-highlight { height:1.1em; line-height:1em; }
|
|
|
+#sortableProcesList .sortableProcesList-title {display:block; width:360px; height:3em; line-height:3em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
|
|
+#sortableProcesList .sortableProcesList-goto {display:block; height:3em; overflow:hidden;}
|
|
|
|
|
|
- " . '</style>';
|
|
|
- echo '<script type="text/javascript" src="stuff/jquery-ui.custom.min.js"></script>';
|
|
|
- echo '<script type="text/javascript">' . "
|
|
|
+ </style>
|
|
|
+ <script type="text/javascript" src="stuff/jquery-ui.custom.min.js"></script>
|
|
|
+ <script type="text/javascript">
|
|
|
jQuery(document).ready(function(){
|
|
|
- jQuery('#sortable-proces-list').sortable({
|
|
|
+ jQuery('#sortableProcesList').sortable({
|
|
|
placeholder: 'ui-state-highlight',
|
|
|
axis: 'y'
|
|
|
});
|
|
|
});
|
|
|
|
|
|
function fun_TEST_SORT_SAVE() {
|
|
|
- var sorted_list=jQuery('#sortable-proces-list').sortable('serialize', {attribute: 'id', key: 'p[]'});
|
|
|
+ var sorted_list=jQuery('#sortableProcesList').sortable('serialize', {attribute: 'id', key: 'p[]'});
|
|
|
window.location.href='?task=TEST_SORT&function_init=fun_TEST_SORT_SAVE&' + sorted_list;
|
|
|
return false;
|
|
|
}
|
|
|
- " . '</script>';
|
|
|
-
|
|
|
- echo '<table cellspacing="0" cellpadding="0" border="1" class="tbl-view">';
|
|
|
- echo '<thead>';
|
|
|
- echo '<tr>';
|
|
|
- foreach ($cols as $k_cell => $v_label) {
|
|
|
- echo '<th>' . (empty($v_label)? str_replace('_', ' ', $k_cell) : $v_label) . '</th>';
|
|
|
- }
|
|
|
- echo '<th>' . "Kolejność ";
|
|
|
- echo App::link('save', array('task'=>'TEST_SORT', 'function_init'=>'fun_TEST_SORT_SAVE'), array('ico'=>'save', 'title'=>"Zapisz kolejność", 'onclick'=>"return fun_TEST_SORT_SAVE();"));
|
|
|
- echo '</th>';
|
|
|
- echo '<th>' . "GOTO" . '</th>';
|
|
|
- echo '</tr>';
|
|
|
- echo '</thead>';
|
|
|
- echo '<tbody id="sortable-proces-list">';
|
|
|
+ </script>
|
|
|
+ <table cellspacing="0" cellpadding="0" border="1" class="tbl-view">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Nr</th>
|
|
|
+ <th style="width:360px">Opis</th>
|
|
|
+ <th>Kolejność
|
|
|
+ <?php echo App::link('save', array('task'=>'TEST_SORT', 'function_init'=>'fun_TEST_SORT_SAVE'), array('ico'=>'save', 'title'=>"Zapisz kolejność", 'onclick'=>"return fun_TEST_SORT_SAVE();")); ?>
|
|
|
+ </th>
|
|
|
+ <th style="width:30%;">GOTO</th>
|
|
|
+ <th></th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="sortableProcesList">
|
|
|
+ <?php
|
|
|
foreach ($proces_list as $v_proces) {
|
|
|
// class="(($proces_id == $v_proces->ID)? ' selected' : '')"
|
|
|
echo '<tr id="p_' . $v_proces->ID . '" class="ui-state-default">';
|
|
|
foreach ($cols as $k_cell => $v_label) {
|
|
|
- $value = $v_proces->$k_cell;
|
|
|
- if (is_string($value) && strlen($value) > 60) {
|
|
|
- $value = '<span title="' . htmlspecialchars($value) . '">' . substr($value, 0, 60) . '...' . '</span>';
|
|
|
+ $value = $v_proces->{$k_cell};
|
|
|
+ if ('DESC' == $k_cell) {
|
|
|
+ $value = '<span class="sortableProcesList-title" title="' . htmlspecialchars($value) . '">' . $value . '</span>';
|
|
|
}
|
|
|
echo '<td>' . $value . '</td>';
|
|
|
}
|
|
|
@@ -2679,14 +2682,16 @@ function fun_TEST_SORT_SAVE() {
|
|
|
echo App::link('v', array('task'=>'TEST_SORT', '_proces_id'=>$v_proces->ID, '_dir'=>'dw'), array('class'=>'btn-clean', 'title'=>'w dół'));
|
|
|
echo '</td>';
|
|
|
echo '<td>';// GOTO
|
|
|
- if (array_key_exists($v_proces->ID, $goto_list)) {
|
|
|
- foreach ($goto_list[$v_proces->ID] as $k_id => $v_goto) {
|
|
|
- $title = "Proces {$v_goto->ID} {$v_goto->IF_TRUE_GOTO_FLAG} {$v_goto->IF_TRUE_GOTO}";
|
|
|
- echo '<span class="btn-box" style="font-family:monospace" title="' . $title . '">' . $v_goto->ID . ' ' . ProcesHelper::proces_flag($v_goto->ID, $v_goto->IF_TRUE_GOTO, $v_goto->IF_TRUE_GOTO_FLAG) . '</span>';
|
|
|
- }
|
|
|
- }
|
|
|
+ echo '<div class="sortableProcesList-goto">';
|
|
|
+ if (array_key_exists($v_proces->ID, $goto_list)) {
|
|
|
+ foreach ($goto_list[$v_proces->ID] as $k_id => $v_goto) {
|
|
|
+ $title = "Krok {$v_goto->ID} {$v_goto->IF_TRUE_GOTO_FLAG} {$v_goto->IF_TRUE_GOTO}";
|
|
|
+ echo '<span class="btn-box" style="font-family:monospace" title="' . $title . '">' . ProcesHelper::proces_flag($v_goto->ID, $v_goto->IF_TRUE_GOTO, $v_goto->IF_TRUE_GOTO_FLAG) . '</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ echo '</div>';
|
|
|
echo '</td>';
|
|
|
- echo '<td><nobr>';
|
|
|
+ echo '<td>';
|
|
|
$path_arr=explode('/', $v_proces->path);
|
|
|
foreach($path_arr as $path) {
|
|
|
$col_temp_r=dechex(rand(0,25)*10);
|
|
|
@@ -2708,7 +2713,7 @@ function fun_TEST_SORT_SAVE() {
|
|
|
$path_last['SORT_PRIO']=$v_proces->SORT_PRIO;
|
|
|
// echo $path_last['ID']."==?".$path_arr[count($path_arr)-2]." / ".$path_last['TEST_SORT_PRIO']." ".$path_last['SORT_PRIO'];
|
|
|
|
|
|
- echo '</nobr></td>';
|
|
|
+ echo '</td>';
|
|
|
echo '</tr>';
|
|
|
}
|
|
|
echo '</tbody>';
|