'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! (#d_recordcount#)", ), '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! (#di_recordcount#)", ), ), 'PermSection' => Array('main' => 'in-commerce:discounts'), 'Sections' => Array( 'in-commerce:discounts_folder' => Array( 'parent' => 'in-commerce', 'icon' => 'discounts', 'label' => 'la_tab_DiscountsAndCoupons', 'permissions' => Array(), 'priority' => 2, 'type' => stTREE, ), 'in-commerce:discounts' => Array( 'parent' => 'in-commerce:discounts_folder', 'icon' => 'discounts', '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' => 2.1, // ., 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(), 'Status' => Array('options' => Array ( 1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'default' => 2 ), 'Name' => Array('type'=>'string','required'=>1,'default'=>'', 'max_len'=>255), 'Start' => Array('formatter' => 'kDateFormatter'), 'End' => Array('formatter' => 'kDateFormatter'), 'GroupId' => Array('formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalGroup WHERE Personal = 0 ORDER BY Name', 'option_key_field'=>'GroupId', 'option_title_field'=>'Name'), 'Type' => Array('formatter'=>'kOptionsFormatter', 'use_phrases' => 1, 'options' => Array ( 1 => 'la_Flat', 2 => 'la_Percent'/*, 3 => 'la_FreeShipping' */), 'default' => 1 ), 'Amount' => Array('type'=>'double'), ), '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( 'Name' => Array( 'title'=>'la_col_Name', 'data_block' => 'grid_checkbox_td' ), 'Start_formatted' => Array( 'title'=>'la_col_Start', 'sort_field' => 'Start' ), 'End_formatted' => Array( 'title'=>'la_col_End', 'sort_field' => 'End' ), 'GroupId' => Array( 'title'=>'la_col_Group' ), 'Type' => Array( 'title'=>'la_col_Type' ), 'Amount' => Array( 'title'=>'la_col_Amount' ), ), ), ), ); ?>