Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F773975
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 3, 1:15 AM
Size
9 KB
Mime Type
text/x-diff
Expires
Wed, Feb 5, 1:15 AM (32 m, 54 s)
Engine
blob
Format
Raw Data
Handle
557129
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/kernel/admin/include/summary/root.php
===================================================================
--- trunk/kernel/admin/include/summary/root.php (revision 2026)
+++ trunk/kernel/admin/include/summary/root.php (revision 2027)
@@ -1,245 +1,247 @@
<?php
$lang_Search = admin_language("la_prompt_Search");
$lang_Users = admin_language("la_Text_Users");
$lang_PendingItems = admin_language("la_prompt_PendingItems");
$lang_Catalog = admin_language("la_Text_Catalog");
global $adminURL,$rootURL,$admin;
$UserURL = $adminURL."/users/user_list.php?env=".BuildEnv();
$browseURL = $adminURL."/browse.php?env=".BuildEnv();
$PendingTotal = 0;
$date_str = adodb_date("F j, Y");
print <<<END
<div isBox="true" id="overview">
<div class="overviewbox_header" func="header" STYLE="background:url($imagesURL/summary/overviewbox_header.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="4"><br>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td><img isEI="true" src="$imagesURL/summary/overviewbox_cl.gif" width="8" height="8" align="absMiddle" hSpace="4"><span class="overview">Overview</span></td>
<td class="info" valign="top" align="right"><span class="overviewDate">$date_str</span> </td>
</tr>
</table>
</div>
<div class="overviewbox_body" func="body" STYLE="background:url($imagesURL/summary/overviewbox_bg.gif);">
<div style="padding:4px; width:100%">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="lTD" width="50%" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
END;
$template = "<TR><TD class=\"oInfo\"><inp:stats_label /></TD><td width=\"1%\" nowrap class=\"oValue\"><inp:stats_value /></TD></TR>";
$objStats = new clsStatList();
$objStats->Query_Item("SELECT * FROM ".GetTablePrefix()."StatItem WHERE AdminSummary=1");
$ItemCount = $objStats->NumItems();
$ItemsPerCol = ceil($ItemCount / 2);
$i = 0;
$col = 1;
$o = "";
while($i < $ItemsPerCol)
{
$s = $objStats->GetItemByIndex($i);
$o .= $s->ParseTemplateText($template);
$i++;
}
print $o;
print <<<END
</table>
</td>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
END;
$o = "";
while($i<$ItemCount)
{
$s = $objStats->GetItemByIndex($i);
$o .= $s->ParseTemplateText($template);
$i++;
}
print $o;
// ---- prepare pending items list based on modules installed: begin -----
$m = GetModuleArray();
foreach($m as $key => $value)
{
$path = $pathtoroot.$value."admin/include/parser.php";
if( file_exists($path) ) include_once($path);
}
$modules = $objModules->GetModuleList();
$pending_source = $objModules->ExecuteFunction('GetModuleInfo', 'summary_pending');
// get total pending item count & merge them into one array
$all_pending = Array();
$pending_col_1 = '';
$pending_col_2 = '';
foreach($pending_source as $module_name => $pending_items)
{
foreach($pending_items as $p_item)
{
$all_pending[] = $p_item;
}
}
if( count($all_pending) % 2 ) $all_pending[] = 'empty';
$ItemCount = count($all_pending);
$ItemsPerCol = ceil($ItemCount / 2);
$i = 0;
while($i < $ItemCount)
{
// create cell content
$item_count = 0;
$col_type = ($i < $ItemsPerCol) ? 'l' : 'r';
$class = $col_type.'TDi';
// if last item then change class
if($i+1 == $ItemsPerCol)
$class = 'lTD';
elseif($i+1 == $ItemsPerCol*2)
$class = 'rTD';
//print_pre($all_pending[$i]);
$cell = is_array($all_pending[$i]) ? PendingCell($all_pending[$i], $class, $item_count) : '<tr><td class="rTD"> </td></tr>';
if($col_type == 'l')
$pending_col_1 .= $cell;
elseif($col_type == 'r')
$pending_col_2 .= $cell;
$PendingTotal += $item_count;
//allocate it to row
$i++;
}
function PendingCell($params, $class, &$pending_count)
{
+ safeDefine('ORDER_STATUS_PENDING', 1);
+
$list_name = getArrayValue($params, 'list_var_name');
$prefix_pos = strpos($list_name, ':');
if( $prefix_pos !== false)
{
global $application;
$prefix = substr($list_name, $prefix_pos+1, strlen($list_name) );
$table =& $application->getUnitOption($prefix, 'TableName');
$pending_status = $prefix == 'ord' ? ORDER_STATUS_PENDING : 2;
$sql = 'SELECT COUNT(*) FROM %s WHERE Status = '.$pending_status;
$pending_count = $application->DB->GetOne( sprintf($sql, $table) );
}
else
{
$pending_count = $GLOBALS[ $params['list_var_name'] ]->CountPending();
$params['link'] = 'javascript:'.$params['link'].';';
}
$o = '<tr>'."\n";
$o .= '<td class="'.$class.'">'."\n";
$o .= '<a href="'.$params['link'].'" class="userslink">'."\n";
$o .= '<img src="'.$params['icon_image'].'" border="0" align="absMiddle">'."\n";
$o .= admin_language($params['phrase']);
$o .= '<span class="info"> ('.$pending_count.')</span></a>'."\n";
$o .= '</td>'."\n";
$o .= '</tr>'."\n";
return $o;
}
// ---- prepare pending items list based on modules installed: end -----
print <<<END
</table>
</td>
</tr>
</table>
</div>
<img src="$imagesURL/spacer.gif" height="21" width="1">
</div>
</div>
<div isBox="true" id="searchBox">
<div class="searchbox_header" func="header" STYLE="background:url($imagesURL/summary/searchbox_header.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="4"><br />
<img isEI="true" src="$imagesURL/summary/searchbox_cl.gif" width="8" height="8" align="absMiddle" hSpace="4">$lang_Search $lang_Users
</div>
<div class="searchbox_body" func="body" STYLE="background:url($imagesURL/summary/searchbox_bg.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="12"><br />
<form NAME="user_search" ID="user_search" method=POST action="$UserURL">
<img src="$imagesURL/spacer.gif" width="12" height="1"><input NAME="list_search" class="search" type="text">
<INPUT TYPE="HIDDEN" NAME="Action" VALUE="m_user_search">
<img isImgButton="true" src="$imagesURL/toolbar/icon16_search.gif" width="22" height="22" align="absMiddle" onclick="user_search.submit();">
</FORM>
</div>
</div>
<div isBox="true" id="pendingitems">
<div class="usersbox_header" func="header" STYLE="background:url($imagesURL/summary/usersbox_header.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="4"><br />
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><img isEI="true" src="$imagesURL/summary/usersbox_cl.gif" width="8" height="8" align="absMiddle" hSpace="4"><b>$lang_PendingItems</b></td>
<td class="info" valign="top"> ($PendingTotal)</td>
</tr>
</table>
</div>
<div class="usersbox_body" func="body" STYLE="background:url($imagesURL/summary/usersbox_bg.gif);">
<div style="padding:8px; width:100%">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" width="50%">
<table cellspacing="0" cellpadding="4" border="0" width="100%">
$pending_col_1
</table>
</td>
<td valign="top" width="50%">
<table cellspacing="0" cellpadding="4" border="0" width="100%">
$pending_col_2
</table>
</td>
</tr>
</table>
</div>
<img src="images/spacer.gif" height="21" width="1">
</div>
</DIV>
<div isBox="true" id="quicklinks">
<div class="overviewbox_header" func="header" STYLE="background:url($imagesURL/summary/overviewbox_header.gif);">
<img src="$imagesURL/spacer.gif" width="1" height="4"><br>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td><img isEI="true" src="$imagesURL/summary/overviewbox_cl.gif" width="8" height="8" align="absMiddle" hSpace="4"><span class="overview">Quick Links</span></td>
<td class="info" valign="top" align="right"><span class="overviewDate"></span> </td>
</tr>
</table>
</div>
<div class="overviewbox_body" func="body" STYLE="background:url($imagesURL/summary/overviewbox_bg.gif);">
<div style="padding:4px; width:100%">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="4">
<tr><td><a class="userslink" href="$browseURL"><img hSpace="3" src="$adminURL/icons/icon24_navigate.gif" border="0" align="absMiddle">$lang_Catalog</a></td></tr>
<tr><td><a class="userslink" href="$UserURL"><img hSpace="3" src="$adminURL/icons/icon24_users.gif" border="0" align="absMiddle">$lang_Users</a></td></tr>
</table>
</div>
<img src="images/spacer.gif" height="21" width="1">
</div>
</div>
END;
?>
\ No newline at end of file
Property changes on: trunk/kernel/admin/include/summary/root.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.6
\ No newline at end of property
+1.7
\ No newline at end of property
Event Timeline
Log In to Comment