X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plekit%2Fphp%2Fcolumns.php;h=d16b1282062398a5c67fa0ebf4fceb316542b976;hb=0f0545cc1217bc84a7540c642cd631683bd13689;hp=987d9bee1aa3d8eebe01f4ca702ad933730c46ab;hpb=0348c099125efad7d6adcea30302ee5071a3e1d4;p=plewww.git
diff --git a/plekit/php/columns.php b/plekit/php/columns.php
index 987d9be..d16b128 100644
--- a/plekit/php/columns.php
+++ b/plekit/php/columns.php
@@ -64,11 +64,19 @@ $this->all_headers[$column['header']]=array('header'=>$column['header'],'type'=>
}
foreach ($this->tag_columns as $column) {
-$this->all_headers[$column['header']]=array('header'=>$column['header'],'type'=>$column['type'],'tagname'=>$column['tagname'],'title'=>$column['tagname'], 'description'=>$column['title'], 'label'=>$this->removeDuration($column['header']),'visible'=>false);
+
+//print("
".$column['header'].":".$column['headerId'].":".$column['tagname']);
+
+if ($column['headerId'] != "")
+ $headerId = $column['headerId'];
+else
+ $headerId = $column['header'];
+
+$this->all_headers[$headerId]=array('header'=>$headerId,'type'=>$column['type'],'tagname'=>$column['tagname'],'title'=>$column['title'], 'description'=>$column['title'], 'label'=>$column['header'],'visible'=>false);
}
foreach ($this->extra_columns as $column) {
-$this->all_headers[$column['header']]=array('header'=>$column['header'],'type'=>$column['type'],'tagname'=>$column['tagname'],'title'=>$column['tagname'], 'description'=>$column['title'], 'label'=>$this->removeDuration($column['header']),'visible'=>false);
+$this->all_headers[$column['header']]=array('header'=>$column['header'],'type'=>$column['type'],'tagname'=>$column['tagname'],'title'=>$column['title'], 'description'=>$column['title'], 'label'=>$column['header'],'visible'=>false);
}
return $this->all_headers;
@@ -82,6 +90,20 @@ return $this->all_headers;
}
+function get_selected_period($label) {
+
+if ($this->all_headers[$label."w"]['visible'])
+ return "w";
+else if ($this->all_headers[$label."m"]['visible'])
+ return "m";
+else if ($this->all_headers[$label."y"]['visible'])
+ return "y";
+else if ($this->all_headers[$label]['visible'])
+ return "";
+
+return "";
+}
+
function node_tags() {
$fetched_tags = array('node_id');
@@ -101,7 +123,7 @@ function print_headers() {
foreach ($this->all_headers as $h)
{
- $headers.="
".$h['header'].":".$h['label'].":".$h['tagname'];
+ $headers.="
".$h['header'].":".$h['label'].":".$h['tagname'].":".$h['visible'];
}
return $headers;
}
@@ -122,11 +144,11 @@ function headerIsVisible($header_name) {
$headersToShow = $this->visible_headers;
+if (in_array($header_name, $headersToShow))
+ return true;
- if ($this->inTypeC($header_name."w") || $this->inTypeC($header_name."m") || $this->inTypeC($header_name."y"))
- return (in_array($header_name."w", $headersToShow) || in_array($header_name."m", $headersToShow) || in_array($header_name."y", $headersToShow));
- else
- return in_array($header_name, $headersToShow);
+if ($this->inTypeC($header_name."w"))
+ return (in_array($header_name."w", $headersToShow) || in_array($header_name."m", $headersToShow) || in_array($header_name."y", $headersToShow));
}
@@ -267,11 +289,13 @@ function checkThreshold($value, $threshold, $hh) {
function cells($table, $node) {
+$this->fetch_data($node);
foreach ($this->all_headers as $h)
{
+if (!$h['fixed']) {
-if (!$h['fixed'] && $h['visible'])
+if ($h['visible'] != "")
{
if ($this->inTypeC($h['header']))
{
@@ -304,9 +328,9 @@ else
$table->cell($value,array('name'=>$h['header'], 'display'=>'table-cell'));
}
}
-else
+else
$table->cell("??", array('name'=>$h['header'], 'display'=>'none'));
-
+}
}
}
@@ -319,68 +343,106 @@ HTML
*/
-function javascript_vars() {
+function javascript_init() {
print("");
-$all_columns_string = "";
-foreach ($this->all_headers as $h)
- $all_columns_string.= $h['header'].",";
-
print("");
-print("var column_table = new Array();");
-print ("var column_index=0;");
-print("var column_table2 = new Array();");
-print("var column_headers = new Array();");
-print("var columns_to_fetch = new Array();");
-//document.onkeyup = scrollList('test');
+}
+
+
+
+function quickselect_html() {
+
+//return '
This link uses the onclick event handler.
Open popup
Add/delete columns | "); +print("||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Add/remove columns | "); if ($showDescription) print("Column description and configuration | "); print("|||||||||||
");
- print(' ');
+ print(' ');
print ("
");
+print(" | ");
//print("");
//print("");
-print("");
-print(" ");
-print(" | ");
+//print("");
+//print("");
+//print(" ");
+//print(" ");
if ($showDescription)
print("");
@@ -453,6 +532,8 @@ if ($showDescription)
print(" | |