Index: branches/5.2.x/units/affiliates/affiliates_config.php =================================================================== diff -u -N -r14582 -r14594 --- branches/5.2.x/units/affiliates/affiliates_config.php (.../affiliates_config.php) (revision 14582) +++ branches/5.2.x/units/affiliates/affiliates_config.php (.../affiliates_config.php) (revision 14594) @@ -1,6 +1,6 @@ hAFTER, 'Conditional' => false, 'HookToPrefix' => 'u', - 'HookToSpecial' => '', - 'HookToEvent' => Array('OnCreate'), + 'HookToSpecial' => 'register', + 'HookToEvent' => Array('OnBeforeItemCreate', 'OnBeforeItemUpdate'), 'DoPrefix' => '', - 'DoSpecial' => '', - 'DoEvent' => 'OnRegisterAsAffiliate', + 'DoSpecial' => 'register', + 'DoEvent' => 'OnValidateAffiliate', ), + Array( - 'Mode' => hBEFORE, + 'Mode' => hAFTER, 'Conditional' => false, 'HookToPrefix' => 'u', - 'HookToSpecial' => '', + 'HookToSpecial' => 'register', 'HookToEvent' => Array('OnCreate'), 'DoPrefix' => '', - 'DoSpecial' => '', - 'DoEvent' => 'OnCheckAffiliateAgreement', + 'DoSpecial' => 'register', + 'DoEvent' => 'OnRegisterAffiliate', ), ), 'AggregateTags' => Array( @@ -50,8 +51,8 @@ ), Array( 'AggregateTo' => 'u', - 'AggregatedTagName' => 'AffiliateIsNotActive', - 'LocalTagName' => 'User_AffiliateIsNotActive', + 'AggregatedTagName' => 'AffiliateIsActive', + 'LocalTagName' => 'User_AffiliateIsActive', ), Array( 'AggregateTo' => 'u', @@ -105,6 +106,19 @@ 'affiliates_payout' => Array('prefixes' => Array('affil','apayments'), 'format' => "!la_title_PayOut_To! '#affil_titlefield#'"), ), + 'Forms' => Array ( + 'registration' => Array ( + 'VirtualFields' => Array ( + 'TermsAccepted' => Array ( + 'type' => 'int', + 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, + 'error_msgs' => Array ('required' => '!lu_comm_MustAgreeAffiliateTermsError!'), + 'required' => 1, 'default' => NULL, + ), + ) + ), + ), + 'EditTabPresets' => Array ( 'Default' => Array ( 'general' => Array ('title' => 'la_tab_General', 't' => 'in-commerce/affiliate_plans/affiliates_edit', 'priority' => 1), @@ -164,34 +178,35 @@ ), '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(USER_ROOT => 'root', USER_GUEST => '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', 'using_fck' => 1, 'default' => NULL), - 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - ), + '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(USER_ROOT => 'root', USER_GUEST => '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' => STATUS_PENDING), + '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', 'using_fck' => 1, 'default' => NULL), + 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), + ), + 'VirtualFields' => Array( - 'UserName' => Array('type'=>'string', 'default' => ''), - 'PlanName' => Array('type'=>'string', 'default' => ''), - 'UserId' => Array('type'=>'int', 'default' => 0), - ), + 'UserName' => Array('type'=>'string', 'default' => ''), + 'PlanName' => Array('type'=>'string', 'default' => ''), + 'UserId' => Array('type'=>'int', 'default' => 0), + ), 'Grids' => Array( 'Default' => Array( 'Icons' => Array ( 'default' => 'icon16_item.png', 0 => 'icon16_disabled.png', 1 => 'icon16_item.png', - 2 => 'icon16_primary.png', + 2 => 'icon16_pending.png', 'module' => 'core', ), 'Fields' => Array(