Page MenuHomeIn-Portal Phabricator

in-commerce
No OneTemporary

File Metadata

Created
Thu, Feb 6, 1:25 PM

in-commerce

Index: branches/5.0.x/in-commerce/units/coupons/coupons_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/coupons/coupons_config.php (revision 12168)
+++ branches/5.0.x/in-commerce/units/coupons/coupons_config.php (revision 12169)
@@ -1,164 +1,182 @@
<?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.
*/
$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',
'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' => 2.2,
'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' ), 'not_null' => 1, 'default' => 1 ), // options => (3 => 'la_FreeShipping')
- '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'=>0),
- 'LastUsedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => 0),
- 'NumberOfUses' => Array('type'=>'int', 'default' => 1,),
+ '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' => 0),
+ 'NumberOfUses' => Array ('type' => 'int', 'default' => 1),
),
'Grids' => Array(
'Default' => Array(
'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_discount.gif',2=>'icon16_discount_pending.gif',0=>'icon16_discount_disabled.gif'),
'Fields' => Array(
'CouponId' => Array ('title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter'),
'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter'),
'Code' => Array( 'title'=>'la_col_CouponCode', 'filter_block' => 'grid_like_filter'),
'Expiration' => Array( 'title'=>'la_col_Expiration', 'filter_block' => 'grid_date_range_filter'),
'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter'),
'LastUsedBy' => Array('title'=>'la_col_LastUsedBy', 'filter_block' => 'grid_like_filter'),
'LastUsedOn' => Array('title'=>'la_col_LastUsedOn', 'filter_block' => 'grid_date_range_filter'),
'NumberOfUses' => Array('title'=>'la_col_NumberOfUses', 'filter_block' => 'grid_range_filter'),
),
),
'Radio' => Array(
'Icons' => Array('default'=>'icon16_custom.gif',1=>'icon16_discount.gif',2=>'icon16_discount_pending.gif',0=>'icon16_discount_disabled.gif'),
'Selector' => 'radio',
'Fields' => Array(
'CouponId' => Array ('title'=>'la_col_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter'),
'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter'),
'Code' => Array( 'title'=>'la_col_CouponCode', 'filter_block' => 'grid_like_filter'),
'Expiration' => Array( 'title'=>'la_col_Expiration', 'filter_block' => 'grid_date_range_filter'),
'Type' => Array( 'title'=>'la_col_Type', 'filter_block' => 'grid_options_filter'),
'Amount' => Array( 'title'=>'la_col_Amount', 'filter_block' => 'grid_float_range_filter'),
'LastUsedBy' => Array('title'=>'la_col_LastUsedBy', 'filter_block' => 'grid_like_filter'),
'LastUsedOn' => Array('title'=>'la_col_LastUsedOn', 'filter_block' => 'grid_date_range_filter'),
'NumberOfUses' => Array('title'=>'la_col_NumberOfUses', 'filter_block' => 'grid_range_filter'),
),
),
),
);
?>
\ No newline at end of file

Event Timeline