Index: branches/5.2.x/units/gift_certificates/gift_certificates_config.php =================================================================== diff -u -N -r14717 -r16385 --- branches/5.2.x/units/gift_certificates/gift_certificates_config.php (.../gift_certificates_config.php) (revision 14717) +++ branches/5.2.x/units/gift_certificates/gift_certificates_config.php (.../gift_certificates_config.php) (revision 16385) @@ -1,6 +1,6 @@ '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, +$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'), - 'QueryString' => Array ( - 1 => 'id', - 2 => 'Page', - 3 => 'PerPage', - 4 => 'event', - 5 => 'mode', - ), + 'AutoLoad' => true, - 'IDField' => 'GiftCertificateId', - 'StatusField' => Array('Status'), - 'TitleField' => 'Recipient', - 'TableName' => TABLE_PREFIX.'GiftCertificates', + 'QueryString' => Array ( + 1 => 'id', + 2 => 'Page', + 3 => 'PerPage', + 4 => 'event', + 5 => 'mode', + ), - '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!'), - ), + 'IDField' => 'GiftCertificateId', + 'StatusField' => Array ('Status'), + 'TitleField' => 'Recipient', + 'TableName' => TABLE_PREFIX.'GiftCertificates', - '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!",), + '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!'), ), - 'PermSection' => Array ('main' => 'in-commerce:gift-certificates'), + '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!",), + ), - '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, // ., because this section replaces parent in tree - 'type' => stTAB, - ), - ), + 'PermSection' => Array ('main' => 'in-commerce:gift-certificates'), - 'ListSQLs' => Array ('' => 'SELECT %1$s.* %2$s FROM %1$s',), - 'ItemSQLs' => Array ('' => 'SELECT * FROM %1$s',), - - 'ListSortings' => Array ( - '' => Array( - 'Sorting' => Array('Recipient' => 'asc'), - ) + '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, // ., because this section replaces parent in tree + 'type' => stTAB, ), + ), - '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 IF(l%2$s_Name = "", l%3$s_Name, l%2$s_Name) AS Name, IsoCode - FROM '.TABLE_PREFIX.'CountryStates - WHERE Type = ' . DESTINATION_TYPE_COUNTRY . ' - ORDER BY Name', - 'option_key_field' => 'IsoCode', 'option_title_field' => 'Name', - 'not_null' => 1, 'required' => 1, 'default' => 'USA' - ), + 'ListSQLs' => Array ( + '' => ' SELECT %1$s.* %2$s + FROM %1$s', + ), - '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), + '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 IF(l%2$s_Name = "", l%3$s_Name, l%2$s_Name) AS Name, IsoCode + FROM '.TABLE_PREFIX.'CountryStates + WHERE Type = ' . DESTINATION_TYPE_COUNTRY . ' + ORDER BY Name', + 'option_key_field' => 'IsoCode', 'option_title_field' => 'Name', + 'not_null' => 1, 'required' => 1, 'default' => 'USA' ), - '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' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'Code' => Array ('filter_block' => 'grid_like_filter', 'width' => 100, ), - 'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 100, ), - 'Debit' => Array ('title' => 'column:la_fld_RemainingAmount', 'filter_block' => 'grid_range_filter', 'width' => 160, ), - 'Amount' => Array ('filter_block' => 'grid_range_filter', 'width' => 100, ), - 'Expiration' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ), - ), + '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' => 'column:la_fld_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), + 'Code' => Array ('filter_block' => 'grid_like_filter', 'width' => 100, ), + 'Status' => Array ('filter_block' => 'grid_options_filter', 'width' => 100, ), + 'Debit' => Array ('title' => 'column:la_fld_RemainingAmount', 'filter_block' => 'grid_range_filter', 'width' => 160, ), + 'Amount' => Array ('filter_block' => 'grid_range_filter', 'width' => 100, ), + 'Expiration' => Array ('filter_block' => 'grid_date_range_filter', 'width' => 145, ), + ), ), - ); \ No newline at end of file + ), +); \ No newline at end of file