Index: branches/RC/core/units/visits/visits_tag_processor.php =================================================================== diff -u -N -r8929 -r11546 --- branches/RC/core/units/visits/visits_tag_processor.php (.../visits_tag_processor.php) (revision 8929) +++ branches/RC/core/units/visits/visits_tag_processor.php (.../visits_tag_processor.php) (revision 11546) @@ -1,27 +1,33 @@ Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); return !in_array( $object->GetDBField( $params['user_field'] ) , $virtual_users ); - } - - + } + + function UserLink($params) { $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); $user_id = $object->GetDBField( $params['user_field'] ); - if($user_id) - { - //return $this->Application->HREF('in-commerce/users/users_edit_general','', Array('u_id' => $user_id) ); - $resource_id = $this->Conn->GetOne('SELECT ResourceId FROM '.TABLE_PREFIX.'PortalUser WHERE PortalUserId = '.$user_id); - return 'javascript:OpenUserEdit('.$resource_id.');'; + + if ($user_id) { + $url_params = Array ( + 'm_opener' => 'd', + 'u_mode' => 't', + 'u_event' => 'OnEdit', + 'u_id' => $user_id, + 'pass' => 'all,u' + ); + + return $this->Application->HREF($params['edit_template'], '', $url_params); } } - + function getDateLimitClause($field) { $search_filter = $this->Application->RecallVar( $this->getPrefixSpecial().'_search_filter'); @@ -32,37 +38,37 @@ } return ''; } - + function AffiliateOrderInfo($params) { $list =& $this->GetList($params); - + $date_limit = str_replace($list->TableName, 'vis', $this->getDateLimitClause('VisitDate') ); - + $affil_table = $this->Application->getUnitOption('affil', 'TableName'); $affil_idfield = $this->Application->getUnitOption('affil', 'IDField'); $sql = 'SELECT '.$affil_idfield.' FROM '.$affil_table.' WHERE PortalUserId = '.$this->Application->RecallVar('user_id'); $affiliate_id = $this->Conn->GetOne($sql); - + $sql = 'SELECT COUNT(ord.OrderId) AS OrderCount FROM '.$list->TableName.' vis LEFT JOIN '.TABLE_PREFIX.'Orders ord ON ord.VisitId = vis.VisitId WHERE (vis.AffiliateId = '.$affiliate_id.') AND (ord.Status = '.ORDER_STATUS_PROCESSED.')'.($date_limit ? ' AND '.$date_limit : ''); $result = $this->Conn->GetRow($sql); - + $sql = 'SELECT COUNT(*) FROM '.$list->TableName.' vis WHERE AffiliateId = '.$affiliate_id.($date_limit ? ' AND '.$date_limit : ''); - + $result['TotalVisitors'] = $this->Conn->GetOne($sql); $result['OrderTotalAmount'] = $list->getTotal('OrderTotalAmount', 'SUM'); $result['OrderAffiliateCommission'] = $list->getTotal('OrderAffiliateCommission', 'SUM'); - + $block_params = $this->prepareTagParams($params); $block_params['name'] = $params['render_as']; $format_fields = Array('OrderTotalAmount', 'OrderAffiliateCommission'); - + if( $this->HasParam($params, 'currency') ) { $iso = $this->GetISO($params['currency']); @@ -74,13 +80,13 @@ $result[$format_field] = $value; } } - + $block_params = array_merge_recursive2($block_params, $result); - + return $this->Application->ParseBlock($block_params); } - - + + /*function ShowTotals($params) { $list =& $this->GetList($params); @@ -89,47 +95,47 @@ $block_params['name'] = $this->SelectParam($params, 'render_as,block'); return $this->Application->ParseBlock($block_params); }*/ - + function ListVisitors($params) { $o = ''; $params['render_as'] = $params['item_render_as']; - + $o_visitors = $this->PrintList2($params); - + if($o_visitors) { $header = ''; $footer = ''; - + $block_params = $this->prepareTagParams($params); - + $header_block = getArrayValue($params, 'header_render_as'); if($header_block) { $block_params['name'] = $header_block; $header = $this->Application->ParseBlock($block_params); } - + $footer_block = getArrayValue($params, 'footer_render_as'); if($footer_block) { $block_params['name'] = $footer_block; $footer = $this->Application->ParseBlock($block_params); } - + $o = $header.$o_visitors.$footer; } else { $visitors_params = array('name' => $params['empty_myvisitors_render_as']); $o = $this->Application->ParseBlock($visitors_params); } - - return $o; - - } + + return $o; + + } /* function OrderLink($params){ $object = &$this->Application->recallObject($this->getPrefixSpecial()); @@ -138,14 +144,14 @@ return $main_processor->T($params); } */ - + /** * Enter description here... * * @param unknown_type $params * @return kDBList */ - + function &GetList($params) { $list_name = $this->SelectParam($params, 'list_name,name'); @@ -159,14 +165,14 @@ $names_mapping = $this->Application->GetVar('NamesToSpecialMapping'); $names_mapping[$this->Prefix][$list_name] = $special; $this->Application->SetVar('NamesToSpecialMapping', $names_mapping); - + } - + return parent::GetList($params); } - + } - + ?> \ No newline at end of file