Index: branches/5.3.x/units/gateways/gw_classes/ideal_nl.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gateways/gw_classes/ideal_nl.php (.../ideal_nl.php) (revision 15492) +++ branches/5.3.x/units/gateways/gw_classes/ideal_nl.php (.../ideal_nl.php) (revision 15671) @@ -1,6 +1,6 @@ FindChildValue('message'); $this->parsed_responce['XML'] = $transaction_xml; $this->Application->SetVar('failure_template', $this->Application->RecallVar('gw_cancel_template')); - $this->parsed_responce['MESSAGE'] = $error_msg ? $error_msg : 'Unknown gateway error ('.htmlspecialchars($transaction_xml).')'; + $this->parsed_responce['MESSAGE'] = $error_msg ? $error_msg : 'Unknown gateway error ('.htmlspecialchars($transaction_xml, null, CHARSET).')'; return false; } Index: branches/5.3.x/install/upgrades.sql =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/install/upgrades.sql (.../upgrades.sql) (revision 15492) +++ branches/5.3.x/install/upgrades.sql (.../upgrades.sql) (revision 15671) @@ -282,3 +282,7 @@ INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:general.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:output.add', 11, 1, 1, 0); INSERT INTO Permissions VALUES(DEFAULT, 'in-commerce:contacts.add', 11, 1, 1, 0); + +# ===== v 5.2.1-B1 ===== +ALTER TABLE Affiliates CHANGE PortalUserId PortalUserId INT(10) NULL DEFAULT NULL; +UPDATE Affiliates SET PortalUserId = NULL WHERE PortalUserId = 0; Index: branches/5.3.x/units/destinations/dst_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/destinations/dst_event_handler.php (.../dst_event_handler.php) (revision 15492) +++ branches/5.3.x/units/destinations/dst_event_handler.php (.../dst_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ getObject(); /* @var $object kDBItem */ - $zone_object = &$this->Application->recallObject('z'); + $zone_object = $this->Application->recallObject('z'); + /* @var $zone_object kDBItem */ + $zone_id = (int)$zone_object->GetID(); $zone_type = $zone_object->GetDBField('Type'); Index: branches/5.3.x/admin_templates/products/review_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/products/review_edit.tpl (.../review_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/products/review_edit.tpl (.../review_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/units/shipping_quote_engines/usps.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/shipping_quote_engines/usps.php (.../usps.php) (revision 15492) +++ branches/5.3.x/units/shipping_quote_engines/usps.php (.../usps.php) (revision 15671) @@ -1,6 +1,6 @@ Application->getClientIp(), $usps_server . '/' . $api_dll . '?' . urldecode($request), $body ); Index: branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_edit.tpl (.../affiliate_plans_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_edit.tpl (.../affiliate_plans_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/units/products/products_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/products/products_event_handler.php (.../products_event_handler.php) (revision 15492) +++ branches/5.3.x/units/products/products_event_handler.php (.../products_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ GetDBField('InventoryStatus') == 2) { // inventory by options (use first selected combination in grid) - $combination_id = array_shift( array_keys( $this->Application->GetVar('poc_grid') ) ); + $combinations = $this->Application->GetVar('poc_grid'); + list ($combination_id, ) = each($combinations); } else { // inventory by product @@ -295,7 +296,7 @@ foreach ($orders as $ord_id) { $order->Load($ord_id); - $this->Application->EmailEventAdmin('BACKORDER.FULLFILL'); + $this->Application->emailAdmin('BACKORDER.FULLFILL'); //reserve what's possible in any case $event = new kEvent('ord:OnReserveItems'); @@ -692,15 +693,15 @@ $sql = ' SELECT * FROM ' . TABLE_PREFIX . 'SpamControl WHERE ItemResourceId=' . $object->GetDBField('ResourceId') . ' - AND IPaddress="' . $_SERVER['REMOTE_ADDR'] . '" + AND IPaddress="' . $this->Application->getClientIp() . '" AND PortalUserId=' . $user_id . ' AND DataType="Rating"'; $res = $this->Conn->GetRow($sql); if ( $res && $res['Expire'] < adodb_mktime() ) { $sql = ' DELETE FROM ' . TABLE_PREFIX . 'SpamControl WHERE ItemResourceId=' . $object->GetDBField('ResourceId') . ' - AND IPaddress="' . $_SERVER['REMOTE_ADDR'] . '" + AND IPaddress="' . $this->Application->getClientIp() . '" AND PortalUserId=' . $user_id . ' AND DataType="Rating"'; $this->Conn->Query($sql); @@ -723,7 +724,7 @@ $sql = ' INSERT INTO ' . TABLE_PREFIX . 'SpamControl (ItemResourceId, IPaddress, PortalUserId, DataType, Expire) VALUES (' . $object->GetDBField('ResourceId') . ', - "' . $_SERVER['REMOTE_ADDR'] . '", + "' . $this->Application->getClientIp() . '", ' . $user_id . ', "Rating", ' . $expire . ')'; @@ -773,8 +774,8 @@ if ( preg_match('/' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . '/', $friend_email) ) { $user_id = $this->Application->RecallVar('user_id'); - $email_sent = $this->Application->EmailEventUser('PRODUCT.SUGGEST', $user_id, $send_params); - $this->Application->EmailEventAdmin('PRODUCT.SUGGEST'); + $email_sent = $this->Application->emailUser('PRODUCT.SUGGEST', $user_id, $send_params); + $this->Application->emailAdmin('PRODUCT.SUGGEST'); if ( $email_sent ) { $event->setRedirectParams(Array ('opener' => 's', 'pass' => 'all')); @@ -945,21 +946,25 @@ $this->Conn->Query($sql); } - function OnPackageApprove($event){ + protected function OnPackageApprove(kEvent $event) + { $field_values = $event->getEventParam('field_values'); $item_data = unserialize($field_values['ItemData']); $package_content_ids = $item_data['PackageContent']; + $object_item = $this->Application->recallObject('p.packageitem', null, array ('skip_autoload' => true)); + /* @var $object_item ProductsItem */ - - $object_item = &$this->Application->recallObject('p.packageitem', null, array('skip_autoload'=>true)); foreach ($package_content_ids as $package_item_id) { - $object_field_values = array(); - // query processing data from product and run approve event - $sql = 'SELECT ProcessingData FROM '.TABLE_PREFIX.'Products WHERE ProductId = '.$package_item_id; + $object_field_values = array (); + + // query processing data from product and run approve event + $sql = 'SELECT ProcessingData + FROM ' . TABLE_PREFIX . 'Products + WHERE ProductId = ' . $package_item_id; $processing_data = $this->Conn->GetOne($sql); - if($processing_data) - { + + if ( $processing_data ) { $processing_data = unserialize($processing_data); $approve_event = new kEvent($processing_data['ApproveEvent']); @@ -974,10 +979,7 @@ $approve_event->setEventParam('field_values', $object_field_values); $this->Application->HandleEvent($approve_event); } - - } - } /** @@ -1219,7 +1221,7 @@ } - function ProcessPackageItems($event) + function ProcessPackageItems(kEvent $event) { //$this->Application->SetVar('p_mode', 't'); @@ -1239,7 +1241,7 @@ /* $this->Application->SetVar('p_mode', false); - $list = &$this->Application->recallObject('p.content', 'p_List', array('types'=>'content')); + $list = $this->Application->recallObject('p.content', 'p_List', array('types'=>'content')); $this->Application->SetVar('p_mode', 't'); Index: branches/5.3.x/units/affiliates/affiliates_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/affiliates/affiliates_event_handler.php (.../affiliates_event_handler.php) (revision 15492) +++ branches/5.3.x/units/affiliates/affiliates_event_handler.php (.../affiliates_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ SetDBField('PortalUserId', $user->GetID()); if ( $object->Create() ) { - $this->Application->EmailEventUser('AFFILIATE.REGISTER', $user->GetID()); - $this->Application->EmailEventAdmin('AFFILIATE.REGISTER'); + $this->Application->emailUser('AFFILIATE.REGISTER', $user->GetID()); + $this->Application->emailAdmin('AFFILIATE.REGISTER'); } } @@ -404,8 +404,8 @@ $object = $event->getObject(); /* @var $object kDBItem */ - $this->Application->EmailEventUser('AFFILIATE.PAYMENT.TYPE.CHANGED', $object->GetDBField('PortalUserId')); - $this->Application->EmailEventAdmin('AFFILIATE.PAYMENT.TYPE.CHANGED'); + $this->Application->emailUser('AFFILIATE.PAYMENT.TYPE.CHANGED', $object->GetDBField('PortalUserId')); + $this->Application->emailAdmin('AFFILIATE.PAYMENT.TYPE.CHANGED'); $next_template = $this->Application->GetVar('next_template'); @@ -448,8 +448,8 @@ foreach ($new_ids as $payment_id) { $payment_object->Load($payment_id); - $this->Application->EmailEventUser('AFFILIATE.PAYMENT', $payment_object->GetDBField('PortalUserId')); - $this->Application->EmailEventAdmin('AFFILIATE.PAYMENT'); + $this->Application->emailUser('AFFILIATE.PAYMENT', $payment_object->GetDBField('PortalUserId')); + $this->Application->emailAdmin('AFFILIATE.PAYMENT'); } $object = $event->getObject(); @@ -467,8 +467,8 @@ $old_status = $this->Conn->GetOne($sql); if ( $old_status == 2 && $object->GetDBField('Status') == 1 ) { - $this->Application->EmailEventUser('AFFILIATE.REGISTRATION.APPROVED', $object->GetDBField('PortalUserId')); - $this->Application->EmailEventAdmin('AFFILIATE.REGISTRATION.APPROVED'); + $this->Application->emailUser('AFFILIATE.REGISTRATION.APPROVED', $object->GetDBField('PortalUserId')); + $this->Application->emailAdmin('AFFILIATE.REGISTRATION.APPROVED'); } } @@ -591,7 +591,7 @@ $ids = $this->StoreSelectedIDs($event); if ( $ids ) { - $status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField')); + $status_field = $object->getStatusField(); foreach ($ids as $id) { $object->Load($id); @@ -617,12 +617,12 @@ if ( $object->Update() ) { switch ($event->Name) { case 'OnMassApprove': - $this->Application->EmailEventUser('AFFILIATE.REGISTRATION.APPROVED', $object->GetDBField('PortalUserId')); - $this->Application->EmailEventAdmin('AFFILIATE.REGISTRATION.APPROVED'); + $this->Application->emailUser('AFFILIATE.REGISTRATION.APPROVED', $object->GetDBField('PortalUserId')); + $this->Application->emailAdmin('AFFILIATE.REGISTRATION.APPROVED'); break; case 'OnMassDecline': - $this->Application->EmailEventUser('AFFILIATE.REGISTRATION.DENIED', $object->GetDBField('PortalUserId')); - $this->Application->EmailEventAdmin('AFFILIATE.REGISTRATION.DENIED'); + $this->Application->emailUser('AFFILIATE.REGISTRATION.DENIED', $object->GetDBField('PortalUserId')); + $this->Application->emailAdmin('AFFILIATE.REGISTRATION.DENIED'); break; } $event->status = kEvent::erSUCCESS; Index: branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl (.../affiliate_plans_brackets.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_brackets.tpl (.../affiliate_plans_brackets.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/units/manufacturers/manufacturers_config.php =================================================================== diff -u -N -r15656 -r15671 --- branches/5.3.x/units/manufacturers/manufacturers_config.php (.../manufacturers_config.php) (revision 15656) +++ branches/5.3.x/units/manufacturers/manufacturers_config.php (.../manufacturers_config.php) (revision 15671) @@ -1,6 +1,6 @@ 'string', 'formatter' => 'kPictureFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => IMAGES_PATH.'manufacturers/', - 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!', + 'file_types' => '*.jpg;*.jpeg;*.gif;*.png;*.bmp', 'files_description' => '!la_hint_ImageFiles!', 'multiple' => false, 'thumb_format' => 'resize:100x100', 'max_len' => 255, 'not_null' => 1, 'default' => '' ), Index: branches/5.3.x/admin_templates/img/toolbar/toolbar-sprite.png =================================================================== diff -u -N -r15492 -r15671 Binary files differ Index: branches/5.3.x/units/shipping/shipping_tag_processor.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/shipping/shipping_tag_processor.php (.../shipping_tag_processor.php) (revision 15492) +++ branches/5.3.x/units/shipping/shipping_tag_processor.php (.../shipping_tag_processor.php) (revision 15671) @@ -1,6 +1,6 @@ getObject($params); + /* @var $object kDBItem */ + + $o = ''; $selected = trim($object->GetDBField('PortalGroups'), ','); $selected_arr = explode(',', $selected); - $all_groups = $this->Conn->Query('SELECT GroupId, Name FROM '.TABLE_PREFIX.'UserGroups ORDER BY NAME', 'GroupId'); - $o = ''; - foreach ($all_groups as $a_group) - { + $sql = 'SELECT GroupId, Name + FROM ' . TABLE_PREFIX . 'UserGroups + ORDER BY Name'; + $all_groups = $this->Conn->Query($sql, 'GroupId'); + + $mode = array_key_exists('mode', $params) ? $params['mode'] : false; + + foreach ($all_groups as $a_group) { $is_selected = in_array($a_group['GroupId'], $selected_arr); - $continue = $params['mode'] == 'selected' ? !$is_selected : $is_selected; - if ($continue) continue; + $continue = $mode == 'selected' ? !$is_selected : $is_selected; + + if ( $continue ) { + continue; + } + $block_params = $a_group; - $block_params['name'] = $params['render_as']; + $block_params['name'] = $params['render_as']; $o .= $this->Application->ParseBlock($block_params); } + return $o; } } \ No newline at end of file Index: branches/5.3.x/units/gateways/gw_classes/paypal_direct.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gateways/gw_classes/paypal_direct.php (.../paypal_direct.php) (revision 15492) +++ branches/5.3.x/units/gateways/gw_classes/paypal_direct.php (.../paypal_direct.php) (revision 15671) @@ -1,6 +1,6 @@ Application->getClientIp(); $post_fields['USER'] = $gw_params['api_username']; $post_fields['PWD'] = $gw_params['api_password']; $post_fields['SIGNATURE'] = $gw_params['signature']; Index: branches/5.3.x/units/products/products_tag_processor.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 15492) +++ branches/5.3.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 15671) @@ -1,6 +1,6 @@ Application->recallObject('rel'); +// $related = $this->Application->recallObject('rel'); + return $this->PrintList2($params); } @@ -536,13 +537,17 @@ function IsSubscription($params) { - $object = &$this->Application->recallObject($this->getPrefixSpecial()); + $object = $this->getObject($params); + /* @var $object kDBItem */ + return ($object->GetDBField('Type') == 2); } function IsTangible($params) { - $object = &$this->Application->recallObject($this->getPrefixSpecial()); + $object = $this->getObject($params); + /* @var $object kDBItem */ + return ($object->GetDBField('Type') == 1); } Index: branches/5.3.x/admin_templates/affiliate_plans/affiliates_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/affiliate_plans/affiliates_edit.tpl (.../affiliates_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/affiliate_plans/affiliates_edit.tpl (.../affiliates_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/admin_templates/products/access_pricing_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/products/access_pricing_edit.tpl (.../access_pricing_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/products/access_pricing_edit.tpl (.../access_pricing_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + @@ -30,7 +32,7 @@ )); a_toolbar.Render(); - + a_toolbar.HideButton('prev'); a_toolbar.HideButton('next'); @@ -59,12 +61,12 @@ - - + Index: branches/5.3.x/units/products/products_config.php =================================================================== diff -u -N -r15656 -r15671 --- branches/5.3.x/units/products/products_config.php (.../products_config.php) (revision 15656) +++ branches/5.3.x/units/products/products_config.php (.../products_config.php) (revision 15671) @@ -1,6 +1,6 @@ Array ('type' => 'string', 'default' => null), 'ShippingLimitation' => Array ('type' => 'string', 'default' => NULL), - 'AssignedCoupon' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0, - 'formatter' => 'kLEFTFormatter', - 'options' => Array (0 => 'None'), - 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'ProductsCoupons WHERE `%s` = \'%s\'', - 'left_key_field' => 'CouponId', - 'left_title_field' => 'Name'), + 'AssignedCoupon' => Array ( + 'type' => 'int', + 'formatter' => 'kLEFTFormatter', 'options' => Array (0 => 'None'), + 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'ProductsCoupons WHERE %s', + 'left_key_field' => 'CouponId', 'left_title_field' => 'Name', + 'not_null' => 1, 'default' => 0, + ), 'MinQtyFreePromoShipping' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), 'MetaKeywords' => Array ('type' => 'string', 'default' => null), 'MetaDescription' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null), Index: branches/5.3.x/units/affiliates/affiliates_config.php =================================================================== diff -u -N -r15656 -r15671 --- branches/5.3.x/units/affiliates/affiliates_config.php (.../affiliates_config.php) (revision 15656) +++ branches/5.3.x/units/affiliates/affiliates_config.php (.../affiliates_config.php) (revision 15671) @@ -1,6 +1,6 @@ Array ( '' => Array ( 'UserId' => 'u.PortalUserId', - 'UserName' => 'IF( LENGTH(u.Username), u.Username, \'\')', + 'UserName' => 'IF(u.Username = "", u.Email, u.Username)', 'PlanName' => 'ap.Name', ), ), @@ -197,7 +197,7 @@ '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.'Users WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Username', 'required' => 1, 'not_null' => 1, 'default' => 0, ), + 'PortalUserId' => Array ('type' => 'int', 'unique' => Array (), '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 . 'Users WHERE %s', 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, 'required' => 1, 'default' => null), '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'), Index: branches/5.3.x/units/downloads/download_helper.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/downloads/download_helper.php (.../download_helper.php) (revision 15492) +++ branches/5.3.x/units/downloads/download_helper.php (.../download_helper.php) (revision 15671) @@ -1,6 +1,6 @@ SetDBField('ProductName', $product_object->GetField('Name')); $down_object->SetDBField('FileId', $file_info['FileId']); $down_object->SetDBField('Filename', $file_info['FilePath']); - $down_object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR']); + $down_object->SetDBField('IPAddress', $this->Application->getClientIp()); $down_object->SetDBField('StartedOn_date', $file_info['download_start']); $down_object->SetDBField('StartedOn_time', $file_info['download_start']); Index: branches/5.3.x/units/gateways/gw_classes/atosorigin.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gateways/gw_classes/atosorigin.php (.../atosorigin.php) (revision 15492) +++ branches/5.3.x/units/gateways/gw_classes/atosorigin.php (.../atosorigin.php) (revision 15671) @@ -1,6 +1,6 @@ Application->GetSID() . ',' . MD5($item_data['OrderId']); $params['order_id'] = $item_data['OrderId']; - $params['customer_ip_address'] = $_SERVER['REMOTE_ADDR']; + $params['customer_ip_address'] = $this->Application->getClientIp(); $params['customer_id'] = $item_data['PortalUserId']; $billing_email = $item_data['BillingEmail']; Index: branches/5.3.x/units/pricing/pricing_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/pricing/pricing_event_handler.php (.../pricing_event_handler.php) (revision 15492) +++ branches/5.3.x/units/pricing/pricing_event_handler.php (.../pricing_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ Application->recallObject('dst'); + $destinations = $this->Application->recallObject('dst'); + /* @var $destinations kDBItem */ $queryDel="DELETE FROM ".$destinations->TableName." WHERE ShippingZoneId=".$this->Application->GetVar($event->Prefix.'_id'); $this->Conn->Query($queryDel); @@ -242,7 +243,7 @@ { parent::OnCancel($event); - $dst_object = &$this->Application->recallObject('dst'); + $dst_object = $this->Application->recallObject('dst'); /* @var $dst_object kDBItem */ $sql = 'DELETE FROM ' . $dst_object->TableName . ' Index: branches/5.3.x/admin_templates/paid_listings/paid_listing_type_shopcart.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/paid_listings/paid_listing_type_shopcart.tpl (.../paid_listing_type_shopcart.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/paid_listings/paid_listing_type_shopcart.tpl (.../paid_listing_type_shopcart.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/admin_templates/currencies/currencies_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/currencies/currencies_edit.tpl (.../currencies_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/currencies/currencies_edit.tpl (.../currencies_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/units/gateways/gw_classes/sella_guestpay.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gateways/gw_classes/sella_guestpay.php (.../sella_guestpay.php) (revision 15492) +++ branches/5.3.x/units/gateways/gw_classes/sella_guestpay.php (.../sella_guestpay.php) (revision 15671) @@ -1,6 +1,6 @@ Application->recallObject('CurlHelper'); Index: branches/5.3.x/units/gift_certificates/gift_certificates_eh.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gift_certificates/gift_certificates_eh.php (.../gift_certificates_eh.php) (revision 15492) +++ branches/5.3.x/units/gift_certificates/gift_certificates_eh.php (.../gift_certificates_eh.php) (revision 15671) @@ -1,6 +1,6 @@ $object->GetDBField('Code'), ); - $this->Application->EmailEventAdmin('USER.GIFTCERTIFICATE', null, $send_params); + $this->Application->emailAdmin('USER.GIFTCERTIFICATE', null, $send_params); $send_params['to_email'] = $object->GetDBField('RecipientEmail'); $send_params['to_name'] = $object->GetDBField('Recipient'); - $this->Application->EmailEventUser('USER.GIFTCERTIFICATE', null, $send_params); + $this->Application->emailUser('USER.GIFTCERTIFICATE', null, $send_params); } $this->clearSelectedIDs($event); Index: branches/5.3.x/admin_templates/products/file_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/products/file_edit.tpl (.../file_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/products/file_edit.tpl (.../file_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + @@ -42,7 +44,7 @@ a_toolbar.DisableButton('prev'); - + Index: branches/5.3.x/admin_templates/products/relations_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/products/relations_edit.tpl (.../relations_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/products/relations_edit.tpl (.../relations_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/admin_templates/products/images_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/products/images_edit.tpl (.../images_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/products/images_edit.tpl (.../images_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + @@ -36,7 +38,7 @@ a_toolbar.HideButton('prev'); a_toolbar.HideButton('next'); - a_toolbar.HideButton('sep1'); + a_toolbar.HideButton('sep1'); a_toolbar.DisableButton('next'); Index: branches/5.3.x/units/affiliate_payment_types/affiliate_payment_types_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/affiliate_payment_types/affiliate_payment_types_event_handler.php (.../affiliate_payment_types_event_handler.php) (revision 15492) +++ branches/5.3.x/units/affiliate_payment_types/affiliate_payment_types_event_handler.php (.../affiliate_payment_types_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ Conn->Query($sql); - $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') ); - $object->SetDBField($status_field, 1); + $object->SetDBField($object->getStatusField(), 1); } } Index: branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_items.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_items.tpl (.../affiliate_plans_items.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/affiliate_plans/affiliate_plans_items.tpl (.../affiliate_plans_items.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/units/taxesdestinations/taxes_dst_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/taxesdestinations/taxes_dst_event_handler.php (.../taxes_dst_event_handler.php) (revision 15492) +++ branches/5.3.x/units/taxesdestinations/taxes_dst_event_handler.php (.../taxes_dst_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ getObject(); /* @var $object kDBItem */ - $zone_object = &$this->Application->recallObject('tax'); + $zone_object = $this->Application->recallObject('tax'); + /* @var $zone_object kDBItem */ + $zone_id = (int)$this->Application->GetVar('tax_id'); $zone_type = $zone_object->GetDBField('Type'); Index: branches/5.3.x/units/gateways/gw_classes/rightconnect.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gateways/gw_classes/rightconnect.php (.../rightconnect.php) (revision 15492) +++ branches/5.3.x/units/gateways/gw_classes/rightconnect.php (.../rightconnect.php) (revision 15671) @@ -1,6 +1,6 @@ Application->getClientIp(); $post_fields["ADMIN_EMAIL"] = "admin@yourdomain.com";*/ Index: branches/5.3.x/units/gateways/gw_classes/google_checkout.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gateways/gw_classes/google_checkout.php (.../google_checkout.php) (revision 15492) +++ branches/5.3.x/units/gateways/gw_classes/google_checkout.php (.../google_checkout.php) (revision 15671) @@ -1,6 +1,6 @@ - '.htmlspecialchars($order_item['ProductName']).' - '.htmlspecialchars($order_item[$ml_formatter->LangFieldName('DescriptionExcerpt')]).''. + '.htmlspecialchars($order_item['ProductName'], null, CHARSET).' + '.htmlspecialchars($order_item[$ml_formatter->LangFieldName('DescriptionExcerpt')], null, CHARSET).''. $this->getPriceXML('unit-price', $order_item['Price']).' '.$order_item['Quantity'].' '; @@ -102,7 +102,7 @@ $shipping_xml = ''; foreach ($shipping_types as $shipping_name) { - $shipping_xml .= ' + $shipping_xml .= ' 0.00 '; } @@ -390,7 +390,7 @@ $shipping_name = $shipping_type['ShippingName']; $processable_shipping_index = array_search($shipping_name, $process_shippings); if ($processable_shipping_index !== false) { - $shipping_types_xml .= ' + $shipping_types_xml .= ' '.sprintf('%01.2f', $shipping_type['TotalCost']).' true '; @@ -402,7 +402,7 @@ // add unavailable shipping types foreach ($process_shippings as $shipping_name) { - $shipping_types_xml .= ' + $shipping_types_xml .= ' 0.00 false '; Index: branches/5.3.x/units/payment_type/payment_type_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/payment_type/payment_type_event_handler.php (.../payment_type_event_handler.php) (revision 15492) +++ branches/5.3.x/units/payment_type/payment_type_event_handler.php (.../payment_type_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ getSelectedIDs($event); if ( $ids ) { - $status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField')); + $status_field = $object->getStatusField(); foreach ($ids as $id) { $object->Load($id); @@ -120,7 +120,7 @@ $object = $event->getObject(); /* @var $object kDBItem */ - $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') ); + $status_field = $object->getStatusField(); if ( $object->GetDBField('IsPrimary') == 1 && $object->GetDBField($status_field) == 0 ) { $object->SetDBField($status_field, 1); Index: branches/5.3.x/units/orders/orders_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 15492) +++ branches/5.3.x/units/orders/orders_event_handler.php (.../orders_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ Application->getUnitOption($event->Prefix, 'StatusField')); + $status_field = $order_dummy->getStatusField(); + if ( isset($field_values[$status_field]) && $order_dummy->GetDBField($status_field) != $field_values[$status_field] ) { // user can't change status by himself return false; @@ -371,13 +372,19 @@ function OrderEmailParams(&$order) { $billing_email = $order->GetDBField('BillingEmail'); - $user_email = $this->Conn->GetOne(' SELECT Email FROM '.$this->Application->getUnitOption('u', 'TableName').' - WHERE PortalUserId = '.$order->GetDBField('PortalUserId')); - $email_params = Array(); - $email_params['_user_email'] = $user_email; //for use when shipping vs user is required in InventoryAction - $email_params['to_email'] = $billing_email ? $billing_email : $user_email; - $email_params['to_name'] = $order->GetDBField('BillingTo'); - return $email_params; + + $sql = 'SELECT Email + FROM ' . $this->Application->getUnitOption('u', 'TableName') . ' + WHERE PortalUserId = ' . $order->GetDBField('PortalUserId'); + $user_email = $this->Conn->GetOne($sql); + + $ret = Array ( + '_user_email' => $user_email, // for use when shipping vs user is required in InventoryAction + 'to_name' => $order->GetDBField('BillingTo'), + 'to_email' => $billing_email ? $billing_email : $user_email, + ); + + return $ret; } function PrepareCoupons($event, &$order) @@ -480,8 +487,8 @@ $this->PrepareCoupons($event, $order); } - $this->Application->EmailEventUser('ORDER.SUBMIT', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); - $this->Application->EmailEventAdmin('ORDER.SUBMIT'); + $this->Application->emailUser('ORDER.SUBMIT', null, $this->OrderEmailParams($order)); + $this->Application->emailAdmin('ORDER.SUBMIT'); } if ($shipping_control === false || $shipping_control == SHIPPING_CONTROL_PREAUTH ) { @@ -1609,7 +1616,7 @@ $this->setNextOrderNumber($event); - $object->SetDBField('OrderIP', $_SERVER['REMOTE_ADDR']); + $object->SetDBField('OrderIP', $this->Application->getClientIp()); $order_type = $this->getTypeBySpecial( $this->Application->GetVar('order_type') ); $object->SetDBField('Status', $order_type); @@ -2107,11 +2114,12 @@ $this->PrepareCoupons($event, $object); $this->SplitOrder($event, $object); - if ($object->GetDBField('IsRecurringBilling') != 1) { - $this->Application->EmailEventUser('ORDER.APPROVE', $object->GetDBField('PortalUserId'), $email_params); + if ( $object->GetDBField('IsRecurringBilling') != 1 ) { + $this->Application->emailUser('ORDER.APPROVE', null, $email_params); + // Mask credit card with XXXX - if ($this->Application->ConfigValue('Comm_MaskProcessedCreditCards')) { + if ( $this->Application->ConfigValue('Comm_MaskProcessedCreditCards') ) { $this->maskCreditCard($object, 'PaymentAccount'); $set_new_status = 1; } @@ -2130,15 +2138,15 @@ $this->raiseProductEvent('Deny', $product_item['ProductId'], $product_item); } - if ( ($original_order_status != ORDER_STATUS_INCOMPLETE ) && ($event->Name == 'OnMassOrderDeny' || $event->Name == 'OnOrderDeny') ) { - $this->Application->EmailEventUser('ORDER.DENY', $object->GetDBField('PortalUserId'), $email_params); + if ( ($original_order_status != ORDER_STATUS_INCOMPLETE) && ($event->Name == 'OnMassOrderDeny' || $event->Name == 'OnOrderDeny') ) { + $this->Application->emailUser('ORDER.DENY', null, $email_params); // inform payment gateway that order was declined $gw_data = $object->getGatewayData(); if ( $gw_data ) { - $this->Application->registerClass( $gw_data['ClassName'], GW_CLASS_PATH . '/' . $gw_data['ClassFile'] ); - $gateway_object = $this->Application->recallObject( $gw_data['ClassName'] ); + $this->Application->registerClass($gw_data['ClassName'], GW_CLASS_PATH . '/' . $gw_data['ClassFile']); + $gateway_object = $this->Application->recallObject($gw_data['ClassName']); $gateway_object->OrderDeclined($object->GetFieldValues(), $gw_data['gw_params']); } @@ -2180,19 +2188,19 @@ if ( !array_key_exists('error_number', $ret) ) { $set_new_status = $this->approveOrder($order_items); - // $set_new_status = $this->shipOrder($order_items); +// $set_new_status = $this->shipOrder($order_items); $object->SetDBField('ShippingDate', adodb_mktime()); $object->UpdateFormattersSubFields(); $shipping_email = $object->GetDBField('ShippingEmail'); $email_params['to_email'] = $shipping_email ? $shipping_email : $email_params['_user_email']; - $this->Application->EmailEventUser('ORDER.SHIP', $object->GetDBField('PortalUserId'), $email_params); + $this->Application->emailUser('ORDER.SHIP', null, $email_params); // inform payment gateway that order was shipped $gw_data = $object->getGatewayData(); - $this->Application->registerClass( $gw_data['ClassName'], GW_CLASS_PATH.'/'.$gw_data['ClassFile'] ); - $gateway_object = $this->Application->recallObject( $gw_data['ClassName'] ); + $this->Application->registerClass($gw_data['ClassName'], GW_CLASS_PATH . '/' . $gw_data['ClassFile']); + $gateway_object = $this->Application->recallObject($gw_data['ClassName']); $gateway_object->OrderShipped($object->GetFieldValues(), $gw_data['gw_params']); } @@ -2207,17 +2215,22 @@ case 'OnMassOrderProcess': case 'OnOrderProcess': - if ($this->ReadyToProcess($object->GetID())) { + if ( $this->ReadyToProcess($object->GetID()) ) { $event->CallSubEvent('OnReserveItems'); - if ($event->status == kEvent::erSUCCESS) $set_new_status = true; - $this->Application->EmailEventUser('BACKORDER.PROCESS', $object->GetDBField('PortalUserId'), $email_params); - } else { + + if ( $event->status == kEvent::erSUCCESS ) { + $set_new_status = true; + } + + $this->Application->emailUser('BACKORDER.PROCESS', null, $email_params); + } + else { $event->status = kEvent::erFAIL; } break; } - if ($set_new_status) { + if ( $set_new_status ) { $object->Update(); } } @@ -2426,7 +2439,7 @@ $this->CheckUser($event); if ( !$object->GetDBField('OrderIP') ) { - $object->SetDBField('OrderIP', $_SERVER['REMOTE_ADDR']); + $object->SetDBField('OrderIP', $this->Application->getClientIp()); } $shipping_option = $this->Application->GetVar('OriginalShippingOption'); @@ -2872,8 +2885,8 @@ $sub_order->SetDBField('Status', ORDER_STATUS_BACKORDERS); if ($event->Special != 'recurring') { // just in case if admin uses tangible backordered products in recurring orders - $this->Application->EmailEventUser('BACKORDER.ADD', $sub_order->GetDBField('PortalUserId'), $this->OrderEmailParams($sub_order)); - $this->Application->EmailEventAdmin('BACKORDER.ADD'); + $this->Application->emailUser('BACKORDER.ADD', null, $this->OrderEmailParams($sub_order)); + $this->Application->emailAdmin('BACKORDER.ADD'); } } else { @@ -3389,7 +3402,7 @@ */ function OnGoToOrder($event) { - $id = array_shift( $this->StoreSelectedIDs($event) ); + $id = current($this->StoreSelectedIDs($event)); $id_field = $this->Application->getUnitOption($event->Prefix,'IDField'); $table = $this->Application->getUnitOption($event->Prefix,'TableName'); @@ -3511,15 +3524,15 @@ if ($complete_event->status == kEvent::erSUCCESS) { //send recurring ok email - $this->Application->EmailEventUser('ORDER.RECURRING.PROCESSED', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); - $this->Application->EmailEventAdmin('ORDER.RECURRING.PROCESSED'); + $this->Application->emailUser('ORDER.RECURRING.PROCESSED', null, $this->OrderEmailParams($order)); + $this->Application->emailAdmin('ORDER.RECURRING.PROCESSED'); } else { //send Recurring failed event $order->SetDBField('Status', ORDER_STATUS_DENIED); $order->Update(); - $this->Application->EmailEventUser('ORDER.RECURRING.DENIED', $order->GetDBField('PortalUserId'), $this->OrderEmailParams($order)); - $this->Application->EmailEventAdmin('ORDER.RECURRING.DENIED'); + $this->Application->emailUser('ORDER.RECURRING.DENIED', null, $this->OrderEmailParams($order)); + $this->Application->emailAdmin('ORDER.RECURRING.DENIED'); } } @@ -3690,6 +3703,12 @@ } $this->Application->setUnitOption($event->Prefix, 'Fields', $fields); + + $user_forms = $this->Application->getUnitOption('u', 'Forms'); + + $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); + $virtual_fields['UserPassword']['hashing_method'] = $user_forms['default']['Fields']['PasswordHashingMethod']['default']; + $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); } /** Index: branches/5.3.x/install/upgrades.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/install/upgrades.php (.../upgrades.php) (revision 15492) +++ branches/5.3.x/install/upgrades.php (.../upgrades.php) (revision 15671) @@ -1,6 +1,6 @@ Array ('Core' => '5.2.0-B3'), '5.2.0-RC1' => Array ('Core' => '5.2.0-RC1'), '5.2.0' => Array ('Core' => '5.2.0'), + '5.2.1-B1' => Array ('Core' => '5.2.1-B1'), ); } @@ -104,7 +105,7 @@ // clean incomplete orders 5+ hours old // don't use ORDER_STATUS_INCOMPLETE constant, since it's not available upgrade - $delete_timestamp = mktime() - (3600 * 5); + $delete_timestamp = time() - (3600 * 5); $sql = 'SELECT OrderId FROM ' . TABLE_PREFIX . 'Orders WHERE Status = ' . 0 . ' AND OrderDate < ' . $delete_timestamp; Index: branches/5.3.x/units/product_options/product_options_tag_processor.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/product_options/product_options_tag_processor.php (.../product_options_tag_processor.php) (revision 15492) +++ branches/5.3.x/units/product_options/product_options_tag_processor.php (.../product_options_tag_processor.php) (revision 15671) @@ -1,6 +1,6 @@ GetID(), $options) ? $options[$object->GetID()] : ''; if ( $object->GetDBField('OptionType') == OptionType::CHECKBOX ) { - $selected = is_array($option_value) && in_array(htmlspecialchars($val), $option_value); + $selected = is_array($option_value) && in_array(htmlspecialchars($val, null, CHARSET), $option_value); } else { // radio buttons ? $selected = htmlspecialchars_decode($option_value) == $val; Index: branches/5.3.x/units/brackets/brackets_tag_processor.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/brackets/brackets_tag_processor.php (.../brackets_tag_processor.php) (revision 15492) +++ branches/5.3.x/units/brackets/brackets_tag_processor.php (.../brackets_tag_processor.php) (revision 15671) @@ -1,6 +1,6 @@ SelectParam($params, 'name,field'); - if ( ($params['field'] == 'Start' || $params['name'] == 'End') && $value == -1) { + if ( ($field == 'Start' || $field == 'End') && $value == -1 ) { $value = '∞'; } @@ -29,6 +30,8 @@ function ShowBracketsForm($params) { $shipping_object = $this->Application->recallObject('s'); + /* @var $shipping_object kDBItem */ + $default_start = ($shipping_object->GetDBField('Type') == 1) ? 0 : 1; $brackets_helper = $this->Application->recallObject('BracketsHelper'); Index: branches/5.3.x/units/orders/orders_tag_processor.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 15492) +++ branches/5.3.x/units/orders/orders_tag_processor.php (.../orders_tag_processor.php) (revision 15671) @@ -1,6 +1,6 @@ Application->RemoveVar('checkout_errors'); + $this->Application->RemoveVar('checkout_errors'); $errors = unserialize($errors); if ( isset($errors[OrderCheckoutErrorType::COUPON]) ) { @@ -1217,66 +1217,6 @@ return $o; } - function OrderProductEmail($params) - { - $order = $this->Application->recallObject('ord'); - $orditems = $this->Application->recallObject('orditems'); - - $sql = 'SELECT ResourceId - FROM '.TABLE_PREFIX.'Products - WHERE ProductId = '.$orditems->GetDBField('ProductId'); - $resource_id = $this->Conn->GetOne($sql); - - $ml_formatter = $this->Application->recallObject('kMultiLanguage'); - $custom_fields = $this->Application->getUnitOption('p', 'CustomFields'); - $custom_name = $ml_formatter->LangFieldName('cust_'.array_search($params['msg_custom_field'], $custom_fields)); - - $sql = 'SELECT '.$custom_name.' - FROM '.$this->Application->getUnitOption('p-cdata', 'TableName').' - WHERE ResourceId = '.$resource_id; - $message_template = $this->Conn->GetOne($sql); - - if (!$message_template || trim($message_template) == '') { - // message template missing - return ; - } - - $from_name = strip_tags($this->Application->ConfigValue('Site_Name')); - $from_email = $this->Application->ConfigValue('DefaultEmailSender'); - - $to_name = $order->GetDBField('BillingTo'); - $to_email = $order->GetDBField('BillingEmail'); - if (!$to_email) { - // billing email is empty, then use user's email - $sql = 'SELECT Email - FROM '.$this->Application->getUnitOption('u', 'TableName').' - WHERE PortalUserId = '.$order->GetDBField('PortalUserId'); - $to_email = $this->Conn->GetOne($sql); - } - - $esender = $application->recallObject('EmailSender.-product'); - /* @var $esender kEmailSendingHelper */ - - $esender->SetFrom($from_email, $from_name); - $esender->AddTo($to_email, $to_name); - - $email_events_eh = $this->Application->recallObject('emailevents_EventHandler'); - /* @var $email_events_eh EmailEventsEventsHandler */ - - list ($message_headers, $message_body) = $email_events_eh->ParseMessageBody($message_template, Array()); - if (!trim($message_body)) { - // message body missing - return false; - } - - foreach ($message_headers as $header_name => $header_value) { - $esender->SetEncodedHeader($header_name, $header_value); - } - - $esender->SetHTML($message_body); - $esender->Deliver(); - } - /** * Prints order totals * Index: branches/5.3.x/units/order_items/order_items_tag_processor.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/order_items/order_items_tag_processor.php (.../order_items_tag_processor.php) (revision 15492) +++ branches/5.3.x/units/order_items/order_items_tag_processor.php (.../order_items_tag_processor.php) (revision 15671) @@ -1,6 +1,6 @@ = 0 ? '+' : '-'; } - $block_params['value'] = htmlspecialchars($val); + $block_params['value'] = htmlspecialchars($val, null, CHARSET); $block_params['type'] = $key_data['OptionType']; } $o .= $this->Application->ParseBlock($block_params, 1); @@ -176,7 +176,7 @@ foreach ($values as $val) { $i++; $val = htmlspecialchars_decode($val); - $block_params['value'] = htmlspecialchars($val); + $block_params['value'] = htmlspecialchars($val, null, CHARSET); if ($price_types[$val] == '$') { $iso = $this->GetISO($params['currency']); $value = $this->AddCurrencySymbol(sprintf("%.2f", $this->ConvertCurrency($prices[$val], $iso)), $iso, true); // true to force sign Index: branches/5.3.x/install/install_schema.sql =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/install/install_schema.sql (.../install_schema.sql) (revision 15492) +++ branches/5.3.x/install/install_schema.sql (.../install_schema.sql) (revision 15671) @@ -663,7 +663,7 @@ CREATE TABLE Affiliates ( AffiliateId int(11) NOT NULL AUTO_INCREMENT, - PortalUserId int(10) unsigned NOT NULL DEFAULT '0', + PortalUserId int(10) DEFAULT NULL, AffiliatePlanId int(10) unsigned NOT NULL DEFAULT '0', AccumulatedAmount decimal(10,2) NOT NULL DEFAULT '0.00', AmountToPay decimal(10,2) NOT NULL DEFAULT '0.00', @@ -677,8 +677,8 @@ Comments text, CreatedOn int(11) DEFAULT NULL, PRIMARY KEY (AffiliateId), - UNIQUE KEY PortalUserId (PortalUserId), UNIQUE KEY AffiliateCode (AffiliateCode), + UNIQUE KEY PortalUserId (PortalUserId), KEY LastOrderDate (LastOrderDate), KEY AffiliatePlanId (AffiliatePlanId), KEY `Status` (`Status`), Index: branches/5.3.x/admin_templates/affiliate_plans/affiliate_payment_types_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/affiliate_plans/affiliate_payment_types_edit.tpl (.../affiliate_payment_types_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/affiliate_plans/affiliate_payment_types_edit.tpl (.../affiliate_payment_types_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/units/gateways/gw_tag_processor.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gateways/gw_tag_processor.php (.../gw_tag_processor.php) (revision 15492) +++ branches/5.3.x/units/gateways/gw_tag_processor.php (.../gw_tag_processor.php) (revision 15671) @@ -1,6 +1,6 @@ ConfigValues[$id]) ? $this->ConfigValues[$id] : ''; if ( !array_key_exists('no_special', $params) || !$params['no_special'] ) { - $value = htmlspecialchars($value); + $value = htmlspecialchars($value, null, CHARSET); } if ( getArrayValue($params, 'checked') ) { Index: branches/5.3.x/admin_templates/manufacturers/manufacturers_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/manufacturers/manufacturers_edit.tpl (.../manufacturers_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/manufacturers/manufacturers_edit.tpl (.../manufacturers_edit.tpl) (revision 15671) @@ -61,7 +61,7 @@ - + Index: branches/5.3.x/units/orders/orders_config.php =================================================================== diff -u -N -r15656 -r15671 --- branches/5.3.x/units/orders/orders_config.php (.../orders_config.php) (revision 15656) +++ branches/5.3.x/units/orders/orders_config.php (.../orders_config.php) (revision 15671) @@ -1,6 +1,6 @@ Array ( '' => Array ( - 'CustomerName' => 'IF( ISNULL(u.Username), IF (%1$s.PortalUserId = ' . USER_ROOT . ', \'root\', IF (%1$s.PortalUserId = ' . USER_GUEST . ', \'Guest\', \'n/a\')), CONCAT(u.FirstName,\' \',u.LastName) )', - 'Username' => 'IF( ISNULL(u.Username),\'root\',u.Username)', + 'CustomerName' => 'IF( ISNULL(u.Username), IF (%1$s.PortalUserId = ' . USER_ROOT . ', "root", IF (%1$s.PortalUserId = ' . USER_GUEST . ', "Guest", "n/a")), CONCAT(u.FirstName," ",u.LastName) )', + 'Username' => 'IF( ISNULL(u.Username),"root",IF(u.Username = "", u.Email, u.Username))', 'OrderNumber' => 'CONCAT(LPAD(Number,6,"0"),\'-\',LPAD(SubNumber,3,"0") )', 'SubtotalWithoutDiscount' => '(SubTotal + DiscountTotal)', 'SubtotalWithDiscount' => '(SubTotal)', 'AmountWithoutVAT' => '(SubTotal+IF(ShippingTaxable=1, ShippingCost, 0)+IF(ProcessingTaxable=1, ProcessingFee, 0)-IF(VATIncluded=1,VAT,0))', 'TotalAmount' => 'SubTotal+ShippingCost+IF(VATIncluded=1,0,VAT)+ProcessingFee+InsuranceFee-GiftCertificateDiscount', 'CouponCode' => 'pc.Code', 'CouponName' => 'pc.Name', - 'AffiliateUser' => 'IF( LENGTH(au.Username),au.Username,\'!la_None!\')', + 'AffiliateUser' => 'IF(au.PortalUserId IS NULL, "!la_None!", IF(au.Username = "", au.Email, au.Username))', 'AffiliatePortalUserId' => 'af.PortalUserId', 'GiftCertificateCode' => 'gc.Code', 'GiftCertificateRecipient' => 'gc.Recipient', @@ -315,7 +315,7 @@ 'not_null' => 1, 'default' => 0, ), 'OrderDate' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'), - 'PortalUserId' =>Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' =>Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Users WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Username', 'required' =>1, 'not_null' =>1, 'default' =>-1), + 'PortalUserId' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users WHERE %s', 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, 'required' => 1, 'not_null' => 1, 'default' => -1), 'OrderIP' => Array ('type' => 'string', 'not_null' => 1, 'default' => '', 'filter_type' => 'like'), 'UserComment' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL), 'AdminComment' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL), Index: branches/5.3.x/units/affiliate_payments/affiliate_payments_config.php =================================================================== diff -u -N -r15656 -r15671 --- branches/5.3.x/units/affiliate_payments/affiliate_payments_config.php (.../affiliate_payments_config.php) (revision 15656) +++ branches/5.3.x/units/affiliate_payments/affiliate_payments_config.php (.../affiliate_payments_config.php) (revision 15671) @@ -1,6 +1,6 @@ 'af.PortalUserId', ), 'log' => Array ( - 'Username' => 'au.Username', + 'Username' => 'IF(au.Username = "", au.Email, au.Username)', 'PortalUserId' => 'af.PortalUserId', ), ), @@ -104,7 +104,7 @@ 'Fields' => Array ( 'AffiliatePaymentId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'AffiliateId' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (0 => 'lu_None'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'Affiliates af LEFT JOIN '.TABLE_PREFIX.'Users pu ON pu.PortalUserId = af.PortalUserId WHERE `%s` = \'%s\'', 'left_key_field' => 'AffiliateId', 'left_title_field' => 'Username', 'not_null'=>1,'default'=>0), + 'AffiliateId' => Array('type' => 'int','formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (0 => 'lu_None'), 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Affiliates af LEFT JOIN ' . TABLE_PREFIX . 'Users u ON u.PortalUserId = af.PortalUserId WHERE %s', 'left_key_field' => 'af.AffiliateId', 'left_title_field' => 'IF(u.Email = "", u.Username, u.Email)', 'not_null' => 1, 'default' => 0), 'PaymentDate' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), 'Amount' => Array ('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%.02f', 'not_null' => '1', 'required'=>1, 'default' => '0.00'), 'Comment' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL), Index: branches/5.3.x/admin_templates/products/pricing_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/products/pricing_edit.tpl (.../pricing_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/products/pricing_edit.tpl (.../pricing_edit.tpl) (revision 15671) @@ -1,3 +1,5 @@ + + Index: branches/5.3.x/units/coupons/coupons_config.php =================================================================== diff -u -N -r15656 -r15671 --- branches/5.3.x/units/coupons/coupons_config.php (.../coupons_config.php) (revision 15656) +++ branches/5.3.x/units/coupons/coupons_config.php (.../coupons_config.php) (revision 15671) @@ -1,6 +1,6 @@ Array ('type' => 'double', 'default' => null), 'LastUsedBy' => Array ( - 'type' => 'int', 'formatter' => 'kLEFTFormatter', + 'type' => 'int', + 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array (USER_ROOT => 'root', USER_GUEST => 'Guest'), - 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users - WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', - 'left_title_field' => 'Username', 'required' => 0, 'default' => null, + 'left_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Users WHERE %s', + 'left_key_field' => 'PortalUserId', 'left_title_field' => USER_TITLE_FIELD, + 'required' => 0, 'default' => null, ), 'LastUsedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL), 'NumberOfUses' => Array ('type' => 'int', 'default' => 1), Index: branches/5.3.x/admin_templates/products/products_edit.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/products/products_edit.tpl (.../products_edit.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/products/products_edit.tpl (.../products_edit.tpl) (revision 15671) @@ -72,7 +72,7 @@ - + Index: branches/5.3.x/install/install_data.sql =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/install/install_data.sql (.../install_data.sql) (revision 15492) +++ branches/5.3.x/install/install_data.sql (.../install_data.sql) (revision 15671) @@ -254,33 +254,33 @@ INSERT INTO CustomFields VALUES (DEFAULT, 1, 'p_ItemTemplate', 'la_fld_cust_p_ItemTemplate', 0, 'la_title_SystemCF', 'la_fld_cust_p_ItemTemplate', 'text', NULL, '', 0, 0, 1, 0); INSERT INTO CustomFields VALUES (DEFAULT, 6, 'shipping_addr_block', 'la_fld_BlockShippingAddress', 0, 'la_section_StoreSettings', 'la_fld_BlockShippingAddress', 'checkbox', '1=+Block', '', 0, 1, 1, 0); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, 'In-Commerce', 'Order Submitted', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, 'In-Commerce', 'Order Submitted', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.APPROVE', NULL, 1, 0, 'In-Commerce', 'Order Approved', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.DENY', NULL, 1, 0, 'In-Commerce', 'Order Denied', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.SHIP', NULL, 1, 0, 'In-Commerce', 'Order Shipped', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, 'In-Commerce', 'Backorder Added', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, 'In-Commerce', 'Backorder Added', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'BACKORDER.FULLFILL', NULL, 1, 0, 'In-Commerce', 'Back-order is Fulfilled', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'BACKORDER.PROCESS', NULL, 1, 0, 'In-Commerce', 'Backorder Processed', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 0, 'In-Commerce', 'Suggest product to a friend', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 1, 'In-Commerce', 'Suggest product to a friend', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, 'In-Commerce', 'Affiliate registered', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, 'In-Commerce', 'Affiliate registered', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, 'In-Commerce', 'Affiliate payment issued', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, 'In-Commerce', 'Affiliate payment issued', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 1, 0, 'In-Commerce', 'Affiliate registration approved', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 0, 0, 'In-Commerce', 'Affiliate registration approved', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 1, 0, 'In-Commerce', 'Affiliate registration denied', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 0, 0, 'In-Commerce', 'Affiliate registration denied', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, 'In-Commerce', 'Affiliate payment type changed', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, 'In-Commerce', 'Affiliate payment type changed', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, 'In-Commerce', 'Recurring Order Processed', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, 'In-Commerce', 'Recurring Order Processed', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, 'In-Commerce', 'Recurring Order Denied', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, 'In-Commerce', 'Recurring Order Denied', 1, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, 'In-Commerce', 'Gift Certificate', 0, 1, 1); -INSERT INTO EmailEvents (EventId, Event, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, 'In-Commerce', 'Gift Certificate', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, 'In-Commerce', 'Order Submitted', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.SUBMIT', NULL, 1, 1, 'In-Commerce', 'Order Submitted', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.APPROVE', NULL, 1, 0, 'In-Commerce', 'Order Approved', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.DENY', NULL, 1, 0, 'In-Commerce', 'Order Denied', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.SHIP', NULL, 1, 0, 'In-Commerce', 'Order Shipped', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, 'In-Commerce', 'Backorder Added', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'BACKORDER.ADD', NULL, 1, 1, 'In-Commerce', 'Backorder Added', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'BACKORDER.FULLFILL', NULL, 1, 0, 'In-Commerce', 'Back-order is Fulfilled', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'BACKORDER.PROCESS', NULL, 1, 0, 'In-Commerce', 'Backorder Processed', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 0, 'In-Commerce', 'Suggest product to a friend', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'PRODUCT.SUGGEST', NULL, 1, 1, 'In-Commerce', 'Suggest product to a friend', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, 'In-Commerce', 'Affiliate registered', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTER', NULL, 1, 1, 'In-Commerce', 'Affiliate registered', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, 'In-Commerce', 'Affiliate payment issued', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.PAYMENT', NULL, 1, 0, 'In-Commerce', 'Affiliate payment issued', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 1, 0, 'In-Commerce', 'Affiliate registration approved', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.APPROVED', NULL, 0, 0, 'In-Commerce', 'Affiliate registration approved', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 1, 0, 'In-Commerce', 'Affiliate registration denied', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.REGISTRATION.DENIED', NULL, 0, 0, 'In-Commerce', 'Affiliate registration denied', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, 'In-Commerce', 'Affiliate payment type changed', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'AFFILIATE.PAYMENT.TYPE.CHANGED', NULL, 1, 0, 'In-Commerce', 'Affiliate payment type changed', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, 'In-Commerce', 'Recurring Order Processed', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.RECURRING.PROCESSED', NULL, 1, 0, 'In-Commerce', 'Recurring Order Processed', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, 'In-Commerce', 'Recurring Order Denied', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'ORDER.RECURRING.DENIED', NULL, 1, 0, 'In-Commerce', 'Recurring Order Denied', 1, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, 'In-Commerce', 'Gift Certificate', 0, 1, 1); +INSERT INTO EmailTemplates (TemplateId, TemplateName, ReplacementTags, Enabled, FrontEndOnly, Module, Description, Type, AllowChangingSender, AllowChangingRecipient) VALUES(DEFAULT, 'USER.GIFTCERTIFICATE', NULL, 1, 0, 'In-Commerce', 'Gift Certificate', 1, 1, 1); INSERT INTO GatewayConfigFields VALUES (1, 'submit_url', 'Gateway URL', 'text', '', 2); INSERT INTO GatewayConfigFields VALUES (2, 'user_account', 'Authorize.net User Name', 'text', '', 2); Index: branches/5.3.x/units/affiliate_plans/affiliate_plans_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/affiliate_plans/affiliate_plans_event_handler.php (.../affiliate_plans_event_handler.php) (revision 15492) +++ branches/5.3.x/units/affiliate_plans/affiliate_plans_event_handler.php (.../affiliate_plans_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ Conn->Query($sql); - $status_field = array_shift($this->Application->getUnitOption($event->Prefix, 'StatusField')); - $object->SetDBField($status_field, 1); + $object->SetDBField($object->getStatusField(), 1); } } Index: branches/5.3.x/units/gateways/gw_classes/paybox.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/gateways/gw_classes/paybox.php (.../paybox.php) (revision 15492) +++ branches/5.3.x/units/gateways/gw_classes/paybox.php (.../paybox.php) (revision 15671) @@ -1,6 +1,6 @@ Application->GetSID().','.MD5($item_data['OrderId']); /*$params['order_id'] = $item_data['OrderId']; - $params['customer_ip_address'] = $_SERVER['REMOTE_ADDR']; + $params['customer_ip_address'] = $this->Application->getClientIp(); $params['customer_id'] = $item_data['PortalUserId'];*/ $billing_email = $item_data['BillingEmail']; Index: branches/5.3.x/units/taxes/taxes_event_handler.php =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/units/taxes/taxes_event_handler.php (.../taxes_event_handler.php) (revision 15492) +++ branches/5.3.x/units/taxes/taxes_event_handler.php (.../taxes_event_handler.php) (revision 15671) @@ -1,6 +1,6 @@ Application->recallObject('taxdst'); + $destinations = $this->Application->recallObject('taxdst'); + /* @var $destinations kDBItem */ $queryDel="DELETE FROM ".$destinations->TableName." WHERE TaxZoneId=".(int)$this->Application->GetVar('tax_id'); $this->Conn->Query($queryDel); Index: branches/5.3.x/admin_templates/affiliate_plans/affiliate_edit_payments.tpl =================================================================== diff -u -N -r15492 -r15671 --- branches/5.3.x/admin_templates/affiliate_plans/affiliate_edit_payments.tpl (.../affiliate_edit_payments.tpl) (revision 15492) +++ branches/5.3.x/admin_templates/affiliate_plans/affiliate_edit_payments.tpl (.../affiliate_edit_payments.tpl) (revision 15671) @@ -1,3 +1,5 @@ + +