Page MenuHomeIn-Portal Phabricator

in-commerce
No OneTemporary

File Metadata

Created
Sun, Jan 5, 9:33 PM

in-commerce

Index: branches/5.0.x/in-commerce/units/discounts/discounts_config.php
===================================================================
--- branches/5.0.x/in-commerce/units/discounts/discounts_config.php (revision 12630)
+++ branches/5.0.x/in-commerce/units/discounts/discounts_config.php (revision 12631)
@@ -1,146 +1,150 @@
<?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),
+ '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',
+ 'required' => 1, 'default' => NULL
+ ),
'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/admin_templates/discounts/discount_edit.tpl
===================================================================
--- branches/5.0.x/in-commerce/admin_templates/discounts/discount_edit.tpl (revision 12630)
+++ branches/5.0.x/in-commerce/admin_templates/discounts/discount_edit.tpl (revision 12631)
@@ -1,74 +1,74 @@
<inp2:adm_SetPopupSize width="870" height="600"/>
<inp2:m_include t="incs/header"/>
<inp2:m_RenderElement name="combined_header" prefix="d" section="in-commerce:discounts" title_preset="discount_edit" 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('d','<inp2:d_SaveEvent/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('d','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('d', '<inp2:d_PrevId/>');
}
) );
a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
go_to_id('d', '<inp2:d_NextId/>');
}
) );
//a_toolbar.AddButton( new ToolBarSeparator('sep2') );
a_toolbar.Render();
<inp2:m_if check="d_IsSingle" >
a_toolbar.HideButton('prev');
a_toolbar.HideButton('next');
a_toolbar.HideButton('sep1');
//a_toolbar.HideButton('sep2');
<inp2:m_else/>
<inp2:m_if check="d_IsLast" >
a_toolbar.DisableButton('next');
</inp2:m_if>
<inp2:m_if check="d_IsFirst" >
a_toolbar.DisableButton('prev');
</inp2:m_if>
</inp2:m_if>
</script>
</td>
</tr>
</tbody>
</table>
<inp2:d_SaveWarning name="grid_save_warning"/>
<inp2:d_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<inp2:m_RenderElement name="inp_label" prefix="d" field="DiscountId" title="!la_fld_Id!"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="d" field="Status" title="!la_fld_Status!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="d" field="Name" title="!la_fld_Name!" size="35"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="d" field="Start" title="!la_fld_Start!" size="10"/>
<inp2:m_RenderElement name="inp_edit_date_time" prefix="d" field="End" title="!la_fld_End!" size="10"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="d" field="GroupId" title="!la_fld_Group!"/>
- <inp2:m_RenderElement name="inp_edit_options" prefix="d" field="Type" title="!la_fld_Type!"/>
+ <inp2:m_RenderElement name="inp_edit_options" prefix="d" field="GroupId" title="!la_fld_Group!" has_empty="1"/>
+ <inp2:m_RenderElement name="inp_edit_radio" prefix="d" field="Type" title="!la_fld_Type!"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="d" field="Amount" title="!la_fld_Amount!" size="4"/>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file

Event Timeline