Page MenuHomeIn-Portal Phabricator

in-commerce
No OneTemporary

File Metadata

Created
Sun, Feb 2, 6:53 PM

in-commerce

Index: branches/5.0.x/in-commerce/units/affiliate_plans/affiliate_plans_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/affiliate_plans/affiliate_plans_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/affiliate_plans/affiliate_plans_config.php (revision 12500)
@@ -1,113 +1,114 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'ap',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'AffiliatePlansEventHandler','file'=>'affiliate_plans_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
'AggregateTags' => Array(
),
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'AffiliatePlanId',
'StatusField' => Array('Enabled', 'IsPrimary'), // field, that is affected by Approve/Decline events
'TitleField' => 'Name',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('ap'=>'!la_title_Adding_Affiliate_Plan!'),
'edit_status_labels' => Array('ap'=>'!la_title_Editing_Affiliate_Plan!'),
'new_titlefield' => Array('ap'=>'!la_title_New_Affiliate_Plan!'),
),
'affiliate_plans_list' => Array('prefixes' => Array('ap_List'), 'format' => "!la_title_AffiliatePlans!"),
'affiliate_plans_edit' => Array('prefixes' => Array('ap'), 'format' => "#ap_status# '#ap_titlefield#' - !la_title_General!"),
'affiliate_plans_brackets' => Array('prefixes' => Array('ap','apbrackets_List'), 'format' => "#ap_status# '#ap_titlefield#' - !la_title_AffiliatePlansBrackets!"),
'affiliate_plans_items' => Array('prefixes' => Array('ap','api_List'), 'format' => "#ap_status# '#ap_titlefield#' - !la_title_AffiliatePlansBrackets!"),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'in-commerce/affiliate_plans/affiliate_plans_edit', 'priority' => 1),
'brackets' => Array ('title' => 'la_tab_Brackets', 't' => 'in-commerce/affiliate_plans/affiliate_plans_brackets', 'priority' => 2),
// 'items' => Array ('title' => 'la_tab_Items', 't' => 'in-commerce/affiliate_plans/affiliate_plans_items', 'priority' => 3),
),
),
'PermSection' => Array('main' => 'in-commerce:affiliate_plans'),
'Sections' => Array(
'in-commerce:affiliate_plans' => Array(
'parent' => 'in-commerce:affiliates_folder',
'icon' => 'affiliates',
'label' => 'la_tab_AffiliatePlans',
'url' => Array('t' => 'in-commerce/affiliate_plans/affiliate_plans_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline', 'advanced:set_primary'),
'priority' => 5.2, // <parent_priority>.<own_priority>, because this section replaces parent in tree
'type' => stTAB,
),
),
'TableName' => TABLE_PREFIX.'AffiliatePlans',
'ListSQLs' => Array('' => 'SELECT * FROM %s'),
'ItemSQLs' => Array('' => 'SELECT * FROM %s'),
'SubItems' => Array('apbrackets', /*'api'*/),
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array('IsPrimary' => 'desc'),
'Sorting' => Array('Name' => 'desc'),
)
),
'Fields' => Array(
'AffiliatePlanId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
'Name' => Array('type' => 'string', 'unique' => Array(), 'not_null' => '1', 'required' => 1, 'default' => ''),
'PlanType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(/*0 => 'la_by_amount',*/ 1 => 'la_by_amount', 2 => 'la_by_items_sold'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
'ResetInterval' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(86400 => 'la_day', 604800 => 'la_week', 2628000 => 'la_month', 7884000 => 'la_quartely', 31536000 => 'la_year'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'PaymentType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_regular', 1 => 'la_by_request'), 'use_phrases' => 1, 'not_null' => 1,'default' => 0),
'MinPaymentAmount' => Array('type' => 'string','not_null' => '1','default' => ''),
'Enabled' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Disabled', 1 => 'la_Enabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'IsPrimary' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array (
'default' => 'icon16_item.png',
'0_0' => 'icon16_disabled.png',
'0_1' => 'icon16_disabled.png',
'1_0' => 'icon16_item.png',
'1_1' => 'icon16_primary.png',
+ 'module' => 'core',
),
'Fields' => Array(
'AffiliatePlanId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
'PlanType' => Array( 'title' => 'la_col_PlanType', 'filter_block' => 'grid_options_filter', 'width' => 150, ),
'Enabled' => Array( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 80, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/downloads/downloads_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/downloads/downloads_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/downloads/downloads_config.php (revision 12500)
@@ -1,111 +1,112 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'down',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'kDBEventHandler','file'=>'','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'RegisterClasses' => Array(
Array('pseudo'=>'DownloadHelper','class'=>'DownloadHelper','file'=>'download_helper.php','build_event'=>'','require_classes'=>'kHelper'),
),
'AutoLoad' => true,
'Hooks' => Array(
/*Array(
'Mode' => hBEFORE,
'Conditional' => true,
'HookToPrefix' => 'p',
'HookToSpecial' => '',
'HookToEvent' => Array( 'onPreSave' ),
'DoPrefix' => 'pr',
'DoSpecial' => 'tang',
'DoEvent' => 'OnArrange',
),*/
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
),
'TitlePresets' => Array(
'downloads_list'=>Array( 'prefixes' => Array('down_List'),
'format' => "!la_title_FileDownloads!",
),
),
'PermSection' => Array('main' => 'in-commerce:downloadlog'),
'Sections' => Array(
'in-commerce:downloadlog' => Array(
'parent' => 'in-portal:reports',
'icon' => 'download_log',
'label' => 'la_tab_DownloadLog',
'url' => Array('t' => 'in-commerce/downloads/downloads_list', 'pass' => 'm'),
'permissions' => Array('view', 'delete'),
'priority' => 7,
'type' => stTREE,
),
),
'IDField' => 'DownloadId',
'TitleField' => 'Name',
'TableName' => TABLE_PREFIX.'UserDownloads',
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('StartedOn' => 'desc'),
)
),
'Fields' => Array(
'DownloadId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'PortalUserId' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'Username' => Array('type' => 'string','not_null' => 1, 'default' => ''),
'ProductId' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'ProductName' => Array('type' => 'string','not_null' => 1, 'default' => ''),
'FileId' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'Filename' => Array('type' => 'string','not_null' => 1, 'default' => ''),
'IPAddress' => Array('type' => 'string','not_null' => 1, 'default' => ''),
'StartedOn' => Array('type' => 'int','formatter' => 'kDateFormatter','not_null' => 1, 'default' => 0),
'EndedOn' => Array('type' => 'int','formatter' => 'kDateFormatter','not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array(
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array (
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
+ 'module' => 'core',
),
'Fields' => Array(
'DownloadId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Username' => Array( 'title'=>'la_col_Username', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'ProductName' => Array( 'title'=>'la_col_DownloadedProductName', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
'Filename' => Array( 'title'=>'la_col_DownloadedFileName', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
'IPAddress' => Array( 'title'=>'la_col_IPAddress', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
'StartedOn' => Array( 'title'=>'la_col_StartedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 150, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/reports/reports_event_handler.php
===================================================================
--- branches/5.0.x/in-commerce/units/reports/reports_event_handler.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/reports/reports_event_handler.php (revision 12500)
@@ -1,823 +1,835 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class ReportsEventHandler extends kDBEventHandler {
function mapPermissions()
{
parent::mapPermissions();
$permissions = Array(
// user can view any form on front-end
'OnRunReport' => Array ('self' => 'view'),
'OnUpdateConfig' => Array ('self' => 'view'),
'OnChangeStatistics' => Array ('self' => 'view'),
'OnPieChart' => Array ('self' => 'view'),
'OnPrintChart' => Array ('self' => 'view'),
'OnExportReport' => Array ('self' => 'view'),
);
$this->permMapping = array_merge($this->permMapping, $permissions);
}
function OnRunReport(&$event)
{
$this->Application->LinkVar('reports_finish_t');
$progress_t = $this->Application->GetVar('progress_t');
$event->redirect = $progress_t;
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
if($items_info) $field_values = array_shift($items_info);
$object =& $event->getObject( Array('skip_autoload' => true) );
$object->SetFieldsFromHash($field_values);
$object->UpdateFormattersMasterFields();
$field_values['offset'] = 0;
$table_name = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_SaleReport';
$field_values['table_name'] = $table_name;
$this->Conn->Query('DROP TABLE IF EXISTS '.$table_name);
$filter_value = '';
$from = $object->GetDBField('FromDateTime');
$to = $object->GetDBField('ToDateTime');
$day_seconds = 23 * 60 * 60 + 59 * 60 + 59;
if ($from && !$to) {
$to = $from + $day_seconds;
}
elseif (!$from && $to) {
$from = $to - $day_seconds;
}
if ($from && $to) {
$filter_value = 'AND o.OrderDate >= '.$from.' AND o.OrderDate <= '.$to;
}
$ebay_table_fields = '';
$ebay_joins = '';
$ebay_query_fields = '';
$user_id = $this->Application->RecallVar('user_id');
$sql = 'DELETE FROM '.TABLE_PREFIX.'PersistantSessionData
WHERE
PortalUserId = "'.$user_id.'"
AND VariableName LIKE \'rep_columns_%\'';
$this->Conn->Query($sql);
if ($this->Application->isModuleEnabled('in-auction'))
{
if (in_array($field_values['ReportType'], Array(1,5))) // not overall.
{
$ebay_table_fields = ',
StoreQty int(11) NOT NULL DEFAULT 0,
eBayQty int(11) NOT NULL DEFAULT 0,
StoreAmount double(10,4) NOT NULL DEFAULT 0,
eBayAmount double(10,4) NOT NULL DEFAULT 0,
StoreProfit double(10,4) NOT NULL DEFAULT 0,
eBayProfit double(10,4) NOT NULL DEFAULT 0';
$ebay_joins = '
LEFT JOIN '.TABLE_PREFIX.'eBayOrderItems AS eod
ON od.OptionsSalt = eod.OptionsSalt
';
$ebay_query_fields = ',
SUM(IF(ISNULL(eod.OptionsSalt), od.Quantity, 0)) as StoreQty,
SUM(IF(ISNULL(eod.OptionsSalt), 0, od.Quantity)) as eBayQty,
SUM(IF(ISNULL(eod.OptionsSalt), od.Price * od.Quantity, 0)) as StoreAmount,
SUM(IF(ISNULL(eod.OptionsSalt), 0, od.Price * od.Quantity)) as eBayAmount,
SUM(IF(ISNULL(eod.OptionsSalt), (od.Price - od.Cost) * od.Quantity, 0)) as StoreProfit,
SUM(IF(ISNULL(eod.OptionsSalt), 0, (od.Price - od.Cost) * od.Quantity)) as eBayProfit
';
}
}
if ($field_values['ReportType'] == 1) { // by Category
$q = 'CREATE TABLE '.$table_name.' (
CategoryId int(11) NOT NULL DEFAULT 0,
Qty int(11) NOT NULL DEFAULT 0,
Cost double(10,4) NOT NULL DEFAULT 0,
Amount double(10,4) NOT NULL DEFAULT 0,
Tax double(10,4) NOT NULL DEFAULT 0,
Shipping double(10,4) NOT NULL DEFAULT 0,
Processing double(10,4) NOT NULL DEFAULT 0,
Profit double(10,4) NOT NULL DEFAULT 0
'.$ebay_table_fields.'
)';
$field_values['total'] = $this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Category');
$this->Conn->Query($q);
$q = 'INSERT INTO '.$field_values['table_name'].'
SELECT
c.CategoryId,
SUM(od.Quantity) as Qty,
SUM(od.Cost * od.Quantity) as Cost,
SUM(od.Price * od.Quantity) as SaleAmount,
SUM(o.VAT * od.Price * od.Quantity / o.SubTotal) as Tax,
SUM(o.ShippingCost * od.Price * od.Quantity / o.SubTotal) as Shipping,
SUM(o.ProcessingFee * od.Price * od.Quantity / o.SubTotal) as Processing,
SUM((od.Price - od.Cost) * od.Quantity) as Profit'
.$ebay_query_fields.'
FROM '.TABLE_PREFIX.'Orders AS o
LEFT JOIN '.TABLE_PREFIX.'OrderItems AS od
ON od.OrderId = o.OrderId
LEFT JOIN '.TABLE_PREFIX.'Products AS p
ON p.ProductId = od.ProductId
LEFT JOIN '.TABLE_PREFIX.'CategoryItems AS ci
ON ci.ItemResourceId = p.ResourceId
LEFT JOIN '.TABLE_PREFIX.'Category AS c
ON c.CategoryId = ci.CategoryId
'.$ebay_joins.'
WHERE
o.Status IN (4,6)
AND
ci.PrimaryCat = 1
'.$filter_value.'
GROUP BY c.CategoryId
HAVING NOT ISNULL(CategoryId)
';
$this->Conn->Query($q);
}
elseif ($field_values['ReportType'] == 2) { // by User
$q = 'CREATE TABLE '.$table_name.' (
PortalUserId int(11) NOT NULL DEFAULT 0,
Qty int(11) NOT NULL DEFAULT 0,
Cost double(10,4) NOT NULL DEFAULT 0,
Amount double(10,4) NOT NULL DEFAULT 0,
Tax double(10,4) NOT NULL DEFAULT 0,
Shipping double(10,4) NOT NULL DEFAULT 0,
Processing double(10,4) NOT NULL DEFAULT 0,
Profit double(10,4) NOT NULL DEFAULT 0
)';
$field_values['total'] = $this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Category');
$this->Conn->Query($q);
$q = 'INSERT INTO '.$field_values['table_name'].'
SELECT
u.PortalUserId,
SUM(od.Quantity) as Qty,
SUM(od.Cost * od.Quantity) as Cost,
SUM(od.Price * od.Quantity) as SaleAmount,
SUM(o.VAT * od.Price * od.Quantity / o.SubTotal) as Tax,
SUM(o.ShippingCost * od.Price * od.Quantity / o.SubTotal) as Shipping,
SUM(o.ProcessingFee * od.Price * od.Quantity / o.SubTotal) as Processing,
SUM((od.Price - od.Cost) * od.Quantity) as Profit
FROM '.TABLE_PREFIX.'Orders AS o
LEFT JOIN '.TABLE_PREFIX.'OrderItems AS od
ON od.OrderId = o.OrderId
LEFT JOIN '.TABLE_PREFIX.'PortalUser AS u
ON u.PortalUserId = o.PortalUserId
WHERE
o.Status IN (4,6)
'.$filter_value.'
GROUP BY u.PortalUserId
HAVING NOT ISNULL(PortalUserId)
';
$this->Conn->Query($q);
}
elseif ($field_values['ReportType'] == 5) { // by Product
$q = 'CREATE TABLE '.$table_name.' (
ProductId int(11) NOT NULL DEFAULT 0,
Qty int(11) NOT NULL DEFAULT 0,
Cost double(10,4) NOT NULL DEFAULT 0,
Amount double(10,4) NOT NULL DEFAULT 0,
Tax double(10,4) NOT NULL DEFAULT 0,
Shipping double(10,4) NOT NULL DEFAULT 0,
Processing double(10,4) NOT NULL DEFAULT 0,
Profit double(10,4) NOT NULL DEFAULT 0'
.$ebay_table_fields.'
)';
$field_values['total'] = $this->Conn->GetOne('SELECT COUNT(*) FROM '.TABLE_PREFIX.'Products');
$this->Conn->Query($q);
$q = 'INSERT INTO '.$field_values['table_name'].'
SELECT
p.ProductId,
SUM(od.Quantity) as Qty,
SUM(od.Cost * od.Quantity) as Cost,
SUM(od.Price * od.Quantity) as SaleAmount,
SUM(o.VAT * od.Price * od.Quantity / o.SubTotal) as Tax,
SUM(o.ShippingCost * od.Price * od.Quantity / o.SubTotal) as Shipping,
SUM(o.ProcessingFee * od.Price * od.Quantity / o.SubTotal) as Processing,
SUM((od.Price - od.Cost) * od.Quantity) as Profit'
.$ebay_query_fields.'
FROM '.TABLE_PREFIX.'Orders AS o
LEFT JOIN '.TABLE_PREFIX.'OrderItems AS od
ON od.OrderId = o.OrderId
LEFT JOIN '.TABLE_PREFIX.'Products AS p
ON p.ProductId = od.ProductId
'.$ebay_joins.'
WHERE
o.Status IN (4,6)
'.$filter_value.'
GROUP BY p.ProductId
HAVING NOT ISNULL(ProductId)
';
$this->Conn->Query($q);
}
elseif ($field_values['ReportType'] == 12) { // Overall
$q = 'CREATE TABLE '.$table_name.' (
Marketplace tinyint(1) NOT NULL DEFAULT 0,
Qty int(11) NOT NULL DEFAULT 0,
Cost double(10,4) NOT NULL DEFAULT 0,
Amount double(10,4) NOT NULL DEFAULT 0,
Tax double(10,4) NOT NULL DEFAULT 0,
Shipping double(10,4) NOT NULL DEFAULT 0,
Processing double(10,4) NOT NULL DEFAULT 0,
Profit double(10,4) NOT NULL DEFAULT 0
)';
$this->Conn->Query($q);
if ($this->Application->isModuleEnabled('in-auction'))
{
$field_values['total'] = 2;
$q = 'INSERT INTO '.$field_values['table_name'].'
SELECT
1 AS Marketplace,
SUM(IF(ISNULL(eod.OptionsSalt), od.Quantity, 0)) as Qty,
SUM(IF(ISNULL(eod.OptionsSalt), od.Cost * od.Quantity, 0)) as Cost,
SUM(IF(ISNULL(eod.OptionsSalt), od.Price * od.Quantity, 0)) as SaleAmount,
SUM(IF(ISNULL(eod.OptionsSalt), o.VAT * od.Price * od.Quantity / o.SubTotal, 0)) as Tax,
SUM(IF(ISNULL(eod.OptionsSalt), o.ShippingCost * od.Price * od.Quantity / o.SubTotal, 0)) as Shipping,
SUM(IF(ISNULL(eod.OptionsSalt), o.ProcessingFee * od.Price * od.Quantity / o.SubTotal, 0)) as Processing,
SUM(IF(ISNULL(eod.OptionsSalt), (od.Price - od.Cost) * od.Quantity, 0)) as Profit
FROM '.TABLE_PREFIX.'Orders AS o
LEFT JOIN '.TABLE_PREFIX.'OrderItems AS od
ON od.OrderId = o.OrderId
LEFT JOIN '.TABLE_PREFIX.'eBayOrderItems AS eod
ON od.OptionsSalt = eod.OptionsSalt
WHERE
o.Status IN (4,6)
'.$filter_value;
$this->Conn->Query($q);
$q = 'INSERT INTO '.$field_values['table_name'].'
SELECT
2 AS Marketplace,
SUM(IF(ISNULL(eod.OptionsSalt), 0, od.Quantity)) as Qty,
SUM(IF(ISNULL(eod.OptionsSalt), 0, od.Cost * od.Quantity)) as Cost,
SUM(IF(ISNULL(eod.OptionsSalt), 0, od.Price * od.Quantity)) as SaleAmount,
SUM(IF(ISNULL(eod.OptionsSalt), 0, o.VAT * od.Price * od.Quantity / o.SubTotal)) as Tax,
SUM(IF(ISNULL(eod.OptionsSalt), 0, o.ShippingCost * od.Price * od.Quantity / o.SubTotal)) as Shipping,
SUM(IF(ISNULL(eod.OptionsSalt), 0, o.ProcessingFee * od.Price * od.Quantity / o.SubTotal)) as Processing,
SUM(IF(ISNULL(eod.OptionsSalt), 0, (od.Price - od.Cost) * od.Quantity)) as Profit
FROM '.TABLE_PREFIX.'Orders AS o
LEFT JOIN '.TABLE_PREFIX.'OrderItems AS od
ON od.OrderId = o.OrderId
LEFT JOIN '.TABLE_PREFIX.'eBayOrderItems AS eod
ON od.OptionsSalt = eod.OptionsSalt
WHERE
o.Status IN (4,6)
'.$filter_value;
$this->Conn->Query($q);
} else {
$field_values['total'] = 1;
$q = 'INSERT INTO '.$field_values['table_name'].'
SELECT
1 AS Marketplace,
SUM(od.Quantity) as Qty,
SUM(od.Cost * od.Quantity) as Cost,
SUM(od.Price * od.Quantity) as SaleAmount,
SUM(o.VAT * od.Price * od.Quantity / o.SubTotal) as Tax,
SUM(o.ShippingCost * od.Price * od.Quantity / o.SubTotal) as Shipping,
SUM(o.ProcessingFee * od.Price * od.Quantity / o.SubTotal) as Processing,
SUM((od.Price - od.Cost) * od.Quantity) as Profit
FROM '.TABLE_PREFIX.'Orders AS o
LEFT JOIN '.TABLE_PREFIX.'OrderItems AS od
ON od.OrderId = o.OrderId
WHERE
o.Status IN (4,6)
'.$filter_value;
$this->Conn->Query($q);
}
}
$vars = array('rep_Page', 'rep_Sort1', 'rep_Sort1_Dir', 'rep_Sort2', 'rep_Sort2_Dir');
foreach ($vars as $var_name) {
$this->Application->RemoveVar($var_name);
}
//temporary
$event->redirect = $this->Application->GetVar('reports_finish_t');
$field_values['from'] = $from;
$field_values['to'] = $to;
$this->Application->StoreVar('report_options', serialize($field_values));
}
function OnUpdateConfig(&$event)
{
$report = $this->Application->RecallVar('report_options');
if (!$report) {
return ;
}
$field_values = unserialize($report);
$rep_options = $this->Application->getUnitOptions('rep');
$new_options = Array ();
$new_options['TableName'] = $field_values['table_name'];
$new_options['Fields'] = Array (
'Qty' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%d', 'default' => 0, 'totals' => 'sum'),
'Cost' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
'Amount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
'Tax' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
'Shipping' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
'Processing' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
'Profit' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
);
if ( $this->Application->isModuleEnabled('in-auction') ) {
if ( in_Array ($field_values['ReportType'], Array (1, 5)) ) {
$new_options['Fields'] += Array (
'StoreQty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'format' => '%d', 'default' => 0, 'totals' => 'sum'),
'StoreAmount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
'StoreProfit' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
'eBayQty' => Array ('type' => 'int', 'formatter' => 'kFormatter', 'format' => '%d', 'default' => 0, 'totals' => 'sum'),
'eBayAmount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
'eBayProfit' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%.2f', 'default' => 0, 'totals' => 'sum'),
);
}
}
if ($field_values['ReportType'] == 1) { // by Category
$new_options['ListSQLs'][''] =
'SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Category AS c
ON c.CategoryId = %1$s.CategoryId';
$new_options['Grids']['Default'] = Array (
- 'Icons' => Array ('default' => 'icon16_item.png'),
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 'module' => 'core',
+ ),
'Fields' => Array (
'CategoryName' => Array ('title' => 'la_col_CategoryName', 'filter_block' => 'grid_like_filter'),
'Qty' => Array ('title' => 'la_col_Qty', 'td_style' => 'text-align: center', 'total' => 'sum', 'filter_block' => 'grid_range_filter'),
'StoreQty' => Array ('title' => 'la_col_StoreQty', 'td_style' => 'text-align: center', 'total' => 'sum', 'filter_block' => 'grid_range_filter'),
'eBayQty' => Array ('title' => 'la_col_eBayQty', 'td_style' => 'text-align: center', 'total' => 'sum', 'filter_block' => 'grid_range_filter'),
'Cost' => Array ('title' => 'la_col_Cost', 'td_style' => 'text-align: right', 'total' => 'sum', 'hidden' => 1, 'filter_block' => 'grid_float_range_filter'),
'Amount' => Array ('title' => 'la_col_GMV', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'StoreAmount' => Array ('title' => 'la_col_StoreGMV', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'eBayAmount' => Array ('title' => 'la_col_eBayGMV', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Tax' => Array ('title' => 'la_col_Tax', 'td_style' => 'text-align: right', 'total' => 'sum', 'hidden' => 1, 'filter_block' => 'grid_float_range_filter'),
'Shipping' => Array ('title' => 'la_col_Shipping', 'td_style' => 'text-align: right', 'total' => 'sum', 'hidden' => 1, 'filter_block' => 'grid_float_range_filter'),
'Processing' => Array ('title' => 'la_col_Processing', 'td_style' => 'text-align: right', 'total' => 'sum', 'hidden' => 1, 'filter_block' => 'grid_float_range_filter'),
'Profit' => Array ('title' => 'la_col_Profit', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'StoreProfit' => Array ('title' => 'la_col_StoreProfit', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'eBayProfit' => Array ('title' => 'la_col_eBayProfit', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
),
);
if (!$this->Application->isModuleEnabled('in-auction')) {
$a_fields =& $new_options['Grids']['Default']['Fields'];
unset($a_fields['StoreQty']);
unset($a_fields['eBayQty']);
unset($a_fields['StoreAmount']);
unset($a_fields['eBayAmount']);
unset($a_fields['StoreProfit']);
unset($a_fields['eBayProfit']);
}
$new_options['VirtualFields'] = array_merge($rep_options['VirtualFields'], Array (
'CategoryName' => Array ('type' => 'string', 'default' => ''),
'Metric' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => $this->GetMetricOptions($new_options, 'CategoryName'),
'use_phrases' => 1,
'default' => 0,
),
));
$lang = $this->Application->GetVar('m_lang');
// products root category
$products_category_id = $this->Application->findModule('Name', 'In-Commerce', 'RootCat');
// get root category name
$sql = 'SELECT LENGTH(l' . $lang . '_CachedNavbar)
FROM ' . TABLE_PREFIX . 'Category
WHERE CategoryId = '.$products_category_id;
$root_length = $this->Conn->GetOne($sql) + 4;
$new_options['CalculatedFields'][''] = array(
'CategoryName' => 'REPLACE(SUBSTR(c.l'.$lang.'_CachedNavbar, '.$root_length.'), "&|&", " > ")',
);
}
elseif ($field_values['ReportType'] == 2) { // by User
$new_options['ListSQLs'][''] =
'SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser AS u
ON u.PortalUserId = %1$s.PortalUserId';
$new_options['Grids']['Default'] = Array (
- 'Icons' => Array ('default' => 'icon16_item.png'),
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 'module' => 'core',
+ ),
'Fields' => Array (
'Login' => Array ('title' => 'la_col_Login', 'filter_block' => 'grid_like_filter'),
'FirstName' => Array ('title' => 'la_col_FirstName', 'filter_block' => 'grid_like_filter'),
'LastName' => Array ('title' => 'la_col_LastName', 'filter_block' => 'grid_like_filter'),
'Qty' => Array ('title' => 'la_col_Qty', 'td_style' => 'text-align: center', 'total' => 'sum', 'filter_block' => 'grid_range_filter'),
'Cost' => Array ('title' => 'la_col_Cost', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Amount' => Array ('title' => 'la_col_GMV', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Tax' => Array ('title' => 'la_col_Tax', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Shipping' => Array ('title' => 'la_col_Shipping', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Processing' => Array ('title' => 'la_col_Processing', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Profit' => Array ('title' => 'la_col_Profit', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
),
);
$new_options['VirtualFields'] = array_merge($rep_options['VirtualFields'], Array (
'Login' => Array ('type' => 'string', 'default' => ''),
'FirstName' => Array ('type' => 'string', 'default' => ''),
'LastName' => Array ('type' => 'string', 'default' => ''),
));
$new_options['CalculatedFields'][''] = Array (
'Login' => 'u.Login',
'FirstName' => 'u.FirstName',
'LastName' => 'u.LastName',
);
}
elseif ($field_values['ReportType'] == 5) { // by Product
$new_options['ListSQLs'][''] =
'SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Products AS p
ON p.ProductId = %1$s.ProductId';
$new_options['Grids']['Default'] = Array (
- 'Icons' => Array ('default' => 'icon16_item.png'),
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 'module' => 'core',
+ ),
'Fields' => Array (
'ProductName' => Array ('title' => 'la_col_ProductName', 'filter_block' => 'grid_like_filter'),
'Qty' => Array ('title' => 'la_col_Qty', 'td_style' => 'text-align: center', 'total' => 'sum', 'filter_block' => 'grid_range_filter'),
'StoreQty' => Array ('title' => 'la_col_StoreQty', 'td_style' => 'text-align: center', 'total' => 'sum', 'filter_block' => 'grid_range_filter'),
'eBayQty' => Array ('title' => 'la_col_eBayQty', 'td_style' => 'text-align: center', 'total' => 'sum', 'filter_block' => 'grid_range_filter'),
'Cost' => Array ('title' => 'la_col_Cost', 'td_style' => 'text-align: right', 'total' => 'sum', 'hidden' => 1, 'filter_block' => 'grid_float_range_filter'),
'Amount' => Array ('title' => 'la_col_GMV', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'StoreAmount' => Array ('title' => 'la_col_StoreGMV', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'eBayAmount' => Array ('title' => 'la_col_eBayGMV', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Tax' => Array ('title' => 'la_col_Tax', 'td_style' => 'text-align: right', 'total' => 'sum', 'hidden' => 1, 'filter_block' => 'grid_float_range_filter'),
'Shipping' => Array ('title' => 'la_col_Shipping', 'td_style' => 'text-align: right', 'total' => 'sum', 'hidden' => 1, 'filter_block' => 'grid_float_range_filter'),
'Processing' => Array ('title' => 'la_col_Processing', 'td_style' => 'text-align: right', 'total' => 'sum', 'hidden' => 1, 'filter_block' => 'grid_float_range_filter'),
'Profit' => Array ('title' => 'la_col_Profit', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'StoreProfit' => Array ('title' => 'la_col_StoreProfit', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'eBayProfit' => Array ('title' => 'la_col_eBayProfit', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
),
);
if (!$this->Application->isModuleEnabled('in-auction'))
{
$a_fields =& $new_options['Grids']['Default']['Fields'];
unset($a_fields['StoreQty']);
unset($a_fields['eBayQty']);
unset($a_fields['StoreAmount']);
unset($a_fields['eBayAmount']);
unset($a_fields['StoreProfit']);
unset($a_fields['eBayProfit']);
}
$new_options['VirtualFields'] = array_merge($rep_options['VirtualFields'], Array (
'ProductName' => Array ('type' => 'string', 'default' => ''),
'Metric' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => $this->GetMetricOptions($new_options, 'ProductName'),
'use_phrases' => 1,
'default' => 0
),
));
$lang = $this->Application->GetVar('m_lang');
$new_options['CalculatedFields'][''] = Array (
'ProductName' => 'p.l'.$lang.'_Name',
);
}
elseif ($field_values['ReportType'] == 12) { // Overall
$new_options['ListSQLs'][''] =
'SELECT %1$s.* %2$s FROM %1$s';
$new_options['Fields']['Marketplace'] = Array (
'formatter' => 'kOptionsFormatter',
'options' => Array (
1 => 'la_OnlineStore',
2 => 'la_eBayMarketplace',
),
'use_phrases' => 1,
'default' => 1
);
$new_options['Grids']['Default'] = Array(
- 'Icons' => Array('default' => 'icon16_item.png'),
+ 'Icons' => Array(
+ 'default' => 'icon16_item.png',
+ 'module' => 'core',
+ ),
'Fields' => Array(
'Marketplace' => Array ('title' => 'la_col_Marketplace', 'filter_block' => 'grid_options_filter'),
'Qty' => Array ('title' => 'la_col_Qty', 'td_style' => 'text-align: center', 'total' => 'sum', 'filter_block' => 'grid_range_filter'),
'Cost' => Array ('title' => 'la_col_Cost', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Amount' => Array ('title' => 'la_col_GMV', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Tax' => Array ('title' => 'la_col_Tax', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Shipping' => Array ('title' => 'la_col_Shipping', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Processing' => Array ('title' => 'la_col_Processing', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
'Profit' => Array ('title' => 'la_col_Profit', 'td_style' => 'text-align: right', 'total' => 'sum', 'filter_block' => 'grid_float_range_filter'),
),
);
$new_options['VirtualFields'] = array_merge($rep_options['VirtualFields'], array(
'Metric' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter',
'options' => $this->GetMetricOptions($new_options, 'Marketplace'),
'use_phrases' => 1,
'default' => 0
),
));
$lang = $this->Application->GetVar('m_lang');
}
$new_options['ListSortings'] = Array(
'' => Array(
'Sorting' => Array('Amount' => 'desc'),
)
);
foreach ($new_options as $key => $val) {
$this->Application->setUnitOption('rep', $key, $val);
}
}
/**
* Enter description here...
*
* @param kdbItem $object
* @param string $search_field
* @param string $value
* @param string $type
*/
function processRangeField(&$object, $search_field, $type)
{
$value = $object->GetField($search_field);
if (!$value) return false;
$lang_current =& $this->Application->recallObject('lang.current');
$dt_separator = getArrayValue($object->GetFieldOptions($search_field), 'date_time_separator');
if (!$dt_separator) {
$dt_separator = ' ';
}
$time = ($type == 'from') ? adodb_mktime(0, 0, 0) : adodb_mktime(23, 59, 59);
$time = adodb_date($lang_current->GetDBField('InputTimeFormat'), $time);
$full_value = $value.$dt_separator.$time;
$formatter =& $this->Application->recallObject($object->Fields[$search_field]['formatter']);
$value_ts = $formatter->Parse($full_value, $search_field, $object);
$pseudo = getArrayValue($object->FieldErrors, $search_field, 'pseudo');
if ($pseudo) {
unset($object->FieldErrors[$search_field]); // remove error!
// invalid format -> ignore this date in search
return false;
}
return $value_ts;
}
/**
* Generate Metric Field Options
*
* @param array $a_config_options
* @param string $exclude_field
*/
function GetMetricOptions(&$a_config_options, $exclude_field)
{
$a_ret = Array();
foreach ($a_config_options['Grids']['Default']['Fields'] AS $field => $a_options)
{
if ($field == $exclude_field)
{
continue;
}
$a_ret[$field] = $a_options['title'];
}
return $a_ret;
}
function OnChangeStatistics(&$event)
{
$this->Application->StoreVar('ChartMetric', $this->Application->GetVar('metric'));
}
function OnPieChart(&$event)
{
$ChartHelper =& $this->Application->RecallObject('ChartHelper');
header("Content-type: image/png");
$width = $event->getEventParam('width');
if (!$width) {
$width = 800;
}
$height = $event->getEventParam('height');
if (!$height) {
$height = 600;
}
$a_data = unserialize($this->Application->RecallVar('graph_data'));
$chart = new LibchartPieChart($width, $height);
$dataSet = new LibchartXYDataSet();
foreach ($a_data AS $key=>$a_values)
{
$dataSet->addPoint(new LibchartPoint($a_values['Name'], $a_values['Metric']));
// $dataSet->addPoint(new LibchartPoint($a_values['Name'].' ('.$a_values['Metric'].')', $a_values['Metric']));
}
$chart->setDataSet($dataSet);
$chart->setTitle($this->Application->RecallVar('graph_metric'));
$chart->render();
$event->status = erSTOP;
}
/** Generates png-chart output
*
* @param kEvent $event
*/
function OnPrintChart(&$event)
{
$ChartHelper =& $this->Application->RecallObject('ChartHelper');
header("Content-type: image/png");
$width = $this->Application->GetVar('width');
if ($width == 0)
{
$width = 800;
}
$height = $this->Application->GetVar('height');
if ($height == 0)
{
$height = 400;
}
$chart = new LibchartLineChart($width, $height);
$a_labels = unserialize($this->Application->RecallVar('graph_labels'));
if ($this->Application->isModuleEnabled('in-auction'))
{
$serie1 = new LibchartXYDataSet();
$a_serie = unserialize($this->Application->RecallVar('graph_serie1'));
foreach ($a_labels AS $key=>$value)
{
$serie1->addPoint(new LibchartPoint($value, $a_serie[$key]));
}
}
$serie2 = new LibchartXYDataSet();
$a_serie = unserialize($this->Application->RecallVar('graph_serie2'));
foreach ($a_labels AS $key=>$value)
{
$serie2->addPoint(new LibchartPoint($value, $a_serie[$key]));
}
$dataSet = new LibchartXYSeriesDataSet();
if ($this->Application->isModuleEnabled('in-auction'))
{
$dataSet->addSerie($this->Application->RecallVar('graph_serie1_label'), $serie1);
}
$dataSet->addSerie($this->Application->RecallVar('graph_serie2_label'), $serie2);
$chart->setDataSet($dataSet);
$chart->setTitle($this->Application->RecallVar('graph_metric'));
$Plot =& $chart->getPlot();
$Plot->setGraphCaptionRatio(0.7);
$chart->render();
$event->status = erSTOP;
}
function OnExportReport(&$event)
{
$report =& $this->Application->recallObject($event->getPrefixSpecial(),'rep_List',Array('skip_counting'=>true,'per_page'=>-1) );
/* @var $report kDBList*/
$ReportItem =& $this->Application->recallObject('rep.item', 'rep', Array('skip_autoload' => true));
/* @var $ReportItem kDBItem*/
$a_grids = $this->Application->getUnitOption('rep', 'Grids');
$a_fields = $a_grids['Default']['Fields'];
$ret = '';
foreach ($a_fields AS $field => $a_props)
{
$ret .= '<commas>'.$field.'<commas><tab>';
}
$ret = substr($ret, 0, strlen($ret) - 5).'<cr>';
$report->Query(true);
$report->GoFirst();
$counter = 0;
$a_totals = Array();
foreach ($a_fields AS $field => $a_props) {
$counter++;
if ($counter == 1)
{
continue;
}
$a_totals[$field] = 0;
}
foreach($report->Records as $a_row) {
$ReportItem->SetFieldsFromHash($a_row);
$row = '';
foreach ($a_fields AS $field => $a_props)
{
$row .= '<commas>'.$ReportItem->GetField($field).'<commas><tab>';
$a_totals[$field] += $a_row[$field];
}
$ret .= substr($row, 0, strlen($row) - 5).'<cr>';
}
// totals
$ReportItem->SetFieldsFromHash($a_totals);
$counter = 0;
foreach ($a_fields AS $field => $a_props)
{
$counter++;
if ($counter == 1)
{
$row = '<commas><commas><tab>';
continue;
}
$row .= '<commas>'.$ReportItem->GetField($field).'<commas><tab>';
}
$ret .= substr($row, 0, strlen($row) - 5).'<cr>';
$ret = str_replace("\r",'', $ret);
$ret = str_replace("\n",'', $ret);
$ret = str_replace('"','\'\'', $ret);
$ret = str_replace('<commas>','"', $ret);
$ret = str_replace('<tab>',',', $ret);
$ret = str_replace('<cr>',"\r", $ret);
$report_options = unserialize($this->Application->RecallVar('report_options'));
switch ($report_options['ReportType'])
{
case 1:
$file_name = '-ByCategory';
break;
case 2:
$file_name = '-ByUser';
break;
case 5:
$file_name = '-ByProduct';
break;
case 12:
$file_name = '';
break;
}
header("Content-type: application/txt");
header("Content-length: ".(string)strlen($ret));
header("Content-Disposition: attachment; filename=\"".html_entity_decode('SalesReport'.$file_name.'-'.date('d-M-Y').'.csv')."\"");
header("Pragma: no-cache"); //some IE-fixing stuff
echo $ret;
exit();
}
}
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/reports/reports_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/reports/reports_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/reports/reports_config.php (revision 12500)
@@ -1,135 +1,138 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'rep',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ReportsEventHandler','file'=>'reports_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ReportsTagProcessor','file'=>'reports_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode', // 't' for temp '' for normal
),
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'rep',
'HookToSpecial' => '*',
'HookToEvent' => Array('OnAfterConfigRead'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnUpdateConfig',
),
),
'IDField' => 'CategoryId',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('d'=>'!la_title_Adding_Discount!'),
'edit_status_labels' => Array('d'=>'!la_title_Editing_Discount!'),
'new_titlefield' => Array('d'=>'!la_title_New_Discount!'),
),
'report_options'=>Array('format' => "!la_title_ReportOptions!"),
'report_results'=>Array('format' => "!la_title_ReportResults!"),
'report_chart'=>Array('format' => "!la_title_SalesReportChart!"),
),
'PermSection' => Array('main' => 'in-commerce:reports'),
'Sections' => Array(
'in-commerce:reports' => Array(
'parent' => 'in-commerce',
'icon' => 'in-commerce:sales_report',
'label' => 'la_tab_SaleReports',
'url' => Array('t' => 'in-commerce/reports/reports', 'pass' => 'm,rep', 'rep_event'=>'OnNew'),
'permissions' => Array('view', 'add'),
'priority' => 2,
'type' => stTREE,
),
),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER),
Array('mode' => 'AND', 'filters' => Array(4,5,6), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Status != 1' ),
1 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => 'Status != 2' ),
2 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ),
3 => Array(),
4 => Array('label' => 'la_Flat', 'on_sql' => '', 'off_sql' => 'Type != 1' ),
5 => Array('label' => 'la_Percent', 'on_sql' => '', 'off_sql' => 'Type != 2' ),
6 => Array('label' => 'la_FreeShipping', 'on_sql' => '', 'off_sql' => 'Type != 3' ),
)
),
'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %1$s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Name' => 'asc'),
)
),
'CalculatedFields' => Array (
'' => Array (
'CategoryId' => '0',
),
),
'Fields' => Array(
),
'VirtualFields' => Array(
'ReportType' => array('formatter'=>'kOptionsFormatter','options'=>array(
12 => 'la_Overall',
1 => 'la_ByCategory',
2 => 'la_ByUser',
5 => 'la_byProduct'
),'use_phrases'=>1,'default'=>12
),
'FromDateTime' => Array('formatter'=>'kDateFormatter','default'=>'','filter_type'=>'range_from','filter_field'=>'OrderDate' ),
'ToDateTime' => Array('formatter'=>'kDateFormatter','default'=>'','filter_type'=>'range_to','filter_field'=>'OrderDate', 'empty_time' => adodb_mktime(23,59,59) ),
'Recursive' => array('default'=>1),
'SkipEmpty' => array('default'=>1),
'CategoryId' => Array ('type' => 'int', 'default' => 0),
),
'Grids' => Array(
'Default' => Array(
- 'Icons' => Array('default'=>'icon16_item.png'),
+ 'Icons' => Array(
+ 'default' => 'icon16_item.png',
+ 'module' => 'core',
+ ),
'Fields' => Array(
'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
'Start' => Array( 'title'=>'la_col_Start', 'filter_block' => 'grid_date_range_filter'),
'End' => Array( 'title'=>'la_col_End', 'filter_block' => 'grid_date_range_filter'),
'GroupId' => Array( 'title'=>'la_col_Group', 'filter_block' => 'grid_options_filter'),
'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter'),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/affiliate_payments/affiliate_payments_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/affiliate_payments/affiliate_payments_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/affiliate_payments/affiliate_payments_config.php (revision 12500)
@@ -1,150 +1,156 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'apayments',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'AffiliatePaymentsEventHandler','file'=>'affiliate_payments_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'AffiliatePaymentsTagProcessor','file'=>'affiliate_payments_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'AggregateTags' => Array(
Array(
'AggregateTo' => 'ord',
'AggregatedTagName' => 'InitPaymentsList',
'LocalTagName' => 'InitList',
),
Array(
'AggregateTo' => 'ord',
'AggregatedTagName' => 'ListPayments',
'LocalTagName' => 'ListPayments',
),
Array(
'AggregateTo' => 'ord',
'AggregatedTagName' => 'PaymentsPaginationBar',
'LocalTagName' => 'PaginationBar',
),
Array(
'AggregateTo' => 'ord',
'AggregatedTagName' => 'PaymentsCount',
'LocalTagName' => 'TotalRecords',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
),
'IDField' => 'AffiliatePaymentId',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('apayments'=>'!la_title_Adding_Affiliate_Payment!'),
'edit_status_labels' => Array('apayments'=>'!la_title_Editing_Affiliate_Payment!'),
'new_titlefield' => Array('apayments'=>'!la_title_New_Affiliate_Payment!'),
),
'payments_log' => Array('prefixes' => Array('apayments.log_List'), 'format' => "!la_title_AffiliatePayments!"),
),
'Sections' => Array(
'in-commerce:paymentlog' => Array(
'parent' => 'in-commerce',
'icon' => 'transactions',
'label' => 'la_tab_PaymentLog',
'url' => Array('t' => 'in-commerce/payments/payments_list', 'pass' => 'm'),
'permissions' => Array('view'),
'priority' => 6,
'type' => stTREE,
),
),
'TableName' => TABLE_PREFIX.'AffiliatePayments',
'ListSQLs' => Array(''=>' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Affiliates af ON %1$s.AffiliateId = af.AffiliateId
LEFT JOIN '.TABLE_PREFIX.'PortalUser au ON af.PortalUserId = au.PortalUserId'),
'ItemSQLs' => Array(''=>' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Affiliates af ON %1$s.AffiliateId = af.AffiliateId
LEFT JOIN '.TABLE_PREFIX.'PortalUser au ON af.PortalUserId = au.PortalUserId'),
'CalculatedFields' => Array(
'' => Array(
'PortalUserId' => 'af.PortalUserId',
),
'log' => Array(
'Username' => 'au.Login',
'PortalUserId' => 'af.PortalUserId',
),
),
'ForeignKey' => 'AffiliateId',
'ParentTableKey' => 'AffiliateId',
'ParentPrefix' => 'affil',
'AutoDelete' => true,
'AutoClone' => true,
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('PaymentDate' => 'desc'),
)
),
'Fields' => Array(
'AffiliatePaymentId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'AffiliateId' => Array('type'=>'int','formatter'=>'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(0 => 'lu_None'), 'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'Affiliates af LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = af.PortalUserId WHERE `%s` = \'%s\'','left_key_field'=>'AffiliateId','left_title_field'=>'Login','not_null'=>1,'default'=>0),
'PaymentDate' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'not_null' => '1','default' => '#NOW#'),
'Amount' => Array('type' => 'double', 'formatter'=>'kFormatter', 'format'=>'%.02f', 'not_null' => '1', 'required'=>1, 'default' => '0.00'),
'Comment' => Array('type' => 'string', 'formatter' => 'kFormatter', 'not_null' => 1, 'using_fck' => 1, 'default' => ''),
'PaymentReference' => Array('type' => 'string','not_null' => '1','default' => ''),
'PaymentTypeId' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT Name, PaymentTypeId FROM '.TABLE_PREFIX.'AffiliatePaymentTypes WHERE Status = 1 ORDER BY IsPrimary DESC, Priority DESC, Name ASC', 'option_key_field'=>'PaymentTypeId', 'option_title_field'=>'Name', 'not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array(
'Username' => Array('type' => 'string'),
'PortalUserId' => Array('type' => 'int'),
),
'Grids' => Array(
'Default' => Array(
- 'Icons' => Array('default'=>'icon16_item.png'),
+ 'Icons' => Array(
+ 'default' => 'icon16_item.png',
+ 'module' => 'core',
+ ),
'Fields' => Array(
'AffiliatePaymentId'=> Array( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'PaymentDate' => Array( 'title' => 'la_col_PaymentDate', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'Amount' => Array( 'title' => 'la_col_Amount', 'filter_block' => 'grid_float_range_filter'),
'Comment' => Array( 'title' => 'la_col_Comment', 'filter_block' => 'grid_like_filter', 'first_chars' => 50),
'PaymentTypeId' => Array( 'title' => 'la_col_PaymentType', 'filter_block' => 'grid_options_filter'),
'PaymentReference' => Array( 'title' => 'la_col_PaymentReference', 'filter_block' => 'grid_like_filter', 'first_chars' => 50),
),
),
'Log' => Array(
- 'Icons' => Array('default'=>'icon16_item.png'),
+ 'Icons' => Array(
+ 'default' => 'icon16_item.png',
+ 'module' => 'core',
+ ),
'Fields' => Array(
'AffiliatePaymentId'=> Array( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Username' => Array( 'title' => 'la_col_Username', 'data_block' => 'grid_userlink_td', 'filter_block' => 'grid_like_filter'),
'PaymentDate' => Array( 'title' => 'la_col_PaymentDate', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'Amount' => Array( 'title' => 'la_col_Amount', 'data_block' => 'grid_currency_td', 'filter_block' => 'grid_float_range_filter'),
'Comment' => Array( 'title' => 'la_col_Comment', 'filter_block' => 'grid_like_filter', 'first_chars' => 50),
'PaymentTypeId' => Array( 'title' => 'la_col_PaymentType', 'filter_block' => 'grid_options_filter'),
'PaymentReference' => Array( 'title' => 'la_col_PaymentReference', 'filter_block' => 'grid_like_filter', 'first_chars' => 50),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/affiliate_payment_types/affiliate_payment_types_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/affiliate_payment_types/affiliate_payment_types_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/affiliate_payment_types/affiliate_payment_types_config.php (revision 12500)
@@ -1,108 +1,109 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'apt',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'AffiliatePaymentTypesEventHandler','file'=>'affiliate_payment_types_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
'AggregateTags' => Array(
Array(
'AggregateTo' => 'u',
'AggregatedTagName' => 'ListAffiliatesPaymentTypes',
'LocalTagName' => 'PrintList',
'LocalSpecial' => 'active',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'PaymentTypeId',
'StatusField' => Array('Status', 'IsPrimary'), // field, that is affected by Approve/Decline events
'TitleField' => 'Name',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('apt'=>'!la_title_Adding_Affiliate_Payment_Type!'),
'edit_status_labels' => Array('apt'=>'!la_title_Editing_Affiliate_Payment_Type!'),
'new_titlefield' => Array('apt'=>'!la_title_New_Affiliate_Payment_Type!'),
),
'affiliate_payment_types_list' => Array('prefixes' => Array('apt_List'), 'format' => "!la_title_AffiliatePaymentTypes!"),
'affiliate_payment_types_edit' => Array('prefixes' => Array('apt'), 'format' => "#apt_status# '#apt_titlefield#' - !la_title_General!"),
),
'PermSection' => Array('main' => 'in-commerce:affiliate_payment_types'),
'Sections' => Array(
'in-commerce:affiliate_payment_types' => Array(
'parent' => 'in-commerce:affiliates_folder',
'icon' => 'affiliates',
'label' => 'la_tab_AffiliatePaymentTypes',
'url' => Array('t' => 'in-commerce/affiliate_plans/affiliate_payment_types_list', 'pass' => 'm'),
'permissions' => Array(
'view', 'add', 'edit', 'delete', 'advanced:approve',
'advanced:decline', 'advanced:set_primary', 'advanced:move_up', 'advanced:move_down'
),
'priority' => 5.3, // <parent_priority>.<own_priority>, because this section replaces parent in tree
'type' => stTAB,
),
),
'TableName' => TABLE_PREFIX.'AffiliatePaymentTypes',
'ListSQLs' => Array('' => 'SELECT * FROM %s'),
'ItemSQLs' => Array('' => 'SELECT * FROM %s'),
'ListSortings' => Array(
'' => Array(
'ForcedSorting' => Array('IsPrimary' => 'desc', 'Priority' => 'desc'),
'Sorting' => Array('Name' => 'asc'),
)
),
'Fields' => Array(
'PaymentTypeId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Name' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''),
'Description' => Array('type' => 'string', 'formatter' => 'kFormatter', 'not_null' => 1, 'using_fck' => 1, 'default' => ''),
'IsPrimary' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'Status' => Array('type' => 'int','not_null' => 1, 'default' => 0),
'Priority' => Array('type' => 'int','not_null' => 1, 'default' => 0),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array (
'default' => 'icon16_item.png',
'0_0' => 'icon16_disabled.png',
'0_1' => 'icon16_disabled.png',
'1_0' => 'icon16_item.png',
'1_1' => 'icon16_primary.png',
+ 'module' => 'core',
),
'Fields' => Array(
'PaymentTypeId' => Array( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Name' => Array( 'title' => 'la_col_Name', 'data_block' => 'affiliate_payment_type_caption_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
'Description' => Array( 'title' => 'la_col_Description', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/shipping_quote_engines/shipping_quote_engines_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/shipping_quote_engines/shipping_quote_engines_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/shipping_quote_engines/shipping_quote_engines_config.php (revision 12500)
@@ -1,138 +1,139 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'sqe',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'ShippingQuoteEngineEventHandler', 'file' => 'shipping_quote_engine_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
'RegisterClasses' => Array (
Array ('pseudo' => 'ShippingQuoteEngine', 'class' => 'ShippingQuoteEngine', 'file' => 'shipping_quote_engine.php', 'build_event' => ''),
Array ('pseudo' => 'CustomShippingQuoteEngine', 'class' => 'CustomShippingQuoteEngine', 'file' => 'custom_shipping_quote_engine.php', 'build_event' => ''),
Array ('pseudo' => 'Intershipper', 'class' => 'Intershipper', 'file' => 'intershipper.php', 'build_event' => ''),
Array ('pseudo' => 'USPS', 'class' => 'USPS', 'file' => 'usps.php', 'build_event' => ''),
Array ('pseudo' => 'ShippingQuoteCollector', 'class' => 'ShippingQuoteCollector', 'file' => 'shipping_quote_collector.php', 'build_event' => '', 'require_classes' => 'ShippingQuoteEngine'),
),
'AutoLoad' => true,
'Hooks' => Array (
),
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'EngineId',
'StatusField' => Array ('Status'),
'TitleField' => 'Name',
'TitlePresets' => Array (
'default' => Array ( 'edit_status_labels' => Array ('sqe' => '!la_title_EditingShippingQuoteEngine!'),
),
'engine_list'=>Array ( 'prefixes' => Array ('sqe_List'),
'format' => "!la_title_ShippingQuoteEngines!",
),
'engine_edit'=>Array ( 'prefixes' => Array ('sqe'),
'format' => "#sqe_status# '#sqe_titlefield#' - !la_title_General!",
),
),
'PermSection' => Array ('main' => 'in-commerce:shipping_quote_engines'),
'Sections' => Array (
'in-commerce:shipping_quote_engines' => Array (
'parent' => 'in-commerce:shipping_folder',
'icon' => 'conf_shipping',
'label' => 'la_tab_ShippingQuoteEngines',
'url' => Array ('t' => 'in-commerce/shipping/shipping_list', 'pass' => 'm'),
'permissions' => Array ('view', 'edit', 'advanced:approve', 'advanced:decline'),
'priority' => 4.2,
'type' => stTAB,
),
),
'TableName' => TABLE_PREFIX.'ShippingQuoteEngines',
'FilterMenu' => Array (
'Groups' => Array (
Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array (
'show_active' => Array ('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
)
),
'ListSQLs' => Array ( ''=> 'SELECT * FROM %s'),
// key - special, value - list select sql
'ItemSQLs' => Array ( ''=> 'SELECT * FROM %s'),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Name' => 'asc'),
)
),
'Fields' => Array (
'EngineId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Name' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'FlatSurcharge' => Array ('type' => 'double', 'not_null' => '1', 'default' => '0'),
'PercentSurcharge' => Array ('type' => 'double', 'not_null' => '1', 'default' => '0'),
'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Enabled', 0 => 'la_Disabled' ), 'default' => 0, 'not_null' => 1),
'Properties' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'ClassName' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
),
'VirtualFields' => Array (
'AccountLogin' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'AccountPassword' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'UPSEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'UPSAccount' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'UPSInvoiced' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced')),
'FDXEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'FDXAccount' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'FDXInvoiced' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced')),
'DHLEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'DHLAccount' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'DHLInvoiced' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced')),
'USPEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'USPAccount' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'USPInvoiced' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced')),
'ARBEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'ARBAccount' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'ARBInvoiced' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Invoiced', 0 => 'NotInvoiced')),
'1DYEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'2DYEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'3DYEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'GNDEnabled' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Enabled', 0 => 'Disabled')),
'ShipMethod' => Array ('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array ('DRP' => 'Drop-Off At Carrier Location', 'PCK' => 'Schedule A Special Pickup', 'SCD' => 'Regularly Scheduled Pickup')),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
+ 'module' => 'core',
),
'Fields' => Array (
'EngineId' => Array ( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
'Name' => Array ( 'title' => 'la_col_ShippingQuoteEngineName', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
'FlatSurcharge' => Array ( 'title' => 'la_col_FlatSurcharge', 'filter_block' => 'grid_float_range_filter', 'width' => 150, ),
'PercentSurcharge' => Array ( 'title' => 'la_col_PercentSurcharge', 'filter_block' => 'grid_float_range_filter', 'width' => 150, ),
'Status' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 150, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/payment_type/payment_type_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/payment_type/payment_type_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/payment_type/payment_type_config.php (revision 12500)
@@ -1,146 +1,147 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'pt',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'PaymentTypeEventHandler', 'file' => 'payment_type_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'PaymentTypeTagProcessor', 'file' => 'payment_type_tag_processor.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'PaymentTypeId',
'StatusField' => Array ('Status', 'IsPrimary'),
'TableName' => TABLE_PREFIX.'PaymentTypes',
'TitlePresets' => Array (
'default' => Array ( 'new_status_labels' => Array ('pt' => '!la_title_AddingPaymentType!'),
'edit_status_labels' => Array ('pt' => '!la_title_EditingPaymentType!'),
'new_titlefield' => Array ('pt' => '!la_title_NewPaymentType!'),
),
'payment_type_list'=>Array ( 'prefixes' => Array ('pt_List'),
'format' => "!la_title_PaymentTypes!",
),
'payment_type_edit'=>Array ( 'prefixes' => Array ('pt'),
'new_titlefield' => Array ('pt' => '!la_title_NewPaymentType!'),
'format' => "#pt_status# '#pt_titlefield#' - !la_title_General!",
),
'gateway' => Array ('prefixes' => Array ('pt'), 'format' => "#pt_status# '#pt_titlefield#' - !la_title_Gateway!"),
'group_list' => Array ('prefixes' => Array ('pt'), 'format' => "#pt_status# '#pt_titlefield#' - !la_title_Groups!"),
'payment_currencies_edit' => Array ('prefixes' => Array ('pt'), 'format' => "#pt_status# '#pt_titlefield#' - !la_title_Currencies!"),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'in-commerce/payment_type/payment_type_edit', 'priority' => 1),
'gateway' => Array ('title' => 'la_tab_Gateway', 't' => 'in-commerce/payment_type/payment_type_gateway', 'priority' => 2),
'currencies' => Array ('title' => 'la_tab_Currencies', 't' => 'in-commerce/payment_type/payment_type_currencies', 'priority' => 3),
'groups' => Array ('title' => 'la_tab_UserGroups', 't' => 'in-commerce/payment_type/payment_type_groups', 'priority' => 4),
),
),
'PermSection' => Array ('main' => 'in-commerce:payment_types'),
'Sections' => Array (
'in-commerce:payment_types' => Array (
'parent' => 'in-commerce:setting_folder',
'icon' => 'conf_payment_types',
'label' => 'la_tab_PaymentTypes',
'url' => Array ('t' => 'in-commerce/payment_type/payment_type_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 5,
'type' => stTREE,
),
),
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'SubItems' => Array ('gwfv', 'ptc'),
'FilterMenu' => Array (
'Groups' => Array (
Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array (
'show_active' => Array ('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
)
),
'CalculatedFields' => Array (
'' => Array (
'Gateway' => TABLE_PREFIX.'Gateways.Name',
),
),
'ListSQLs' => Array ( '' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Gateways ON %1$s.GatewayId = '.TABLE_PREFIX.'Gateways.GatewayId',
), // key - special, value - list select sql
'ItemSQLs' => Array ( '' => 'SELECT * FROM %s',
),
'ListSortings' => Array (
'' => Array (
'ForcedSorting' => Array ('Priority' => 'desc'),
'Sorting' => Array ('Name' => 'asc'),
)
),
'Fields' => Array (
'PaymentTypeId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,),
'Name' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'required'=>true, 'max_len' => 100),
'Description' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
'Instructions' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL),
'AdminComments' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL),
'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Enabled', 0 => 'la_Disabled' ), 'default' => 0, 'not_null' => 1),
'Priority' => Array ('type' => 'int', 'not_null' => true, 'default' => 0),
'IsPrimary' => Array ('type' => 'int', 'not_null' => true, 'default' => 0),
'BuiltIn' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_BuiltIn', 0 => 'la_UserDefined' ), 'default' => 0, 'not_null' => 1 ),
'GatewayId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Gateways', 'option_key_field' => 'GatewayId', 'option_title_field' => 'Name', 'default' => 1, 'not_null' => 1),
'PlacedOrdersEdit' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'ProcessingFee' => Array ('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%.02f', 'not_null' => '1', 'default' => '0.00'),
'PortalGroups' => Array ('type' => 'string', 'not_null' => 1, 'default' => '',),
),
/* 'VirtualFields' => Array (
'Qty' => 1,
),*/
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
'0_0' => 'icon16_disabled.png',
'0_1' => 'icon16_disabled.png',
'1_0' => 'icon16_item.png',
'1_1' => 'icon16_primary.png',
+ 'module' => 'core',
),
'Fields' => Array (
'PaymentTypeId' => Array ( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50),
'Name' => Array ( 'title' => 'la_col_PaymentTypeName', 'data_block' => 'payment_caption_td', 'filter_block' => 'grid_like_filter', 'width' => 200),
'Description' => Array ( 'title' => 'la_col_Description', 'filter_block' => 'grid_like_filter', 'width' => 200),
'BuiltIn' => Array ( 'title' => 'la_col_BuiltIn', 'filter_block' => 'grid_options_filter', 'width' => 100),
'Status' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/manufacturers/manufacturers_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/manufacturers/manufacturers_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/manufacturers/manufacturers_config.php (revision 12500)
@@ -1,143 +1,144 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'manuf',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'ManufacturersEventHandler','file'=>'manufacturers_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'ManufacturersTagProcessor','file'=>'manufacturers_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'manuf',
'HookToSpecial' => '',
'HookToEvent' => Array('OnAfterItemLoad', 'OnBeforeItemCreate', 'OnBeforeItemUpdate', 'OnUpdateAddress'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnPrepareStates',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'ManufacturerId',
'StatusField' => Array(),
'TableName' => TABLE_PREFIX.'Manufacturers',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('manuf'=>'!la_title_AddingManufacturer!'),
'edit_status_labels' => Array('manuf'=>'!la_title_EditingManufacturer!'),
'new_titlefield' => Array('manuf'=>'!la_title_NewManufacturers!'),
),
'manuf_list'=>Array( 'prefixes' => Array('manuf_List'),
'format' => "!la_title_Manufacturers!",
),
'manuf_edit'=>Array( 'prefixes' => Array('manuf'),
'new_titlefield' => Array('manuf'=>'!la_title_NewManufacturer!'),
'format' => "#manuf_status# '#manuf_titlefield#' - !la_title_General!",
),
),
'PermSection' => Array('main' => 'in-commerce:manufacturers'),
'Sections' => Array(
'in-commerce:manufacturers' => Array(
'parent' => 'in-commerce',
'icon' => 'manufacturers',
'label' => 'la_tab_Manufacturers',
'url' => Array('t' => 'in-commerce/manufacturers/manufacturers_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete'),
'priority' => 4,
'type' => stTREE,
),
),
'TitleField' => 'Name', // field, used in bluebar when editing existing item
'ListSQLs' => Array( ''=>'SELECT * FROM %s',
), // key - special, value - list select sql
'ItemSQLs' => Array(''=>'SELECT * FROM %s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Name' => 'asc'),
)
),
'Fields' => Array (
'ManufacturerId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
'Name' => Array('type' => 'string','not_null' => '1','default' => '', 'required'=>true,'max_len'=>255),
'Description' => Array('type' => 'string', 'formatter' => 'kFormatter', 'not_null' => 1, 'using_fck' => 1, 'default' => ''),
'URL' => Array('type' => 'string','not_null' => '1','default' => '','max_len'=>255),
'Logo' => Array (
'type' => 'string',
'formatter' => 'kPictureFormatter',
'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => IMAGES_PATH.'manufacturers/',
'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!',
'multiple' => false,
'max_len' => 255, 'not_null' => 1, 'default' => ''
),
'IsPopular' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'Email' => Array('type' => 'string', 'formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', 'sample_value' => 'email@domain.com', 'default' => null, 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!') ),
'Phone' => Array('type' => 'string','default' => null),
'Fax' => Array('type' => 'string', 'default' => null),
'Address1' => Array('type' => 'string','default' => null),
'Address2' => Array('type' => 'string', 'default' => null),
'City' => Array('type' => 'string','default' => null),
'State' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array(), 'option_key_field' => 'DestAbbr', 'option_title_field' => 'Translation', 'default' => null),
'Zip' => Array('type' => 'string', 'default' => null),
'Country' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
'options_sql'=>'SELECT %1$s
FROM '.TABLE_PREFIX.'StdDestinations
LEFT JOIN '.TABLE_PREFIX.'Phrase
ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
WHERE
DestType=1
AND
LanguageId = %2$s
ORDER BY Translation',
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation', 'default' => null),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
+ 'module' => 'core',
),
'Fields' => Array (
'ManufacturerId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Name' => Array ('title' => 'la_col_ManufacturerName', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
'IsPopular' => Array ('title' => 'la_col_IsPopular', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
'URL' => Array ('title' => 'la_col_URL', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
),
),
),
'ConfigMapping' => Array (
'PerPage' => 'Comm_Perpage_Manufacturers',
'ShortListPerPage' => 'Comm_Perpage_Manufacturers_Short',
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/shipping/shipping_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/shipping/shipping_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/shipping/shipping_config.php (revision 12500)
@@ -1,173 +1,174 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 's',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'ShippingEventHandler', 'file' => 'shipping_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'ShippingTagProcessor', 'file' => 'shipping_tag_processor.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'AggregateTags' => Array (
Array (
'AggregateTo' => 'ord',
'AggregatedTagName' => 'PrintShippingTypes',
'LocalTagName' => 'Order_PrintShippingTypes',
),
),
'Hooks' => Array (
Array (
'Mode' => hBEFORE,
'Conditional' => true,
'HookToPrefix' => 'sc',
'HookToSpecial' => '',
'HookToEvent' => Array ( 'OnPropagate', 'OnClearAll' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnPreSave',
),
),
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'ShippingID',
'StatusField' => Array ('Status'),
'TitleField' => 'Name',
'TitlePresets' => Array (
'default' => Array ( 'new_status_labels' => Array ('s' => '!la_title_AddingShippingType!'),
'edit_status_labels' => Array ('s' => '!la_title_EditingShippingType!'),
'new_titlefield' => Array ('s' => '!la_title_NewShippingType!'),
),
'shipping_list'=>Array ( 'prefixes' => Array ('s_List'),
'format' => "!la_title_ShippingTypes!",
),
'shipping_type_edit'=>Array ( 'prefixes' => Array ('s'),
'format' => "#s_status# '#s_titlefield#' - !la_title_General!",
),
'zones' => Array ('prefixes' => Array ('s'), 'format' => "#s_status# '#s_titlefield#' - !la_title_Zones!"),
'brackets' => Array ('prefixes' => Array ('s'), 'format' => "#s_status# '#s_titlefield#' - !la_title_Brackets!"),
'costs' => Array ('prefixes' => Array ('s'), 'format' => "#s_status# '#s_titlefield#' - !la_title_Costs!"),
'groups' => Array ('prefixes' => Array ('s'), 'format' => "#s_status# '#s_titlefield#' - !la_title_Groups!"),
'select_modifier' => Array ('prefixes' => Array ('s'), 'format' => "!la_title_ApplyModifier!"),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'in-commerce/shipping/shipping_edit', 'priority' => 1),
'zones' => Array ('title' => 'la_tab_ShippingZones', 't' => 'in-commerce/shipping/shipping_zones', 'priority' => 2),
'brackets' => Array ('title' => 'la_tab_Brackets', 't' => 'in-commerce/shipping/shipping_brackets', 'priority' => 3),
'costs' => Array ('title' => 'la_tab_Costs', 't' => 'in-commerce/shipping/shipping_costs', 'priority' => 4),
'groups' => Array ('title' => 'la_tab_UserGroups', 't' => 'in-commerce/shipping/shipping_type_groups', 'priority' => 5),
),
),
'PermSection' => Array ('main' => 'in-commerce:shipping'),
'Sections' => Array (
'in-commerce:shipping_folder' => Array (
'parent' => 'in-commerce:setting_folder',
'icon' => 'conf_shipping',
'label' => 'la_tab_Shipping',
'permissions' => Array (),
'priority' => 4,
'type' => stTREE,
),
'in-commerce:shipping' => Array (
'parent' => 'in-commerce:shipping_folder',
'icon' => 'conf_shipping',
'label' => 'la_tab_CustomShippingTypes',
'url' => Array ('t' => 'in-commerce/shipping/shipping_custom_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'),
'priority' => 4.1,
'type' => stTAB,
),
),
'TableName' => TABLE_PREFIX.'ShippingType',
'SubItems' => Array ('z', 'br'),
'FilterMenu' => Array (
'Groups' => Array (
Array ('mode' => 'AND', 'filters' => Array ('show_active', 'show_disabled'), 'type' => WHERE_FILTER),
),
'Filters' => Array (
'show_active' => Array ('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
'show_disabled' => Array ('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
)
),
'ListSQLs' => Array ( ''=> 'SELECT * FROM %s'),
// key - special, value - list select sql
'ItemSQLs' => Array ( ''=> 'SELECT * FROM %s'),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Name' => 'asc'),
)
),
'Fields' => Array (
'ShippingID' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Code' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'required'=>true, 'max_len'=>25, 'error_msgs' => Array ('required' => 'Please fill in')),
'Name' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'required'=>true, 'max_len'=>100, 'error_msgs' => Array ('required' => 'Please fill in')),
'SpeedCode' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'required' => true, 'max_len' => 25),
'LocationFrom' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'Riga', 2 => 'Salaspils', 3 => 'Chicago', 4 => 'Dublin'), 'not_null' => true, 'default' => 1),
'Type' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (1 => 'la_ByWeight', 2 => 'la_ByItem', 3 => 'la_ByAmount', 4 => 'la_Handling'), 'not_null' => true, 'default' => 1),
'BaseFee' => Array ('type' => 'float', 'min_value_inc'=>0, 'formatter' => 'kFormatter', 'format' => '%0.2f', 'default' => 0, 'not_null' => true),
'CODFlatSurcharge' => Array ('type' => 'float', 'min_value_inc'=>0, 'formatter' => 'kFormatter', 'format' => '%0.2f', 'default' => 0, 'not_null' => true),
'CODPercentSurcharge' => Array ('type' => 'float', 'min_value_inc'=>0, 'formatter' => 'kFormatter', 'format' => '%0.2f', 'default' => 0, 'not_null' => true),
'Status' => Array ('type' => 'int', 'options' => Array ( 1 => 'la_Active', 0 => 'la_Disabled', 2 => 'la_SelectedOnly' ), 'use_phrases' => 1, 'default' => 1, 'not_null' => true ),
'CostType' => Array ('type' => 'int', 'options' => Array ( 1 => 'la_Flat', 2 => 'la_PerUnit', 3 => 'la_Combined' ), 'use_phrases' => 1, 'default' => 1, 'not_null' => true ),
'ZeroIfEmpty' => Array ('type' => 'int', 'options' => Array ( 1 => 'la_Zeros', 0 => 'la_NoShipments' ), 'use_phrases' => 1, 'default' => 1, 'not_null' => true ),
'PrecisionBeforeSep' => Array ('type' => 'int', 'options' => Array ( 1 => '1 digit', 2 => '2 digits', 3 => '3 digits', 4 => '4 digits' ), 'default' => 2, 'not_null' => true ),
'PrecisionAfterSep' => Array ('type' => 'int', 'options' => Array ( 0 => 'none', 1 => '1 digit', 2 => '2 digits' ), 'default' => 2, 'not_null' => true ),
'PortalGroups' => Array ('type' => 'string', 'not_null' => 1, 'default' => 0,),
'FreeShippingMinAmount' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'not_null' => 1, 'format' => '%.2f', 'default' => 0),
'IsFreePromoShipping' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, 'use_phrases' => 1, 'options' => Array (0 => 'la_No', 1 => 'la_Yes', ), 'formatter' => 'kOptionsFormatter'),
'InsuranceFee' => Array ('type' => 'float', 'default' => null),
'InsuranceType' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (2 => 'la_Percent', 1 => 'la_Flat',),
'not_null' => 1, 'default' => 2
),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
+ 'module' => 'core',
),
'Fields' => Array (
'ShippingID' => Array ( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
'Name' => Array ( 'title' => 'la_col_ShippingName', 'filter_block' => 'grid_range_filter', 'width' => 250, ),
'Type' => Array ( 'title' => 'la_col_ShippingType', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
'SpeedCode' => Array ( 'title' => 'la_col_SpeedCode', 'filter_block' => 'grid_like_filter', 'width' => 130, ),
'BaseFee' => Array ( 'title' => 'la_col_BaseFee', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ),
'IsFreePromoShipping' => Array ( 'title' => 'la_col_IsFreePromoShipping', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
'Status' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 170, ),
/*'CODFlatSurcharge' => Array ( 'title' => 'la_col_CODFlatSurcharge', 'filter_block' => 'grid_float_range_filter'),*/
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/taxes/taxes_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/taxes/taxes_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/taxes/taxes_config.php (revision 12500)
@@ -1,115 +1,117 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'tax',
'ItemClass' => Array ('class' => 'kDBItem','file' => '','build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList','file' => '','build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'TaxesEventHandler','file' => 'taxes_event_handler.php','build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'TaxesTagProcessor','file' => 'taxes_tag_processor.php','build_event' => 'OnBuild'),
'AutoLoad' => true,
'hooks' => Array (),
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
/*'Hooks' => Array (
Array (
'Mode' => hBEFORE,
'Conditional' => true,
'HookToPrefix' => 'tax',
'HookToSpecial' => '',
'HookToEvent' => Array ( 'onEdit' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnLoadZoneForm',
),
),*/
'IDField' => 'TaxZoneId',
'TitleField' => 'Name',
'TitlePresets' => Array (
'default' => Array ( 'new_status_labels' => Array ('tax' => '!la_title_AddingTaxZone!'),
'edit_status_labels' => Array ('tax' => '!la_title_EditingTaxZone!'),
'new_titlefield' => Array ('tax' => '!la_title_NewTaxZone!'),
),
'taxes_list'=>Array ( 'prefixes' => Array ('tax_List'),
'format' => "!la_title_Taxes!",
),
'taxes_edit'=>Array ( 'prefixes' => Array ('tax'),
'new_titlefield' => Array ('tax' => '!la_title_NewTax!'),
'format' => "#tax_status# '#tax_titlefield#' - !la_title_General!",
),
),
'PermSection' => Array ('main' =>'in-commerce:taxes'),
'Sections' => Array (
'in-commerce:taxes' => Array (
'parent' => 'in-commerce:setting_folder',
'icon' => 'conf_taxes',
'label' => 'la_tab_Taxes',
'url' => Array ('t' => 'in-commerce/taxes/taxes_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete'),
'priority' => 6,
'type' => stTREE,
),
),
'TableName' => TABLE_PREFIX.'TaxZones',
'AutoDelete' => true,
'AutoClone' => true,
'SubItems' => Array ('taxdst'),
'ListSQLs' => Array ( ''=> 'SELECT %1$s.* %2$s FROM %s'),
// key - special, value - list select sql
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Name' => 'asc', 'TaxValue' => 'asc'),
)
),
'Fields' => Array (
'TaxZoneId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0,),
'Name' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'required'=>true, 'max_len'=>100, 'error_msgs' => Array ('required' => 'Please fill in')),
'Type' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array (1 => 'la_ByCountry', 2 => 'la_ByState', 3 => 'la_ByZIP'), 'not_null' => true, 'default' => 1),
'TaxValue' => Array ('type' => 'double', 'not_null' => true, 'default' => 0),
'ApplyToShipping' => Array ('type' => 'int', 'not_null' => true, 'default' => 0, 'formatter' => 'kOptionsFormatter', 'use_phrases'=>1, 'options'=>Array (0=>'la_No', 1=>'la_Yes')),
'ApplyToProcessing' => Array ('type' => 'int', 'not_null' => true, 'default' => 0, 'formatter' => 'kOptionsFormatter', 'use_phrases'=>1, 'options'=>Array (0=>'la_No', 1=>'la_Yes')),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
+ 'module' => 'core',
+ 'module' => 'core',
),
'Fields' => Array (
'TaxZoneId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
'Name' => Array ( 'title' => 'la_col_TaxZoneName', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
'TaxValue' => Array ( 'title' => 'la_col_TaxValue', 'filter_block' => 'grid_float_range_filter', 'width' => 110, ),
'Type' => Array ( 'title' => 'la_col_ZoneType', 'filter_block' => 'grid_options_filter', 'width' => 90, ),
'ApplyToShipping' => Array ( 'title' => 'la_col_TaxApplyToShipping', 'filter_block' => 'grid_options_filter', 'width' => 140, ),
'ApplyToProcessing' => Array ( 'title' => 'la_col_TaxApplyToProcessing', 'filter_block' => 'grid_options_filter', 'width' => 150, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/coupons/coupons_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/coupons/coupons_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/coupons/coupons_config.php (revision 12500)
@@ -1,191 +1,193 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'coup',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'CouponsEventHandler','file'=>'coupons_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'CouponsTagProcessor','file'=>'coupons_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'ord',
'HookToSpecial' => '',
'HookToEvent' => Array( 'OnUpdateCart', 'OnCheckout' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnApplyCoupon',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode', // 't' for temp '' for normal
),
'IDField' => 'CouponId',
'StatusField' => Array('Status'),
'TitleField' => 'Name',
'TableName' => TABLE_PREFIX.'ProductsCoupons',
'SubItems' => Array('coupi'),
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('coup'=>'!la_title_Adding_Coupon!'),
'edit_status_labels' => Array('coup'=>'!la_title_Editing_Coupon!'),
'new_titlefield' => Array('coup'=>'!la_title_New_Coupon!'),
),
'coupons_list'=>Array('prefixes' => Array('coup_List'),
'format' => "!la_title_Coupons!",
),
'coupons_edit'=>Array( 'prefixes' => Array('coup'),
'format' => "#coup_status# '#coup_titlefield#' - !la_title_General!",
),
'coupons_items'=>Array('prefixes' => Array('coup','coupi_List'),
'format' => "#coup_status# '#coup_titlefield#' - !la_title_CouponItems!",
),
'coupons_clone'=>Array('prefixes' => Array('coup'),
'format' => "!la_CloneCoupon!",
),
'coupon_selector' => Array('format' => '!la_title_CouponSelector!'),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'in-commerce/discounts/coupon_edit', 'priority' => 1),
'items' => Array ('title' => 'la_tab_CouponsItems', 't' => 'in-commerce/discounts/coupon_items', 'priority' => 2),
),
),
'PermSection' => Array('main' => 'in-commerce:coupons'),
'Sections' => Array(
'in-commerce:coupons' => Array(
'parent' => 'in-commerce:discounts_folder',
'icon' => 'discounts_coupons',
'label' => 'la_tab_Coupons',
'url' => Array('t' => 'in-commerce/discounts/coupons_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'),
'priority' => 3.2, // <parent_priority>.<own_priority>, because this section replaces parent in tree
'type' => stTAB,
),
),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER),
Array('mode' => 'AND', 'filters' => Array(4,5/*,6*/), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => 'Status != 1' ),
1 => Array('label' => 'la_Used', 'on_sql' => '', 'off_sql' => 'Status != 2' ),
2 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ),
3 => Array(),
4 => Array('label' => 'la_Flat', 'on_sql' => '', 'off_sql' => 'Type != 1' ),
5 => Array('label' => 'la_Percent', 'on_sql' => '', 'off_sql' => 'Type != 2' ),
// 6 => Array('label' => 'la_FreeShipping', 'on_sql' => '', 'off_sql' => 'Type != 3' ),
)
),
'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %1$s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Name' => 'asc'),
)
),
'Fields' => Array(
'CouponId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array (
'type' => 'int', 'formatter' => 'kOptionsFormatter',
'options' => Array ( 1 => 'la_Enabled', 2 => 'la_Used', 0 => 'la_Disabled' ),
'use_phrases' => 1, 'not_null' => 1, 'default' => 1
),
'Name' => Array ( 'type' =>'string', 'required' => 1, 'default' => null, 'max_len' => 255),
'Code' => Array (
'type' => 'string', 'required' => 1, 'default' => null,
'max_len' => 255, 'unique' => Array ('Code'),
),
'Expiration' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null,),
'GroupId' => Array ('type' => 'int', 'default' => null, ),
'Type' => Array (
'type' => 'int', 'formatter' => 'kOptionsFormatter', 'use_phrases' => 1,
'options' => Array ( 1 => 'la_Flat', 2 => 'la_Percent'/*, 3 => 'la_FreeShipping'*/),
'not_null' => 1, 'default' => 1,
),
'Amount' => Array ('type' => 'double', 'default' => null),
'LastUsedBy' => Array (
'type' => 'int', 'formatter' => 'kLEFTFormatter',
'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
'options' => Array (-1 => 'root', -2 => 'Guest'),
'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PortalUser
WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId',
'left_title_field' => 'Login', 'required' => 0, 'default' => null,
),
'LastUsedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => ''),
'NumberOfUses' => Array ('type' => 'int', 'default' => 1),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array(
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
2 => 'icon16_pending.png',
+ 'module' => 'core',
),
'Fields' => Array(
'CouponId' => Array ('title'=>'la_col_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
'Code' => Array( 'title'=>'la_col_CouponCode', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'Expiration' => Array( 'title'=>'la_col_Expiration', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ),
'LastUsedBy' => Array('title'=>'la_col_LastUsedBy', 'filter_block' => 'grid_like_filter', 'width' => 140, ),
'LastUsedOn' => Array('title'=>'la_col_LastUsedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'NumberOfUses' => Array('title'=>'la_col_NumberOfUses', 'filter_block' => 'grid_range_filter', 'width' => 130, ),
),
),
'Radio' => Array(
'Icons' => Array(
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
2 => 'icon16_pending.png',
+ 'module' => 'core',
),
'Fields' => Array(
'CouponId' => Array ('title'=>'la_col_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
'Code' => Array( 'title'=>'la_col_CouponCode', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'Expiration' => Array( 'title'=>'la_col_Expiration', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ),
'LastUsedBy' => Array('title'=>'la_col_LastUsedBy', 'filter_block' => 'grid_like_filter', 'width' => 140, ),
'LastUsedOn' => Array('title'=>'la_col_LastUsedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'NumberOfUses' => Array('title'=>'la_col_NumberOfUses', 'filter_block' => 'grid_range_filter', 'width' => 130, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/zones/zones_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/zones/zones_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/zones/zones_config.php (revision 12500)
@@ -1,79 +1,80 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'z',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'ZonesEventHandler', 'file' => 'zones_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'ZonesTagProcessor', 'file' => 'zones_tag_processor.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'hooks' => Array (),
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
),
'IDField' => 'ZoneID',
'TitleField' => 'Name',
'TitlePresets' => Array (
'default' => Array ( 'new_status_labels' => Array ('z' => '!la_title_AddingShippingZone!'),
'edit_status_labels' => Array ('z' => '!la_title_EditingShippingZone!'),
'new_titlefield' => Array ('z' => '!la_title_NewShippingZone!'),
),
'zones_edit' => Array ( 'prefixes' => Array ('z'), 'format' => "#z_status# - '#z_titlefield#'"),
),
'TableName' => TABLE_PREFIX.'ShippingZones',
'ForeignKey' => 'ShippingTypeID', //Name of the field in this table used as ForeignKey
'ParentTableKey' => 'ShippingID', //Name of the field in parent table linked with ForeignKey
'ParentPrefix' => 's', //Prefix of parent item
'AutoDelete' => true,
'AutoClone' => true,
'SubItems' => Array ('dst', 'sc'),
'ListSQLs' => Array ( ''=> 'SELECT * FROM %s'),
// key - special, value - list select sql
'ItemSQLs' => Array ( ''=> 'SELECT * FROM %s'),
'ListSortings' => Array (
'' => Array (
'Sorting' => Array ('Name' => 'asc'),
)
),
'Fields' => Array (
'ZoneID' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, ),
'ShippingTypeID' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, ),
'Name' => Array ('type' => 'string', 'required'=>true, 'max_len'=>100, 'error_msgs' => Array ('required' => 'Please fill in'), 'not_null' => 1, 'default' => '', ),
'Type' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_ByCountry', 2 => 'la_ByState', 3 => 'la_ByZIP'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, ),
'CODallowed' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Allowed', 0 => 'la_NotAllowed'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1, ),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
+ 'module' => 'core',
),
'Fields' => Array (
'ZoneID' => Array ( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
'Name' => Array ( 'title' => 'la_col_ShipZoneName', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
'Type' => Array ( 'title' => 'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
'CODallowed' => Array ( 'title' => 'la_col_CODallowed', 'filter_block' => 'grid_options_filter', 'width' => 120, )
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/orders/orders_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/orders/orders_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/orders/orders_config.php (revision 12500)
@@ -1,498 +1,501 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'ord',
'ItemClass' => Array('class'=>'OrdersItem','file'=>'orders_item.php','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'OrdersEventHandler','file'=>'orders_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'OrdersTagProcessor','file'=>'orders_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'ord',
'HookToSpecial' => '',
'HookToEvent' => Array( 'OnPreSave' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnRecalculateItems',
),
/* OnApplyCoupon is called as hook for OnUpdateCart/OnCheckout, which calls OnRecalcualate themself
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'coup',
'HookToSpecial' => '',
'HookToEvent' => Array( 'OnApplyCoupon' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnRecalculateItems',
),*/
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array( 'OnCreate' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnUserCreate',
),
Array(
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array('OnCheckExpiredMembership'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnCheckRecurringOrders',
),
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array( 'OnLogin' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnUserLogin',
),
Array(
'Mode' => hBEFORE, // before because OnInpLogin is called after real in-portal login and uses data from hooks
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array( 'OnInpLogin' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnUserLogin',
),
),
'AggregateTags' => Array(
Array(
'AggregateTo' => 'orditems',
'AggregatedTagName' => 'LinkRemoveFromCart',
'LocalTagName' => 'Orditems_LinkRemoveFromCart',
),
Array(
'AggregateTo' => 'orditems',
'AggregatedTagName' => 'ProductLink',
'LocalTagName' => 'Orderitems_ProductLink',
),
Array(
'AggregateTo' => 'orditems',
'AggregatedTagName' => 'ProductExists',
'LocalTagName' => 'Orderitems_ProductExists',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'OrderId',
'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
'ViewMenuPhrase' => 'la_title_Orders',
'CatalogTabIcon' => 'icon16_item.png',
'TitleField' => 'OrderNumber',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('ord'=>'!la_title_Adding_Order!'),
'edit_status_labels' => Array('ord'=>'!la_title_Editing_Order!'),
'new_titlefield' => Array('ord'=>'!la_title_New_Order!'),
),
'orders_incomplete' => Array( 'prefixes' => Array('ord.incomplete_List'),
'format' => "!la_title_IncompleteOrders!",
),
'orders_pending' => Array( 'prefixes' => Array('ord.pending_List'),
'format' => "!la_title_PendingOrders!",
),
'orders_backorders' => Array( 'prefixes' => Array('ord.backorders_List'),
'format' => "!la_title_BackOrders!",
),
'orders_toship' => Array( 'prefixes' => Array('ord.toship_List'),
'format' => "!la_title_OrdersToShip!",
),
'orders_processed' => Array( 'prefixes' => Array('ord.processed_List'),
'format' => "!la_title_OrdersProcessed!",
),
'orders_returns' => Array( 'prefixes' => Array('ord.returns_List'),
'format' => "!la_title_OrdersReturns!",
),
'orders_denied' => Array( 'prefixes' => Array('ord.denied_List'),
'format' => "!la_title_OrdersDenied!",
),
'orders_archived' => Array( 'prefixes' => Array('ord.archived_List'),
'format' => "!la_title_OrdersArchived!",
),
'orders_search' => Array( 'prefixes' => Array('ord.search_List'),
'format' => "!la_title_OrdersSearch!",
),
'orders_edit_general' => Array('prefixes' => Array('ord'), 'format' => "#ord_status# '#ord_titlefield#' - !la_title_General!"),
'orders_edit_billing' => Array('prefixes' => Array('ord'), 'format' => "#ord_status# '#ord_titlefield#' - !la_title_OrderBilling!"),
'orders_edit_shipping' => Array('prefixes' => Array('ord'), 'format' => "#ord_status# '#ord_titlefield#' - !la_title_OrderShipping!"),
'orders_edit_items' => Array('prefixes' => Array('ord', 'orditems_List'), 'format' => "#ord_status# '#ord_titlefield#' - !la_title_OrderItems!"),
'orders_edit_preview' => Array('prefixes' => Array('ord'), 'format' => "#ord_status# '#ord_titlefield#' - !la_title_OrderPreview!"),
'orders_gw_result' => Array('prefixes' => Array('ord'), 'format' => "!la_title_OrderGWResult!"),
'order_items_edit' => Array( 'prefixes' => Array('ord', 'orditems'),
'new_status_labels' => Array('orditems'=>'!la_title_Adding_Order_Item!'),
'edit_status_labels' => Array('orditems'=>'!la_title_Editing_Order_Item!'),
'new_titlefield' => Array('orditems'=>'!la_title_New_Order_Item!'),
'format' => "#ord_status# '#ord_titlefield#' - #orditems_status# '#orditems_titlefield#'",
),
'orders_export' => Array('format' => '!la_title_OrdersExport!'),
'orders_product_edit' => Array('format' => '!la_title_Editing_Order_Item!'),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'in-commerce/orders/orders_edit', 'priority' => 1),
'items' => Array ('title' => 'la_tab_Items', 't' => 'in-commerce/orders/orders_edit_items', 'priority' => 2),
'shipping' => Array ('title' => 'la_tab_Shipping', 't' => 'in-commerce/orders/orders_edit_shipping', 'priority' => 3),
'billing' => Array ('title' => 'la_tab_Billing', 't' => 'in-commerce/orders/orders_edit_billing', 'priority' => 4),
'preview' => Array ('title' => 'la_tab_Preview', 't' => 'in-commerce/orders/orders_edit_preview', 'priority' => 5),
),
),
'PermSection' => Array('main' => 'in-commerce:orders'),
'Sections' => Array(
'in-commerce:orders' => Array(
'parent' => 'in-commerce',
'icon' => 'in-commerce:orders',
'label' => 'la_tab_Orders',
'url' => Array('t' => 'in-commerce/orders/orders_pending_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:deny', 'advanced:archive', 'advanced:place', 'advanced:process', 'advanced:ship', 'advanced:reset_to_pending'),
'priority' => 1,
'type' => stTREE,
),
),
'SectionAdjustments' => Array (
'in-portal:visits' => Array (
'url' => Array ('t' => 'in-commerce/visits/visits_list_incommerce', 'pass' => 'm'),
),
),
'StatisticsInfo' => Array(
'pending' => Array(
- 'icon' => 'icon16_item.png',
+ 'icon' => 'core:icon16_item.png',
'label' => 'la_title_Orders',
'js_url' => "#url#",
'url' => Array('t' => 'in-commerce/orders/orders_pending_list', 'pass' => 'm'),
'status' => ORDER_STATUS_PENDING,
+
),
),
'TableName' => TABLE_PREFIX.'Orders',
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1,2,3,4,5,6), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' => 'la_Incomplete', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
1 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
2 => Array('label' => 'la_BackOrders', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
3 => Array('label' => 'la_ToShip', 'on_sql' => '', 'off_sql' => '%1$s.Status != 3' ),
4 => Array('label' => 'la_Processed', 'on_sql' => '', 'off_sql' => '%1$s.Status != 4' ),
5 => Array('label' => 'la_Denied', 'on_sql' => '', 'off_sql' => '%1$s.Status != 5' ),
6 => Array('label' => 'la_Archived', 'on_sql' => '', 'off_sql' => '%1$s.Status != 6' ),
)
),
'CalculatedFields' => Array(
'' => Array (
'CustomerName' => 'IF( ISNULL(u.Login), IF (%1$s.PortalUserId = -1, \'root\', IF (%1$s.PortalUserId = -2, \'Guest\', \'n/a\')), CONCAT(u.FirstName,\' \',u.LastName) )',
'Username' => 'IF( ISNULL(u.Login),\'root\',u.Login)',
'OrderNumber' => 'CONCAT(LPAD(Number,6,"0"),\'-\',LPAD(SubNumber,3,"0") )',
'SubtotalWithoutDiscount' => '(SubTotal + DiscountTotal)',
'SubtotalWithDiscount' => '(SubTotal)',
'AmountWithoutVAT' => '(SubTotal+IF(ShippingTaxable=1, ShippingCost, 0)+IF(ProcessingTaxable=1, ProcessingFee, 0))',
'TotalAmount' => 'ROUND(SubTotal+ShippingCost+VAT+ProcessingFee+InsuranceFee-GiftCertificateDiscount,2)',
'CouponCode' => 'pc.Code',
'CouponName' => 'pc.Name',
'AffiliateUser' => 'IF( LENGTH(au.Login),au.Login,\'!la_None!\')',
'AffiliatePortalUserId' => 'af.PortalUserId',
'GiftCertificateCode' => 'gc.Code',
'GiftCertificateRecipient' => 'gc.Recipient',
),
'myorders' => Array (
'OrderNumber' => 'CONCAT(LPAD(Number,6,"0"),\'-\',LPAD(SubNumber,3,"0") )',
'SubtotalWithoutDiscount' => '(SubTotal + DiscountTotal)',
'SubtotalWithDiscount' => '(SubTotal)',
'AmountWithoutVAT' => '(SubTotal+IF(ShippingTaxable=1, ShippingCost, 0)+IF(ProcessingTaxable=1, ProcessingFee, 0))',
'TotalAmount' => 'ROUND(SubTotal+ShippingCost+VAT+ProcessingFee+InsuranceFee-GiftCertificateDiscount,2)',
/*'ItemsCount' => 'COUNT(%1$s.OrderId)',*/
),
),
// %1$s - table name of object
// %2$s - calculated fields
'ListSQLs' => Array (
'' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'ProductsCoupons pc ON %1$s.CouponId = pc.CouponId
LEFT JOIN '.TABLE_PREFIX.'GiftCertificates gc ON %1$s.GiftCertificateId = gc.GiftCertificateId
LEFT JOIN '.TABLE_PREFIX.'Affiliates af ON %1$s.AffiliateId = af.AffiliateId
LEFT JOIN '.TABLE_PREFIX.'PortalUser au ON af.PortalUserId = au.PortalUserId',
'myorders' => ' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId',
// LEFT JOIN '.TABLE_PREFIX.'OrderItems ON %1$s.OrderId = '.TABLE_PREFIX.'OrderItems.OrderId',
),
'ItemSQLs' => Array (
'' => ' SELECT %1$s.* %2$s FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'ProductsCoupons pc ON %1$s.CouponId = pc.CouponId
LEFT JOIN '.TABLE_PREFIX.'GiftCertificates gc ON %1$s.GiftCertificateId = gc.GiftCertificateId
LEFT JOIN '.TABLE_PREFIX.'Affiliates af ON %1$s.AffiliateId = af.AffiliateId
LEFT JOIN '.TABLE_PREFIX.'PortalUser au ON af.PortalUserId = au.PortalUserId',
),
'SubItems' => Array('orditems'),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('OrderDate' => 'desc'),
)
),
'Fields' => Array(
'OrderId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0, 'filter_type' => 'equals'),
'Number' => Array('type' => 'int','required'=>1,'formatter'=>'kFormatter', 'unique'=>Array('SubNumber'),'format'=>'%06d', 'max_value_inc'>999999, 'not_null' => '1','default' => 0),
'SubNumber' => Array('type' => 'int','required'=>1,'formatter'=>'kFormatter','unique'=>Array('Number'), 'format'=>'%03d', 'max_value_inc'>999, 'not_null' => '1','default' => 0),
'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter','options'=>Array(0=>'la_Incomplete',1=>'la_Pending',2=>'la_BackOrders',3=>'la_ToShip',4=>'la_Processed',5=>'la_Denied',6=>'la_Archived'), 'use_phrases'=>1, 'not_null' => '1','default' => 0, 'filter_type' => 'equals'),
'OnHold' => Array (
'type' => 'int',
'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1,
'not_null' => 1, 'default' => 0
),
'OrderDate' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'required' => 1, 'not_null' => '1', 'default' => '#NOW#'),
'PortalUserId'=>Array('type'=>'int','formatter'=>'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options'=>Array(-1=>'root',-2=>'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'','left_key_field'=>'PortalUserId','left_title_field'=>'Login','required'=>1,'not_null'=>1,'default'=>-1),
'OrderIP' => Array('type' => 'string','not_null' => '1','default' => '', 'filter_type' => 'like'),
'UserComment' => Array('type' => 'string', 'formatter' => 'kFormatter', 'not_null' => 1, 'using_fck' => 1, 'default' => ''),
'AdminComment' => Array('type' => 'string', 'formatter' => 'kFormatter', 'not_null' => 1, 'using_fck' => 1, 'default' => ''),
'BillingTo' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingCompany' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingPhone' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingFax' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingEmail' => Array('type' => 'string','formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i','not_null' => '1','default' => ''),
'BillingAddress1' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingAddress2' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingCity' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingState' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
'options' => Array(),
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'BillingZip' => Array('type' => 'string','not_null' => '1','default' => ''),
'BillingCountry' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
'options_sql'=>'SELECT %1$s
FROM '.TABLE_PREFIX.'StdDestinations
LEFT JOIN '.TABLE_PREFIX.'Phrase
ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
WHERE
DestType=1
AND
LanguageId = %2$s
ORDER BY Translation',
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => 'USA'),
'VAT' => Array('type' => 'float','formatter'=>'kFormatter','not_null'=>1,'default' => '0','format'=>'%01.2f'),
'VATPercent' => Array('type' => 'float','formatter'=>'kFormatter','not_null'=>1,'default' => '0','format'=>'%01.3f'),
'PaymentType' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter','options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PaymentTypes WHERE Status = 1', 'option_key_field'=>'PaymentTypeId','option_title_field'=>'Description', 'not_null' => 1, 'default' => 0),
'PaymentAccount' => Array('type' => 'string','not_null' => '1', 'cardtype_field' => 'PaymentCardType', 'default' => '', 'filter_type' => 'like'),
'PaymentNameOnCard' => Array('type' => 'string','not_null' => '1','default' => ''),
'PaymentCCExpDate' => Array('type' => 'string', 'formatter'=>'kCCDateFormatter', 'month_field' => 'PaymentCCExpMonth', 'year_field'=>'PaymentCCExpYear', 'not_null' => '1','default' => ''),
'PaymentCardType' => Array('type' => 'string', 'not_null' => 1, 'formatter'=>'kOptionsFormatter', 'options' => Array('' => '','1' => 'Visa','2' => 'Mastercard', '3' => 'Amex', '4' => 'Discover', '5' => 'Diners Club', '6' => 'JBC'), 'default' => ''),
'PaymentExpires' => Array('type' => 'int', 'formatter'=>'kDateFormatter','not_null' => '1','default' => '#NOW#'),
'ShippingTo' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingCompany' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingPhone' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingFax' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingEmail' => Array('type' => 'string','formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i','not_null' => '1','default' => ''),
'ShippingAddress1' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingAddress2' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingCity' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingState' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
'options' => Array(),
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => ''),
'ShippingZip' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingCountry' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
'options_sql'=>'SELECT %1$s
FROM '.TABLE_PREFIX.'StdDestinations
LEFT JOIN '.TABLE_PREFIX.'Phrase
ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
WHERE
DestType=1
AND
LanguageId = %2$s
ORDER BY Translation',
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => 'USA'),
'ShippingType' => Array('type' => 'int','formatter'=>'kOptionsFormatter','options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'ShippingType WHERE Status = 1','option_key_field'=>'ShippingID','option_title_field'=>'Name', 'not_null' => 1, 'default' => 0),
'ShippingCost' => Array('type' => 'double','formatter'=>'kFormatter','format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'ShippingCustomerAccount' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingTracking' => Array('type' => 'string','not_null' => '1','default' => ''),
'ShippingDate' => Array('type' => 'int', 'formatter'=>'kDateFormatter','default' => null),
'SubTotal' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'ReturnTotal' => Array ('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00'),
'CostTotal' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'OriginalAmount' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'ShippingOption' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array(0 => 'la_ship_all_together', 1 => 'la_ship_backorder_separately', 2 => 'la_ship_backorders_upon_avail'), 'default'=>0),
'ShippingGroupOption' => Array('type' => 'int', 'not_null' => 1, 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array(0 => 'la_auto_group_shipments', 1 => 'la_manual_group_shipments'), 'default'=>0),
'GiftCertificateId' => Array('type' => 'int','default' => null),
'GiftCertificateDiscount' => Array('type' => 'float', 'formatter' => 'kFormatter', 'format' => '%01.2f', 'not_null' => 1, 'default' => '0.00',),
'ShippingInfo' => Array('type' => 'string', 'default' => NULL),
'CouponId' => Array('type' => 'int','default' => null),
'CouponDiscount' => Array('type' => 'float','not_null' => '1','default' => '0.00','formatter'=>'kFormatter','format'=>'%01.2f'),
'DiscountTotal' => Array('type' => 'float','not_null' => '1','default' => '0.00','formatter'=>'kFormatter','format'=>'%01.2f'),
'TransactionStatus' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options' => Array(0=>'la_Invalid', 1 => 'la_Verified', 2 => 'la_Penging'), 'use_phrases'=>1, 'not_null' => '1','default' => 2),
'GWResult1' => Array('type' => 'string', 'formatter'=>'kSerializedFormatter', 'not_null' => '1','default' => ''),
'GWResult2' => Array('type' => 'string', 'formatter'=>'kSerializedFormatter', 'not_null' => '1','default' => ''),
'AffiliateId' => Array('type'=>'int','formatter'=>'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(0 => 'lu_None'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'Affiliates af LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = af.PortalUserId WHERE `%s` = \'%s\'','left_key_field'=>'AffiliateId','left_title_field'=>'Login','not_null'=>1,'default'=>0),
'VisitId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'AffiliateCommission' => Array('type' => 'double', 'formatter'=>'kFormatter','format'=>'%.02f', 'not_null' => '1','default' => '0.0000'),
'ProcessingFee' => Array('type' => 'double', 'formatter'=>'kFormatter','format'=>'%.02f', 'not_null' => '0','default' => '0.0000'),
'InsuranceFee' => Array ('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'ShippingTaxable' => Array('type' => 'int', 'not_null' => 0, 'default' => 0),
'ProcessingTaxable' => Array('type' => 'int', 'not_null' => 0, 'default' => 0),
'IsRecurringBilling' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'ChargeOnNextApprove' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
'NextCharge' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
'GroupId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'GoogleOrderNumber' => Array ('type' => 'string', 'default' => NULL), // MySQL BIGINT UNSIGNED = 8 Bytes, PHP int = 4 Bytes -> threat as string
),
'VirtualFields' => Array(
'CustomerName' => Array('type'=>'string','default'=>'','filter_type'=>'like'),
'TotalAmount' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'AmountWithoutVAT' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'SubtotalWithDiscount' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'SubtotalWithoutDiscount' => Array('type' => 'float', 'formatter'=>'kFormatter', 'format'=>'%01.2f', 'not_null' => '1','default' => '0.00'),
'OrderNumber' => Array('type'=>'string','default'=>'', 'filter_type' => 'like'),
// for ResetToUser
'UserTo' => Array('type'=>'string','default'=>''),
'UserCompany' => Array('type'=>'string','default'=>''),
'UserPhone' => Array('type'=>'string','default'=>''),
'UserFax' => Array('type'=>'string','default'=>''),
'UserEmail' => Array('type'=>'string','default'=>''),
'UserAddress1' => Array('type'=>'string','default'=>''),
'UserAddress2' => Array('type'=>'string','default'=>''),
'UserCity' => Array('type'=>'string','default'=>''),
'UserState' => Array('type'=>'string','default'=>''),
'UserZip' => Array('type'=>'string','default'=>''),
'UserCountry' => Array('type'=>'string','default'=>''),
// for Search
'Username' => Array('type'=>'string','filter_type'=>'like'),
'OrderSearchId' => Array('type'=>'int','filter_type'=>'equals','filter_field'=>'OrderId'),
'FromDateTime' => Array('formatter'=>'kDateFormatter','default'=>'','filter_type'=>'range_from','filter_field'=>'OrderDate' ),
'ToDateTime' => Array('formatter'=>'kDateFormatter','default'=>'','filter_type'=>'range_to','filter_field'=>'OrderDate', 'empty_time' => adodb_mktime(23,59,59) ),
'FromAmount' => Array('type'=>'double', 'formatter'=>'kFormatter', 'format'=>'%01.2f','filter_type'=>'range_from','filter_field'=>'TotalAmount'),
'ToAmount' => Array('type'=>'double', 'formatter'=>'kFormatter', 'format'=>'%01.2f','filter_type'=>'range_to','filter_field'=>'TotalAmount'),
'HasBackOrders' => Array('default'=>false),
'PaymentCVV2' => Array('type'=>'string', 'default'=>false),
'AffiliateUser' => Array('type'=>'string', 'filter_type' => 'like'),
'AffiliatePortalUserId' => Array('type'=>'int'),
// export related fields: begin
'ExportFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CSV', /*2 => 'XML'*/), 'default' => 1),
'ExportFilename' => Array('type' => 'string', 'default' => ''),
'FieldsSeparatedBy' => Array('type' => 'string', 'default' => ','),
'FieldsEnclosedBy' => Array('type' => 'string', 'default' => '"'),
'LineEndings' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'Windows', 2 => 'UNIX'), 'default' => 1),
'LineEndingsInside' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CRLF', 2 => 'LF'), 'default' => 2),
'IncludeFieldTitles' => Array('type' => 'int', 'default' => 1),
'ExportColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()),
'AvailableColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()),
'ExportPresets' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()),
'ExportSavePreset' => Array('type'=>'int'),
'ExportPresetName' => Array('type'=>'string'),
// export related fields: end
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array(
'default' => 'icon16_item.png',
0 => 'icon16_item.png',
2 => 'icon16_pending.png',
5 => 'icon16_disabled.png',
+ 'module' => 'core',
),
'Fields' => Array(
'OrderId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ), 'OrderNumber' => Array( 'title' => 'la_col_OrderNumber', 'data_block' => 'grid_ordernumber_td', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'OrderDate' => Array( 'title'=>'la_col_OrderDate', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'CustomerName' => Array( 'title' => 'la_col_CustomerName', 'data_block' => 'grid_userlink_td', 'user_field' => 'PortalUserId', 'filter_block' => 'grid_like_filter', 'width' => 140, ),
'PaymentType' => Array( 'title' => 'la_col_PaymentType', 'data_block' => 'grid_billinglink_td', 'filter_block' => 'grid_options_filter', 'width' => 140, ),
'TotalAmount' => Array( 'title' => 'la_col_TotalAmount', 'data_block' => 'grid_previewlink_td', 'filter_block' => 'grid_range_filter', 'width' => 140, ),
'AffiliateUser' => Array( 'title' => 'la_col_AffiliateUser', 'data_block' => 'grid_userlink_td', 'user_field' => 'AffiliatePortalUserId', 'filter_block' => 'grid_like_filter', 'width' => 140, ),
'OnHold' => Array ('title' => 'la_col_OnHold', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
),
),
'Search' => Array(
'Icons' => Array(
'default' => 'icon16_item.png',
0 => 'icon16_item.png',
2 => 'icon16_pending.png',
5 => 'icon16_disabled.png',
+ 'module' => 'core',
),
'Fields' => Array(
'OrderId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
'OrderNumber' => Array('title' => 'la_col_OrderNumber', 'data_block' => 'grid_ordernumber_td', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
'OrderDate' => Array('title' => 'la_col_OrderDate', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'CustomerName' => Array('title' => 'la_col_CustomerName', 'data_block' => 'grid_userlink_td', 'user_field' => 'PortalUserId', 'filter_block' => 'grid_like_filter'),
'PaymentType' => Array('title' => 'la_col_PaymentType', 'data_block' => 'grid_billinglink_td', 'filter_block' => 'grid_options_filter'),
'TotalAmount' => Array('title' => 'la_col_TotalAmount', 'data_block' => 'grid_previewlink_td', 'filter_block' => 'grid_float_range_filter'),
'AffiliateUser' => Array( 'title' => 'la_col_AffiliateUser', 'data_block' => 'grid_userlink_td', 'user_field' => 'AffiliatePortalUserId', 'filter_block' => 'grid_user_like_filter'),
'OrderIP' => Array('title' => 'la_col_OrderIP', 'filter_block' => 'grid_like_filter'),
'Username' => Array('title' => 'la_col_Username', 'filter_block' => 'grid_user_like_filter'),
'PaymentAccount' => Array('title' => 'la_col_CreditCardNumber', 'filter_block' => 'grid_like_filter'),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/currencies/currencies_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/currencies/currencies_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/currencies/currencies_config.php (revision 12500)
@@ -1,142 +1,143 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'curr',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'CurrenciesEventHandler', 'file' => 'currencies_event_handler.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'CurrenciesTagProcessor', 'file' => 'currencies_tag_processor.php', 'build_event' => 'OnBuild'),
'RegisterClasses' => Array (
Array ('pseudo' => 'BankLVCurrencyRates', 'class' => 'kBankLVCurrencyRates', 'file' => 'currency_rates.php', 'build_event' => ''),
Array ('pseudo' => 'ECBCurrencyRates', 'class' => 'kECBCurrencyRates', 'file' => 'currency_rates.php', 'build_event' => ''),
Array ('pseudo' => 'FRNYCurrencyRates', 'class' => 'kFRNYCurrencyRates', 'file' => 'currency_rates.php', 'build_event' => ''),
),
'AutoLoad' => true,
'hooks' => Array (),
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
/*'Hooks' => Array (
Array (
'Mode' => hBEFORE,
'Conditional' => true,
'HookToPrefix' => 'tax',
'HookToSpecial' => '',
'HookToEvent' => Array ( 'onEdit' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnLoadZoneForm',
),
),*/
'IDField' => 'CurrencyId',
'StatusField' => Array ('Status', 'IsPrimary'),
'TitleField' => 'ISO',
'TitlePresets' => Array (
'default' => Array ( 'new_status_labels' => Array ('curr' => '!la_title_AddingCurrency!'),
'edit_status_labels' => Array ('curr' => '!la_title_EditingCurrency!'),
'new_titlefield' => Array ('curr' => '!la_title_NewCurrency!'),
),
'currencies_list'=>Array ( 'prefixes' => Array ('curr_List'),
'format' => "!la_title_Currencies!",
),
'currencies_edit'=>Array ( 'prefixes' => Array ('curr'),
'new_titlefield' => Array ('curr' => '!la_title_NewCurrency!'),
'format' => "#curr_status# '#curr_titlefield#' - !la_title_General!",
),
),
'PermSection' => Array ('main' => 'in-commerce:currencies'),
'Sections' => Array (
'in-commerce:currencies' => Array (
'parent' => 'in-commerce:setting_folder',
'icon' => 'conf_currencies',
'label' => 'la_tab_Currencies',
'url' => Array ('t' => 'in-commerce/currencies/currencies_list', 'pass' => 'm'),
'permissions' => Array ('view', 'add', 'edit', 'delete', 'advanced:move_up', 'advanced:move_down', 'advanced:update_rate', 'advanced:set_primary'),
'priority' => 3,
'type' => stTREE,
),
),
'TableName' => TABLE_PREFIX.'Currencies',
'AutoDelete' => true,
'AutoClone' => true,
'SubItems' => Array (),
'ListSQLs' => Array ( ''=> 'SELECT %1$s.*,
phr.Translation
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Phrase phr ON
%1$s.Name = phr.Phrase'),
// key - special, value - list select sql
'ItemSQLs' => Array ( ''=> 'SELECT * FROM %s'),
'CalculatedFields' => Array (
'' => Array (
'Translation' => 'phr.Translation',
),
),
'ListSortings' => Array (
'' => Array (
'ForcedSorting' => Array ('IsPrimary' => 'desc', 'Priority' => 'desc', 'Status' => 'desc'),
'Sorting' => Array ('ISO' => 'asc'),
)
),
'Fields' => Array
(
'CurrencyId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'ISO' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'Symbol' => Array ('type' => 'string', 'default' => null),
'SymbolPosition' => Array ('type' => 'int', 'default' => null,'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Left', 1 => 'la_Right'),'use_phrases' => '1'),
'Name' => Array ('type' => 'string', 'not_null' => '1', 'default' => ''),
'RateToPrimary' => Array ('type' => 'float', 'not_null' => 1, 'min_value_exc' => 0, 'formatter' => 'kFormatter', 'format' => '%0.4f', 'default' => 1),
'Modified' => Array ('type' => 'int', 'not_null' => 1, 'default' => '#NOW#', 'formatter' => 'kDateFormatter'),
'Status' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1, 'options' => Array ( 1 => 'la_Active', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'formatter' => 'kOptionsFormatter'),
'IsPrimary' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
),
'VirtualFields' => Array (
'Translation' => Array ('type' => 'string'),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array (
'default' => 'icon16_item.png',
'0_0' => 'icon16_disabled.png',
'0_1' => 'icon16_disabled.png',
'1_0' => 'icon16_item.png',
'1_1' => 'icon16_primary.png',
+ 'module' => 'core',
),
'Fields' => Array (
'CurrencyId' => Array ( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
'ISO' => Array ( 'title' => 'la_col_ISOCode', 'data_block' => 'currency_caption_td', 'filter_block' => 'grid_like_filter', 'width' => 90, ),
'Translation' => Array ( 'title' => 'la_col_CurrencyName', 'use_phrases' => 1, 'filter_block' => 'grid_like_filter', 'width' => 250, ),
'RateToPrimary' => Array ( 'title' => 'la_col_RateToPrimary', 'filter_block' => 'grid_float_range_filter', 'width' => 130, ),
'Modified' => Array ( 'title' => 'la_col_LastUpdated', 'filter_block' => 'grid_date_range_filter', 'width' => 150, ),
'Status' => Array ( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/affiliates/affiliates_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/affiliates/affiliates_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/affiliates/affiliates_config.php (revision 12500)
@@ -1,206 +1,207 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'affil',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'AffiliatesEventHandler','file'=>'affiliates_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'AffiliatesTagProcessor','file'=>'affiliates_tag_processor.php','build_event'=>'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array(
Array(
'Mode' => hAFTER,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array('OnCreate'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnRegisterAsAffiliate',
),
Array(
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'u',
'HookToSpecial' => '',
'HookToEvent' => Array('OnCreate'),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnCheckAffiliateAgreement',
),
),
'AggregateTags' => Array(
Array(
'AggregateTo' => 'u',
'AggregatedTagName' => 'IsAffiliate',
'LocalTagName' => 'User_IsAffiliate',
),
Array(
'AggregateTo' => 'u',
'AggregatedTagName' => 'AffiliateIsNotActive',
'LocalTagName' => 'User_AffiliateIsNotActive',
),
Array(
'AggregateTo' => 'u',
'AggregatedTagName' => 'AffiliateField',
'LocalTagName' => 'CurrentUserAffiliateField',
),
Array(
'AggregateTo' => 'u',
'AggregatedTagName' => 'IsAffiliateOrRegisterAsAffiliateAllowed',
'LocalTagName' => 'IsAffiliateOrRegisterAsAffiliateAllowed',
),
Array(
'AggregateTo' => 'm',
'AggregatedTagName' => 'RequireAffiliate',
'LocalTagName' => 'Main_RequireAffiliate',
),
Array(
'AggregateTo' => 'm',
'AggregatedTagName' => 'AllowAffiliateRegistration',
'LocalTagName' => 'AllowAffiliateRegistration',
),
),
'QueryString' => Array(
1 => 'id',
2 => 'Page',
3 => 'event',
4 => 'mode',
),
'RegularEvents' => Array(
'store_affiliate' => Array('EventName' => 'OnStoreAffiliate', 'RunInterval' => 0, 'Type' => reBEFORE),
'reset_affiliate_stats' => Array('EventName' => 'OnResetStatistics', 'RunInterval' => 0, 'Type' => reBEFORE),
),
'IDField' => 'AffiliateId',
'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
'TitleField' => 'UserName',
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('affil'=>'!la_title_Adding_Affiliate!'),
'edit_status_labels' => Array('affil'=>'!la_title_Editing_Affiliate!'),
'new_titlefield' => Array('affil'=>'!la_title_New_Affiliate!'),
),
'affiliates_list' => Array('prefixes' => Array('affil_List'), 'format' => "!la_title_Affiliates!"),
'affiliates_edit' => Array('prefixes' => Array('affil'), 'format' => "#affil_status# '#affil_titlefield#' - !la_title_General!"),
'affiliate_payments' => Array('prefixes' => Array('affil', 'apayments_List'), 'format' => "#affil_status# '#affil_titlefield#' - !la_title_Payments!"),
'affiliates_payout' => Array('prefixes' => Array('affil','apayments'), 'format' => "!la_title_PayOut_To! '#affil_titlefield#'"),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'in-commerce/affiliate_plans/affiliates_edit', 'priority' => 1),
'payments' => Array ('title' => 'la_tab_Payments', 't' => 'in-commerce/affiliate_plans/affiliate_edit_payments', 'priority' => 2),
),
),
'PermSection' => Array('main' => 'in-commerce:affiliates'),
'Sections' => Array(
'in-commerce:affiliates_folder' => Array(
'parent' => 'in-commerce',
'icon' => 'affiliates',
'label' => 'la_tab_Affiliates',
'use_parent_header' => 1,
'permissions' => Array(),
'priority' => 5,
'type' => stTREE,
),
'in-commerce:affiliates' => Array(
'parent' => 'in-commerce:affiliates_folder',
'icon' => 'affiliates',
'label' => 'la_tab_Affiliates',
'url' => Array('t' => 'in-commerce/affiliate_plans/affiliates_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'),
'priority' => 5.1, // <parent_priority>.<own_priority>, because this section replaces parent in tree
'type' => stTAB,
),
),
'TableName' => TABLE_PREFIX.'Affiliates',
'CalculatedFields' => Array(
'' => Array (
'UserId' => 'u.PortalUserId',
'UserName' => 'IF( LENGTH(u.Login), u.Login, \'\')',
'PlanName' => 'ap.Name',
),
),
'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'AffiliatePlans ap ON %1$s.AffiliatePlanId = ap.AffiliatePlanId'),
'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.PortalUserId = u.PortalUserId
LEFT JOIN '.TABLE_PREFIX.'AffiliatePlans ap ON %1$s.AffiliatePlanId = ap.AffiliatePlanId'),
'SubItems' => Array('apayments'),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('CreatedOn' => 'desc', 'UserName' => 'asc'),
)
),
'Fields' => Array(
'AffiliateId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'PortalUserId' => Array('type' => 'int', 'unique'=>Array('PortalUserId'), 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!', 'unique' => '!la_affiliate_already_exists!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'not_null' => 1, 'default' => 0, ),
'AffiliatePlanId' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT Name, AffiliatePlanId FROM '.TABLE_PREFIX.'AffiliatePlans WHERE Enabled = 1 ORDER BY Name', 'option_key_field'=>'AffiliatePlanId', 'option_title_field'=>'Name', 'not_null' => 1, 'default' => 0),
'AccumulatedAmount' => Array('type' => 'double', 'formatter'=>'kFormatter', 'format'=>'%.02f', 'not_null' => '1','default' => '0.00'),
'AmountToPay' => Array('type' => 'double', 'formatter'=>'kFormatter', 'format'=>'%.02f', 'not_null' => '1','default' => '0.00'),
'LastPaymentDate' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'default' => null),
'LastOrderDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
'Status' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options'=>Array(1=>'la_Active', 2=>'la_Pending', 0=>'la_Disabled'), 'use_phrases'=>1, 'not_null' => '1','default' => 2),
'AffiliateCode' => Array('type' => 'string', 'not_null' => '1', 'default' => ''),
'ItemsSold' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'PaymentTypeId' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options' => Array(0 => ''), 'options_sql'=>'SELECT Name, PaymentTypeId FROM '.TABLE_PREFIX.'AffiliatePaymentTypes WHERE Status = 1 ORDER BY IsPrimary DESC, Priority DESC, Name ASC', 'option_key_field'=>'PaymentTypeId', 'option_title_field'=>'Name', 'not_null' => 1, 'default' => 0),
'SSN' => Array('type' => 'string','not_null' => '1','default' => '', 'required' => 1),
'Comments' => Array('type' => 'string', 'formatter' => 'kFormatter', 'not_null' => 1, 'using_fck' => 1, 'default' => ''),
'CreatedOn' => Array('type' => 'int', 'formatter'=>'kDateFormatter', 'not_null' => '1', 'default' => '#NOW#'),
),
'VirtualFields' => Array(
'UserName' => Array('type'=>'string', 'default' => ''),
'PlanName' => Array('type'=>'string', 'default' => ''),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array (
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
2 => 'icon16_primary.png',
+ 'module' => 'core',
),
'Fields' => Array(
'AffiliateId' => Array( 'title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'UserName' => Array( 'title' => 'la_col_UserName', 'data_block' => 'grid_userlink_td', 'filter_block' => 'grid_like_filter'),
'PlanName' => Array( 'title'=>'la_col_PlanName', 'filter_block' => 'grid_like_filter'),
'PaymentTypeId' => Array( 'title' => 'la_col_PaymentType', 'filter_block' => 'grid_options_filter', 'width' => 120, ),
'CreatedOn' => Array( 'title' => 'la_col_RegisteredOn', 'format' => '_regional_DateFormat', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'Status' => Array( 'title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/discounts/discounts_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/discounts/discounts_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/discounts/discounts_config.php (revision 12500)
@@ -1,145 +1,146 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array(
'Prefix' => 'd',
'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'),
'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'),
'EventHandlerClass' => Array('class'=>'DiscountsEventHandler','file'=>'discounts_event_handler.php','build_event'=>'OnBuild'),
'TagProcessorClass' => Array('class'=>'kDBTagProcessor','file'=>'','build_event'=>'OnBuild'),
'AutoLoad' => true,
'hooks' => Array(),
'QueryString' => Array(
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode', // 't' for temp '' for normal
),
'IDField' => 'DiscountId',
'StatusField' => Array('Status'),
'TitleField' => 'Name',
'TableName' => TABLE_PREFIX.'ProductsDiscounts',
'SubItems' => Array('di'),
'TitlePresets' => Array(
'default' => Array( 'new_status_labels' => Array('d'=>'!la_title_Adding_Discount!'),
'edit_status_labels' => Array('d'=>'!la_title_Editing_Discount!'),
'new_titlefield' => Array('d'=>'!la_title_New_Discount!'),
),
'discounts_list'=>Array('prefixes' => Array('d_List'),
'format' => "!la_title_Discounts!",
),
'discount_edit'=>Array( 'prefixes' => Array('d'),
'format' => "#d_status# '#d_titlefield#' - !la_title_General!",
),
'discount_items'=>Array('prefixes' => Array('d','di_List'),
'format' => "#d_status# '#d_titlefield#' - !la_title_DiscountItems!",
),
),
'EditTabPresets' => Array (
'Default' => Array (
'general' => Array ('title' => 'la_tab_General', 't' => 'in-commerce/discounts/discount_edit', 'priority' => 1),
'items' => Array ('title' => 'la_tab_DiscountItems', 't' => 'in-commerce/discounts/discount_items', 'priority' => 2),
),
),
'PermSection' => Array('main' => 'in-commerce:discounts'),
'Sections' => Array(
'in-commerce:discounts_folder' => Array(
'parent' => 'in-commerce',
'use_parent_header' => 1,
'icon' => 'discounts_coupons',
'label' => 'la_tab_DiscountsAndCoupons',
'permissions' => Array(),
'priority' => 3,
'type' => stTREE,
),
'in-commerce:discounts' => Array(
'parent' => 'in-commerce:discounts_folder',
'icon' => 'discounts_coupons',
'label' => 'la_tab_Discounts',
'url' => Array('t' => 'in-commerce/discounts/discounts_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'),
'priority' => 3.1, // <parent_priority>.<own_priority>, because this section replaces parent in tree
'type' => stTAB,
),
),
'FilterMenu' => Array(
'Groups' => Array(
Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER),
Array('mode' => 'AND', 'filters' => Array(4,5,6), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Status != 1' ),
1 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => 'Status != 2' ),
2 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ),
3 => Array(),
4 => Array('label' => 'la_Flat', 'on_sql' => '', 'off_sql' => 'Type != 1' ),
5 => Array('label' => 'la_Percent', 'on_sql' => '', 'off_sql' => 'Type != 2' ),
6 => Array('label' => 'la_FreeShipping', 'on_sql' => '', 'off_sql' => 'Type != 3' ),
)
),
'ListSQLs' => Array( ''=>'SELECT %1$s.* %2$s FROM %1$s',
), // key - special, value - list select sql
'ItemSQLs' => Array( ''=>'SELECT * FROM %1$s',
),
'ListSortings' => Array(
'' => Array(
'Sorting' => Array('Name' => 'asc'),
)
),
'Fields' => Array(
'DiscountId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ( 1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'default' => 2 ),
'Name' => Array('type'=>'string','required' => 1, 'default' => null, 'max_len'=>255),
'Start' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
'End' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
'GroupId' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalGroup WHERE Personal = 0 ORDER BY Name', 'option_key_field'=>'GroupId', 'option_title_field'=>'Name', 'default' => 0),
'Type' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Flat', 2 => 'la_Percent'/*, 3 => 'la_FreeShipping' */), 'default' => 1 ),
'Amount' => Array('type'=>'double', 'default' => null),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array(
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
2 => 'icon16_pending.png',
+ 'module' => 'core',
),
'Fields' => Array(
'DiscountId' => Array( 'title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
'Start' => Array( 'title'=>'la_col_Start', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'End' => Array( 'title'=>'la_col_End', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ),
'GroupId' => Array( 'title'=>'la_col_Group', 'filter_block' => 'grid_options_filter', 'width' => 150, ),
'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter', 'width' => 90, ),
'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/units/gift_certificates/gift_certificates_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/gift_certificates/gift_certificates_config.php (revision 12499)
+++ branches/5.0.x/in-commerce/units/gift_certificates/gift_certificates_config.php (revision 12500)
@@ -1,150 +1,151 @@
<?php
/**
* @version $Id$
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.net/license/commercial/ for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
$config = Array (
'Prefix' => 'gc',
'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
'EventHandlerClass' => Array ('class' => 'GiftCertificateEventHandler', 'file' => 'gift_certificates_eh.php', 'build_event' => 'OnBuild'),
'TagProcessorClass' => Array ('class' => 'GiftCertificateTagProcessor', 'file' => 'gift_certificates_tp.php', 'build_event' => 'OnBuild'),
'AutoLoad' => true,
'Hooks' => Array (
Array (
'Mode' => hBEFORE,
'Conditional' => false,
'HookToPrefix' => 'ord',
'HookToSpecial' => '',
'HookToEvent' => Array( 'OnUpdateCart', 'OnCheckout' ),
'DoPrefix' => '',
'DoSpecial' => '',
'DoEvent' => 'OnApplyGiftCertificate',
),
),
'QueryString' => Array (
1 => 'id',
2 => 'page',
3 => 'event',
4 => 'mode',
),
'IDField' => 'GiftCertificateId',
'StatusField' => Array('Status'),
'TitleField' => 'Recipient',
'TableName' => TABLE_PREFIX.'GiftCertificates',
'TitlePresets' => Array (
'default' => Array (
'new_status_labels' => Array ('gc' => '!la_title_AddingGiftCertificate!'),
'edit_status_labels' => Array ('gc' => '!la_title_EditingGiftCertificate!'),
'new_titlefield' => Array ('gc' => '!la_title_NewGiftCertificate!'),
),
'gift_certificates_list' => Array ('prefixes' => Array ('gc_List'), 'format' => "!la_title_GiftCertificates!",),
'gift_certificates_edit' => Array ('prefixes' => Array ('gc'), 'format' => "#gc_status# '#gc_titlefield#' - !la_title_General!",),
),
'PermSection' => Array ('main' => 'in-commerce:gift-certificates'),
'Sections' => Array (
'in-commerce:gift-certificates' => Array (
'parent' => 'in-commerce:discounts_folder',
'icon' => 'discounts_coupons',
'label' => 'la_tab_GiftCertificates',
'url' => Array('t' => 'in-commerce/discounts/gift_certificate_list', 'pass' => 'm'),
'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'),
'priority' => 3.3, // <parent_priority>.<own_priority>, because this section replaces parent in tree
'type' => stTAB,
),
),
'FilterMenu' => Array (
'Groups' => Array(
Array ('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER),
),
'Filters' => Array(
0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => 'Status != 1' ),
1 => Array('label' => 'la_Used', 'on_sql' => '', 'off_sql' => 'Status != 2' ),
2 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ),
)
),
'ListSQLs' => Array ('' => 'SELECT %1$s.* %2$s FROM %1$s',),
'ItemSQLs' => Array ('' => 'SELECT * FROM %1$s',),
'ListSortings' => Array (
'' => Array(
'Sorting' => Array('Recipient' => 'asc'),
)
),
'Fields' => Array (
'GiftCertificateId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
'OrderId' => Array ('type' => 'int', 'default' => 0),
'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ( 1 => 'la_Enabled', 2 => 'la_Used', 0 => 'la_Disabled' ), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2 ),
'SendVia' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array ( 0 => 'la_opt_Email', 1 => 'la_opt_PostalMail'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0 ),
'Purchaser' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255),
'Recipient' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255),
'RecipientEmail' => Array('type' => 'string', 'formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', 'sample_value' => 'email@domain.com', 'not_null' => '1', 'required'=>1, 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!') ),
'RecipientFirstname' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255),
'RecipientLastname' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255),
'RecipientAddress1' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255),
'RecipientAddress2' => Array('type'=>'string', 'default'=>null, 'max_len'=>255),
'RecipientCity' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255),
'RecipientState' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255),
'RecipientZipcode' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255),
'RecipientCountry' => Array('type' => 'string', 'formatter'=>'kOptionsFormatter',
'options_sql'=>'SELECT %1$s
FROM '.TABLE_PREFIX.'StdDestinations
LEFT JOIN '.TABLE_PREFIX.'Phrase
ON '.TABLE_PREFIX.'Phrase.Phrase = '.TABLE_PREFIX.'StdDestinations.DestName
WHERE
DestType=1
AND
LanguageId = %2$s
ORDER BY Translation',
'option_key_field'=>'DestAbbr','option_title_field'=>'Translation',
'not_null' => '1','default' => 'USA', 'required'=>1
),
'RecipientPhone' => Array('type'=>'string','default'=>null, 'max_len'=>255),
'Message' => Array('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
'Code' => Array('type'=>'string','required'=>1,'default'=>null, 'max_len'=>255, 'unique'=>Array('Code')),
'AddDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#',),
'Expiration' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null,),
'Amount' => Array('type'=>'double', 'default' => null, 'required' => 1, 'min_value_exc' => 0),
'Debit' => Array('type'=>'double', 'default' => null),
),
'Grids' => Array (
'Default' => Array (
'Icons' => Array(
'default' => 'icon16_item.png',
0 => 'icon16_disabled.png',
1 => 'icon16_item.png',
2 => 'icon16_pending.png',
+ 'module' => 'core',
),
'Fields' => Array (
'GiftCertificateId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
'Code' => Array ('title' => 'la_col_Code', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
'Debit' => Array ('title' => 'la_col_RemainingAmount', 'filter_block' => 'grid_float_range_filter', 'width' => 160, ),
'Amount' => Array ('title' => 'la_col_Amount', 'filter_block' => 'grid_float_range_filter', 'width' => 100, ),
'Expiration' => Array ('title'=>'la_col_Expiration', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
),
),
),
);
\ No newline at end of file
Index: branches/5.0.x/in-commerce/admin_templates/orders/orders_edit_preview.tpl
===================================================================
--- branches/5.0.x/in-commerce/admin_templates/orders/orders_edit_preview.tpl (revision 12499)
+++ branches/5.0.x/in-commerce/admin_templates/orders/orders_edit_preview.tpl (revision 12500)
@@ -1,390 +1,390 @@
<inp2:adm_SetPopupSize width="820" height="570"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="ord" section="in-commerce:orders" title_preset="orders_edit_preview" tab_preset="Default"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('ord','<inp2:ord_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('ord','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('ord', '<inp2:ord_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('ord', '<inp2:ord_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('print', '<inp2:m_phrase label="la_ToolTip_Print" escape="1"/>', function() {
openSelector('ord', '<inp2:m_Link template="in-commerce/orders/orders_edit_print" pass="all"/>', '', '750x700');
}
) );
<inp2:m_if check="ord_OrderEditable">
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
- a_toolbar.AddButton( new ToolBarButton('place_order', '<inp2:m_phrase label="la_ToolTip_PlaceOrder" escape="1"/>', function() {
+ a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_PlaceOrder" escape="1"/>', function() {
submit_event('ord','OnCompleteOrder');
}
) );
</inp2:m_if>
a_toolbar.Render();
<inp2:m_if check="ord_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="ord_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="ord_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:ord_SaveWarning name="grid_save_warning"/>
<inp2:ord_ErrorWarning name="form_error_warning"/>
<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text">
<inp2:m_phrase label="la_fld_OrderNumber"/>:
</td>
<td>
<inp2:ord_Field field="OrderNumber"/> (<inp2:ord_Field field="Status"/>)
</td>
<td>&nbsp;</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text">
<inp2:m_phrase label="la_fld_Date"/>:
</td>
<td>
<inp2:ord_Field field="OrderDate"/>
</td>
<td>&nbsp;</td>
</tr>
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<td class="text">
<inp2:m_phrase label="la_fld_Username"/>:
</td>
<td>
<inp2:ord_Field field="PortalUserId"/> (<inp2:ord_Field field="CustomerName"/>)
</td>
<td>&nbsp;</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="100%" class="tableborder">
<tr>
<td>
<table cellspacing="0" cellpadding="2" width="100%" border="0">
<tr class="subsectiontitle">
<td colspan="2">
<inp2:m_Phrase label="la_comm_ShippingBillingInfo"/>
</td>
</tr>
<tr>
<inp2:m_if check="ord_Field" name="ShippingTo">
<td width="50%" class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>" style="vertical-align: top">
<!-- shipping -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="la_fld_ShippingTo"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="ShippingTo"/></td>
</tr>
<inp2:m_if check="ord_Field" name="ShippingEmail">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="lu_field_email"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="ShippingEmail"/></td>
</tr>
</inp2:m_if>
<inp2:m_if check="ord_Field" name="ShippingPhone">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="lu_comm_PhoneNumber"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="ShippingPhone"/></td>
</tr>
</inp2:m_if>
<inp2:m_if check="ord_Field" name="ShippingFax">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="lu_comm_FaxNumber"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="ShippingFax"/></td>
</tr>
</inp2:m_if>
<inp2:m_if check="ord_Field" name="ShippingCompany">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="lu_shipping_Company"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="ShippingCompany"/></td>
</tr>
</inp2:m_if>
<tr>
<td class="order_preview_field_name" style="vertical-align: top;">Address:</td>
<td class="order_preview_field_value">
<inp2:m_if check="ord_FieldEquals" field="ShippingAddress1" value="" inverse="inverse" >
<inp2:ord_Field field="ShippingAddress1"/><br>
</inp2:m_if>
<inp2:m_if check="ord_FieldEquals" field="ShippingAddress2" value="" inverse="inverse" >
<inp2:ord_Field field="ShippingAddress2"/><br>
</inp2:m_if>
<inp2:ord_PrintLocation type="Shipping"/>
</td>
</tr>
</table>
</td>
</inp2:m_if>
<inp2:m_if check="ord_Field" name="BillingTo">
<td width="50%" class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>" style="vertical-align: top">
<!-- billing -->
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="la_fld_BillingTo"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="BillingTo"/></td>
</tr>
<inp2:m_if check="ord_Field" name="BillingEmail">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="lu_billing_Email"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="BillingEmail"/></td>
</tr>
</inp2:m_if>
<inp2:m_if check="ord_Field" name="BillingPhone">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="lu_comm_PhoneNumber"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="BillingPhone"/></td>
</tr>
</inp2:m_if>
<inp2:m_if check="ord_Field" name="BillingFax">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="lu_comm_FaxNumber"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="BillingFax"/></td>
</tr>
</inp2:m_if>
<inp2:m_if check="ord_Field" name="BillingCompany">
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="lu_billing_Company"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="BillingCompany"/></td>
</tr>
</inp2:m_if>
<tr>
<td class="order_preview_field_name" style="vertical-align: top;"><inp2:m_phrase label="lu_billing_Address"/>:</td>
<td class="order_preview_field_value">
<inp2:m_if check="ord_FieldEquals" field="BillingAddress1" value="" inverse="inverse" >
<inp2:ord_Field field="BillingAddress1"/><br>
</inp2:m_if>
<inp2:m_if check="ord_FieldEquals" field="BillingAddress2" value="" inverse="inverse" >
<inp2:ord_Field field="BillingAddress2"/><br>
</inp2:m_if>
<inp2:ord_PrintLocation type="Billing"/>
</td>
</tr>
<tr>
<td class="order_preview_field_name"><inp2:m_phrase label="la_fld_PaymentType"/>:</td>
<td class="order_preview_field_value"><inp2:ord_Field field="PaymentType"/></td>
</tr>
</table>
</td>
</inp2:m_if>
<inp2:m_if check="ord_Field" name="ShippingTo" inverse="inverse"><td width="50%" valign="top">&nbsp;</td></inp2:m_if>
<inp2:m_if check="ord_Field" name="BillingTo" inverse="inverse"><td width="50%" valign="top">&nbsp;</td></inp2:m_if>
</tr>
<tr class="subsectiontitle">
<td colspan="2">
<inp2:m_Phrase label="la_comm_OrderContents"/>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" width="100%" border="0" class="orders_flat_table">
<tr class="subsectiontitle">
<td width="70%"<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders"> colspan="2"</inp2:m_if> nowrap><inp2:m_Phrase label="la_col_Product"/></td>
<td width="10%" nowrap style="text-align: center"><inp2:m_Phrase label="la_col_Quantity"/></td>
<td width="10%" nowrap style="text-align: right"><inp2:m_Phrase label="la_col_Price"/></td>
<td width="10%" nowrap style="text-align: right"><inp2:m_Phrase label="la_col_ExtendedPrice"/></td>
</tr>
<inp2:m_DefineElement name="option_value_element">
<inp2:m_param name="value"/> <inp2:m_if check="m_ParamEquals" name="price" value=""><inp2:m_else/> (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_if>
<inp2:m_if check="m_ParamEquals" name="is_last" value="1"><inp2:m_else/>, </inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="option_element">
<inp2:m_if check="m_ParamEquals" param="type" value="6"> <!-- checkboxes - multiple -->
<strong><inp2:m_param name="option"/>:</strong>
<inp2:PrintOptionValues render_as="option_value_element"/>
<inp2:m_else/>
<strong><inp2:m_param name="option"/>:</strong> <inp2:m_param name="value"/>
<inp2:m_if check="m_ParamEquals" name="price" value=""><inp2:m_else/> (<inp2:m_param name="sign"/><inp2:m_param name="price"/> <inp2:m_param name="price_type"/>)</inp2:m_if>
</inp2:m_if><br/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="option_value_element_no_price">
<inp2:m_param name="value"/>
<inp2:m_if check="m_ParamEquals" name="is_last" value="1"><inp2:m_else/>, </inp2:m_if>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="option_element_no_price">
<inp2:m_if check="m_ParamEquals" param="type" value="6"> <!-- checkboxes - multiple -->
<strong><inp2:m_param name="option"/>:</strong>
<inp2:PrintOptionValues render_as="option_value_element_no_price"/>
<inp2:m_else/>
<strong><inp2:m_param name="option"/>:</strong> <inp2:m_param name="value"/>
</inp2:m_if><br/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="product_image">
<img src="<inp2:m_param name="img_path" />" title="<inp2:m_param name="alt" />" alt="<inp2:m_param name="alt" />" <inp2:m_param name="img_size" /> border="0" />
</inp2:m_DefineElement>
<inp2:m_DefineElement name="order_detail_row">
<tr class="<inp2:m_odd_even odd="table-color1" even="table-color2"/>">
<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">
<td valign="top" width="120">
<inp2:p_Image render_as="product_image" thumbnail="1" DefaultImage="../../in-commerce/admin_templates/img/itemicons/no_picture_list.gif" MaxWidth="120" MaxHeight="120" DefaultWidth="120" />
</td>
</inp2:m_if>
<td align="left" valign="top" width="100%">
<strong><inp2:{$PrefixSpecial}_Field field="ProductName"/></strong><br/>
<small><strong>SKU: </strong><inp2:Field field="SKU"/></small>
<inp2:m_if check="HasOptions">
<br/>
<small>
<inp2:m_if check="DisplayOptionsPricing"> <!-- selectable options or overriding combination -->
<inp2:PrintOptions render_as="option_element"/>
<inp2:m_else/> <!-- listed combinations -->
<inp2:PrintOptions render_as="option_element_no_price"/>
</inp2:m_if>
</small>
<br/>
</inp2:m_if>
<inp2:m_if check="HasDiscount">
<br />
<inp2:m_Phrase label="lu_comm_RegularPrice" />: <inp2:Field name="FlatPrice" /><br />
<inp2:m_Phrase label="lu_comm_Discount" />: - <inp2:Field name="ItemDiscount" />
</inp2:m_if>
</td>
<td align="right" nowrap style="text-align: center"><inp2:{$PrefixSpecial}_Field field="Quantity"/></td>
<td align="right" nowrap><inp2:{$PrefixSpecial}_Field field="Price"/></td>
<td align="right" nowrap><inp2:{$PrefixSpecial}_Field field="ExtendedPrice"/></td>
</tr>
</inp2:m_DefineElement>
<inp2:orditems_PrintList block="order_detail_row" per_page="-1"/>
<tr style="border-top: 2px solid black">
<td align="left"<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders"> colspan="2"</inp2:m_if>>
<inp2:m_if check="ord_Field" name="CouponId">
<span class="order_preview_field_name"><inp2:m_Phrase label="la_CouponCode"/>:</span> <inp2:ord_Field field="CouponCode"/><br />
</inp2:m_if>
<inp2:m_if check="ord_FieldEquals" field="DiscountTotal" value="0.00" inverse="inverse">
<span class="order_preview_field_name"><inp2:m_Phrase label="la_TotalSavings"/>:</span> <inp2:ord_Field field="DiscountTotal"/><br />
</inp2:m_if>
</td>
<td align="right" nowrap colspan="2" class="order-totals-name"><inp2:m_Phrase label="la_SubTotal"/>:</td>
<td align="right" nowrap class="arial2">
<inp2:m_if check="ord_FieldEquals" name="VAT" value="0.00">
<inp2:ord_Field field="AmountWithoutVAT"/>
<inp2:m_else />
<inp2:ord_Field field="SubTotal"/>
</inp2:m_if>
</td>
</tr>
<inp2:m_DefineElement name="shipping_total">
<tr>
<td align="right" nowrap colspan="<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">4<inp2:m_else/>3</inp2:m_if>" class="order-totals-name"><inp2:m_Phrase label="la_ShippingHandling"/><inp2:m_if check="ord_ShippingType"> (<inp2:ord_ShippingType />):</inp2:m_if></td>
<td align="right" nowrap class="arial2"><inp2:ord_Field field="ShippingCost"/></td>
</tr>
<tr>
<td align="right" nowrap colspan="<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">4<inp2:m_else/>3</inp2:m_if>" class="order-totals-name"><inp2:m_Phrase label="la_Insurance_Fee"/>:</td>
<td align="right" nowrap class="arial2"><inp2:ord_Field field="InsuranceFee"/></td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="vat_total">
<tr>
<td align="right" nowrap colspan="<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">4<inp2:m_else/>3</inp2:m_if>" class="order-totals-name"><inp2:m_Phrase label="la_VAT"/> <inp2:ord_Field field="VATPercent"/>%:</td>
<td align="right" nowrap class="arial2"><inp2:ord_Field field="VAT"/></td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="processing_total">
<tr>
<td align="right" nowrap colspan="<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">4<inp2:m_else/>3</inp2:m_if>" class="order-totals-name"><inp2:m_Phrase label="la_ProcessingFee"/>:</td>
<td align="right" nowrap class="arial2"><inp2:ord_Field field="ProcessingFee"/></td>
</tr>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="return_total">
<tr>
<td align="right" nowrap colspan="<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">4<inp2:m_else/>3</inp2:m_if>" class="order-totals-name"><inp2:m_Phrase label="la_fld_TotalReturns"/>:</td>
<td align="right" nowrap class="arial2">-<inp2:ord_Field field="ReturnTotal"/></td>
</tr>
</inp2:m_DefineElement>
<inp2:ord_PrintTotals
shipping_render_as="shipping_total"
processing_render_as="processing_total"
vat_render_as="vat_total"
return_render_as="return_total"/>
<inp2:m_if check="ord_Field" field="GiftCertificateId">
<tr>
<td align="right" nowrap colspan="<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">4<inp2:m_else/>3</inp2:m_if>" class="order-totals-name"><inp2:m_Phrase label="!la_fld_Gift_Certificate_Number!"/>:</td>
<td align="right" nowrap class="arial2"><inp2:ord_Field field="GiftCertificateCode"/></td>
</tr>
<tr>
<td align="right" nowrap colspan="<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">4<inp2:m_else/>3</inp2:m_if>" class="order-totals-name"><inp2:m_Phrase label="!la_fld_Gift_Certificate_Amount_Applied!"/>:</td>
<td align="right" nowrap class="arial2"><inp2:ord_Field field="GiftCertificateDiscount"/></td>
</tr>
</inp2:m_if>
<tr>
<td align="right" colspan="<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders">3<inp2:m_else/>2</inp2:m_if>">&nbsp;</td>
<td align="right"><span class="order_preview_field_name">Total:</span></td>
<td align="right" nowrap><span class="order_preview_field_name"><inp2:ord_Field field="TotalAmount"/></span></td>
</tr>
<inp2:m_if check="ord_HasOriginalAmount" >
<tr>
<td align="right"<inp2:m_if check="m_GetConfig" name="ShowProductImagesInOrders"> colspan="2"</inp2:m_if>>&nbsp;</td>
<td align="right" colspan="2" nowrap><span class="order_preview_field_name"><inp2:m_Phrase label="la_fld_OriginalAmount"/>:</span></td>
<td align="right" nowrap <span class="order_preview_field_name"><inp2:ord_Field field="OriginalAmount"/></span></td>
</tr>
</inp2:m_if>
</table>
</td>
</tr>
</table>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.0.x/in-commerce/admin_templates/products/products_images.tpl
===================================================================
--- branches/5.0.x/in-commerce/admin_templates/products/products_images.tpl (revision 12499)
+++ branches/5.0.x/in-commerce/admin_templates/products/products_images.tpl (revision 12500)
@@ -1,107 +1,107 @@
<inp2:adm_SetPopupSize width="1000" height="680"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="p" section="in-portal:browse" pagination="1" pagination_prefix="img" title_preset="images" tab_preset="Default"/>
<inp2:m_include t="incs/image_blocks"/>
<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<script type="text/javascript">
function edit()
{
std_edit_temp_item('img', 'in-commerce/products/images_edit');
}
a_toolbar = new ToolBar();
a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
submit_event('p','<inp2:p_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('p','OnCancelEdit');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep1') );
a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
go_to_id('p', '<inp2:p_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('p', '<inp2:p_NextId/>');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.AddButton( new ToolBarButton('new_item', '<inp2:m_phrase label="la_ToolTip_New_Images" escape="1"/>::<inp2:m_phrase label="la_ToolTip_Add" escape="1"/>',
function() {
std_new_item('img', 'in-commerce/products/images_edit')
} ) );
a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
function() {
std_delete_items('img')
} ) );
a_toolbar.AddButton( new ToolBarSeparator('sep3') );
a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_MoveUp" escape="1"/>', function() {
submit_event('img','OnMassMoveUp');
}
) );
a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_MoveDown" escape="1"/>', function() {
submit_event('img','OnMassMoveDown');
}
) );
- a_toolbar.AddButton( new ToolBarButton('primary_image', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>', function() {
+ a_toolbar.AddButton( new ToolBarButton('setprimary', '<inp2:m_phrase label="la_ToolTip_SetPrimary" escape="1"/>', function() {
submit_event('img','OnSetPrimary');
}
) );
a_toolbar.AddButton( new ToolBarSeparator('sep4') );
a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
show_viewmenu(a_toolbar,'view');
}
) );
a_toolbar.Render();
<inp2:m_if check="p_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
<inp2:m_else/>
<inp2:m_if check="p_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="p_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
<inp2:m_RenderElement name="search_main_toolbar" prefix="img" grid="Default"/>
</tr>
</tbody>
</table>
<inp2:m_RenderElement name="grid" PrefixSpecial="img" IdField="ImageId" grid="Default" menu_filters="yes"/>
<script type="text/javascript">
- Grids['img'].SetDependantToolbarButtons( new Array('edit','delete','move_up','move_down','primary_image') );
+ Grids['img'].SetDependantToolbarButtons( new Array('edit','delete','move_up','move_down','setprimary') );
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Index: branches/5.0.x/in-commerce/admin_templates/img/itemicons/icon16_primary.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/5.0.x/in-commerce/admin_templates/img/itemicons/icon16_primary.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: branches/5.0.x/in-commerce/admin_templates/img/itemicons/icon16_disabled.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/5.0.x/in-commerce/admin_templates/img/itemicons/icon16_disabled.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: branches/5.0.x/in-commerce/admin_templates/img/itemicons/icon16_item.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: branches/5.0.x/in-commerce/admin_templates/img/itemicons/icon16_item.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property

Event Timeline