Index: trunk/kernel/admin_templates/summary/root.tpl
===================================================================
diff -u -r4524 -r4651
--- trunk/kernel/admin_templates/summary/root.tpl (.../root.tpl) (revision 4524)
+++ trunk/kernel/admin_templates/summary/root.tpl (.../root.tpl) (revision 4651)
@@ -69,21 +69,39 @@
+
+
- " border="0" alt="" title="" />
- " class="userlink">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ">
+ " border="0" alt="" title="" />
+ " class="userslink"> ()
+
-
+
+
|
Index: trunk/kernel/units/users/users_event_handler.php
===================================================================
diff -u -r4625 -r4651
--- trunk/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4625)
+++ trunk/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4651)
@@ -14,6 +14,11 @@
return true;
}
+ if ($event->Name == 'OnSetPersistantVariable') {
+ // only logged in users have persistant variables
+ return $this->Application->GetVar('u_id') > 0;
+ }
+
return parent::CheckPermission($event);
}
Index: trunk/core/units/users/users_event_handler.php
===================================================================
diff -u -r4625 -r4651
--- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4625)
+++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4651)
@@ -14,6 +14,11 @@
return true;
}
+ if ($event->Name == 'OnSetPersistantVariable') {
+ // only logged in users have persistant variables
+ return $this->Application->GetVar('u_id') > 0;
+ }
+
return parent::CheckPermission($event);
}
Index: trunk/core/units/categories/categories_config.php
===================================================================
diff -u -r4636 -r4651
--- trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 4636)
+++ trunk/core/units/categories/categories_config.php (.../categories_config.php) (revision 4651)
@@ -21,6 +21,9 @@
),
),
'IDField' => 'CategoryId',
+
+ 'StatusField' => Array('Status'),
+
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'ItemType' => 1, // used for custom fields only
Index: trunk/kernel/units/categories/categories_config.php
===================================================================
diff -u -r4636 -r4651
--- trunk/kernel/units/categories/categories_config.php (.../categories_config.php) (revision 4636)
+++ trunk/kernel/units/categories/categories_config.php (.../categories_config.php) (revision 4651)
@@ -21,6 +21,9 @@
),
),
'IDField' => 'CategoryId',
+
+ 'StatusField' => Array('Status'),
+
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'ItemType' => 1, // used for custom fields only
Index: trunk/kernel/units/statistics/statistics_tag_processor.php
===================================================================
diff -u -r4524 -r4651
--- trunk/kernel/units/statistics/statistics_tag_processor.php (.../statistics_tag_processor.php) (revision 4524)
+++ trunk/kernel/units/statistics/statistics_tag_processor.php (.../statistics_tag_processor.php) (revision 4651)
@@ -194,34 +194,71 @@
function CountPending($params)
{
$prefix = $params['prefix'];
-
- $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
- if (!$statistics_info) {
- return 0;
+ $value = $this->Application->getCache('statistics.pending', $prefix);
+ if ($value === false) {
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+ if (!$statistics_info) {
+ return 0;
+ }
+
+ $table = $this->Application->getUnitOption($prefix, 'TableName');
+ $status_field = array_shift( $this->Application->getUnitOption($prefix, 'StatusField') );
+ $sql = 'SELECT COUNT(*)
+ FROM '.$table.'
+ WHERE '.$status_field.' = '.$statistics_info['status'];
+ $value = $this->Conn->GetOne($sql);
+ $this->Application->setCache('statistics.pending', $prefix, $value);
}
+ return $value;
+ }
+
+ function GetTotalPending()
+ {
+ $sql = 'SELECT Prefix
+ FROM '.TABLE_PREFIX.'ItemTypes';
+ $prefixes = $this->Conn->GetCol($sql);
- $table = $this->Application->getUnitOption($prefix, 'TableName');
- $status_field = array_shift( $this->Application->getUnitOption($prefix, 'StatusField') );
- $sql = 'SELECT COUNT(*)
- FROM '.$table.'
- WHERE '.$status_field.' = '.$statistics_info['status'];
- return $this->Conn->GetOne($sql);
+ $sum = 0;
+ foreach ($prefixes as $prefix) {
+ $sum += $this->CountPending( Array('prefix' => $prefix) );
+ }
+ return $sum;
}
function PrintPendingStatistics($params)
{
$sql = 'SELECT Prefix
FROM '.TABLE_PREFIX.'ItemTypes';
- $prefixes = $this->Conn->GetCol($sql);
+ $check_prefixes = $this->Conn->GetCol($sql);
+ if (!$check_prefixes) {
+ return '';
+ }
- $block_params = Array('name' => $this->SelectParam($params, 'render_as,block') );
-
$ret = '';
- foreach ($prefixes as $prefix) {
+ $columns = $params['columns'];
+ $block_params = $this->prepareTagParams( Array('name' => $this->SelectParam($params, 'render_as,block') ) );
+
+ $prefixes = Array();
+ foreach ($check_prefixes as $prefix) {
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+ if ($statistics_info) {
+ $prefixes[] = $prefix;
+ }
+ }
+
+ $row_number = 0;
+
+ foreach ($prefixes as $i => $prefix) {
$block_params['prefix'] = $prefix;
$statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
- if (!$statistics_info) continue;
+ if ($i % $columns == 0) {
+ $column_number = 1;
+ $ret .= '';
+ }
+
+ $block_params['column_number'] = $column_number;
+ $block_params['is_first'] = $i < $columns ? 1 : 0;
$template = $statistics_info['url']['t'];
unset($statistics_info['url']['t']);
$url = $this->Application->HREF($template, '', $statistics_info['url']);
@@ -233,7 +270,11 @@
$block_params['icon'] = $statistics_info['icon'];
$block_params['label'] = $statistics_info['label'];
$ret .= $this->Application->ParseBlock($block_params);
-
+ $column_number++;
+
+ if (($i+1) % $columns == 0) {
+ $ret .= '
';
+ }
}
return $ret;
}
Index: trunk/core/units/statistics/statistics_tag_processor.php
===================================================================
diff -u -r4524 -r4651
--- trunk/core/units/statistics/statistics_tag_processor.php (.../statistics_tag_processor.php) (revision 4524)
+++ trunk/core/units/statistics/statistics_tag_processor.php (.../statistics_tag_processor.php) (revision 4651)
@@ -194,34 +194,71 @@
function CountPending($params)
{
$prefix = $params['prefix'];
-
- $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
- if (!$statistics_info) {
- return 0;
+ $value = $this->Application->getCache('statistics.pending', $prefix);
+ if ($value === false) {
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+ if (!$statistics_info) {
+ return 0;
+ }
+
+ $table = $this->Application->getUnitOption($prefix, 'TableName');
+ $status_field = array_shift( $this->Application->getUnitOption($prefix, 'StatusField') );
+ $sql = 'SELECT COUNT(*)
+ FROM '.$table.'
+ WHERE '.$status_field.' = '.$statistics_info['status'];
+ $value = $this->Conn->GetOne($sql);
+ $this->Application->setCache('statistics.pending', $prefix, $value);
}
+ return $value;
+ }
+
+ function GetTotalPending()
+ {
+ $sql = 'SELECT Prefix
+ FROM '.TABLE_PREFIX.'ItemTypes';
+ $prefixes = $this->Conn->GetCol($sql);
- $table = $this->Application->getUnitOption($prefix, 'TableName');
- $status_field = array_shift( $this->Application->getUnitOption($prefix, 'StatusField') );
- $sql = 'SELECT COUNT(*)
- FROM '.$table.'
- WHERE '.$status_field.' = '.$statistics_info['status'];
- return $this->Conn->GetOne($sql);
+ $sum = 0;
+ foreach ($prefixes as $prefix) {
+ $sum += $this->CountPending( Array('prefix' => $prefix) );
+ }
+ return $sum;
}
function PrintPendingStatistics($params)
{
$sql = 'SELECT Prefix
FROM '.TABLE_PREFIX.'ItemTypes';
- $prefixes = $this->Conn->GetCol($sql);
+ $check_prefixes = $this->Conn->GetCol($sql);
+ if (!$check_prefixes) {
+ return '';
+ }
- $block_params = Array('name' => $this->SelectParam($params, 'render_as,block') );
-
$ret = '';
- foreach ($prefixes as $prefix) {
+ $columns = $params['columns'];
+ $block_params = $this->prepareTagParams( Array('name' => $this->SelectParam($params, 'render_as,block') ) );
+
+ $prefixes = Array();
+ foreach ($check_prefixes as $prefix) {
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+ if ($statistics_info) {
+ $prefixes[] = $prefix;
+ }
+ }
+
+ $row_number = 0;
+
+ foreach ($prefixes as $i => $prefix) {
$block_params['prefix'] = $prefix;
$statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
- if (!$statistics_info) continue;
+ if ($i % $columns == 0) {
+ $column_number = 1;
+ $ret .= '';
+ }
+
+ $block_params['column_number'] = $column_number;
+ $block_params['is_first'] = $i < $columns ? 1 : 0;
$template = $statistics_info['url']['t'];
unset($statistics_info['url']['t']);
$url = $this->Application->HREF($template, '', $statistics_info['url']);
@@ -233,7 +270,11 @@
$block_params['icon'] = $statistics_info['icon'];
$block_params['label'] = $statistics_info['label'];
$ret .= $this->Application->ParseBlock($block_params);
-
+ $column_number++;
+
+ if (($i+1) % $columns == 0) {
+ $ret .= '
';
+ }
}
return $ret;
}
Index: trunk/kernel/admin_templates/incs/sections_list.css
===================================================================
diff -u -r4524 -r4651
--- trunk/kernel/admin_templates/incs/sections_list.css (.../sections_list.css) (revision 4524)
+++ trunk/kernel/admin_templates/incs/sections_list.css (.../sections_list.css) (revision 4651)
@@ -99,4 +99,22 @@
.usersbox_body {
border: 1px solid #666767;
background: url(../img/summary/usersbox_bg.gif) top left;
+}
+
+.lTDi {
+ border-right: 1px solid #CCCCCC;
+ border-top: 1px solid #CCCCCC;
+}
+
+.rTDi {
+ border-top: 1px solid #CCCCCC;
+}
+
+.lTD {
+ border-right: 1px solid #CCCCCC;
+}
+
+
+.rTD {
+
}
\ No newline at end of file
Index: trunk/core/admin_templates/summary/root.tpl
===================================================================
diff -u -r4524 -r4651
--- trunk/core/admin_templates/summary/root.tpl (.../root.tpl) (revision 4524)
+++ trunk/core/admin_templates/summary/root.tpl (.../root.tpl) (revision 4651)
@@ -69,21 +69,39 @@
+
+
- " border="0" alt="" title="" />
- " class="userlink">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | ">
+ " border="0" alt="" title="" />
+ " class="userslink"> ()
+
-
+
+
|